Skip to content

Commit fdb776d

Browse files
rolavickalibuild
andauthored
[PWGUD] Refactor of personal task (#8709)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent f15027a commit fdb776d

File tree

2 files changed

+1197
-1456
lines changed

2 files changed

+1197
-1456
lines changed

PWGUD/Core/UPCTauCentralBarrelHelperRL.h

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,23 @@ enum MyParticle {
2828
P_MUON = 1,
2929
P_PION = 2,
3030
P_KAON = 3,
31-
P_PROTON = 4
31+
P_PROTON = 4,
32+
P_ENUM_COUNTER = 5
33+
};
34+
35+
enum MyTauChannel {
36+
CH_EE = 0,
37+
CH_MUMU = 1,
38+
CH_EMU = 2,
39+
CH_PIPI = 3,
40+
CH_EPI = 4,
41+
CH_MUPI = 5,
42+
CH_FOURPI = 6,
43+
CH_ETHREEPI = 7,
44+
CH_MUTHREEPI = 8,
45+
CH_SIXPI = 9,
46+
CH_EMUPI = 10,
47+
CH_ENUM_COUNTER = 11
3248
};
3349

3450
void printLargeMessage(std::string info)
@@ -106,18 +122,18 @@ int testPIDhypothesis(T trackPIDinfo, float maxNsigmaTPC = 5.0, float maxNsigmaT
106122
}
107123

108124
template <typename T>
109-
int trackPDG(T trackPIDinfo)
125+
int trackPDG(T trackPIDinfo, float maxNsigmaTPC = 5.0, float maxNsigmaTOF = 5.0, bool useTOF = true, bool useTOFsigmaAfterTPC = true, float nSigmaShift = 0., bool isMC = false)
110126
// using testPIDhypothesis, reads enumMyParticle and return pdg value
111127
{
112-
if (testPIDhypothesis(trackPIDinfo) == P_ELECTRON) {
128+
if (testPIDhypothesis(trackPIDinfo, maxNsigmaTPC, maxNsigmaTOF, useTOF, useTOFsigmaAfterTPC, nSigmaShift, isMC) == P_ELECTRON) {
113129
return 11;
114-
} else if (testPIDhypothesis(trackPIDinfo) == P_MUON) {
130+
} else if (testPIDhypothesis(trackPIDinfo, maxNsigmaTPC, maxNsigmaTOF, useTOF, useTOFsigmaAfterTPC, nSigmaShift, isMC) == P_MUON) {
115131
return 13;
116-
} else if (testPIDhypothesis(trackPIDinfo) == P_PION) {
132+
} else if (testPIDhypothesis(trackPIDinfo, maxNsigmaTPC, maxNsigmaTOF, useTOF, useTOFsigmaAfterTPC, nSigmaShift, isMC) == P_PION) {
117133
return 211;
118-
} else if (testPIDhypothesis(trackPIDinfo) == P_KAON) {
134+
} else if (testPIDhypothesis(trackPIDinfo, maxNsigmaTPC, maxNsigmaTOF, useTOF, useTOFsigmaAfterTPC, nSigmaShift, isMC) == P_KAON) {
119135
return 321;
120-
} else if (testPIDhypothesis(trackPIDinfo) == P_PROTON) {
136+
} else if (testPIDhypothesis(trackPIDinfo, maxNsigmaTPC, maxNsigmaTOF, useTOF, useTOFsigmaAfterTPC, nSigmaShift, isMC) == P_PROTON) {
121137
return 2212;
122138
} else {
123139
printDebugMessage("Something is wrong with track PDG selector");
@@ -198,6 +214,32 @@ double calculateAcoplanarity(double phi_trk1, double phi_trk2)
198214
return (o2::constants::math::TwoPI - aco);
199215
}
200216

217+
template <typename Ps>
218+
int countPhysicalPrimary(Ps particles)
219+
// Function to loop over particles associated to a mcCollision and return total of physical primary particles
220+
{
221+
int nTotal = 0;
222+
for (auto& particle : particles) {
223+
if (!particle.isPhysicalPrimary())
224+
continue;
225+
nTotal++;
226+
}
227+
return nTotal;
228+
}
229+
230+
template <typename Ps>
231+
int countParticlesWithoutMother(Ps particles)
232+
// Function to loop over particles associated to a mcCollision and return total of particles without mothers (hopely alternative to isPhysicalPrimary)
233+
{
234+
int nTotal = 0;
235+
for (auto& particle : particles) {
236+
if (particle.has_mothers())
237+
continue;
238+
nTotal++;
239+
}
240+
return nTotal;
241+
}
242+
201243
template <typename T>
202244
float getAvgITSClSize(T const& track)
203245
{

0 commit comments

Comments
 (0)