@@ -142,24 +142,24 @@ struct nucleiQC {
142142 }
143143
144144 static_for<0 , nuclei::kNspecies - 1 >([&](auto iSpecies) {
145- constexpr int iSpeciesCt = decltype (iSpecies)::value;
146- const int iSpeciesRt = iSpeciesCt ;
145+ constexpr int kSpeciesCt = decltype (iSpecies)::value;
146+ const int kSpeciesRt = kSpeciesCt ;
147147
148- if (std::find (mSpeciesToProcess .begin (), mSpeciesToProcess .end (), iSpeciesCt ) == mSpeciesToProcess .end ()) {
148+ if (std::find (mSpeciesToProcess .begin (), mSpeciesToProcess .end (), kSpeciesCt ) == mSpeciesToProcess .end ()) {
149149 return ;
150150 }
151151
152152 float tpcBetheBlochParams[6 ];
153153 for (int iParam = 0 ; iParam < 6 ; iParam++) {
154- tpcBetheBlochParams[iParam] = cfgBetheBlochParams->get (iSpeciesRt , iParam);
154+ tpcBetheBlochParams[iParam] = cfgBetheBlochParams->get (kSpeciesRt , iParam);
155155 }
156156
157157 nuclei::createHistogramRegistryNucleus<iSpeciesCt>(mHistograms );
158158
159- if (cfgUseCentralTpcCalibration->get (static_cast <uint32_t >(iSpeciesRt ), static_cast <uint32_t >(0 )) == 0 ) {
160- mPidManagers [iSpeciesRt ] = nuclei::PidManager (iSpeciesRt , tpcBetheBlochParams);
159+ if (cfgUseCentralTpcCalibration->get (static_cast <uint32_t >(kSpeciesRt ), static_cast <uint32_t >(0 )) == 0 ) {
160+ mPidManagers [kSpeciesRt ] = nuclei::PidManager (kSpeciesRt , tpcBetheBlochParams);
161161 } else {
162- mPidManagers [iSpeciesRt ] = nuclei::PidManager (iSpeciesRt );
162+ mPidManagers [kSpeciesRt ] = nuclei::PidManager (kSpeciesRt );
163163 }
164164 });
165165 }
@@ -198,28 +198,28 @@ struct nucleiQC {
198198 template <int iSpecies, typename Ttrack, typename Tcollision>
199199 bool pidSelection (const Ttrack& track, const Tcollision& collision)
200200 {
201- constexpr int index = iSpecies;
202- if (!nuclei::checkSpeciesValidity (index )) {
203- std::runtime_error (" species contains invalid nucleus index " );
201+ constexpr int kIndex = iSpecies;
202+ if (!nuclei::checkSpeciesValidity (kIndex )) {
203+ std::runtime_error (" species contains invalid nucleus kIndex " );
204204 }
205205
206- const float centrality = nuclei::getCentrality (collision, cfgCentralityEstimator);
207- const float nsigmaTPC = mPidManagers [index ].getNSigmaTPC (track);
208- mHistograms .fill (HIST (nuclei::cNames[index ]) + HIST (" /h3NsigmaTPC_preselectionVsCentrality" ), track.pt (), nsigmaTPC, centrality);
209- if (std::abs (nsigmaTPC) > cfgNsigmaTPC->get (index , 1 ))
206+ float centrality = nuclei::getCentrality (collision, cfgCentralityEstimator);
207+ float nsigmaTPC = mPidManagers [kIndex ].getNSigmaTPC (track);
208+ mHistograms .fill (HIST (nuclei::cNames[kIndex ]) + HIST (" /h3NsigmaTPC_preselectionVsCentrality" ), track.pt (), nsigmaTPC, centrality);
209+ if (std::abs (nsigmaTPC) > cfgNsigmaTPC->get (kIndex , 1 ))
210210 return false ;
211- mHistograms .fill (HIST (nuclei::cNames[index ]) + HIST (" /h3NsigmaTPCVsCentrality" ), track.pt (), nsigmaTPC, centrality);
211+ mHistograms .fill (HIST (nuclei::cNames[kIndex ]) + HIST (" /h3NsigmaTPCVsCentrality" ), track.pt (), nsigmaTPC, centrality);
212212
213- const float nsigmaITS = mPidManagers [index ].getNSigmaITS (track);
214- mHistograms .fill (HIST (nuclei::cNames[index ]) + HIST (" /h3NsigmaITS_preselectionVsCentrality" ), track.sign () * track.pt (), nsigmaITS, centrality);
213+ float nsigmaITS = mPidManagers [kIndex ].getNSigmaITS (track);
214+ mHistograms .fill (HIST (nuclei::cNames[kIndex ]) + HIST (" /h3NsigmaITS_preselectionVsCentrality" ), track.sign () * track.pt (), nsigmaITS, centrality);
215215 // add nsigmaITS cut ?
216- mHistograms .fill (HIST (nuclei::cNames[index ]) + HIST (" /h3NsigmaITSVsCentrality" ), track.sign () * track.pt (), nsigmaITS, centrality);
216+ mHistograms .fill (HIST (nuclei::cNames[kIndex ]) + HIST (" /h3NsigmaITSVsCentrality" ), track.sign () * track.pt (), nsigmaITS, centrality);
217217
218- const float nsigmaTOF = mPidManagers [index ].getNSigmaTOF (track);
219- mHistograms .fill (HIST (nuclei::cNames[index ]) + HIST (" /h3NsigmaTOF_preselectionVsCentrality" ), track.pt (), nsigmaTOF, centrality);
220- if (std::abs (nsigmaTOF) > cfgNsigmaTOF->get (index , 1 ))
218+ float nsigmaTOF = mPidManagers [kIndex ].getNSigmaTOF (track);
219+ mHistograms .fill (HIST (nuclei::cNames[kIndex ]) + HIST (" /h3NsigmaTOF_preselectionVsCentrality" ), track.pt (), nsigmaTOF, centrality);
220+ if (std::abs (nsigmaTOF) > cfgNsigmaTOF->get (kIndex , 1 ))
221221 return false ;
222- mHistograms .fill (HIST (nuclei::cNames[index ]) + HIST (" /h3NsigmaTOFVsCentrality" ), track.pt (), nsigmaTOF, centrality);
222+ mHistograms .fill (HIST (nuclei::cNames[kIndex ]) + HIST (" /h3NsigmaTOFVsCentrality" ), track.pt (), nsigmaTOF, centrality);
223223
224224 return true ;
225225 }
@@ -234,7 +234,7 @@ struct nucleiQC {
234234
235235 // heavy flavour mother
236236 // if (particle.has_mothers()) {
237- // for (auto& motherparticle : particle.mothers_as<aod::McParticles>()) {
237+ // for (const auto& motherparticle : particle.mothers_as<aod::McParticles>()) {
238238 // if (std::find(nuclei::hfMothCodes.begin(), nuclei::hfMothCodes.end(), std::abs(motherparticle.pdgCode())) != nuclei::hfMothCodes.end()) {
239239 // flags |= kIsSecondaryFromWeakDecay;
240240 // motherPdgCode = motherparticle.pdgCode();
@@ -245,7 +245,7 @@ struct nucleiQC {
245245
246246 } else if (particle.has_mothers ()) {
247247 candidate.flags |= nuclei::Flags::kIsSecondaryFromWeakDecay ;
248- for (auto & motherparticle : particle.template mothers_as <aod::McParticles>()) {
248+ for (const auto & motherparticle : particle.template mothers_as <aod::McParticles>()) {
249249 candidate.motherPdgCode = motherparticle.pdgCode ();
250250 }
251251
@@ -362,25 +362,25 @@ struct nucleiQC {
362362 template <int iSpecies, const bool isGenerated>
363363 void fillHistograms (const nuclei::SlimCandidate& candidate)
364364 {
365- constexpr int index = iSpecies;
366- if (!nuclei::checkSpeciesValidity (index )) {
367- std::runtime_error (" species contains invalid nucleus index " );
365+ constexpr int kIndex = iSpecies;
366+ if (!nuclei::checkSpeciesValidity (kIndex )) {
367+ std::runtime_error (" species contains invalid nucleus kIndex " );
368368 }
369369
370370 if (isGenerated) {
371- const float ptGenerated = (index == nuclei::Species::kPr || index == nuclei::Species::kDe || index == nuclei::Species::kTr ) ? candidate.ptGenerated : candidate.ptGenerated / 2 .f ;
372- mHistograms .fill (HIST (nuclei::cNames[index ]) + HIST (" /hPtGenerated" ), ptGenerated);
373- mHistograms .fill (HIST (nuclei::cNames[index ]) + HIST (" /h3PtVsEtaVsCentralityGenerated" ), ptGenerated, candidate.etaGenerated , candidate.centrality );
374- mHistograms .fill (HIST (nuclei::cNames[index ]) + HIST (" /h3PhiVsEtaVsCentralityGenerated" ), candidate.phiGenerated , candidate.etaGenerated , candidate.centrality );
371+ const float ptGenerated = (kIndex == nuclei::Species::kPr || kIndex == nuclei::Species::kDe || kIndex == nuclei::Species::kTr ) ? candidate.ptGenerated : candidate.ptGenerated / 2 .f ;
372+ mHistograms .fill (HIST (nuclei::cNames[kIndex ]) + HIST (" /hPtGenerated" ), ptGenerated);
373+ mHistograms .fill (HIST (nuclei::cNames[kIndex ]) + HIST (" /h3PtVsEtaVsCentralityGenerated" ), ptGenerated, candidate.etaGenerated , candidate.centrality );
374+ mHistograms .fill (HIST (nuclei::cNames[kIndex ]) + HIST (" /h3PhiVsEtaVsCentralityGenerated" ), candidate.phiGenerated , candidate.etaGenerated , candidate.centrality );
375375 } else {
376- mHistograms .fill (HIST (nuclei::cNames[index ]) + HIST (" /hPtReconstructed" ), candidate.pt );
377- mHistograms .fill (HIST (nuclei::cNames[index ]) + HIST (" /h3PtVsEtaVsCentralityReconstructed" ), candidate.pt , candidate.eta , candidate.centrality );
378- mHistograms .fill (HIST (nuclei::cNames[index ]) + HIST (" /h3PhiVsEtaVsCentralityReconstructed" ), candidate.phi , candidate.eta , candidate.centrality );
379- mHistograms .fill (HIST (nuclei::cNames[index ]) + HIST (" /h3DCAxyVsPtVsCentrality" ), candidate.DCAxy , candidate.pt , candidate.centrality );
380- mHistograms .fill (HIST (nuclei::cNames[index ]) + HIST (" /h3DCAzVsPtVsCentrality" ), candidate.DCAz , candidate.pt , candidate.centrality );
381- mHistograms .fill (HIST (nuclei::cNames[index ]) + HIST (" /h3BetaVsPtVsCentrality" ), candidate.beta , candidate.pt , candidate.centrality );
382- mHistograms .fill (HIST (nuclei::cNames[index ]) + HIST (" /h3dEdxVsPVsCentrality" ), candidate.TPCsignal , candidate.pt , candidate.centrality );
383- mHistograms .fill (HIST (nuclei::cNames[index ]) + HIST (" /h3ClusterSizeVsPtVsCentrality" ), mPidManagers [index ].getClusterSizeCosLambdaITS (candidate.clusterSizesITS , candidate.eta ), candidate.pt , candidate.centrality );
376+ mHistograms .fill (HIST (nuclei::cNames[kIndex ]) + HIST (" /hPtReconstructed" ), candidate.pt );
377+ mHistograms .fill (HIST (nuclei::cNames[kIndex ]) + HIST (" /h3PtVsEtaVsCentralityReconstructed" ), candidate.pt , candidate.eta , candidate.centrality );
378+ mHistograms .fill (HIST (nuclei::cNames[kIndex ]) + HIST (" /h3PhiVsEtaVsCentralityReconstructed" ), candidate.phi , candidate.eta , candidate.centrality );
379+ mHistograms .fill (HIST (nuclei::cNames[kIndex ]) + HIST (" /h3DCAxyVsPtVsCentrality" ), candidate.DCAxy , candidate.pt , candidate.centrality );
380+ mHistograms .fill (HIST (nuclei::cNames[kIndex ]) + HIST (" /h3DCAzVsPtVsCentrality" ), candidate.DCAz , candidate.pt , candidate.centrality );
381+ mHistograms .fill (HIST (nuclei::cNames[kIndex ]) + HIST (" /h3BetaVsPtVsCentrality" ), candidate.beta , candidate.pt , candidate.centrality );
382+ mHistograms .fill (HIST (nuclei::cNames[kIndex ]) + HIST (" /h3dEdxVsPVsCentrality" ), candidate.TPCsignal , candidate.pt , candidate.centrality );
383+ mHistograms .fill (HIST (nuclei::cNames[kIndex ]) + HIST (" /h3ClusterSizeVsPtVsCentrality" ), mPidManagers [kIndex ].getClusterSizeCosLambdaITS (candidate.clusterSizesITS , candidate.eta ), candidate.pt , candidate.centrality );
384384 }
385385 }
386386
0 commit comments