Skip to content

Commit d0cc016

Browse files
sangwoosangwoo
authored andcommitted
optimized track index selection and fixed PID selection
1 parent f1d4570 commit d0cc016

File tree

1 file changed

+37
-11
lines changed

1 file changed

+37
-11
lines changed

PWGLF/Tasks/Resonances/f0980pbpbanalysis.cxx

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ struct F0980pbpbanalysis {
132132
Configurable<float> cfgTOFBetaCut{"cfgTOFBetaCut", 0.0, "cut TOF beta"};
133133
Configurable<bool> cfgDeepAngleSel{"cfgDeepAngleSel", true, "Deep Angle cut"};
134134
Configurable<double> cfgDeepAngle{"cfgDeepAngle", 0.04, "Deep Angle cut value"};
135-
Configurable<bool> cfgTrackIndexSel{"cfgTrackIndexSel", false, "Index selection flag"};
135+
Configurable<int> cfgTrackIndexSelType{"cfgTrackIndexSelType", 1, "Index selection type"};
136+
Configurable<double> cMaxTiednSigmaPion{"cMaxTiednSigmaPion", 3.0, "Combined nSigma cut for Pion"};
137+
136138

137139
ConfigurableAxis massAxis{"massAxis", {400, 0.2, 2.2}, "Invariant mass axis"};
138140
ConfigurableAxis ptAxis{"ptAxis", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.8, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 10.0, 13.0, 20.0}, "Transverse momentum Binning"};
@@ -174,6 +176,12 @@ struct F0980pbpbanalysis {
174176
PtlKaon = 1,
175177
};
176178

179+
enum IndexSelList {
180+
None = 0,
181+
woSame = 1,
182+
leq = 2
183+
};
184+
177185
TRandom* rn = new TRandom();
178186
// float theta2;
179187

@@ -320,22 +328,40 @@ struct F0980pbpbanalysis {
320328
}
321329
}
322330
} else if (cfgSelectPID == PIDList::PIDTest) {
323-
if (track.hasTOF()) {
324-
if (std::fabs(getTofNSigma(track)) > cMaxTOFnSigmaPion) {
325-
return 0;
326-
}
327-
if (std::fabs(getTpcNSigma(track)) > cMaxTPCnSigmaPion) {
328-
return 0;
331+
if (cfgUSETOF) {
332+
if (track.hasTOF()) {
333+
if ((track.tofNSigmaPi() * track.tofNSigmaPi() + track.tpcNSigmaPi() * track.tpcNSigmaPi()) > (cMaxTiednSigmaPion * cMaxTiednSigmaPion)) {
334+
return 0;
335+
}
336+
} else {
337+
if (std::fabs(track.tpcNSigmaPi()) > cMaxTPCnSigmaPionS) {
338+
return 0;
339+
}
329340
}
330341
} else {
331-
if (std::fabs(getTpcNSigma(track)) > cMaxTPCnSigmaPionS) {
342+
if (std::fabs(track.tpcNSigmaPi()) > cMaxTPCnSigmaPionS) {
332343
return 0;
333344
}
334345
}
335346
}
336347
return 1;
337348
}
338349

350+
template<typename TrackType1, typename TrackType2>
351+
bool indexSelection(const TrackType1 track1, const TrackType2 track2)
352+
{
353+
if (cfgTrackIndexSelType == IndexSelList::woSame) {
354+
if (track2.globalIndex() == track1.globalIndex()) {
355+
return 0;
356+
}
357+
} else if (cfgTrackIndexSelType == IndexSelList::leq) {
358+
if (track2.globalIndex() <= track1.globalIndex()) {
359+
return 0;
360+
}
361+
}
362+
return 1;
363+
}
364+
339365
template <typename TrackType1, typename TrackType2>
340366
bool selectionPair(const TrackType1 track1, const TrackType2 track2)
341367
{
@@ -420,11 +446,11 @@ struct F0980pbpbanalysis {
420446
histos.fill(HIST("QA/TPC_TOF_selected"), getTpcNSigma(trk2), getTofNSigma(trk2));
421447
}
422448

423-
if (cfgTrackIndexSel && cfgSelectPID == PIDList::PIDTest && trk2.globalIndex() <= trk1.globalIndex()) {
449+
if (!indexSelection(trk1, trk2)) {
424450
continue;
425451
}
426452

427-
if (cfgSelectPID == PIDList::PIDTest && !selectionPair(trk1, trk2)) {
453+
if (!selectionPair(trk1, trk2)) {
428454
continue;
429455
}
430456

@@ -551,4 +577,4 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
551577
{
552578
return WorkflowSpec{
553579
adaptAnalysisTask<F0980pbpbanalysis>(cfgc)};
554-
}
580+
}

0 commit comments

Comments
 (0)