Skip to content

Commit 1369d8b

Browse files
authored
Enhance PID configurations and update identification logic
Added configurable parameters for TPC and TOF n-sigma cuts to clean templates. Updated particle identification logic to use new n-sigma configurations.
1 parent a8b8892 commit 1369d8b

1 file changed

Lines changed: 46 additions & 22 deletions

File tree

‎PWGCF/TwoParticleCorrelations/Tasks/longrangecorrDerived.cxx‎

Lines changed: 46 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ struct LongrangecorrDerived {
115115
Configurable<float> cfgTofPidPtCut{"cfgTofPidPtCut", 0.4f, "Minimum pt to use TOF N-sigma"};
116116
Configurable<float> cfgPidNsigmaMax{"cfgPidNsigmaMax", 1.5f, "Maximum n-sigma for PID"};
117117
Configurable<float> cfgPidNsigmaMin{"cfgPidNsigmaMin", -1.5f, "Minimum n-sigma for PID"};
118+
Configurable<float> cfgCleanNsigmaTpcMax{"cfgCleanNsigmaTpcMax", 1.5f, "Max TPC n-sigma for clean templates"};
119+
Configurable<float> cfgCleanNsigmaTpcMin{"cfgCleanNsigmaTpcMin", -1.5f, "Min TPC n-sigma for clean templates"};
120+
Configurable<float> cfgCleanNsigmaTofMax{"cfgCleanNsigmaTofMax", 1.5f, "Max TOF n-sigma for clean templates"};
121+
Configurable<float> cfgCleanNsigmaTofMin{"cfgCleanNsigmaTofMin", -1.5f, "Min TOF n-sigma for clean templates"};
118122
Configurable<bool> cfgGetNsigmaQA{"cfgGetNsigmaQA", true, "Get QA histograms for PID selection"};
119123
Configurable<bool> cfgGetdEdx{"cfgGetdEdx", true, "Get dEdx histograms for TPC signal"};
120124

@@ -284,6 +288,10 @@ struct LongrangecorrDerived {
284288
histos.add("hMCGen_PidPtEtaPhi", "MC Gen Target", kTH3D, {cfgAxis.axisMcPt, cfgAxis.axisMcEta, cfgAxis.axisMcPhi});
285289
histos.add("hMCRec_PidPtEtaPhi", "MC Rec Target", kTH3D, {cfgAxis.axisMcPt, cfgAxis.axisMcEta, cfgAxis.axisMcPhi});
286290
}
291+
292+
if (cfgSel.cfgGetdEdx) {
293+
histos.add("MC_TpcdEdx_ptwise", "MC True TPC dE/dx;Particle Species;p_{T} (GeV/c);TPC dE/dx", kTHnSparseD, {{3, 0.5, 3.5}, cfgAxis.axisPtQA, cfgAxis.axisTpcSignal});
294+
}
287295
}
288296

