Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion PWGEM/Dilepton/DataModel/lmeeMLTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@
{
DECLARE_SOA_COLUMN(CollisionId, collisionId, int); //!
DECLARE_SOA_COLUMN(HadronicRate, hadronicRate, float); //!
DECLARE_SOA_COLUMN(PIDLabel, pidlabel, uint8_t); //!

Check failure on line 49 in PWGEM/Dilepton/DataModel/lmeeMLTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(TrackType, tracktype, uint8_t); //!

Check failure on line 50 in PWGEM/Dilepton/DataModel/lmeeMLTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(TPCNClsFound, tpcNClsFound, uint8_t); //!

Check failure on line 51 in PWGEM/Dilepton/DataModel/lmeeMLTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(TPCNClsCrossedRows, tpcNClsCrossedRows, uint8_t); //!

Check failure on line 52 in PWGEM/Dilepton/DataModel/lmeeMLTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(TPCNClsPID, tpcNClsPID, uint8_t); //!

Check failure on line 53 in PWGEM/Dilepton/DataModel/lmeeMLTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(IsForValidation, isForValidation, bool); //!
DECLARE_SOA_COLUMN(Sign, sign, short); //!
DECLARE_SOA_COLUMN(P, p, float); //!
Expand All @@ -61,7 +61,7 @@
// DECLARE_SOA_DYNAMIC_COLUMN(P, p, [](float pt, float eta) -> float { return pt * std::cosh(eta); });
DECLARE_SOA_DYNAMIC_COLUMN(MeanClusterSizeITS, meanClusterSizeITS, [](uint32_t itsClusterSizes) -> float {
int total_cluster_size = 0, nl = 0;
for (unsigned int layer = 0; layer < 7; layer++) {

Check failure on line 64 in PWGEM/Dilepton/DataModel/lmeeMLTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
int cluster_size_per_layer = (itsClusterSizes >> (layer * 4)) & 0xf;
if (cluster_size_per_layer > 0) {
nl++;
Expand All @@ -76,7 +76,7 @@
});
DECLARE_SOA_DYNAMIC_COLUMN(MeanClusterSizeITSob, meanClusterSizeITSob, [](uint32_t itsClusterSizes) -> float {
int total_cluster_size = 0, nl = 0;
for (unsigned int layer = 3; layer < 7; layer++) {

Check failure on line 79 in PWGEM/Dilepton/DataModel/lmeeMLTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
int cluster_size_per_layer = (itsClusterSizes >> (layer * 4)) & 0xf;
if (cluster_size_per_layer > 0) {
nl++;
Expand Down Expand Up @@ -162,6 +162,8 @@
DECLARE_SOA_COLUMN(IsCorrectMatch, isCorrectMatch, bool); //!
DECLARE_SOA_COLUMN(PdgCodeMFT, pdgCodeMFT, int); //!
DECLARE_SOA_COLUMN(PdgCodeMCHMID, pdgCodeMCHMID, int); //!
DECLARE_SOA_COLUMN(MatchMCHTrackId, mchTrackId, int); //!

Check failure on line 165 in PWGEM/Dilepton/DataModel/lmeeMLTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(DFId, dfId, uint64_t); //!

Check failure on line 166 in PWGEM/Dilepton/DataModel/lmeeMLTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.

DECLARE_SOA_COLUMN(MultMFT, multMFT, uint16_t); //! number of MFTsa tracks per collision
} // namespace emmlfwdtrack
Expand All @@ -178,7 +180,7 @@
fwdtrack::Chi2MatchMCHMFT,
emmlfwdtrack::PdgCodeMFT, emmlfwdtrack::IsPrimaryMFT,
emmlfwdtrack::PdgCodeMCHMID, emmlfwdtrack::IsPrimaryMCHMID,
emmlfwdtrack::IsCorrectMatch);
emmlfwdtrack::IsCorrectMatch, emmlfwdtrack::MatchMCHTrackId, emmlfwdtrack::DFId);

// iterators
using EMFwdTrackForML = EMFwdTracksForML::iterator;
Expand All @@ -198,7 +200,7 @@
DECLARE_SOA_COLUMN(Signed1PtL, signed1PtL, float); //! signed1Pt of lepton
DECLARE_SOA_COLUMN(EtaL, etaL, float); //! eta of lepton
DECLARE_SOA_COLUMN(DcaL, dcaL, float); //! dca of lepton
DECLARE_SOA_COLUMN(DcaLSigma, dcaLsigma, float); //! dca of lepton

Check failure on line 203 in PWGEM/Dilepton/DataModel/lmeeMLTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.

DECLARE_SOA_COLUMN(Signed1PtH, signed1PtH, float); //! signed1Pt of hadron
DECLARE_SOA_COLUMN(EtaH, etaH, float); //! eta of hadron
Expand Down
6 changes: 4 additions & 2 deletions PWGEM/Dilepton/TableProducer/treeCreatorMuonML.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,10 @@ struct TreeCreatorMuonML {

std::unordered_map<int, int> map_mfttrackcovs;

void processWithMFTCov(MyCollisionsMC const& collisions, aod::BCsWithTimestamps const&, MyFwdTracksMC const&, MyMFTTracksMC const& mfttracks, aod::MFTTracksCov const& mftCovs, aod::McParticles const&, aod::McCollisions const&)
void processWithMFTCov(MyCollisionsMC const& collisions, aod::BCsWithTimestamps const&, MyFwdTracksMC const&, MyMFTTracksMC const& mfttracks, aod::MFTTracksCov const& mftCovs, aod::McParticles const&, aod::McCollisions const&, aod::Origins const& origins)
{
uint64_t dfId = origins.iteratorAt(0).dataframeID();

for (const auto& mfttrackCov : mftCovs) {
map_mfttrackcovs[mfttrackCov.matchMFTTrackId()] = mfttrackCov.globalIndex();
}
Expand Down Expand Up @@ -378,7 +380,7 @@ struct TreeCreatorMuonML {
fwdtrack.chi2MatchMCHMFT(),
mcParticle_MFT.pdgCode(), isPrimary_MFT,
mcParticle_MCHMID.pdgCode(), isPrimary_MCHMID,
isMatched);
isMatched, mchtrack.globalIndex(), dfId);

trackErrTable(tglErrMFTatMP, phiErrMFTatMP, xErrMFTatMP, yErrMFTatMP,
tglErrMCHMIDatMP, phiErrMCHMIDatMP, xErrMCHMIDatMP, yErrMCHMIDatMP);
Expand Down
13 changes: 13 additions & 0 deletions PWGEM/Dilepton/Tasks/taggingHFE.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#include <cmath>
#include <cstdint>
#include <iostream>
#include <random>
#include <string>
#include <string_view>
#include <utility>
Expand Down Expand Up @@ -94,6 +95,7 @@ struct taggingHFE {
Configurable<bool> skipGRPOquery{"skipGRPOquery", true, "skip grpo query"};
Configurable<float> d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"};
Configurable<int> cfgPdgLepton{"cfgPdgLepton", 11, "pdg code of desired lepton: 11 or 13"};
Configurable<float> cfgDownSampling{"cfgDownSampling", 1.1, "down sampling for fake matches"};

struct : ConfigurableGroup {
std::string prefix = "dcaFitterGroup_eK";
Expand Down Expand Up @@ -267,6 +269,10 @@ struct taggingHFE {
ccdb->setLocalObjectValidityChecking();
ccdb->setFatalWhenNull(false);

std::random_device seed_gen;
engine = std::mt19937(seed_gen());
dist01 = std::uniform_real_distribution<float>(0.0f, 1.0f);

fitter_eK.setPropagateToPCA(true);
fitter_eK.setMaxR(20.f);
fitter_eK.setMinParamChange(1e-3);
Expand Down Expand Up @@ -303,6 +309,9 @@ struct taggingHFE {
int mRunNumber;
float d_bz;
Service<o2::ccdb::BasicCCDBManager> ccdb;
std::mt19937 engine;
std::uniform_real_distribution<float> dist01;

// o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE;
o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT;
const o2::dataformats::MeanVertexObject* mMeanVtx = nullptr;
Expand Down Expand Up @@ -970,6 +979,10 @@ struct taggingHFE {
mVtx.setPos({collision.posX(), collision.posY(), collision.posZ()});
mVtx.setCov(collision.covXX(), collision.covXY(), collision.covYY(), collision.covXZ(), collision.covYZ(), collision.covZZ());

if (dist01(engine) > cfgDownSampling) { // random sampling, if necessary
continue;
}

const auto& trackIdsThisCollision = trackIndices.sliceBy(trackIndicesPerCollision, collision.globalIndex());
electronIds.reserve(trackIdsThisCollision.size());
positronIds.reserve(trackIdsThisCollision.size());
Expand Down
Loading