Skip to content

Commit eed5ac4

Browse files
Fix bug + add feeddown QA histograms
1 parent 07644bd commit eed5ac4

1 file changed

Lines changed: 73 additions & 5 deletions

File tree

‎PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx‎

Lines changed: 73 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,10 @@ struct derivedlambdakzeroanalysis {
131131

132132
// for MC
133133
Configurable<bool> doMCAssociation{"doMCAssociation", true, "if MC, do MC association"};
134-
Configurable<bool> doTreatPiToMuon{"doTreatPiToMuon", false, "Take pi decay into muon into account in MC"};
134+
Configurable<bool> doTreatPiToMuon{"doTreatPiToMuon", true, "Take pi decay into muon into account in MC"};
135135
Configurable<bool> doCollisionAssociationQA{"doCollisionAssociationQA", true, "check collision association"};
136136
Configurable<int> doSecondaryV0s{"doSecondaryV0s", 0, "Look at secondary V0s? 0: No; 1: yes via a loop on V0MCCores; 2: yes via a loop on CascMCCores"};
137+
Configurable<bool> doQAfeeddown{"doQAfeeddown", true, "if MC, fill feeddown QA histograms"};
137138

138139
struct : ConfigurableGroup {
139140
std::string prefix = "eventSelections"; // JSON group name
@@ -374,6 +375,8 @@ struct derivedlambdakzeroanalysis {
374375

375376
// MC coll assoc QA axis
376377
ConfigurableAxis axisMonteCarloNch{"axisMonteCarloNch", {300, 0.0f, 3000.0f}, "N_{ch} MC"};
378+
379+
ConfigurableAxis axisPDGCodeMothers{"axisPDGCodeMothers", {7001, -3500.5, 3500.5}, "PDG code of mother particle"};
377380
} axisConfigurations;
378381

379382
// UPC selections
@@ -457,6 +460,7 @@ struct derivedlambdakzeroanalysis {
457460
uint64_t maskSelectionLambda = 0;
458461
uint64_t maskSelectionAntiLambda = 0;
459462

463+
uint64_t secondaryMaskSelectionK0Short = 0;
460464
uint64_t secondaryMaskSelectionLambda = 0;
461465
uint64_t secondaryMaskSelectionAntiLambda = 0;
462466

@@ -669,6 +673,7 @@ struct derivedlambdakzeroanalysis {
669673
BITSET(maskSelectionAntiLambda, selPhysPrimAntiLambda);
670674

671675
// No primary requirement for feeddown matrix
676+
secondaryMaskSelectionK0Short = maskTopological | maskTrackProperties | maskK0ShortSpecific;
672677
secondaryMaskSelectionLambda = maskTopological | maskTrackProperties | maskLambdaSpecific;
673678
secondaryMaskSelectionAntiLambda = maskTopological | maskTrackProperties | maskAntiLambdaSpecific;
674679

@@ -1115,6 +1120,25 @@ struct derivedlambdakzeroanalysis {
11151120
}
11161121
}
11171122

1123+
if (analyseK0Short && doQAfeeddown && (doprocessMonteCarloRun3 || doprocessMonteCarloRun2)) {
1124+
histos.add("h2dK0ShortMothers", "h2dK0ShortMothers", kTH2D, {axisConfigurations.axisPt, axisConfigurations.axisPDGCodeMothers});
1125+
histos.add("h2dK0ShortMothersIsPrimary", "h2dK0ShortMothersIsPrimary", kTH2D, {axisConfigurations.axisPt, axisConfigurations.axisPDGCodeMothers});
1126+
histos.add("h3dK0ShortMothers", "h3dK0ShortMothers", kTH3D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt, axisConfigurations.axisPDGCodeMothers});
1127+
histos.add("h3dK0ShortMothersIsPrimary", "h3dK0ShortMothersIsPrimary", kTH3D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt, axisConfigurations.axisPDGCodeMothers});
1128+
}
1129+
if (analyseLambda && doQAfeeddown && (doprocessMonteCarloRun3 || doprocessMonteCarloRun2)) {
1130+
histos.add("h2dLambdaMothers", "h2dLambdaMothers", kTH2D, {axisConfigurations.axisPt, axisConfigurations.axisPDGCodeMothers});
1131+
histos.add("h2dLambdaMothersIsPrimary", "h2dLambdaMothersIsPrimary", kTH2D, {axisConfigurations.axisPt, axisConfigurations.axisPDGCodeMothers});
1132+
histos.add("h3dLambdaMothers", "h3dLambdaMothers", kTH3D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt, axisConfigurations.axisPDGCodeMothers});
1133+
histos.add("h3dLambdaMothersIsPrimary", "h3dLambdaMothersIsPrimary", kTH3D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt, axisConfigurations.axisPDGCodeMothers});
1134+
}
1135+
if (analyseAntiLambda && doQAfeeddown && (doprocessMonteCarloRun3 || doprocessMonteCarloRun2)) {
1136+
histos.add("h2dAntiLambdaMothers", "h2dAntiLambdaMothers", kTH2D, {axisConfigurations.axisPt, axisConfigurations.axisPDGCodeMothers});
1137+
histos.add("h2dAntiLambdaMothersIsPrimary", "h2dAntiLambdaMothersIsPrimary", kTH2D, {axisConfigurations.axisPt, axisConfigurations.axisPDGCodeMothers});
1138+
histos.add("h3dAntiLambdaMothers", "h3dAntiLambdaMothers", kTH3D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt, axisConfigurations.axisPDGCodeMothers});
1139+
histos.add("h3dAntiLambdaMothersIsPrimary", "h3dAntiLambdaMothersIsPrimary", kTH3D, {axisConfigurations.axisCentrality, axisConfigurations.axisPt, axisConfigurations.axisPDGCodeMothers});
1140+
}
1141+
11181142
if (analyseK0Short)
11191143
histos.add("hMassK0Short", "hMassK0Short", kTH1D, {axisConfigurations.axisK0Mass});
11201144
if (analyseLambda)
@@ -1706,18 +1730,22 @@ struct derivedlambdakzeroanalysis {
17061730

17071731
if (v0.pdgCode() == PDG_t::kK0Short && isPositivePion && isNegativePion) {
17081732
BITSET(bitMap, selConsiderK0Short);
1709-
if (v0.isPhysicalPrimary())
1733+
if (v0.isPhysicalPrimary()) {
17101734
BITSET(bitMap, selPhysPrimK0Short);
1735+
LOG(info) << "coucou1";
1736+
}
17111737
}
17121738
if (v0.pdgCode() == PDG_t::kLambda0 && isPositiveProton && isNegativePion) {
17131739
BITSET(bitMap, selConsiderLambda);
1714-
if (v0.isPhysicalPrimary())
1740+
if (v0.isPhysicalPrimary()) {
17151741
BITSET(bitMap, selPhysPrimLambda);
1742+
}
17161743
}
17171744
if (v0.pdgCode() == PDG_t::kLambda0Bar && isPositivePion && isNegativeProton) {
17181745
BITSET(bitMap, selConsiderAntiLambda);
1719-
if (v0.isPhysicalPrimary())
1746+
if (v0.isPhysicalPrimary()) {
17201747
BITSET(bitMap, selPhysPrimAntiLambda);
1748+
}
17211749
}
17221750
return bitMap;
17231751
}
@@ -2375,6 +2403,43 @@ struct derivedlambdakzeroanalysis {
23752403
}
23762404
}
23772405

