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
51 changes: 40 additions & 11 deletions PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,10 @@
}

// In case override, don't proceed, please - no CCDB access required
if (d_bz_input > -990) {

Check failure on line 221 in PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx

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.
d_bz = d_bz_input;
o2::parameters::GRPMagField grpmag;
if (std::fabs(d_bz) > 1e-5) {

Check failure on line 224 in PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx

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.
grpmag.setL3Current(30000.f / (d_bz / 5.0f));
}
o2::base::Propagator::initFieldFromGRP(&grpmag);
Expand Down Expand Up @@ -269,7 +269,7 @@
}
if (storeOnlyTrueElectronMC) {
const auto& mcParticle = track.template mcParticle_as<aod::McParticles>();
if (std::abs(mcParticle.pdgCode()) != 11) {

Check failure on line 272 in PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx

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.

Check failure on line 272 in PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
return false;
}
}
Expand Down Expand Up @@ -325,7 +325,10 @@
trackParCov.setPID(o2::track::PID::Electron);
mVtx.setPos({collision.posX(), collision.posY(), collision.posZ()});
mVtx.setCov(collision.covXX(), collision.covXY(), collision.covYY(), collision.covXZ(), collision.covYZ(), collision.covZZ());
o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, trackParCov, 2.f, matCorr, &mDcaInfoCov);
bool isPropOK = o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, trackParCov, 2.f, matCorr, &mDcaInfoCov);
if (!isPropOK) {
return false;
}
float dcaXY = mDcaInfoCov.getY();
float dcaZ = mDcaInfoCov.getZ();

Expand Down Expand Up @@ -354,7 +357,7 @@
}

int total_cluster_size = 0, nl = 0;
for (unsigned int layer = 0; layer < 7; layer++) {

Check failure on line 360 in PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx

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 = track.itsClsSizeInLayer(layer);
if (cluster_size_per_layer > 0) {
nl++;
Expand Down Expand Up @@ -387,8 +390,10 @@
trackParCov.setPID(o2::track::PID::Electron);
mVtx.setPos({collision.posX(), collision.posY(), collision.posZ()});
mVtx.setCov(collision.covXX(), collision.covXY(), collision.covYY(), collision.covXZ(), collision.covYZ(), collision.covZZ());
o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, trackParCov, 2.f, matCorr, &mDcaInfoCov);

bool isPropOK = o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, trackParCov, 2.f, matCorr, &mDcaInfoCov);
if (!isPropOK) {
return false;
}
std::vector<float> inputFeatures = mlResponseSingleTrack.getInputFeatures(track, trackParCov, collision);
float binningFeature = mlResponseSingleTrack.getBinningFeature(track, trackParCov, collision);

Expand All @@ -404,7 +409,7 @@
int pbin = lower_bound(binsMl.value.begin(), binsMl.value.end(), binningFeature) - binsMl.value.begin() - 1;
if (pbin < 0) {
pbin = 0;
} else if (static_cast<int>(binsMl.value.size()) - 2 < pbin) {

Check failure on line 412 in PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx

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.
pbin = static_cast<int>(binsMl.value.size()) - 2;
}
// LOGF(info, "track.tpcInnerParam() = %f (GeV/c), pbin = %d", track.tpcInnerParam(), pbin);
Expand Down Expand Up @@ -465,7 +470,10 @@
trackParCov.setPID(o2::track::PID::Electron);
mVtx.setPos({collision.posX(), collision.posY(), collision.posZ()});
mVtx.setCov(collision.covXX(), collision.covXY(), collision.covYY(), collision.covXZ(), collision.covYZ(), collision.covZZ());
o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, trackParCov, 2.f, matCorr, &mDcaInfoCov);
bool isPropOK = o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, trackParCov, 2.f, matCorr, &mDcaInfoCov);
if (!isPropOK) {
return;
}
float dcaXY = mDcaInfoCov.getY();
float dcaZ = mDcaInfoCov.getZ();

