Skip to content

Commit 87e41f9

Browse files
authored
[PWGLF] Improve TOF PID selection cut (#12704)
1 parent 2496bd8 commit 87e41f9

File tree

1 file changed

+93
-29
lines changed

1 file changed

+93
-29
lines changed

PWGLF/Tasks/Resonances/phispectrapbpbqa.cxx

Lines changed: 93 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ struct phispectrapbpbqa {
107107
Configurable<bool> ispTdepPID{"ispTdepPID", false, "pT dependent PID"};
108108
Configurable<float> cfgCutTOFBeta{"cfgCutTOFBeta", 0.5, "cut TOF beta"};
109109
Configurable<float> nsigmaCutTPC{"nsigmacutTPC", 2.0, "Value of the TPC Nsigma cut"};
110-
Configurable<float> nsigmaCutCombined{"nsigmaCutCombined", 2.0, "Value of the Combined TPC-TOF Nsigma cut"};
110+
Configurable<bool> applyTOF{"applyTOF", true, "Apply TOF"};
111111
ConfigurableAxis axisOccupancy{"axisOccupancy", {VARIABLE_WIDTH, -1.0, 200.0, 500.0, 1000.0, 2000.0f, 4000.0, 10000.0f, 100000.0f}, "occupancy axis"};
112112
struct : ConfigurableGroup {
113113
ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {90, 0.98, 1.07}, "#it{M} (GeV/#it{c}^{2})"};
@@ -157,6 +157,8 @@ struct phispectrapbpbqa {
157157

158158
histos.add("hPhiMommentum", "hPhiMommentum", kTH3F, {{36, 0, 6.283}, {200, -10.0, 10.0}, axisOccupancy});
159159

160+
histos.add("hNsigmaTPCBeforeCut", "NsigmaKaon TPC Before Cut", kTH3F, {{200, -10.0f, 10.0f}, {100, 0.0, 10.0}, axisOccupancy});
161+
histos.add("hNsigmaTOFBeforeCut", "NsigmaKaon TOF Before Cut", kTH3F, {{200, -10.0f, 10.0f}, {100, 0.0, 10.0}, axisOccupancy});
160162
histos.add("hNsigmaTPCAfterCut", "NsigmaKaon TPC After Cut", kTH3F, {{200, -10.0f, 10.0f}, {100, 0.0, 10.0}, axisOccupancy});
161163
histos.add("hNsigmaTOFAfterCut", "NsigmaKaon TOF After Cut", kTH3F, {{200, -10.0f, 10.0f}, {100, 0.0, 10.0}, axisOccupancy});
162164

@@ -214,22 +216,63 @@ struct phispectrapbpbqa {
214216
if (candidate.p() < 0.7 && TMath::Abs(nsigmaTPC) < nsigmaCutTPC) {
215217
return true;
216218
}
217-
if (candidate.p() >= 0.7 && candidate.hasTOF() && candidate.beta() > cfgCutTOFBeta && TMath::Sqrt(nsigmaTPC * nsigmaTPC + nsigmaTOF * nsigmaTOF) < nsigmaCutCombined) {
218-
return true;
219+
if (candidate.p() > 0.7 && candidate.hasTOF() && TMath::Abs(nsigmaTPC) < nsigmaCutTPC) {
220+
if (candidate.p() > 0.7 && candidate.p() < 1.6 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -5.0 && nsigmaTOF < 10.0) {
221+
return true;
222+
}
223+
if (candidate.p() >= 1.6 && candidate.p() < 2.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -3.0 && nsigmaTOF < 10.0) {
224+
return true;
225+
}
226+
if (candidate.p() >= 2.0 && candidate.p() < 2.5 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -3.0 && nsigmaTOF < 6.0) {
227+
return true;
228+
}
229+
if (candidate.p() >= 2.5 && candidate.p() < 4.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -2.5 && nsigmaTOF < 4.0) {
230+
return true;
231+
}
232+
if (candidate.p() >= 4.0 && candidate.p() < 5.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -4.0 && nsigmaTOF < 3.0) {
233+
return true;
234+
}
235+
if (candidate.p() >= 5.0 && candidate.p() < 6.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -4.0 && nsigmaTOF < 2.5) {
236+
return true;
237+
}
238+
if (candidate.p() >= 6.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -3.0 && nsigmaTOF < 3.0) {
239+
return true;
240+
}
219241
}
220242
return false;
221243
}
222244

223245
template <typename T>
224246
bool selectionPID(const T& candidate, double nsigmaTPC, double nsigmaTOF)
225247
{
226-
if (candidate.p() < 0.7 && TMath::Abs(nsigmaTPC) < nsigmaCutTPC) {
227-
return true;
228-
}
229-
if (candidate.p() >= 0.7 && candidate.hasTOF() && candidate.beta() > cfgCutTOFBeta && TMath::Sqrt(nsigmaTPC * nsigmaTPC + nsigmaTOF * nsigmaTOF) < nsigmaCutCombined) {
230-
return true;
231-
}
232-
if (candidate.p() >= 0.7 && !candidate.hasTOF() && TMath::Abs(nsigmaTPC) < nsigmaCutTPC) {
248+
if (applyTOF) {
249+
if (!candidate.hasTOF() && TMath::Abs(nsigmaTPC) < nsigmaCutTPC) {
250+
return true;
251+
}
252+
if (candidate.p() > 0.5 && candidate.hasTOF() && TMath::Abs(nsigmaTPC) < nsigmaCutTPC) {
253+
if (candidate.p() > 0.5 && candidate.p() < 1.6 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -5.0 && nsigmaTOF < 10.0) {
254+
return true;
255+
}
256+
if (candidate.p() >= 1.6 && candidate.p() < 2.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -3.0 && nsigmaTOF < 10.0) {
257+
return true;
258+
}
259+
if (candidate.p() >= 2.0 && candidate.p() < 2.5 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -3.0 && nsigmaTOF < 6.0) {
260+
return true;
261+
}
262+
if (candidate.p() >= 2.5 && candidate.p() < 4.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -2.5 && nsigmaTOF < 4.0) {
263+
return true;
264+
}
265+
if (candidate.p() >= 4.0 && candidate.p() < 5.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -4.0 && nsigmaTOF < 3.0) {
266+
return true;
267+
}
268+
if (candidate.p() >= 5.0 && candidate.p() < 6.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -4.0 && nsigmaTOF < 2.5) {
269+
return true;
270+
}
271+
if (candidate.p() >= 6.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -3.0 && nsigmaTOF < 3.0) {
272+
return true;
273+
}
274+
}
275+
} else if (TMath::Abs(nsigmaTPC) < nsigmaCutTPC) {
233276
return true;
234277
}
235278
return false;
@@ -324,6 +367,8 @@ struct phispectrapbpbqa {
324367
if (track1.hasTOF()) {
325368
histos.fill(HIST("hNsigmaTOF"), nSigmaTOF, track1.p(), occupancy, centrality);
326369
}
370+
histos.fill(HIST("hNsigmaTPCBeforeCut"), nSigmaTPC, track1.p(), occupancy);
371+
histos.fill(HIST("hNsigmaTOFBeforeCut"), nSigmaTOF, track1.p(), occupancy);
327372
if (applyPID) {
328373
if (ispTdepPID && !selectionPIDpTdependent(track1, nSigmaTPC, nSigmaTOF)) {
329374
continue;
@@ -374,6 +419,8 @@ struct phispectrapbpbqa {
374419
if (track2.hasTOF()) {
375420
histos.fill(HIST("hNsigmaTOF"), nSigmaTOF2, track2.p(), occupancy, centrality);
376421
}
422+
histos.fill(HIST("hNsigmaTPCBeforeCut"), nSigmaTPC2, track2.p(), occupancy);
423+
histos.fill(HIST("hNsigmaTOFBeforeCut"), nSigmaTOF2, track2.p(), occupancy);
377424
}
378425
if (applyPID) {
379426
if (ispTdepPID && !selectionPIDpTdependent(track2, nSigmaTPC2, nSigmaTOF2)) {
@@ -549,6 +596,7 @@ struct phispectrapbpbqa {
549596
auto oldindex = -999;
550597
auto Rectrackspart = RecTracks.sliceBy(perCollision, RecCollision.globalIndex());
551598
// loop over reconstructed particle
599+
int ntrack1 = 0;
552600
for (auto track1 : Rectrackspart) {
553601
if (!selectionTrack(track1)) {
554602
continue;
@@ -557,6 +605,32 @@ struct phispectrapbpbqa {
557605
continue;
558606
}
559607
auto track1ID = track1.index();
608+
// PID track 1
609+
double nSigmaTPC = track1.tpcNSigmaKa();
610+
double nSigmaTOF = track1.tofNSigmaKa();
611+
if (!track1.hasTOF()) {
612+
nSigmaTOF = -9999.99;
613+
}
614+
if (cfgUpdatePID) {
615+
nSigmaTPC = (nSigmaTPC - hTPCCallib->GetBinContent(hTPCCallib->FindBin(track1.p(), centrality, occupancy))) / hTPCCallib->GetBinError(hTPCCallib->FindBin(track1.p(), centrality, occupancy));
616+
if (track1.hasTOF()) {
617+
nSigmaTOF = (nSigmaTOF - hTOFCallib->GetBinContent(hTOFCallib->FindBin(track1.p(), centrality, occupancy))) / hTOFCallib->GetBinError(hTOFCallib->FindBin(track1.p(), centrality, occupancy));
618+
}
619+
}
620+
histos.fill(HIST("hNsigmaTPCBeforeCut"), nSigmaTPC, track1.p(), occupancy);
621+
histos.fill(HIST("hNsigmaTOFBeforeCut"), nSigmaTOF, track1.p(), occupancy);
622+
623+
if (applyPID) {
624+
if (ispTdepPID && !selectionPIDpTdependent(track1, nSigmaTPC, nSigmaTOF)) {
625+
continue;
626+
}
627+
if (!ispTdepPID && !selectionPID(track1, nSigmaTPC, nSigmaTOF)) {
628+
continue;
629+
}
630+
histos.fill(HIST("hNsigmaTPCAfterCut"), nSigmaTPC, track1.p(), occupancy);
631+
histos.fill(HIST("hNsigmaTOFAfterCut"), nSigmaTOF, track1.p(), occupancy);
632+
}
633+
ntrack1 = ntrack1 + 1;
560634
for (auto track2 : Rectrackspart) {
561635
auto track2ID = track2.index();
562636
if (track2ID <= track1ID) {
@@ -574,18 +648,7 @@ struct phispectrapbpbqa {
574648
if (track1.sign() * track2.sign() > 0) {
575649
continue;
576650
}
577-
// PID track 1
578-
double nSigmaTPC = track1.tpcNSigmaKa();
579-
double nSigmaTOF = track1.tofNSigmaKa();
580-
if (!track1.hasTOF()) {
581-
nSigmaTOF = -9999.99;
582-
}
583-
if (cfgUpdatePID) {
584-
nSigmaTPC = (nSigmaTPC - hTPCCallib->GetBinContent(hTPCCallib->FindBin(track1.p(), centrality, occupancy))) / hTPCCallib->GetBinError(hTPCCallib->FindBin(track1.p(), centrality, occupancy));
585-
if (track1.hasTOF()) {
586-
nSigmaTOF = (nSigmaTOF - hTOFCallib->GetBinContent(hTOFCallib->FindBin(track1.p(), centrality, occupancy))) / hTOFCallib->GetBinError(hTOFCallib->FindBin(track1.p(), centrality, occupancy));
587-
}
588-
}
651+
589652
// PID track 2
590653
double nSigmaTPC2 = track2.tpcNSigmaKa();
591654
double nSigmaTOF2 = track2.tofNSigmaKa();
@@ -598,21 +661,22 @@ struct phispectrapbpbqa {
598661
nSigmaTOF2 = (nSigmaTOF2 - hTOFCallib->GetBinContent(hTOFCallib->FindBin(track2.p(), centrality, occupancy))) / hTOFCallib->GetBinError(hTOFCallib->FindBin(track2.p(), centrality, occupancy));
599662
}
600663
}
664+
if (ntrack1 == 1) {
665+
histos.fill(HIST("hNsigmaTPCBeforeCut"), nSigmaTPC2, track2.p(), occupancy);
666+
histos.fill(HIST("hNsigmaTOFBeforeCut"), nSigmaTOF2, track2.p(), occupancy);
667+
}
601668
if (applyPID) {
602-
if (ispTdepPID && !selectionPIDpTdependent(track1, nSigmaTPC, nSigmaTOF)) {
603-
continue;
604-
}
605-
if (!ispTdepPID && !selectionPID(track1, nSigmaTPC, nSigmaTOF)) {
606-
continue;
607-
}
608-
609669
if (ispTdepPID && !selectionPIDpTdependent(track2, nSigmaTPC2, nSigmaTOF2)) {
610670
continue;
611671
}
612672
if (!ispTdepPID && !selectionPID(track2, nSigmaTPC2, nSigmaTOF2)) {
613673
continue;
614674
}
615675
}
676+
if (ntrack1 == 1) {
677+
histos.fill(HIST("hNsigmaTPCAfterCut"), nSigmaTPC2, track2.p(), occupancy);
678+
histos.fill(HIST("hNsigmaTOFAfterCut"), nSigmaTOF2, track2.p(), occupancy);
679+
}
616680

617681
const auto mctrack1 = track1.mcParticle();
618682
const auto mctrack2 = track2.mcParticle();

0 commit comments

Comments
 (0)