Skip to content

Commit 35e8c71

Browse files
committed
Improve TOF PID selection cut
1 parent ea81612 commit 35e8c71

1 file changed

Lines changed: 74 additions & 74 deletions

File tree

PWGLF/Tasks/Resonances/phispectrapbpbqa.cxx

Lines changed: 74 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -213,30 +213,30 @@ struct phispectrapbpbqa {
213213
template <typename T>
214214
bool selectionPIDpTdependent(const T& candidate, double nsigmaTPC, double nsigmaTOF)
215215
{
216-
if(candidate.p() < 0.7 && TMath::Abs(nsigmaTPC) < nsigmaCutTPC) {
216+
if (candidate.p() < 0.7 && TMath::Abs(nsigmaTPC) < nsigmaCutTPC) {
217217
return true;
218218
}
219219
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;
220+
if (candidate.p() > 0.7 && candidate.p() < 1.6 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -5.0 && nsigmaTOF < 10.0) {
221+
return true;
222222
}
223-
if(candidate.p() >= 1.6 && candidate.p() < 2.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -3.0 && nsigmaTOF < 10.0) {
224-
return true;
223+
if (candidate.p() >= 1.6 && candidate.p() < 2.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -3.0 && nsigmaTOF < 10.0) {
224+
return true;
225225
}
226-
if(candidate.p() >= 2.0 && candidate.p() < 2.5 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -3.0 && nsigmaTOF < 6.0) {
227-
return true;
226+
if (candidate.p() >= 2.0 && candidate.p() < 2.5 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -3.0 && nsigmaTOF < 6.0) {
227+
return true;
228228
}
229-
if(candidate.p() >= 2.5 && candidate.p() < 4.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -2.5 && nsigmaTOF < 4.0) {
230-
return true;
229+
if (candidate.p() >= 2.5 && candidate.p() < 4.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -2.5 && nsigmaTOF < 4.0) {
230+
return true;
231231
}
232-
if(candidate.p() >= 4.0 && candidate.p() < 5.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -4.0 && nsigmaTOF < 3.0) {
233-
return true;
232+
if (candidate.p() >= 4.0 && candidate.p() < 5.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -4.0 && nsigmaTOF < 3.0) {
233+
return true;
234234
}
235-
if(candidate.p() >= 5.0 && candidate.p() < 6.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -4.0 && nsigmaTOF < 2.5) {
236-
return true;
235+
if (candidate.p() >= 5.0 && candidate.p() < 6.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -4.0 && nsigmaTOF < 2.5) {
236+
return true;
237237
}
238-
if(candidate.p() >= 6.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -3.0 && nsigmaTOF < 3.0) {
239-
return true;
238+
if (candidate.p() >= 6.0 && candidate.beta() > cfgCutTOFBeta && nsigmaTOF > -3.0 && nsigmaTOF < 3.0) {
239+
return true;
240240
}
241241
}
242242
return false;
@@ -245,32 +245,32 @@ struct phispectrapbpbqa {
245245
template <typename T>
246246
bool selectionPID(const T& candidate, double nsigmaTPC, double nsigmaTOF)
247247
{
248-
if (applyTOF) {
249-
if(!candidate.hasTOF() && TMath::Abs(nsigmaTPC) < nsigmaCutTPC) {
250-
return true;
248+
if (applyTOF) {
249+
if (!candidate.hasTOF() && TMath::Abs(nsigmaTPC) < nsigmaCutTPC) {
250+
return true;
251251
}
252252
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-
}
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+
}
274274
}
275275
} else if (TMath::Abs(nsigmaTPC) < nsigmaCutTPC) {
276276
return true;
@@ -605,32 +605,32 @@ struct phispectrapbpbqa {
605605
continue;
606606
}
607607
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;
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));
613618
}
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;
619626
}
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;
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;
634634
for (auto track2 : Rectrackspart) {
635635
auto track2ID = track2.index();
636636
if (track2ID <= track1ID) {
@@ -648,7 +648,7 @@ struct phispectrapbpbqa {
648648
if (track1.sign() * track2.sign() > 0) {
649649
continue;
650650
}
651-
651+
652652
// PID track 2
653653
double nSigmaTPC2 = track2.tpcNSigmaKa();
654654
double nSigmaTOF2 = track2.tofNSigmaKa();
@@ -661,23 +661,23 @@ struct phispectrapbpbqa {
661661
nSigmaTOF2 = (nSigmaTOF2 - hTOFCallib->GetBinContent(hTOFCallib->FindBin(track2.p(), centrality, occupancy))) / hTOFCallib->GetBinError(hTOFCallib->FindBin(track2.p(), centrality, occupancy));
662662
}
663663
}
664-
if (ntrack1 ==1) {
665-
histos.fill(HIST("hNsigmaTPCBeforeCut"), nSigmaTPC2, track2.p(), occupancy);
666-
histos.fill(HIST("hNsigmaTOFBeforeCut"), nSigmaTOF2, track2.p(), occupancy);
667-
}
664+
if (ntrack1 == 1) {
665+
histos.fill(HIST("hNsigmaTPCBeforeCut"), nSigmaTPC2, track2.p(), occupancy);
666+
histos.fill(HIST("hNsigmaTOFBeforeCut"), nSigmaTOF2, track2.p(), occupancy);
667+
}
668668
if (applyPID) {
669-
if (ispTdepPID && !selectionPIDpTdependent(track2, nSigmaTPC2, nSigmaTOF2)) {
669+
if (ispTdepPID && !selectionPIDpTdependent(track2, nSigmaTPC2, nSigmaTOF2)) {
670670
continue;
671671
}
672672
if (!ispTdepPID && !selectionPID(track2, nSigmaTPC2, nSigmaTOF2)) {
673673
continue;
674674
}
675675
}
676-
if (ntrack1 ==1) {
677-
histos.fill(HIST("hNsigmaTPCAfterCut"), nSigmaTPC2, track2.p(), occupancy);
678-
histos.fill(HIST("hNsigmaTOFAfterCut"), nSigmaTOF2, track2.p(), occupancy);
679-
}
680-
676+
if (ntrack1 == 1) {
677+
histos.fill(HIST("hNsigmaTPCAfterCut"), nSigmaTPC2, track2.p(), occupancy);
678+
histos.fill(HIST("hNsigmaTOFAfterCut"), nSigmaTOF2, track2.p(), occupancy);
679+
}
680+
681681
const auto mctrack1 = track1.mcParticle();
682682
const auto mctrack2 = track2.mcParticle();
683683
int track1PDG = TMath::Abs(mctrack1.pdgCode());

0 commit comments

Comments
 (0)