@@ -126,6 +126,10 @@ struct OnTheFlyTofPid {
126126
127127 // for handling basic QA histograms if requested
128128 HistogramRegistry histos{" Histos" , {}, OutputObjHandlingPolicy::AnalysisObject};
129+ static constexpr int kParticles = 5 ;
130+ std::string particle_names1[kParticles ] = {" #it{e}" , " #it{#mu}" , " #it{#pi}" , " #it{K}" , " #it{p}" };
131+ std::string particle_names2[kParticles ] = {" Elec" , " Muon" , " Pion" , " Kaon" , " Prot" };
132+ static constexpr int kIdPion = 2 ;
129133
130134 void init (o2::framework::InitContext&)
131135 {
@@ -192,9 +196,7 @@ struct OnTheFlyTofPid {
192196 histos.add (" h2dRelativePtResolution" , " h2dRelativePtResolution" , kTH2F , {axisPt, axisRelativePt});
193197 histos.add (" h2dRelativeEtaResolution" , " h2dRelativeEtaResolution" , kTH2F , {axisEta, axisRelativeEta});
194198
195- std::string particle_names1[5 ] = {" #it{e}" , " #it{#mu}" , " #it{#pi}" , " #it{K}" , " #it{p}" };
196- std::string particle_names2[5 ] = {" Elec" , " Muon" , " Pion" , " Kaon" , " Prot" };
197- for (int i_true = 0 ; i_true < 5 ; i_true++) {
199+ for (int i_true = 0 ; i_true < kParticles ; i_true++) {
198200 std::string name_title_inner_track_res = " h2dInnerTimeResTrack" + particle_names2[i_true] + " VsP" ;
199201 std::string name_title_inner_total_res = " h2dInnerTimeResTotal" + particle_names2[i_true] + " VsP" ;
200202 std::string name_title_outer_track_res = " h2dOuterTimeResTrack" + particle_names2[i_true] + " VsP" ;
@@ -205,10 +207,7 @@ struct OnTheFlyTofPid {
205207 h2dInnerTimeResTotal[i_true] = histos.add <TH2>(name_title_inner_total_res.c_str (), name_title_inner_total_res.c_str (), kTH2F , {axisMomentum, axisTotalTimeRes});
206208 h2dOuterTimeResTrack[i_true] = histos.add <TH2>(name_title_outer_track_res.c_str (), name_title_outer_track_res.c_str (), kTH2F , {axisMomentum, axisTrackTimeRes});
207209 h2dOuterTimeResTotal[i_true] = histos.add <TH2>(name_title_outer_total_res.c_str (), name_title_outer_total_res.c_str (), kTH2F , {axisMomentum, axisTotalTimeRes});
208- }
209-
210- for (int i_true = 0 ; i_true < 5 ; i_true++) {
211- for (int i_hyp = 0 ; i_hyp < 5 ; i_hyp++) {
210+ for (int i_hyp = 0 ; i_hyp < kParticles ; i_hyp++) {
212211 std::string name_title_inner = " h2dInnerNsigmaTrue" + particle_names2[i_true] + " Vs" + particle_names2[i_hyp] + " Hypothesis" ;
213212 std::string name_title_outer = " h2dOuterNsigmaTrue" + particle_names2[i_true] + " Vs" + particle_names2[i_hyp] + " Hypothesis" ;
214213 std::string name_title_inner_delta = " h2dInnerDeltaTrue" + particle_names2[i_true] + " Vs" + particle_names2[i_hyp] + " Hypothesis" ;
@@ -579,11 +578,11 @@ struct OnTheFlyTofPid {
579578 const float noSmearingPt = trkWithTime.mNoSmearingPt ;
580579
581580 // Straight to Nsigma
582- static std::array<float , 5 > expectedTimeInnerTOF, expectedTimeOuterTOF;
583- static std::array<float , 5 > deltaTimeInnerTOF, deltaTimeOuterTOF;
584- static std::array<float , 5 > nSigmaInnerTOF, nSigmaOuterTOF;
585- static constexpr int pdgArray[5 ] = {kElectron , kMuonMinus , kPiPlus , kKPlus , kProton };
586- float masses[5 ];
581+ static std::array<float , kParticles > expectedTimeInnerTOF, expectedTimeOuterTOF;
582+ static std::array<float , kParticles > deltaTimeInnerTOF, deltaTimeOuterTOF;
583+ static std::array<float , kParticlex > nSigmaInnerTOF, nSigmaOuterTOF;
584+ static constexpr int pdgArray[kParticles ] = {kElectron , kMuonMinus , kPiPlus , kKPlus , kProton };
585+ float masses[kParticles ];
587586
588587 if (plotsConfig.doQAplots ) {
589588 // unit conversion: length in cm, time in ps
0 commit comments