289297
myTrackFilter = getGlobalTrackSelectionRun3ITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSibAny,
@@ -1142,6 +1150,22 @@ struct LongrangecorrDerived {
11421150
if (particle.isPhysicalPrimary()) {
11431151
histos.fill(HIST("hRecMCdndpt"), mcCollision.posZ(), particle.eta(), particle.pt());
11441152

1153+
if (cfgSel.cfgGetdEdx) {
1154+
int pdgIdx = 0;
1155+
auto absPdg = std::abs(particle.pdgCode());
1156+
1157+
if (absPdg == PDG_t::kPiPlus)
1158+
pdgIdx = 1; // o2-linter: disable=pdg/explicit-code (histogram species index)
1159+
else if (absPdg == PDG_t::kKPlus)
1160+
pdgIdx = 2; // o2-linter: disable=pdg/explicit-code (histogram species index)
1161+
else if (absPdg == PDG_t::kProton)
1162+
pdgIdx = 3; // o2-linter: disable=pdg/explicit-code (histogram species index)
1163+
1164+
if (pdgIdx > 0) {
1165+
histos.fill(HIST("MC_TpcdEdx_ptwise"), static_cast<double>(pdgIdx), track.pt(), track.tpcSignal());
1166+
}
1167+
}
1168+
11451169
bool isTpcPion = (track.tpcNSigmaPi() > cfgSel.cfgPidNsigmaMin && track.tpcNSigmaPi() < cfgSel.cfgPidNsigmaMax);
11461170
bool isTpcKaon = (track.tpcNSigmaKa() > cfgSel.cfgPidNsigmaMin && track.tpcNSigmaKa() < cfgSel.cfgPidNsigmaMax);
11471171
bool isTpcProton = (track.tpcNSigmaPr() > cfgSel.cfgPidNsigmaMin && track.tpcNSigmaPr() < cfgSel.cfgPidNsigmaMax);
@@ -1167,9 +1191,11 @@ struct LongrangecorrDerived {
11671191
}
11681192

11691193
if (cfgSel.cfgPidMask == KPidMaskPion || cfgSel.cfgPidMask == KPidMaskKaon || cfgSel.cfgPidMask == KPidMaskProton) {
1170-
bool isTargetRec = (cfgSel.cfgPidMask == KPidMaskPion && isPion) ||
1171-
(cfgSel.cfgPidMask == KPidMaskKaon && isKaon) ||
1172-
(cfgSel.cfgPidMask == KPidMaskProton && isProton);
1194+
1195+
auto pdgcodeRec = std::abs(particle.pdgCode());
1196+
bool isTargetRec = (cfgSel.cfgPidMask == KPidMaskPion && isPion && pdgcodeRec == PDG_t::kPiPlus) ||
1197+
(cfgSel.cfgPidMask == KPidMaskKaon && isKaon && pdgcodeRec == PDG_t::kKPlus) ||
1198+
(cfgSel.cfgPidMask == KPidMaskProton && isProton && pdgcodeRec == PDG_t::kProton);
11731199

11741200
if (isTargetRec) {
11751201
histos.fill(HIST("hMCRec_PidPtEtaPhi"), particle.pt(), particle.eta(), particle.phi());
@@ -1210,6 +1236,9 @@ struct LongrangecorrDerived {
12101236
if (!myTrackFilter.IsSelected(track))
12111237
continue;
12121238

1239+
if (!track.hasTOF())
1240+
continue;
1241+
12131242
float tpcNsig = 0.0f, tofNsig = 0.0f;
12141243
if (cfgSel.cfgPidMask & KPidMaskPion) {
12151244
tpcNsig = track.tpcNSigmaPi();
@@ -1230,30 +1259,25 @@ struct LongrangecorrDerived {
12301259
}
12311260
}
12321261

1233-
bool isTpcPion = (track.tpcNSigmaPi() > cfgSel.cfgPidNsigmaMin && track.tpcNSigmaPi() < cfgSel.cfgPidNsigmaMax);
1234-
bool isTpcKaon = (track.tpcNSigmaKa() > cfgSel.cfgPidNsigmaMin && track.tpcNSigmaKa() < cfgSel.cfgPidNsigmaMax);
1235-
bool isTpcProton = (track.tpcNSigmaPr() > cfgSel.cfgPidNsigmaMin && track.tpcNSigmaPr() < cfgSel.cfgPidNsigmaMax);
1236-
1237-
bool isTofPion = (track.tofNSigmaPi() > cfgSel.cfgPidNsigmaMin && track.tofNSigmaPi() < cfgSel.cfgPidNsigmaMax);
1238-
bool isTofKaon = (track.tofNSigmaKa() > cfgSel.cfgPidNsigmaMin && track.tofNSigmaKa() < cfgSel.cfgPidNsigmaMax);
1239-
bool isTofProton = (track.tofNSigmaPr() > cfgSel.cfgPidNsigmaMin && track.tofNSigmaPr() < cfgSel.cfgPidNsigmaMax);
1240-
1241-
bool isPion = false, isKaon = false, isProton = false;
1242-
if (track.pt() > cfgSel.cfgTofPidPtCut && track.hasTOF()) {
1243-
isPion = isTofPion && isTpcPion;
1244-
isKaon = isTofKaon && isTpcKaon;
1245-
isProton = isTofProton && isTpcProton;
1246-
} else if (!(track.pt() > cfgSel.cfgTofPidPtCut && !track.hasTOF())) {
1247-
isPion = isTpcPion;
1248-
isKaon = isTpcKaon;
1249-
isProton = isTpcProton;
1250-
}
1262+
bool isTpcPion = (track.tpcNSigmaPi() > cfgSel.cfgCleanNsigmaTpcMin && track.tpcNSigmaPi() < cfgSel.cfgCleanNsigmaTpcMax);
1263+
bool isTpcKaon = (track.tpcNSigmaKa() > cfgSel.cfgCleanNsigmaTpcMin && track.tpcNSigmaKa() < cfgSel.cfgCleanNsigmaTpcMax);
1264+
bool isTpcProton = (track.tpcNSigmaPr() > cfgSel.cfgCleanNsigmaTpcMin && track.tpcNSigmaPr() < cfgSel.cfgCleanNsigmaTpcMax);
1265+
1266+
bool isTofPion = (track.tofNSigmaPi() > cfgSel.cfgCleanNsigmaTofMin && track.tofNSigmaPi() < cfgSel.cfgCleanNsigmaTofMax);
1267+
bool isTofKaon = (track.tofNSigmaKa() > cfgSel.cfgCleanNsigmaTofMin && track.tofNSigmaKa() < cfgSel.cfgCleanNsigmaTofMax);
1268+
bool isTofProton = (track.tofNSigmaPr() > cfgSel.cfgCleanNsigmaTofMin && track.tofNSigmaPr() < cfgSel.cfgCleanNsigmaTofMax);
1269+
1270+
bool isPion = isTofPion && isTpcPion;
1271+
bool isKaon = isTofKaon && isTpcKaon;
1272+
bool isProton = isTofProton && isTpcProton;
12511273

12521274
if ((isPion && isKaon) || (isPion && isProton) || (isKaon && isProton)) {
12531275
isPion = isKaon = isProton = false;
12541276
}
12551277

1256-
bool isTargetParticle = ((cfgSel.cfgPidMask & KPidMaskPion) && isPion) || ((cfgSel.cfgPidMask & KPidMaskKaon) && isKaon) || ((cfgSel.cfgPidMask & KPidMaskProton) && isProton);
1278+
bool isTargetParticle = ((cfgSel.cfgPidMask & KPidMaskPion) && isPion) ||
1279+
((cfgSel.cfgPidMask & KPidMaskKaon) && isKaon) ||
1280+
((cfgSel.cfgPidMask & KPidMaskProton) && isProton);
12571281

12581282
// FILL AFTER CUTS
12591283
if (cfgSel.cfgGetNsigmaQA && isTargetParticle) {

0 commit comments

Comments
 (0)