Expand Down Expand Up @@ -520,7 +528,7 @@
if (fillQAHistogram) {
// uint32_t itsClusterSizes = track.itsClusterSizes();
int total_cluster_size = 0, nl = 0;
for (unsigned int layer = 0; layer < 7; layer++) {

Check failure on line 531 in PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx

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 = track.itsClsSizeInLayer(layer);
if (cluster_size_per_layer > 0) {
nl++;
Expand All @@ -529,7 +537,7 @@
}

int total_cluster_size_ib = 0, nl_ib = 0;
for (unsigned int layer = 0; layer < 3; layer++) {

Check failure on line 540 in PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx

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 = track.itsClsSizeInLayer(layer);
if (cluster_size_per_layer > 0) {
nl_ib++;
Expand All @@ -538,7 +546,7 @@
}

int total_cluster_size_ob = 0, nl_ob = 0;
for (unsigned int layer = 3; layer < 7; layer++) {

Check failure on line 549 in PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx

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 = track.itsClsSizeInLayer(layer);
if (cluster_size_per_layer > 0) {
nl_ob++;
Expand Down Expand Up @@ -894,7 +902,7 @@
}

// In case override, don't proceed, please - no CCDB access required
if (d_bz_input > -990) {

Check failure on line 905 in PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx

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.
d_bz = d_bz_input;
o2::parameters::GRPMagField grpmag;
if (std::fabs(d_bz) > 1e-5) {
Expand Down Expand Up @@ -983,7 +991,10 @@
trackParCov.setPID(o2::track::PID::Electron);
mVtx.setPos({collision.posX(), collision.posY(), collision.posZ()});
mVtx.setCov(collision.covXX(), collision.covXY(), collision.covYY(), collision.covXZ(), collision.covYZ(), collision.covZZ());
o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, trackParCov, 2.f, matCorr, &mDcaInfoCov);
bool isPropOK = o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, trackParCov, 2.f, matCorr, &mDcaInfoCov);
if (!isPropOK) {
return false;
}
float dcaXY = mDcaInfoCov.getY();
float dcaZ = mDcaInfoCov.getZ();

Expand Down Expand Up @@ -1024,7 +1035,10 @@
if constexpr (loose_track_sign > 0) { // positive track is loose track
auto trackParCov = getTrackParCov(pos);
trackParCov.setPID(o2::track::PID::Electron);
o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, trackParCov, 2.f, matCorr, &mDcaInfoCov);
bool isPropOK = o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, trackParCov, 2.f, matCorr, &mDcaInfoCov);
if (!isPropOK) {
return false;
}
getPxPyPz(trackParCov, pVec_recalc);

ROOT::Math::PtEtaPhiMVector v1(ele.pt(), ele.eta(), ele.phi(), o2::constants::physics::MassElectron);
Expand All @@ -1035,7 +1049,10 @@
} else {
auto trackParCov = getTrackParCov(ele);
trackParCov.setPID(o2::track::PID::Electron);
o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, trackParCov, 2.f, matCorr, &mDcaInfoCov);
bool isPropOK = o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, trackParCov, 2.f, matCorr, &mDcaInfoCov);
if (!isPropOK) {
return false;
}
getPxPyPz(trackParCov, pVec_recalc);

ROOT::Math::PtEtaPhiMVector v1(trackParCov.getPt(), trackParCov.getEta(), trackParCov.getPhi(), o2::constants::physics::MassElectron);
Expand Down Expand Up @@ -1109,7 +1126,10 @@
trackParCov.setPID(o2::track::PID::Electron);
mVtx.setPos({collision.posX(), collision.posY(), collision.posZ()});
mVtx.setCov(collision.covXX(), collision.covXY(), collision.covYY(), collision.covXZ(), collision.covYZ(), collision.covZZ());
o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, trackParCov, 2.f, matCorr, &mDcaInfoCov);
bool isPropOK = o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, trackParCov, 2.f, matCorr, &mDcaInfoCov);
if (!isPropOK) {
continue;
}
getPxPyPz(trackParCov, pVec_recalc);

