Skip to content

Commit 53841c3

Browse files
rolavickalibuild
andauthored
[PWGUD] Slight rework of preselection (#10788)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent e80f47d commit 53841c3

File tree

1 file changed

+22
-13
lines changed

1 file changed

+22
-13
lines changed

PWGUD/Tasks/upcTauRl.cxx

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@ struct UpcTauRl {
223223
} cutTauEvent;
224224

225225
struct : ConfigurableGroup {
226+
Configurable<bool> cutCanUseTrackPID{"cutUseTrackPID", true, {"Apply weak PID check on tracks."}};
227+
Configurable<int> cutCanNgoodPVtracs{"cutCanNgoodPVtracs", 2, {"How many good PV tracks to select."}};
226228
Configurable<float> cutCanMinElectronNsigmaEl{"cutCanMinElectronNsigmaEl", 4.0, {"Good el candidate hypo in. Upper n sigma cut on el hypo of selected electron. What is more goes away."}};
227229
Configurable<float> cutCanMaxElectronNsigmaEl{"cutCanMaxElectronNsigmaEl", -2.0, {"Good el candidate hypo in. Lower n sigma cut on el hypo of selected electron. What is less goes away."}};
228230
Configurable<bool> cutCanElectronHasTOF{"cutCanElectronHasTOF", true, {"Electron candidated is required to hit TOF."}};
@@ -2089,8 +2091,7 @@ struct UpcTauRl {
20892091

20902092
int countTracksPerCollision = 0;
20912093
int countGoodNonPVtracks = 0;
2092-
int countPVGTel = 0;
2093-
int countPVGTmupi = 0;
2094+
int countGoodPVtracks = 0;
20942095
std::vector<int> vecTrkIdx;
20952096
// Loop over tracks with selections
20962097
for (const auto& track : tracks) {
@@ -2101,19 +2102,27 @@ struct UpcTauRl {
21012102
countGoodNonPVtracks++;
21022103
continue;
21032104
}
2104-
// alternative selection
2105-
if (isElectronCandidate(track)) {
2106-
countPVGTel++;
2107-
vecTrkIdx.push_back(track.index());
2108-
continue;
2109-
}
2110-
if (isMuPionCandidate(track)) {
2111-
countPVGTmupi++;
2112-
vecTrkIdx.push_back(track.index());
2113-
}
2105+
countGoodPVtracks++;
2106+
vecTrkIdx.push_back(track.index());
21142107
} // Loop over tracks with selections
21152108

2116-
if ((countPVGTel == 2 && countPVGTmupi == 0) || (countPVGTel == 1 && countPVGTmupi == 1)) {
2109+
// Apply weak condition on track PID
2110+
int countPVGTel = 0;
2111+
int countPVGTmupi = 0;
2112+
if (countGoodPVtracks == 2) {
2113+
for (const auto& vecMember : vecTrkIdx) {
2114+
const auto& thisTrk = tracks.iteratorAt(vecMember);
2115+
if (isElectronCandidate(thisTrk)) {
2116+
countPVGTel++;
2117+
continue;
2118+
}
2119+
if (isMuPionCandidate(thisTrk)) {
2120+
countPVGTmupi++;
2121+
}
2122+
}
2123+
}
2124+
2125+
if (cutPreselect.cutCanUseTrackPID ? ((countPVGTel == 2 && countPVGTmupi == 0) || (countPVGTel == 1 && countPVGTmupi == 1)) : countGoodPVtracks == cutPreselect.cutCanNgoodPVtracs) {
21172126
const auto& trk1 = tracks.iteratorAt(vecTrkIdx[0]);
21182127
const auto& trk2 = tracks.iteratorAt(vecTrkIdx[1]);
21192128

0 commit comments

Comments
 (0)