|
56 | 56 | #include <ReconstructionDataFormats/Track.h> |
57 | 57 | #include <ReconstructionDataFormats/Vertex.h> |
58 | 58 |
|
| 59 | +#include <TH1.h> |
| 60 | + |
59 | 61 | #include <Rtypes.h> |
60 | 62 |
|
61 | 63 | #include <algorithm> |
62 | 64 | #include <array> |
63 | 65 | #include <chrono> |
64 | 66 | #include <cmath> |
| 67 | +#include <cstddef> |
65 | 68 | #include <cstdint> |
66 | | -#include <numeric> |
| 69 | +#include <iterator> |
67 | 70 | #include <string> |
68 | 71 | #include <vector> |
69 | 72 |
|
@@ -115,9 +118,10 @@ constexpr int NProngs = 3; // prongs of the candidates built here |
115 | 118 | constexpr int NMassHypos = 2; // mass hypotheses per channel, i.e. the two orderings of the same-sign pair |
116 | 119 |
|
117 | 120 | /// Whether each prong is a kaon, per channel and mass hypothesis. |
118 | | -constexpr bool IsKaonProng[NChannels3Prong][NMassHypos][NProngs] = { |
119 | | - {{false, true, false}, {false, true, false}}, |
120 | | - {{true, true, false}, {false, true, true}}}; |
| 121 | +constexpr std::array<std::array<std::array<bool, NProngs>, NMassHypos>, NChannels3Prong> IsKaonProng{{ |
| 122 | + {{{{false, true, false}}, {{false, true, false}}}}, |
| 123 | + {{{{true, true, false}}, {{false, true, true}}}}, |
| 124 | +}}; |
121 | 125 |
|
122 | 126 | constexpr double PtMaxModel = 1.e10; |
123 | 127 |
|
@@ -180,8 +184,8 @@ struct HfTrackSelectorTagSelCollisions { |
180 | 184 |
|
181 | 185 | void init(InitContext const&) |
182 | 186 | { |
183 | | - const std::array<int, 7> doProcess = {doprocessTrigAndCentFT0ASel, doprocessTrigAndCentFT0CSel, doprocessTrigAndCentFT0MSel, doprocessTrigAndCentFV0ASel, doprocessTrigSel, doprocessNoTrigSel, doprocessUpcSel}; |
184 | | - if (std::accumulate(doProcess.begin(), doProcess.end(), 0) != 1) { |
| 187 | + const std::array<bool, 7> doProcess = {doprocessTrigAndCentFT0ASel, doprocessTrigAndCentFT0CSel, doprocessTrigAndCentFT0MSel, doprocessTrigAndCentFV0ASel, doprocessTrigSel, doprocessNoTrigSel, doprocessUpcSel}; |
| 188 | + if (std::count(doProcess.begin(), doProcess.end(), true) != 1) { |
185 | 189 | LOGP(fatal, "One and only one process function for collision selection can be enabled at a time!"); |
186 | 190 | } |
187 | 191 |
|
@@ -420,8 +424,8 @@ struct HfTrackSelectorTagSelTracks { |
420 | 424 | LOGF(fatal, "ml-based-track-selector is for test only, please do not use for analysis. If you are aware of what you are doing, set testAcknowledgement to true in the configuration."); |
421 | 425 | } |
422 | 426 |
|
423 | | - const std::array<int, 2> doProcess = {doprocessTracks, doprocessTracksWithCentFT0C}; |
424 | | - if (std::accumulate(doProcess.begin(), doProcess.end(), 0) != 1) { |
| 427 | + const std::array<bool, 2> doProcess = {doprocessTracks, doprocessTracksWithCentFT0C}; |
| 428 | + if (std::count(doProcess.begin(), doProcess.end(), true) != 1) { |
425 | 429 | LOGP(fatal, "One and only one process function of HfTrackSelectorTagSelTracks can be enabled at a time!"); |
426 | 430 | } |
427 | 431 |
|
@@ -985,7 +989,7 @@ struct HfMlBasedTrackSelector { |
985 | 989 | const double minMass = cut3Prong[iChannel].get(binPt, 0u); |
986 | 990 | const double maxMass = cut3Prong[iChannel].get(binPt, 1u); |
987 | 991 | if (minMass >= 0. && maxMass > 0.) { |
988 | | - double massHypos[2] = {0., 0.}; |
| 992 | + std::array<double, 2> massHypos = {0., 0.}; |
989 | 993 | const std::array arrMom{pVecTrack0, pVecTrack1, pVecTrack2}; |
990 | 994 | const double min2 = minMass * minMass; |
991 | 995 | const double max2 = maxMass * maxMass; |
@@ -1100,7 +1104,7 @@ struct HfMlBasedTrackSelector { |
1100 | 1104 | const int64_t globalIndex0, const int64_t globalIndex1, const int64_t globalIndex2) |
1101 | 1105 | { |
1102 | 1106 | uint32_t isSelected3ProngCand = BIT(NChannels3Prong) - 1; |
1103 | | - std::array<int, NChannels3Prong> whichHypo3Prong; |
| 1107 | + std::array<int, NChannels3Prong> whichHypo3Prong{}; |
1104 | 1108 | whichHypo3Prong.fill(BIT(NMassHypos) - 1); // all mass hypotheses alive |
1105 | 1109 |
|
1106 | 1110 | applyMlRoleSelection(isIdentifiedPid0, isIdentifiedPid1, isIdentifiedPid2, whichHypo3Prong, isSelected3ProngCand); |
|
0 commit comments