Skip to content

Commit 7904fac

Browse files
authored
Refactor Bethe-Bloch and PID settings arrays
1 parent 6944cff commit 7904fac

1 file changed

Lines changed: 30 additions & 27 deletions

File tree

PWGLF/Tasks/Nuspex/nucleitpcPbPb.cxx

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -90,40 +90,44 @@ const std::vector<int> particleCharge{1, 1, 1, 1, 2, 2};
9090
constexpr int NBetheParams = 6;
9191
const std::vector<int> hfMothCodes = {511, 521, 531, 541, 5122}; // b-mesons + Lambda_b
9292
const std::vector<std::string> betheBlochParNames{"p0", "p1", "p2", "p3", "p4", "resolution"};
93-
const std::array<std::array<double, NBetheParams>, NParticles> kBetheBlochDefault{{{13.611469, 3.598765, -0.021138, 2.039562, 0.651040, 0.09}, // pion
94-
{5.393020, 7.859534, 0.004048, 2.323197, 1.609307, 0.09}, // proton
95-
{5.393020, 7.859534, 0.004048, 2.323197, 1.609307, 0.09}, // deuteron
96-
{5.393020, 7.859534, 0.004048, 2.323197, 1.609307, 0.09}, // triton
97-
{-126.557359, -0.858569, 1.111643, 1.210323, 2.656374, 0.09}, // helion
98-
{-126.557359, -0.858569, 1.111643, 1.210323, 2.656374, 0.09}}}; // alpha
93+
const std::array<std::array<double, NBetheParams>, NParticles> kBetheBlochDefault{{
94+
{13.611469, 3.598765, -0.021138, 2.039562, 0.651040, 0.09}, // pion
95+
{5.393020, 7.859534, 0.004048, 2.323197, 1.609307, 0.09}, // proton
96+
{5.393020, 7.859534, 0.004048, 2.323197, 1.609307, 0.09}, // deuteron
97+
{5.393020, 7.859534, 0.004048, 2.323197, 1.609307, 0.09}, // triton
98+
{-126.557359, -0.858569, 1.111643, 1.210323, 2.656374, 0.09}, // helion
99+
{-126.557359, -0.858569, 1.111643, 1.210323, 2.656374, 0.09}}}; // alpha
99100

100101
// ---- Track PID/quality selection defaults (per species) --------------------
101102
constexpr int NTrkSettings = 13;
102103
const std::vector<std::string> trackPIDsettingsNames{"useBBparams", "minITSnCls", "minITSnClscos", "minTPCnCls", "maxTPCchi2", "minTPCchi2", "maxITSchi2", "maxTPCnSigma", "maxDcaXY", "maxDcaZ", "minITSclsSize", "minTPCnClsCrossedRows", "minReqClusterITSib"};
103-
const std::array<std::array<double, NTrkSettings>, NParticles> kTrackPIDSettings{{{0, 0, 4, 60, 4.0, 0.5, 100, 2.5, 2., 2., 0., 70, 1},
104-
{1, 0, 4, 70, 4.0, 0.5, 100, 3.0, 2., 2., 0., 70, 1},
105-
{1, 0, 4, 70, 4.0, 0.5, 100, 3.0, 2., 2., 0., 70, 1},
106-
{1, 0, 4, 70, 4.0, 0.5, 100, 3.0, 2., 2., 0., 70, 1},
107-
{1, 0, 4, 75, 4.0, 0.5, 100, 5.0, 2., 2., 0., 70, 1},
108-
{1, 0, 4, 70, 4.0, 0.5, 100, 5.0, 2., 2., 0., 70, 1}}};
104+
const std::array<std::array<double, NTrkSettings>, NParticles> kTrackPIDSettings{{
105+
{0, 0, 4, 60, 4.0, 0.5, 100, 2.5, 2., 2., 0., 70, 1},
106+
{1, 0, 4, 70, 4.0, 0.5, 100, 3.0, 2., 2., 0., 70, 1},
107+
{1, 0, 4, 70, 4.0, 0.5, 100, 3.0, 2., 2., 0., 70, 1},
108+
{1, 0, 4, 70, 4.0, 0.5, 100, 3.0, 2., 2., 0., 70, 1},
109+
{1, 0, 4, 75, 4.0, 0.5, 100, 5.0, 2., 2., 0., 70, 1},
110+
{1, 0, 4, 70, 4.0, 0.5, 100, 5.0, 2., 2., 0., 70, 1}}};
109111