2406+
template <typename TV0>
2407+
void fillFeeddownQA(TV0 const& v0, float pt, float centrality, uint64_t selMap)
2408+
// fill feeddown matrix for Lambdas or AntiLambdas
2409+
// fixme: a potential improvement would be to consider mass windows for the l/al
2410+
{
2411+
if (!v0.has_motherMCPart())
2412+
return; // does not have mother particle in record, skip
2413+
2414+
auto v0mother = v0.motherMCPart();
2415+
2416+
// __________________________________________
2417+
if (verifyMask(selMap, secondaryMaskSelectionK0Short) && analyseK0Short) {
2418+
histos.fill(HIST("h2dK0ShortMothers"), pt, v0mother.pdgCode());
2419+
histos.fill(HIST("h3dK0ShortMothers"), centrality, pt, v0mother.pdgCode());
2420+
if (v0mother.isPhysicalPrimary()) {
2421+
histos.fill(HIST("h2dK0ShortMothersIsPrimary"), pt, v0mother.pdgCode());
2422+
histos.fill(HIST("h3dK0ShortMothersIsPrimary"), centrality, pt, v0mother.pdgCode());
2423+
}
2424+
}
2425+
if (verifyMask(selMap, secondaryMaskSelectionLambda) && analyseLambda) {
2426+
histos.fill(HIST("h2dLambdaMothers"), pt, v0mother.pdgCode());
2427+
histos.fill(HIST("h3dLambdaMothers"), centrality, pt, v0mother.pdgCode());
2428+
if (v0mother.isPhysicalPrimary()) {
2429+
histos.fill(HIST("h2dLambdaMothersIsPrimary"), pt, v0mother.pdgCode());
2430+
histos.fill(HIST("h3dLambdaMothersIsPrimary"), centrality, pt, v0mother.pdgCode());
2431+
}
2432+
}
2433+
if (verifyMask(selMap, secondaryMaskSelectionAntiLambda) && analyseAntiLambda) {
2434+
histos.fill(HIST("h2dAntiLambdaMothers"), pt, v0mother.pdgCode());
2435+
histos.fill(HIST("h3dAntiLambdaMothers"), centrality, pt, v0mother.pdgCode());
2436+
if (v0mother.isPhysicalPrimary()) {
2437+
histos.fill(HIST("h2dAntiLambdaMothersIsPrimary"), pt, v0mother.pdgCode());
2438+
histos.fill(HIST("h3dAntiLambdaMothersIsPrimary"), centrality, pt, v0mother.pdgCode());
2439+
}
2440+
}
2441+
}
2442+
23782443
template <typename TCollision>
23792444
bool isEventAccepted(TCollision const& collision, bool fillHists)
23802445
// check whether the collision passes our collision selections
@@ -3000,13 +3065,16 @@ struct derivedlambdakzeroanalysis {
30003065
histos.fill(HIST("GeneralQA/h2dArmenterosAll"), v0.alpha(), v0.qtarm());
30013066

30023067
uint64_t selMap = computeReconstructionBitmap(v0, collision, yK0Short, yLambda);
3003-
BITSET(selMap, selMapMCassociation);
3068+
selMap |= selMapMCassociation;
30043069

30053070
// feeddown matrix always with association
30063071
if constexpr (requires { v0.motherMCPartId(); }) {
30073072
if (calculateFeeddownMatrix) {
30083073
fillFeeddownMatrix(v0, ptMC, centrality, selMap);
30093074
}
3075+
if (doQAfeeddown) {
3076+
fillFeeddownQA(v0, ptMC, centrality, selMap);
3077+
}
30103078
}
30113079

30123080
// consider only associated candidates if asked to do so, disregard association

0 commit comments

Comments
 (0)