for (const auto& empos : positrons_per_coll) {
Expand Down Expand Up @@ -1154,7 +1174,10 @@
trackParCov.setPID(o2::track::PID::Electron);
mVtx.setPos({collision.posX(), collision.posY(), collision.posZ()});
mVtx.setCov(collision.covXX(), collision.covXY(), collision.covYY(), collision.covXZ(), collision.covYZ(), collision.covZZ());
o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, trackParCov, 2.f, matCorr, &mDcaInfoCov);
bool isPropOK = o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, trackParCov, 2.f, matCorr, &mDcaInfoCov);
if (!isPropOK) {
continue;
}
getPxPyPz(trackParCov, pVec_recalc);
for (const auto& emele : electrons_per_coll) {
if (emele.trackId() == pos.globalIndex()) {
Expand Down Expand Up @@ -1197,7 +1220,10 @@
trackParCov.setPID(o2::track::PID::Electron);
mVtx.setPos({collision.posX(), collision.posY(), collision.posZ()});
mVtx.setCov(collision.covXX(), collision.covXY(), collision.covYY(), collision.covXZ(), collision.covYZ(), collision.covZZ());
o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, trackParCov, 2.f, matCorr, &mDcaInfoCov);
bool isPropOK = o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, trackParCov, 2.f, matCorr, &mDcaInfoCov);
if (!isPropOK) {
continue;
}
getPxPyPz(trackParCov, pVec_recalc);
for (const auto& empos : positrons_per_coll) {
if (empos.trackId() == pos.globalIndex()) {
Expand Down Expand Up @@ -1226,7 +1252,10 @@
trackParCov.setPID(o2::track::PID::Electron);
mVtx.setPos({collision.posX(), collision.posY(), collision.posZ()});
mVtx.setCov(collision.covXX(), collision.covXY(), collision.covYY(), collision.covXZ(), collision.covYZ(), collision.covZZ());
o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, trackParCov, 2.f, matCorr, &mDcaInfoCov);
bool isPropOK = o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, trackParCov, 2.f, matCorr, &mDcaInfoCov);
if (!isPropOK) {
continue;
}
getPxPyPz(trackParCov, pVec_recalc);

for (const auto& emele : electrons_per_coll) {
Expand Down
25 changes: 20 additions & 5 deletions PWGEM/Dilepton/TableProducer/skimmerPrimaryElectronQC.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,10 @@ struct skimmerPrimaryElectronQC {
trackParCov.setPID(o2::track::PID::Electron);
mVtx.setPos({collision.posX(), collision.posY(), collision.posZ()});
mVtx.setCov(collision.covXX(), collision.covXY(), collision.covYY(), collision.covXZ(), collision.covYZ(), collision.covZZ());
o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, trackParCov, 2.f, matCorr, &mDcaInfoCov);
bool isPropOK = o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, trackParCov, 2.f, matCorr, &mDcaInfoCov);
if (!isPropOK) {
return false;
}
float dcaXY = mDcaInfoCov.getY();
float dcaZ = mDcaInfoCov.getZ();

Expand Down Expand Up @@ -409,7 +412,10 @@ struct skimmerPrimaryElectronQC {
trackParCov.setPID(o2::track::PID::Electron);
mVtx.setPos({collision.posX(), collision.posY(), collision.posZ()});
mVtx.setCov(collision.covXX(), collision.covXY(), collision.covYY(), collision.covXZ(), collision.covYZ(), collision.covZZ());
o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, trackParCov, 2.f, matCorr, &mDcaInfoCov);
bool isPropOK = o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, trackParCov, 2.f, matCorr, &mDcaInfoCov);
if (!isPropOK) {
return false;
}
float dcaXY = mDcaInfoCov.getY();
float dcaZ = mDcaInfoCov.getZ();

Expand Down Expand Up @@ -455,7 +461,10 @@ struct skimmerPrimaryElectronQC {
trackParCov.setPID(o2::track::PID::Electron);
mVtx.setPos({collision.posX(), collision.posY(), collision.posZ()});
mVtx.setCov(collision.covXX(), collision.covXY(), collision.covYY(), collision.covXZ(), collision.covYZ(), collision.covZZ());
o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, trackParCov, 2.f, matCorr, &mDcaInfoCov);
bool isPropOK = o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, trackParCov, 2.f, matCorr, &mDcaInfoCov);
if (!isPropOK) {
return;
}
float dcaXY = mDcaInfoCov.getY();
float dcaZ = mDcaInfoCov.getZ();

Expand Down Expand Up @@ -596,12 +605,18 @@ struct skimmerPrimaryElectronQC {

auto t1ParCov = getTrackParCov(t1);
t1ParCov.setPID(o2::track::PID::Electron);
o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, t1ParCov, 2.f, matCorr, &mDcaInfoCov);
bool isPropOK = o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, t1ParCov, 2.f, matCorr, &mDcaInfoCov);
if (!isPropOK) {
return false;
}
getPxPyPz(t1ParCov, pVec1);

auto t2ParCov = getTrackParCov(t2);
t2ParCov.setPID(o2::track::PID::Electron);
o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, t2ParCov, 2.f, matCorr, &mDcaInfoCov);
isPropOK = o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, t2ParCov, 2.f, matCorr, &mDcaInfoCov);
if (!isPropOK) {
return false;
}
getPxPyPz(t2ParCov, pVec2);

ROOT::Math::PtEtaPhiMVector v1(t1ParCov.getPt(), t1ParCov.getEta(), t1ParCov.getPhi(), o2::constants::physics::MassElectron);
Expand Down
Loading