110112
constexpr int NTrkSettings2 = 7;
111113
const std::vector<std::string> trackPIDsettingsNames2{"useITSnsigma", "minITSnsigma", "maxITSnsigma", "fillsparsh", "useTPCnsigmaTOF", "maxTPCnsigmaTOF", "maxTOFnsigma"};
112-
const std::array<std::array<double, NTrkSettings2>, NParticles> kTrackPIDSettings2{{{1, -5, 4, 0, 1, 2, 2},
113-
{1, -5, 4, 0, 1, 2, 2},
114-
{1, -5, 4, 0, 1, 2, 2},
115-
{1, -5, 4, 1, 1, 2, 2},
116-
{1, -5, 4, 1, 1, 2, 2},
117-
{1, -5, 4, 1, 1, 2, 2}}};
114+
const std::array<std::array<double, NTrkSettings2>, NParticles> kTrackPIDSettings2{{
115+
{1, -5, 4, 0, 1, 2, 2},
116+
{1, -5, 4, 0, 1, 2, 2},
117+
{1, -5, 4, 0, 1, 2, 2},
118+
{1, -5, 4, 1, 1, 2, 2},
119+
{1, -5, 4, 1, 1, 2, 2},
120+
{1, -5, 4, 1, 1, 2, 2}}};
118121

119122
// ---- pT-dependent reconstruction correction parameters for He3/He4 ---------
120123
constexpr int NFittingParticle = 4;
121124
constexpr int NFittingParameters = 4;
122125
const std::vector<std::string> trackcorrectionNames{"a", "b", "c", "d"};
123-
const std::array<std::array<double, NFittingParameters>, NFittingParticle> ktrackcorrection{{{0.464215, 0.195771, 0.0183111, 0.0}, // He3
124-
{0.464215, 0.195771, 0.0183111, 0.0}, // anti-He3
125-
{0.00765, 0.503791, -1.10517, 0.0}, // He4
126-
{0.00765, 0.503791, -1.10517, 0.0}}}; // anti-He4
126+
const std::array<std::array<double, NFittingParameters>, NFittingParticle> ktrackcorrection{{
127+
{0.464215, 0.195771, 0.0183111, 0.0}, // He3
128+
{0.464215, 0.195771, 0.0183111, 0.0}, // anti-He3
129+
{0.00765, 0.503791, -1.10517, 0.0}, // He4
130+
{0.00765, 0.503791, -1.10517, 0.0}}}; // anti-He4
127131

128132
// ---- pT-dependent DCA cut parameters ----------------------------------------
129133
// DCAxy(pt) = p0 * exp( p1 * pt) + p2
@@ -132,8 +136,9 @@ constexpr int NDCATypes = 2;
132136
constexpr int NDCAParameters = 3;
133137
const std::vector<std::string> dcaNames{"p0", "p1", "p2"};
134138
const std::vector<std::string> dcaTypeNames{"DCAxy", "DCAz"};
135-
const std::array<std::array<double, NDCAParameters>, NDCATypes> kDCAcorrection{{{0.0118, -0.6889, 0.0017},
136-
{0.1014, 1.7512, 0.0024}}};
139+
const std::array<std::array<double, NDCAParameters>, NDCATypes> kDCAcorrection{{
140+
{0.0118, -0.6889, 0.0017},
141+
{0.1014, 1.7512, 0.0024}}};
137142

138143
// ---- MC decay-origin classification -----------------------------------------
139144
constexpr int DecayTypePrimary = 0;
@@ -280,8 +285,6 @@ struct NucleitpcPbPb {
280285

281286
// Species indices into primaryParticles / particlePdgCodes (order fixed by particleNames above).
282287
const float proton = 1;
283-
const float de = 2;
284-
const float triton = 3;
285288
const float he3 = 4;
286289
const float he4 = 5;
287290

@@ -1063,7 +1066,7 @@ struct NucleitpcPbPb {
10631066
template <typename McPart>
10641067
int classifyDecayType(McPart const& mcPart)
10651068
{
1066-
int decayType = DecayTypePrimary;
1069+
int decayType;
10671070
if (mcPart.isPhysicalPrimary()) {
10681071
decayType = DecayTypePrimary;
10691072
if (mcPart.has_mothers()) {

0 commit comments

Comments
 (0)