Skip to content

Commit 233f50b

Browse files
committed
fix logic issue in K0/Lambda selection/efficiency
1 parent e9fdf7b commit 233f50b

1 file changed

Lines changed: 27 additions & 24 deletions

File tree

PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,11 @@ struct FlowGenericFramework {
200200
O2_DEFINE_CONFIGURABLE(cfgGlobalT0ALowSigma, float, -3., "Number of sigma deviations below expected value in global vs T0A correlation");
201201
O2_DEFINE_CONFIGURABLE(cfgGlobalT0AHighSigma, float, 4, "Number of sigma deviations above expected value in global vs T0A correlation");
202202
} cfgMultCorrCuts;
203+
Configurable<LabeledArray<float>> nSigmas{"nSigmas", {LongArrayFloat.front().data(), 6, 3, {"pos_pi", "pos_ka", "pos_pr", "neg_pi", "neg_ka", "neg_pr"}, {"TPC", "TOF", "ITS"}}, "Labeled array for n-sigma values for TPC, TOF, ITS for pions, kaons, protons (positive and negative)"};
204+
Configurable<LabeledArray<float>> resonanceCuts{"resonanceCuts", {LongArrayFloat.front().data(), 14, 3, {"cos_PAs", "massMin", "massMax", "PosTrackPt", "NegTrackPt", "DCAPosToPVMin", "DCANegToPVMin", "DCAxDaughters", "Lifetime", "RadiusMin", "RadiusMax", "Rapidity", "ArmPodMin", "MassRejection"}, {"K0", "Lambda", "Phi"}}, "Labeled array (float) for various cuts on resonances"};
205+
Configurable<LabeledArray<int>> resonanceSwitches{"resonanceSwitches", {LongArrayInt.front().data(), 8, 3, {"UseParticle", "UseCosPA", "NMassBins", "UseDCAxDaughters", "UseProperLifetime", "UseV0Radius", "UseArmPodCut", "UseCompetingMassRejection"}, {"K0", "Lambda", "Phi"}}, "Labeled array (int) for various cuts on resonances"};
206+
203207
struct : ConfigurableGroup {
204-
Configurable<LabeledArray<float>> nSigmas{"nSigmas", {LongArrayFloat.front().data(), 6, 3, {"pos_pi", "pos_ka", "pos_pr", "neg_pi", "neg_ka", "neg_pr"}, {"TPC", "TOF", "ITS"}}, "Labeled array for n-sigma values for TPC, TOF, ITS for pions, kaons, protons (positive and negative)"};
205-
Configurable<LabeledArray<float>> resonanceCuts{"resonanceCuts", {LongArrayFloat.front().data(), 14, 3, {"cos_PAs", "massMin", "massMax", "PosTrackPt", "NegTrackPt", "DCAPosToPVMin", "DCANegToPVMin", "DCAxDaughters", "Lifetime", "RadiusMin", "RadiusMax", "Rapidity", "ArmPodMin", "MassRejection"}, {"K0", "Lambda", "Phi"}}, "Labeled array (float) for various cuts on resonances"};
206-
Configurable<LabeledArray<int>> resonanceSwitches{"resonanceSwitches", {LongArrayInt.front().data(), 8, 3, {"UseParticle", "UseCosPA", "NMassBins", "UseDCAxDaughters", "UseProperLifetime", "UseV0Radius", "UseArmPodCut", "UseCompetingMassRejection"}, {"K0", "Lambda", "Phi"}}, "Labeled array (int) for various cuts on resonances"};
207208
O2_DEFINE_CONFIGURABLE(cfgUseLsPhi, bool, true, "Use LikeSign for Phi v2")
208209
O2_DEFINE_CONFIGURABLE(cfgUseOnlyTPC, bool, true, "Use only TPC PID for daughter selection")
209210
O2_DEFINE_CONFIGURABLE(cfgFakeKaonCut, float, 0.1f, "Maximum difference in measured momentum and TPC inner ring momentum of particle")
@@ -553,9 +554,9 @@ struct FlowGenericFramework {
553554
gfwMemberCache.multGlobalV0ACutPars = cfgMultCorrCuts.cfgMultGlobalV0ACutPars;
554555
gfwMemberCache.multGlobalT0ACutPars = cfgMultCorrCuts.cfgMultGlobalT0ACutPars;
555556

556-
projectMatrix(cfgPIDCuts.nSigmas->getData(), tpcNsigmaCut, tofNsigmaCut, itsNsigmaCut);
557-
readMatrix(cfgPIDCuts.resonanceCuts->getData(), resoCutVals);
558-
readMatrix(cfgPIDCuts.resonanceSwitches->getData(), resoSwitchVals);
557+
projectMatrix(nSigmas->getData(), tpcNsigmaCut, tofNsigmaCut, itsNsigmaCut);
558+
readMatrix(resonanceCuts->getData(), resoCutVals);
559+
readMatrix(resonanceSwitches->getData(), resoSwitchVals);
559560
printResoCuts();
560561

561562
const auto& ptPtGaps = cfgPtPtGaps->getData();
@@ -1000,21 +1001,21 @@ struct FlowGenericFramework {
10001001
nSigmaVals[i][1] = tofNsigmaCut[i]; // TOF
10011002
nSigmaVals[i][2] = itsNsigmaCut[i]; // ITS
10021003
}
1003-
printTable(cfgPIDCuts.nSigmas.value, nSigmaVals, "nSigma PID Cuts");
1004+
printTable(nSigmas.value, nSigmaVals, "nSigma PID Cuts");
10041005

10051006
// ----- Resonance Cuts -----
10061007
std::vector<std::vector<float>> resoCutsVals(resoCutVals.size());
10071008
for (size_t r = 0; r < resoCutVals.size(); ++r) {
10081009
resoCutsVals[r] = std::vector<float>(resoCutVals[r].begin(), resoCutVals[r].end());
10091010
}
1010-
printTable(cfgPIDCuts.resonanceCuts.value, resoCutsVals, "Resonance Cuts");
1011+
printTable(resonanceCuts.value, resoCutsVals, "Resonance Cuts");
10111012

10121013
// ----- Resonance Switches -----
10131014
std::vector<std::vector<float>> resoSwitchValsF(resoSwitchVals.size());
10141015
for (size_t r = 0; r < resoSwitchVals.size(); ++r) {
10151016
resoSwitchValsF[r] = std::vector<float>(resoSwitchVals[r].begin(), resoSwitchVals[r].end());
10161017
}
1017-
printTable(cfgPIDCuts.resonanceSwitches.value, resoSwitchValsF, "Resonance Switches");
1018+
printTable(resonanceSwitches.value, resoSwitchValsF, "Resonance Switches");
10181019
}
10191020
enum QAFillTime {
10201021
Before,
@@ -2298,12 +2299,12 @@ struct FlowGenericFramework {
22982299
return selection;
22992300
}
23002301
registryQA.fill(HIST("K0/hK0Count"), FillDaughterPt);
2301-
if (massK0s < resoCutVals[MassMin][K0] && massK0s > resoCutVals[MassMax][K0]) {
2302+
if (massK0s < resoCutVals[MassMin][K0] || massK0s > resoCutVals[MassMax][K0]) {
23022303
return selection;
23032304
}
23042305
registryQA.fill(HIST("K0/hK0Count"), FillMassCut);
23052306
// Rapidity correction
2306-
if (v0.yK0Short() > resoCutVals[Rapidity][K0]) {
2307+
if (std::abs(v0.yK0Short()) > resoCutVals[Rapidity][K0]) {
23072308
return selection;
23082309
}
23092310
registryQA.fill(HIST("K0/hK0Count"), FillRapidityCut);
@@ -2387,7 +2388,7 @@ struct FlowGenericFramework {
23872388
registryQA.fill(HIST("Lambda/hLambdaCount"), FillMassCut);
23882389

23892390
// Rapidity correction
2390-
if (v0.yLambda() > resoCutVals[Rapidity][Lambda]) {
2391+
if (std::abs(v0.yLambda()) > resoCutVals[Rapidity][Lambda]) {
23912392
return selection;
23922393
}
23932394
registryQA.fill(HIST("Lambda/hLambdaCount"), FillRapidityCut);
@@ -3002,6 +3003,11 @@ struct FlowGenericFramework {
30023003
return;
30033004
}
30043005
fillV0EfficiencyRecoDebug(posMother.pt(), centrality, EfficiencyK0, V0EfficiencyMotherRapidity);
3006+
auto selection = selectK0(collision, v0, tracks);
3007+
if (!selection.selected) {
3008+
return;
3009+
}
3010+
fillV0EfficiencyRecoDebug(posMother.pt(), centrality, EfficiencyK0, V0EfficiencySelection);
30053011
if (!areGeneratedDaughtersWithinEfficiencyEtaAcceptance(posMother)) {
30063012
return;
30073013
}
@@ -3010,12 +3016,8 @@ struct FlowGenericFramework {
30103016
return;
30113017
}
30123018
fillV0EfficiencyRecoDebug(posMother.pt(), centrality, EfficiencyK0, V0EfficiencyRecoDaughterEta);
3013-
auto selection = selectK0(collision, v0, tracks);
3014-
if (selection.selected) {
3015-
fillV0EfficiencyRecoDebug(posMother.pt(), centrality, EfficiencyK0, V0EfficiencySelection);
3016-
registry.fill(HIST("Efficiency/efficiencyHist"), posMother.pt(), centrality, EfficiencyK0, EfficiencyReconstructed);
3017-
fillV0EfficiencyRecoDebug(posMother.pt(), centrality, EfficiencyK0, V0EfficiencyFilled);
3018-
}
3019+
registry.fill(HIST("Efficiency/efficiencyHist"), posMother.pt(), centrality, EfficiencyK0, EfficiencyReconstructed);
3020+
fillV0EfficiencyRecoDebug(posMother.pt(), centrality, EfficiencyK0, V0EfficiencyFilled);
30193021
return;
30203022
}
30213023

@@ -3026,6 +3028,11 @@ struct FlowGenericFramework {
30263028
return;
30273029
}
30283030
fillV0EfficiencyRecoDebug(posMother.pt(), centrality, EfficiencyLambda, V0EfficiencyMotherRapidity);
3031+
auto selection = selectLambda(collision, v0, tracks);
3032+
if (!selection.selected) {
3033+
return;
3034+
}
3035+
fillV0EfficiencyRecoDebug(posMother.pt(), centrality, EfficiencyLambda, V0EfficiencySelection);
30293036
if (!areGeneratedDaughtersWithinEfficiencyEtaAcceptance(posMother)) {
30303037
return;
30313038
}
@@ -3034,12 +3041,8 @@ struct FlowGenericFramework {
30343041
return;
30353042
}
30363043
fillV0EfficiencyRecoDebug(posMother.pt(), centrality, EfficiencyLambda, V0EfficiencyRecoDaughterEta);
3037-
auto selection = selectLambda(collision, v0, tracks);
3038-
if (selection.selected) {
3039-
fillV0EfficiencyRecoDebug(posMother.pt(), centrality, EfficiencyLambda, V0EfficiencySelection);
3040-
registry.fill(HIST("Efficiency/efficiencyHist"), posMother.pt(), centrality, EfficiencyLambda, EfficiencyReconstructed);
3041-
fillV0EfficiencyRecoDebug(posMother.pt(), centrality, EfficiencyLambda, V0EfficiencyFilled);
3042-
}
3044+
registry.fill(HIST("Efficiency/efficiencyHist"), posMother.pt(), centrality, EfficiencyLambda, EfficiencyReconstructed);
3045+
fillV0EfficiencyRecoDebug(posMother.pt(), centrality, EfficiencyLambda, V0EfficiencyFilled);
30433046
return;
30443047
}
30453048
}

0 commit comments

Comments
 (0)