Skip to content

Commit 48ced9c

Browse files
author
Zuzanna Chochulska
committed
Changing configurables for Phi meson reconstruction
1 parent 0e259a6 commit 48ced9c

5 files changed

Lines changed: 58 additions & 71 deletions

File tree

PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@ class FemtoUniverseCascadeSelection
259259
femtoUniverseSelection::kLowerLimit, // DCA v0 to PV max
260260
femtoUniverseSelection::kLowerLimit, // v0 mass min
261261
femtoUniverseSelection::kUpperLimit, // v0 mass max
262-
}; ///< Map to match a variable with
263-
///< its type
262+
}; ///< Map to match a variable with
263+
///< its type
264264

265265
static constexpr std::string_view mSelectionHelper[kNcascadeSelection] = {
266266
"Cascade particle sign (+1 or -1)",

PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ class FemtoUniverseTrackSelection : public FemtoUniverseObjectSelection<float, f
288288
"Maximal DCA_z (cm)",
289289
"Minimal DCA (cm)",
290290
"Maximal PID (nSigma)"}; ///< Helper information for the different selections
291-
}; // namespace femtoUniverse
291+
}; // namespace femtoUniverse
292292

293293
template <o2::aod::femtouniverseparticle::ParticleType part, o2::aod::femtouniverseparticle::TrackType tracktype, typename cutContainerType>
294294
void FemtoUniverseTrackSelection::init(HistogramRegistry* registry)

PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ struct femtoUniverseProducerTask {
121121
Configurable<bool> ConfEvtTriggerCheck{"ConfEvtTriggerCheck", true, "Evt sel: check for trigger"};
122122
Configurable<int> ConfEvtTriggerSel{"ConfEvtTriggerSel", kINT7, "Evt sel: trigger"};
123123
Configurable<bool> ConfEvtOfflineCheck{"ConfEvtOfflineCheck", false, "Evt sel: check for offline selection"};
124-
Configurable<bool> ConfIsActivateV0{"ConfIsActivateV0", true, "Activate filling of V0 into femtouniverse tables"};
124+
Configurable<bool> ConfIsActivateV0{"ConfIsActivateV0", false, "Activate filling of V0 into femtouniverse tables"};
125+
Configurable<bool> ConfActivateSecondaries{"ConfActivateSecondaries", false, "Fill secondary MC gen particles that were reconstructed"};
125126
Configurable<bool> ConfIsActivateCascade{"ConfIsActivateCascade", true, "Activate filling of Cascade into femtouniverse tables"};
126127
Configurable<bool> ConfIsActivatePhi{"ConfIsActivatePhi", false, "Activate filling of Phi into femtouniverse tables"};
127128
Configurable<bool> ConfMCTruthAnalysisWithPID{"ConfMCTruthAnalysisWithPID", true, "1: take only particles with specified PDG, 0: all particles (for MC Truth)"};
@@ -262,10 +263,11 @@ struct femtoUniverseProducerTask {
262263
Configurable<float> ConfLooseTOFNSigmaValue{"ConfLooseTOFNSigmaValue", 10, "Value for the loose TOF N Sigma for Kaon PID."};
263264
Configurable<float> ConfInvMassLowLimitPhi{"ConfInvMassLowLimitPhi", 1.011, "Lower limit of the Phi invariant mass"}; // change that to do invariant mass cut
264265
Configurable<float> ConfInvMassUpLimitPhi{"ConfInvMassUpLimitPhi", 1.027, "Upper limit of the Phi invariant mass"};
265-
Configurable<int> ConfPDGCodePartOne{"ConfPDGCodePartOne", 321, "Particle 1 - PDG code"};
266-
Configurable<int> ConfPDGCodePartTwo{"ConfPDGCodePartTwo", 321, "Particle 2 - PDG code"};
267266
} ConfPhiSelection;
268267

268+
Configurable<int> ConfPDGCodePartOne{"ConfPDGCodePartOne", 321, "Particle 1 - PDG code"};
269+
Configurable<int> ConfPDGCodePartTwo{"ConfPDGCodePartTwo", 321, "Particle 2 - PDG code"};
270+
269271
// D0/D0bar mesons
270272
struct : o2::framework::ConfigurableGroup {
271273
Configurable<float> ConfD0D0barCandMaxY{"ConfD0D0barCandMaxY", -1., "max. cand. rapidity"};
@@ -640,7 +642,7 @@ struct femtoUniverseProducerTask {
640642
int particleOrigin = 99;
641643
auto motherparticlesMC = particleMC.template mothers_as<aod::McParticles>();
642644

643-
if (abs(pdgCode) == abs(ConfPhiSelection.ConfPDGCodePartOne.value) || abs(pdgCode) == abs(ConfPhiSelection.ConfPDGCodePartTwo.value)) {
645+
if (abs(pdgCode) == abs(ConfPDGCodePartOne.value) || abs(pdgCode) == abs(ConfPDGCodePartTwo.value)) {
644646
if (particleMC.isPhysicalPrimary()) {
645647
particleOrigin = aod::femtouniverseMCparticle::ParticleOriginMCTruth::kPrimary;
646648
} else if (!motherparticlesMC.empty()) {
@@ -1186,8 +1188,8 @@ struct femtoUniverseProducerTask {
11861188
TLorentzVector part1Vec;
11871189
TLorentzVector part2Vec;
11881190

1189-
float mMassOne = TDatabasePDG::Instance()->GetParticle(ConfPhiSelection.ConfPDGCodePartOne)->Mass(); // FIXME: Get from the PDG service of the common header
1190-
float mMassTwo = TDatabasePDG::Instance()->GetParticle(ConfPhiSelection.ConfPDGCodePartTwo)->Mass(); // FIXME: Get from the PDG service of the common header
1191+
float mMassOne = TDatabasePDG::Instance()->GetParticle(321)->Mass(); // FIXME: Get from the PDG service of the common header
1192+
float mMassTwo = TDatabasePDG::Instance()->GetParticle(-321)->Mass(); // FIXME: Get from the PDG service of the common header
11911193

11921194
part1Vec.SetPtEtaPhiM(p1.pt(), p1.eta(), p1.phi(), mMassOne);
11931195
part2Vec.SetPtEtaPhiM(p2.pt(), p2.eta(), p2.phi(), mMassTwo);
@@ -1217,7 +1219,7 @@ struct femtoUniverseProducerTask {
12171219
continue;
12181220
}
12191221

1220-
phiCuts.fillQA<aod::femtouniverseparticle::ParticleType::kPhi, aod::femtouniverseparticle::ParticleType::kPhiChild>(col, p1, p1, p2, ConfPhiSelection.ConfPDGCodePartOne, ConfPhiSelection.ConfPDGCodePartTwo); ///\todo fill QA also for daughters
1222+
phiCuts.fillQA<aod::femtouniverseparticle::ParticleType::kPhi, aod::femtouniverseparticle::ParticleType::kPhiChild>(col, p1, p1, p2, 321, -321); ///\todo fill QA also for daughters
12211223

12221224
int postrackID = p1.globalIndex();
12231225
int rowInPrimaryTrackTablePos = -1; // does it do anything?
@@ -1283,10 +1285,11 @@ struct femtoUniverseProducerTask {
12831285
}
12841286
}
12851287

1286-
template <typename TrackType, bool transientLabels = false>
1288+
template <typename TrackType, bool transientLabels = false, bool resolveDaughs = false>
12871289
void fillParticles(TrackType const& tracks, std::optional<std::reference_wrapper<const std::set<int>>> recoMcIds = std::nullopt)
12881290
{
12891291
std::vector<int> childIDs = {0, 0}; // these IDs are necessary to keep track of the children
1292+
std::vector<int> tmpIDtrack;
12901293

12911294
for (auto& particle : tracks) {
12921295
/// if the most open selection criteria are not fulfilled there is no
@@ -1307,7 +1310,7 @@ struct femtoUniverseProducerTask {
13071310
if (pdgCode == 333) { // ATTENTION: workaround for now, because all Phi mesons are NOT primary particles for now.
13081311
pass = true;
13091312
} else {
1310-
if (particle.isPhysicalPrimary() || (recoMcIds && recoMcIds->get().contains(particle.globalIndex())))
1313+
if (particle.isPhysicalPrimary() || (ConfActivateSecondaries && recoMcIds && recoMcIds->get().contains(particle.globalIndex())))
13111314
pass = true;
13121315
}
13131316
}
@@ -1328,6 +1331,10 @@ struct femtoUniverseProducerTask {
13281331
// instead of the bitmask, the PDG of the particle is stored as uint32_t
13291332

13301333
// now the table is filled
1334+
if constexpr (resolveDaughs) {
1335+
tmpIDtrack.push_back(particle.globalIndex());
1336+
continue;
1337+
}
13311338
outputParts(outputCollision.lastIndex(),
13321339
particle.pt(),
13331340
particle.eta(),
@@ -1349,6 +1356,42 @@ struct femtoUniverseProducerTask {
13491356
outputPartsMCLabels(-1);
13501357
}
13511358
}
1359+
if constexpr (resolveDaughs) {
1360+
childIDs[0] = 0;
1361+
childIDs[1] = 0;
1362+
for (int i = 0; i < tmpIDtrack.size(); i++) {
1363+
const auto& particle = tracks.iteratorAt(tmpIDtrack[i] - tracks.begin().globalIndex());
1364+
for (int daughIndex = 0, n = std::min(2ul, particle.daughtersIds().size()); daughIndex < n; daughIndex++) {
1365+
// loop to find the corresponding index of the daughters
1366+
for (int j = 0; j < tmpIDtrack.size(); j++) {
1367+
if (tmpIDtrack[j] == particle.daughtersIds()[daughIndex]) {
1368+
childIDs[daughIndex] = i - j;
1369+
break;
1370+
}
1371+
}
1372+
}
1373+
outputParts(outputCollision.lastIndex(),
1374+
particle.pt(),
1375+
particle.eta(),
1376+
particle.phi(),
1377+
aod::femtouniverseparticle::ParticleType::kMCTruthTrack,
1378+
0,
1379+
static_cast<uint32_t>(particle.pdgCode()),
1380+
particle.pdgCode(),
1381+
childIDs,
1382+
0,
1383+
0);
1384+
if (ConfIsDebug) {
1385+
fillDebugParticle<false, true, false>(particle);
1386+
}
1387+
1388+
// Workaround to keep the FDParticles and MC label tables
1389+
// aligned, so that they can be joined in the task.
1390+
if constexpr (transientLabels) {
1391+
outputPartsMCLabels(-1);
1392+
}
1393+
}
1394+
}
13521395
}
13531396

13541397
template <bool isMC, typename V0Type, typename TrackType,
@@ -1562,8 +1605,8 @@ struct femtoUniverseProducerTask {
15621605
for (auto& mccol : mccols) {
15631606
auto groupedMCParticles = mcParticles.sliceBy(perMCCollision, mccol.globalIndex());
15641607
auto groupedCollisions = collisions.sliceBy(recoCollsPerMCColl, mccol.globalIndex());
1565-
fillMCTruthCollisions(groupedCollisions, groupedMCParticles); // fills the reco collisions for mc collision
1566-
fillParticles<decltype(groupedMCParticles), true>(groupedMCParticles, recoMcIds); // fills mc particles
1608+
fillMCTruthCollisions(groupedCollisions, groupedMCParticles); // fills the reco collisions for mc collision
1609+
fillParticles<decltype(groupedMCParticles), true, true>(groupedMCParticles, recoMcIds); // fills mc particles
15671610
}
15681611
}
15691612
PROCESS_SWITCH(femtoUniverseProducerTask, processTruthAndFullMC, "Provide both MC truth and reco for tracks and V0s", false);

PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ struct femtoUniversePairTaskTrackD0 {
556556
}
557557
}
558558
} // It is the end of the for loop over D0bar mesons
559-
} // It is the end of the for loop over all candidates
559+
} // It is the end of the for loop over all candidates
560560
}
561561
PROCESS_SWITCH(femtoUniversePairTaskTrackD0, processSideBand, "Enable processing side-band methode", false);
562562

PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -430,20 +430,6 @@ struct femtoUniversePairTaskTrackPhi {
430430
float tpcNSigmaPr, tofNSigmaPr, tpcNSigmaPi, tofNSigmaPi, tpcNSigmaKa, tofNSigmaKa;
431431
if (!ConfTrack.ConfIsSame) {
432432
for (auto& track : groupPartsTrack) {
433-
// if (track.p() > ConfBothTracks.ConfCutTable->get("Track", "MaxP") || track.pt() > ConfBothTracks.ConfCutTable->get("Track", "MaxPt")) {
434-
// continue;
435-
// }
436-
// if (!isFullPIDSelected(track.pidcut(),
437-
// track.p(),
438-
// ConfBothTracks.ConfCutTable->get("Track", "PIDthr"),
439-
// vPIDTrack,
440-
// ConfBothTracks.ConfNspecies,
441-
// kNsigma,
442-
// ConfBothTracks.ConfCutTable->get("Track", "nSigmaTPC"),
443-
// ConfBothTracks.ConfCutTable->get("Track", "nSigmaTPCTOF"))) {
444-
// continue;
445-
// }
446-
447433
tpcNSigmaPi = trackCuts.getNsigmaTPC(track, o2::track::PID::Pion);
448434
tofNSigmaPi = trackCuts.getNsigmaTOF(track, o2::track::PID::Pion);
449435
tpcNSigmaKa = trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon);
@@ -475,27 +461,6 @@ struct femtoUniversePairTaskTrackPhi {
475461
}
476462
/// Now build the combinations
477463
for (auto& [track, phicandidate] : combinations(CombinationsFullIndexPolicy(groupPartsTrack, groupPartsPhi))) {
478-
// if (track.p() > ConfBothTracks.ConfCutTable->get("PhiCandidate", "MaxP") || track.pt() > ConfBothTracks.ConfCutTable->get("PhiCandidate", "MaxPt") || phicandidate.p() > ConfBothTracks.ConfCutTable->get("Track", "MaxP") || phicandidate.pt() > ConfBothTracks.ConfCutTable->get("Track", "MaxPt")) {
479-
// continue;
480-
// }
481-
// if (!isFullPIDSelected(track.pidcut(),
482-
// track.p(),
483-
// ConfBothTracks.ConfCutTable->get("PhiCandidate", "PIDthr"),
484-
// vPIDPhiCandidate,
485-
// ConfBothTracks.ConfNspecies,
486-
// kNsigma,
487-
// ConfBothTracks.ConfCutTable->get("PhiCandidate", "nSigmaTPC"),
488-
// ConfBothTracks.ConfCutTable->get("PhiCandidate", "nSigmaTPCTOF")) ||
489-
// !isFullPIDSelected(phicandidate.pidcut(),
490-
// phicandidate.p(),
491-
// ConfBothTracks.ConfCutTable->get("Track", "PIDthr"),
492-
// vPIDTrack,
493-
// ConfBothTracks.ConfNspecies,
494-
// kNsigma,
495-
// ConfBothTracks.ConfCutTable->get("Track", "nSigmaTPC"),
496-
// ConfBothTracks.ConfCutTable->get("Track", "nSigmaTPCTOF"))) {
497-
// continue;
498-
// }
499464
if (ConfTrack.ConfIsTrackIdentified) {
500465
if (!IsParticleNSigmaAccepted(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon))) {
501466
continue;
@@ -573,27 +538,6 @@ struct femtoUniversePairTaskTrackPhi {
573538
{
574539

575540
for (auto& [track, phicandidate] : combinations(CombinationsFullIndexPolicy(groupPartsTrack, groupPartsPhi))) {
576-
// if (track.p() > ConfBothTracks.ConfCutTable->get("PhiCandidate", "MaxP") || track.pt() > ConfBothTracks.ConfCutTable->get("PhiCandidate", "MaxPt") || phicandidate.p() > ConfBothTracks.ConfCutTable->get("Track", "MaxP") || phicandidate.pt() > ConfBothTracks.ConfCutTable->get("Track", "MaxPt")) {
577-
// continue;
578-
// }
579-
// if (!isFullPIDSelected(track.pidcut(),
580-
// track.p(),
581-
// ConfBothTracks.ConfCutTable->get("PhiCandidate", "PIDthr"),
582-
// vPIDPhiCandidate,
583-
// ConfBothTracks.ConfNspecies,
584-
// kNsigma,
585-
// ConfBothTracks.ConfCutTable->get("PhiCandidate", "nSigmaTPC"),
586-
// ConfBothTracks.ConfCutTable->get("PhiCandidate", "nSigmaTPCTOF")) ||
587-
// !isFullPIDSelected(phicandidate.pidcut(),
588-
// phicandidate.p(),
589-
// ConfBothTracks.ConfCutTable->get("Track", "PIDthr"),
590-
// vPIDTrack,
591-
// ConfBothTracks.ConfNspecies,
592-
// kNsigma,
593-
// ConfBothTracks.ConfCutTable->get("Track", "nSigmaTPC"),
594-
// ConfBothTracks.ConfCutTable->get("Track", "nSigmaTPCTOF"))) {
595-
// continue;
596-
// }
597541
if (ConfTrack.ConfIsTrackIdentified) {
598542
if (!IsParticleNSigmaAccepted(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon))) {
599543
continue;

0 commit comments

Comments
 (0)