Skip to content

Commit 5614fb6

Browse files
committed
New config: use strict pid
1 parent 6cc9fcc commit 5614fb6

File tree

1 file changed

+30
-14
lines changed

1 file changed

+30
-14
lines changed

PWGCF/Flow/Tasks/flowPidCme.cxx

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111

12-
/// \author ZhengqingWang(zhengqing.wang@cern.ch)
12+
/// \author ZhengqingWang(zhengqing.wang@cern.ch), KegangXiong(kxiong@cern.ch)
1313
/// \file flowPidCme.cxx
1414
/// \brief task to calculate the pikp cme signal and bacground.
1515
// C++/ROOT includes.
@@ -158,6 +158,7 @@ struct FillPIDcolums {
158158
Configurable<bool> cfgOpenITSCut{"cfgOpenITSCut", true, "open ITSnsigma cut"};
159159
Configurable<bool> cfgOpenITSCutQAPlots{"cfgOpenITSCutQAPlots", true, "open QA plots after ITS nsigma cut"};
160160
Configurable<bool> cfgOpenDetailPlotsTPCITSContaimination{"cfgOpenDetailPlotsTPCITSContaimination", false, "open detail TH3D plots for nSigmaTPC-ITS Pt-eta-Phi nSigmaITS-clustersize"};
161+
Configurable<bool> cfgUseStrictPID{"cfgUseStrictPID", true, "More strict pid strategy"};
161162
Configurable<bool> cfgOpenAllowCrossTrack{"cfgOpenAllowCrossTrack", false, "Allow one track to be identified as different kind of PID particles"};
162163
Configurable<bool> cfgOpenCrossTrackQAPlots{"cfgOpenCrossTrackQAPlots", true, "open cross pid track QA plots"};
163164
Configurable<bool> cfgOpenTOFOnlyPID{"cfgOpenTOFOnlyPID", true, "only accept tracks who has TOF infomation and use TOFnsigma for PID(priority greater than TPConly and combined"};
@@ -311,9 +312,17 @@ struct FillPIDcolums {
311312
pidVectorUpper = pidVectorTPCPtUpper;
312313
pidVectorLower = pidVectorTPCPtLower;
313314
} else {
314-
nSigmaToUse = (candidate.pt() > cfgPtMaxforTPCOnlyPID && candidate.hasTOF()) ? nSigmaCombined : nSigmaTPC;
315-
pidVectorUpper = (candidate.pt() > cfgPtMaxforTPCOnlyPID && candidate.hasTOF()) ? cfgnSigmaCutRMSUpper.value : cfgnSigmaCutTPCUpper.value;
316-
pidVectorLower = (candidate.pt() > cfgPtMaxforTPCOnlyPID && candidate.hasTOF()) ? cfgnSigmaCutRMSLower.value : cfgnSigmaCutTPCLower.value;
315+
if(candidate.pt() > cfgPtMaxforTPCOnlyPID && candidate.hasTOF()){
316+
nSigmaToUse = nSigmaCombined;
317+
pidVectorUpper = cfgnSigmaCutRMSUpper.value;
318+
pidVectorLower = cfgnSigmaCutRMSLower.value;
319+
}else if(candidate.pt() > cfgPtMaxforTPCOnlyPID && !candidate.hasTOF() && cfgUseStrictPID){
320+
return 0;
321+
}else{
322+
nSigmaToUse = nSigmaTPC;
323+
pidVectorUpper = cfgnSigmaCutTPCUpper.value;
324+
pidVectorLower = cfgnSigmaCutTPCLower.value;
325+
}
317326
}
318327
float nsigma = 9999.99;
319328
const int nPOI = 3;
@@ -448,20 +457,27 @@ struct FillPIDcolums {
448457
}
449458
}
450459
}
451-
if (cfgOpenAllowCrossTrack) {
452-
// one track can be recognized as different PID particles
460+
if(cfgUseStrictPID){
461+
// Only use the track which was recognized as an unique PID particle
453462
int index = (kIsPr << 2) | (kIsKa << 1) | kIsPi;
454-
const int map[] = {0, 1, 2, 7, 3, 8, 9, 10};
463+
const int map[] = {0, 1, 2, 0, 3, 0, 0, 0};
455464
return map[index];
456-
} else {
457-
// Select particle with the lowest nsigma (If not allow cross track)
458-
for (int i = 0; i < nPOI; ++i) {
459-
if (std::abs(nSigmaToUse[i]) < nsigma && (nSigmaToUse[i] > pidVectorLower[i] && nSigmaToUse[i] < pidVectorUpper[i])) {
460-
pid = i;
461-
nsigma = std::abs(nSigmaToUse[i]);
465+
}else{
466+
if (cfgOpenAllowCrossTrack) {
467+
// one track can be recognized as different PID particles
468+
int index = (kIsPr << 2) | (kIsKa << 1) | kIsPi;
469+
const int map[] = {0, 1, 2, 7, 3, 8, 9, 10};
470+
return map[index];
471+
} else {
472+
// Select particle with the lowest nsigma (If not allow cross track)
473+
for (int i = 0; i < nPOI; ++i) {
474+
if (std::abs(nSigmaToUse[i]) < nsigma && (nSigmaToUse[i] > pidVectorLower[i] && nSigmaToUse[i] < pidVectorUpper[i])) {
475+
pid = i;
476+
nsigma = std::abs(nSigmaToUse[i]);
477+
}
462478
}
479+
return pid + 1; // shift the pid by 1, 1 = pion, 2 = kaon, 3 = proton
463480
}
464-
return pid + 1; // shift the pid by 1, 1 = pion, 2 = kaon, 3 = proton
465481
}
466482
// Clear the vectors
467483
std::vector<float>().swap(pidVectorLower);

0 commit comments

Comments
 (0)