Skip to content

Commit 2a07238

Browse files
committed
Less strict daughter track selection and configurable PID rejection criteria in flowGenericFramework.cxx
1 parent dd03005 commit 2a07238

1 file changed

Lines changed: 34 additions & 35 deletions

File tree

PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ struct FlowGenericFramework {
207207
struct : ConfigurableGroup {
208208
O2_DEFINE_CONFIGURABLE(cfgUseLsPhi, bool, true, "Use LikeSign for Phi v2")
209209
O2_DEFINE_CONFIGURABLE(cfgUseOnlyTPC, bool, true, "Use only TPC PID for daughter selection")
210+
O2_DEFINE_CONFIGURABLE(cfgDaughterPIDRejection, bool, true, "Reject daughters if not consistent with expected K0/Lambda decay products")
210211
O2_DEFINE_CONFIGURABLE(cfgFakeKaonCut, float, 0.1f, "Maximum difference in measured momentum and TPC inner ring momentum of particle")
211212
O2_DEFINE_CONFIGURABLE(cfgUseAsymmetricPID, bool, false, "Use asymmetric PID cuts")
212213
O2_DEFINE_CONFIGURABLE(cfgTPCNsigmaCut, float, 3.0f, "TPC N-sigma cut for pions, kaons, protons")
@@ -393,9 +394,9 @@ struct FlowGenericFramework {
393394
V0EfficiencyCommonPrimaryMother,
394395
V0EfficiencyMotherSpecies,
395396
V0EfficiencyMotherRapidity,
397+
V0EfficiencySelection,
396398
V0EfficiencyGeneratedDaughterEta,
397399
V0EfficiencyRecoDaughterEta,
398-
V0EfficiencySelection,
399400
V0EfficiencyFilled,
400401
V0EfficiencyStageCount
401402
};
@@ -465,6 +466,7 @@ struct FlowGenericFramework {
465466
FillProperLifetime,
466467
FillArmPodCut,
467468
FillCompetingMass,
469+
FillDaughterTrackSelected,
468470
FillV02DaughterTrackSelection,
469471
FillV0DaughterTrackSelection
470472
};
@@ -735,7 +737,7 @@ struct FlowGenericFramework {
735737
registryQA.add("K0/hK0s", "", {HistType::kTH1D, {singleCount}});
736738
registryQA.add("K0/hK0s_corrected", "", {HistType::kTH1D, {singleCount}});
737739
}
738-
registryQA.add("K0/hK0Count", "Number of K0;; Count", {HistType::kTH1D, {{13, 0.5, 13.5}}});
740+
registryQA.add("K0/hK0Count", "Number of K0;; Count", {HistType::kTH1D, {{14, 0.5, 14.5}}});
739741
registryQA.get<TH1>(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(FillCandidate, "K0 candidates");
740742
registryQA.get<TH1>(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(FillDaughterPt, "Daughter pt");
741743
registryQA.get<TH1>(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(FillMassCut, "Mass cut");
@@ -747,8 +749,9 @@ struct FlowGenericFramework {
747749
registryQA.get<TH1>(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(FillProperLifetime, "Proper lifetime");
748750
registryQA.get<TH1>(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(FillArmPodCut, "Armenteros-Podolanski cut");
749751
registryQA.get<TH1>(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(FillCompetingMass, "Competing mass rejection");
750-
registryQA.get<TH1>(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(FillV02DaughterTrackSelection, "v02 Daughter track selection");
751-
registryQA.get<TH1>(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(FillV0DaughterTrackSelection, "v0 Daughter track selection");
752+
registryQA.get<TH1>(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(FillDaughterTrackSelected, "Daughter track selected");
753+
registryQA.get<TH1>(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(FillV02DaughterTrackSelection, "v02 Daughter eta selection");
754+
registryQA.get<TH1>(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(FillV0DaughterTrackSelection, "v0 Daughter eta selection");
752755
}
753756

754757
if (resoSwitchVals[UseParticle][Lambda] != 0) {
@@ -772,7 +775,7 @@ struct FlowGenericFramework {
772775
registryQA.add("Lambda/hLambdas", "", {HistType::kTH1D, {singleCount}});
773776
registryQA.add("Lambda/hLambdas_corrected", "", {HistType::kTH1D, {singleCount}});
774777
}
775-
registryQA.add("Lambda/hLambdaCount", "Number of Lambda;; Count", {HistType::kTH1D, {{13, 0.5, 13.5}}});
778+
registryQA.add("Lambda/hLambdaCount", "Number of Lambda;; Count", {HistType::kTH1D, {{14, 0.5, 14.5}}});
776779
registryQA.get<TH1>(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(FillCandidate, "Lambda candidates");
777780
registryQA.get<TH1>(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(FillDaughterPt, "Daughter pt");
778781
registryQA.get<TH1>(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(FillMassCut, "Mass cut");
@@ -784,6 +787,7 @@ struct FlowGenericFramework {
784787
registryQA.get<TH1>(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(FillProperLifetime, "Proper lifetime");
785788
registryQA.get<TH1>(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(FillArmPodCut, "Armenteros-Podolanski cut");
786789
registryQA.get<TH1>(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(FillCompetingMass, "Competing mass rejection");
790+
registryQA.get<TH1>(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(FillDaughterTrackSelected, "Daughter track selected");
787791
registryQA.get<TH1>(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(FillV02DaughterTrackSelection, "v02 Daughter track selection");
788792
registryQA.get<TH1>(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(FillV0DaughterTrackSelection, "v0 Daughter track selection");
789793
}
@@ -2118,11 +2122,11 @@ struct FlowGenericFramework {
21182122
if (!selectionV0DaughterEta(postrack, fractionSetup) || !selectionV0DaughterEta(negtrack, fractionSetup)) {
21192123
continue;
21202124
}
2125+
registryQA.fill(HIST("K0/hK0Count"), (fractionSetup == FractionV02) ? FillV02DaughterTrackSelection : FillV0DaughterTrackSelection);
21212126

21222127
if (cfgFill.cfgFillV0QA && fractionSetup == FractionV02) {
21232128
fillV0QA(k0Selection, v0, postrack, negtrack, centrality, weff);
21242129
}
2125-
registryQA.fill(HIST("K0/hK0Count"), (fractionSetup == FractionV02) ? FillV02DaughterTrackSelection : FillV0DaughterTrackSelection);
21262130

21272131
if (v0.mK0Short() > cfgPIDCuts.cfgK0SideBand1Min && v0.mK0Short() < cfgPIDCuts.cfgK0SideBand1Max) {
21282132
histosResoNpt[fractionSetup][K0Sideband1]->Fill(v0.pt(), (cfgUseNchCorrection) ? weff : 1.0);
@@ -2235,34 +2239,28 @@ struct FlowGenericFramework {
22352239
template <typename TTrack>
22362240
bool selectionV0Daughter(const TTrack& track, int pid)
22372241
{
2238-
if (!(track.itsNCls() > cfgTrackCuts.cfgMinNITSCls)) {
2239-
return 0;
2240-
}
2241-
if (!track.hasTPC()) {
2242+
if (track.tpcNClsCrossedRows() < cfgTrackCuts.cfgNTPCXrows) {
22422243
return false;
22432244
}
2244-
if (track.tpcNClsFound() < cfgTrackCuts.cfgNTPCCls) {
2245-
return false;
2246-
}
2247-
if (!(track.tpcNClsCrossedRows() > cfgTrackCuts.cfgNTPCXrows)) {
2248-
return 0;
2249-
}
2250-
2251-
if (cfgPIDCuts.cfgUseOnlyTPC) {
2252-
if (pid == Pions && std::abs(track.tpcNSigmaPi()) > cfgPIDCuts.cfgTPCNsigmaCut) {
2253-
return false;
2254-
}
2255-
if (pid == Kaons && std::abs(track.tpcNSigmaKa()) > cfgPIDCuts.cfgTPCNsigmaCut) {
2256-
return false;
2257-
}
2258-
if (pid == Protons && std::abs(track.tpcNSigmaPr()) > cfgPIDCuts.cfgTPCNsigmaCut) {
2259-
return false;
2260-
}
2261-
} else {
2262-
int partIndex = cfgPIDCuts.cfgUseAsymmetricPID ? getNsigmaPIDAssymmetric(track) : getNsigmaPID(track);
2263-
int pidIndex = partIndex - 1; // 0 = pion, 1 = kaon, 2 = proton
2264-
if (pidIndex != pid) {
2265-
return false;
2245+
// Only accept daughters consistent with the expected identities of K0 or Lambda decay.
2246+
if (cfgPIDCuts.cfgDaughterPIDRejection) {
2247+
if (cfgPIDCuts.cfgUseOnlyTPC) {
2248+
if (pid == Pions && std::abs(track.tpcNSigmaPi()) > cfgPIDCuts.cfgTPCNsigmaCut) {
2249+
return false;
2250+
} else if (pid == Protons && std::abs(track.tpcNSigmaPr()) > cfgPIDCuts.cfgTPCNsigmaCut) {
2251+
return false;
2252+
} else if (pid != Pions && pid != Protons) {
2253+
return false;
2254+
}
2255+
} else {
2256+
int partIndex = cfgPIDCuts.cfgUseAsymmetricPID ? getNsigmaPIDAssymmetric(track) : getNsigmaPID(track);
2257+
int pidIndex = partIndex - 1; // 0 = pion, 1 = kaon, 2 = proton
2258+
if (pid != Pions && pid != Protons) {
2259+
return false;
2260+
}
2261+
if (pidIndex != pid) {
2262+
return false;
2263+
}
22662264
}
22672265
}
22682266

@@ -2366,7 +2364,7 @@ struct FlowGenericFramework {
23662364
if (!selectionV0Daughter(postrack, Pions) || !selectionV0Daughter(negtrack, Pions)) {
23672365
return selection;
23682366
}
2369-
2367+
registryQA.fill(HIST("K0/hK0Count"), FillDaughterTrackSelected);
23702368
selection.selected = true;
23712369
selection.isK0 = true;
23722370
registryQA.fill(HIST("K0/hK0AP"), v0.alpha(), v0.qtarm());
@@ -2453,16 +2451,17 @@ struct FlowGenericFramework {
24532451
registryQA.fill(HIST("Lambda/hLambdaCount"), FillCompetingMass);
24542452
if (selection.isL) {
24552453
if (!selectionV0Daughter(postrack, Protons) || !selectionV0Daughter(negtrack, Pions)) {
2456-
registryQA.fill(HIST("Lambda/hLambdaAP"), v0.alpha(), v0.qtarm());
24572454
return selection;
24582455
}
2456+
registryQA.fill(HIST("Lambda/hLambdaAP"), v0.alpha(), v0.qtarm());
24592457
}
24602458
if (selection.isAL) {
24612459
if (!selectionV0Daughter(postrack, Pions) || !selectionV0Daughter(negtrack, Protons)) {
2462-
registryQA.fill(HIST("Lambda/hAntiLambdaAP"), v0.alpha(), v0.qtarm());
24632460
return selection;
24642461
}
2462+
registryQA.fill(HIST("Lambda/hAntiLambdaAP"), v0.alpha(), v0.qtarm());
24652463
}
2464+
registryQA.fill(HIST("Lambda/hLambdaCount"), FillDaughterTrackSelected);
24662465
selection.selected = true;
24672466

24682467
return selection;

0 commit comments

Comments
 (0)