5151#include " Framework/runDataProcessing.h"
5252#include " ReconstructionDataFormats/Track.h"
5353
54- #include " Math/Vector4D.h"
55- #include " TRandom3.h"
54+ #include < Math/Vector4D.h>
5655#include < TMCProcess.h>
56+ #include < TPDGCode.h> // for PDG codes
57+ #include < TRandom3.h>
5758
5859#include < algorithm>
5960#include < cmath>
@@ -118,6 +119,7 @@ struct NucleusCandidateFlow {
118119
119120namespace nuclei
120121{
122+ constexpr int nITSlayers = 7 ;
121123constexpr double bbMomScalingDefault[5 ][2 ]{
122124 {1 ., 1 .},
123125 {1 ., 1 .},
@@ -272,25 +274,33 @@ struct nucleiSpectra {
272274
273275 Configurable<bool > cfgCompensatePIDinTracking{" cfgCompensatePIDinTracking" , false , " If true, divide tpcInnerParam by the electric charge" };
274276
277+ struct : o2::framework::ConfigurableGroup {
278+ std::string prefix{" cfgTrackCut" };
279+ Configurable<LabeledArray<double >> DcaMax{" DcaMax" , {nuclei::DCAcutDefault[0 ], 5 , 2 , nuclei::names, nuclei::nDCAConfigName}, " Max DCAxy and DCAz for light nuclei" };
280+ Configurable<float > EtaMax{" EtaMax" , 0 .8f , " Max Eta for tracks" };
281+ Configurable<int > ITSnClusMin{" ITSnClsMin" , 5 , " Minimum number of ITS clusters" };
282+ Configurable<float > ITSchi2ClusMax{" ITSchi2ClusMax" , 36 .f , " Max ITS Chi2 per cluster" };
283+ Configurable<float > RapidityMax{" RapidityMax" , 1 .f , " Maximum rapidity for tracks" };
284+ Configurable<float > RapidityMin{" RapidityMin" , -1 .f , " Minimum rapidity for tracks" };
285+ Configurable<bool > RapidityToggle{" RapidityToggle" , false , " If true, use rapidity cuts" };
286+ Configurable<float > TPCchi2ClusMax{" TPCchi2ClusMax" , 4 .f , " Max TPC Chi2 per cluster" };
287+ Configurable<int > TPCnCrossedRowsMin{" TPCnCrossedRowsMin" , 70 , " Minimum number of TPC crossed rows" };
288+ Configurable<float > TPCnCrossedRowsOverFindableMin{" TPCnCrossedRowsOverFindableMin" , 0 .8f , " Minimum ratio of crossed rows over findable clusters" };
289+ Configurable<int > TPCnClsMin{" TPCnClsMin" , 80 , " Minimum number of TPC clusters" };
290+ Configurable<float > TPCrigidityMin{" TPCrigidityMin" , 0 .5f , " Minimum TPC rigidity for tracks" };
291+ Configurable<LabeledArray<double >> TPCnSigmaMax{" TPCnSigmaMax" , {nuclei::nSigmaTPCdefault[0 ], 5 , 2 , nuclei::names, nuclei::nSigmaConfigName}, " TPC nsigma selection for light nuclei" };
292+
293+ } cfgTrackCut;
275294 Configurable<int > cfgCentralityEstimator{" cfgCentralityEstimator" , 0 , " Centrality estimator (FV0A: 0, FT0M: 1, FT0A: 2, FT0C: 3)" };
276295 Configurable<float > cfgCMrapidity{" cfgCMrapidity" , 0 .f , " Rapidity of the center of mass (only for p-Pb)" };
277296 Configurable<float > cfgCutVertex{" cfgCutVertex" , 10 .0f , " Accepted z-vertex range" };
278- Configurable<float > cfgCutEta{" cfgCutEta" , 0 .8f , " Eta range for tracks" };
279- Configurable<float > cfgCutTpcMom{" cfgCutTpcMom" , 0 .2f , " Minimum TPC momentum for tracks" };
280- Configurable<float > cfgCutRapidityMin{" cfgCutRapidityMin" , -1 ., " Minimum rapidity for tracks" };
281- Configurable<float > cfgCutRapidityMax{" cfgCutRapidityMax" , 1 ., " Maximum rapidity for tracks" };
282- Configurable<bool > cfgCutOnReconstructedRapidity{" cfgCutOnReconstructedRapidity" , false , " Cut on reconstructed rapidity" };
283- Configurable<float > cfgCutNclusITS{" cfgCutNclusITS" , 5 , " Minimum number of ITS clusters" };
284- Configurable<float > cfgCutNclusTPC{" cfgCutNclusTPC" , 70 , " Minimum number of TPC clusters" };
285297 Configurable<float > cfgCutPtMinTree{" cfgCutPtMinTree" , 0 .2f , " Minimum track transverse momentum for tree saving" };
286298 Configurable<float > cfgCutPtMaxTree{" cfgCutPtMaxTree" , 15 .0f , " Maximum track transverse momentum for tree saving" };
287299
288300 Configurable<LabeledArray<int >> cfgEventSelections{" cfgEventSelections" , {nuclei::EvSelDefault[0 ], 8 , 1 , nuclei::eventSelectionLabels, nuclei::eventSelectionTitle}, " Event selections" };
289301
290302 Configurable<LabeledArray<double >> cfgMomentumScalingBetheBloch{" cfgMomentumScalingBetheBloch" , {nuclei::bbMomScalingDefault[0 ], 5 , 2 , nuclei::names, nuclei::chargeLabelNames}, " TPC Bethe-Bloch momentum scaling for light nuclei" };
291303 Configurable<LabeledArray<double >> cfgBetheBlochParams{" cfgBetheBlochParams" , {nuclei::betheBlochDefault[0 ], 5 , 6 , nuclei::names, nuclei::betheBlochParNames}, " TPC Bethe-Bloch parameterisation for light nuclei" };
292- Configurable<LabeledArray<double >> cfgNsigmaTPC{" cfgNsigmaTPC" , {nuclei::nSigmaTPCdefault[0 ], 5 , 2 , nuclei::names, nuclei::nSigmaConfigName}, " TPC nsigma selection for light nuclei" };
293- Configurable<LabeledArray<double >> cfgDCAcut{" cfgDCAcut" , {nuclei::DCAcutDefault[0 ], 5 , 2 , nuclei::names, nuclei::nDCAConfigName}, " Max DCAxy and DCAz for light nuclei" };
294304 Configurable<LabeledArray<double >> cfgDownscaling{" cfgDownscaling" , {nuclei::DownscalingDefault[0 ], 5 , 1 , nuclei::names, nuclei::DownscalingConfigName}, " Fraction of kept candidates for light nuclei" };
295305 Configurable<LabeledArray<int >> cfgTreeConfig{" cfgTreeConfig" , {nuclei::TreeConfigDefault[0 ], 5 , 2 , nuclei::names, nuclei::treeConfigNames}, " Filtered trees configuration" };
296306 Configurable<bool > cfgFillPairTree{" cfgFillPairTree" , true , " Fill trees for pairs of light nuclei" };
@@ -331,7 +341,7 @@ struct nucleiSpectra {
331341 // CCDB options
332342 Configurable<int > cfgMaterialCorrection{" cfgMaterialCorrection" , static_cast <int >(o2::base::Propagator::MatCorrType::USEMatCorrLUT), " Type of material correction" };
333343 Configurable<std::string> cfgCCDBurl{" ccdb-url" , " http://alice-ccdb.cern.ch" , " url of the ccdb repository" };
334- Configurable<std::string> cfgZorroCCDBpath{" cfgZorroCCDBpath" , " /Users/m/mpuccio/ EventFiltering/OTS /" , " path to the zorro ccdb objects" };
344+ Configurable<std::string> cfgZorroCCDBpath{" cfgZorroCCDBpath" , " EventFiltering/Zorro /" , " path to the zorro ccdb objects" };
335345 int mRunNumber = 0 ;
336346 float mBz = 0 .f;
337347
@@ -356,7 +366,7 @@ struct nucleiSpectra {
356366 float dauVtx[3 ]{0 .f , 0 .f , 0 .f };
357367 auto daughters = particle.daughters_as <aod::McParticles>();
358368 for (const auto & dau : daughters) {
359- if (abs (dau.pdgCode ()) != 22 && abs (dau.pdgCode ()) != 11 ) {
369+ if (std:: abs (dau.pdgCode ()) != PDG_t:: kGamma && std:: abs (dau.pdgCode ()) != PDG_t:: kElectron ) {
360370 dauVtx[0 ] = dau.vx ();
361371 dauVtx[1 ] = dau.vy ();
362372 dauVtx[2 ] = dau.vz ();
@@ -510,14 +520,14 @@ struct nucleiSpectra {
510520 spectra.add (" hTpcSignalDataSelected" , " Specific energy loss for selected particles" , HistType::kTH2F , {{600 , -6 ., 6 ., " #it{p} (GeV/#it{c})" }, {1400 , 0 , 1400 , " d#it{E} / d#it{X} (a. u.)" }});
511521 spectra.add (" hTofSignalData" , " TOF beta" , HistType::kTH2F , {{500 , 0 ., 5 ., " #it{p} (GeV/#it{c})" }, {750 , 0 , 1.5 , " TOF #beta" }});
512522
513- for (int iC{0 }; iC < 2 ; ++iC) {
523+ for (unsigned int iC{0 }; iC < nuclei::matter. size () ; ++iC) {
514524 nuclei::hGloTOFtracks[iC] = spectra.add <TH2>(fmt::format (" hTPCTOFtracks{}" , nuclei::matter[iC]).data (), fmt::format (" Global vs TOF matched {} tracks in a collision" , nuclei::chargeLabelNames[iC]).data (), HistType::kTH2D , {{300 , -0.5 , 300.5 , " Number of global tracks" }, {300 , -0.5 , 300.5 , " Number of TOF matched tracks" }});
515525
516526 for (int iS{0 }; iS < nuclei::species; ++iS) {
517527 nuclei::hNsigma[0 ][iS][iC] = spectra.add <TH3>(fmt::format (" h{}nsigma{}_{}" , nuclei::pidName[0 ], nuclei::matter[iC], nuclei::names[iS]).data (), fmt::format (" n#sigma_{{}} {} {}" , nuclei::pidName[0 ], nuclei::matter[iC], nuclei::names[iS]).data (), HistType::kTH3D , {centAxis, ptAxes[iS], nSigmaAxes[0 ]});
518528 nuclei::hNsigmaEta[0 ][iS][iC] = spectra.add <TH3>(fmt::format (" h{}nsigmaEta{}_{}" , nuclei::pidName[0 ], nuclei::matter[iC], nuclei::names[iS]).data (), fmt::format (" n#sigma_{{}} {} {} vs #eta" , nuclei::pidName[0 ], nuclei::matter[iC], nuclei::names[iS]).data (), HistType::kTH3D , {etaAxis, ptAxes[iS], nSigmaAxes[0 ]});
519529
520- for (int iPID{0 }; iPID < 2 ; ++iPID) {
530+ for (unsigned int iPID{0 }; iPID < nuclei::matter. size () ; ++iPID) {
521531 nuclei::hDCAxy[iPID][iS][iC] = spectra.add <TH3>(fmt::format (" hDCAxy{}_{}_{}" , nuclei::pidName[iPID], nuclei::matter[iC], nuclei::names[iS]).data (), fmt::format (" DCAxy {} {} {}" , nuclei::pidName[iPID], nuclei::matter[iC], nuclei::names[iS]).data (), HistType::kTH3D , {centAxis, ptAxes[iS], dcaxyAxes[iS]});
522532 nuclei::hDCAz[iPID][iS][iC] = spectra.add <TH3>(fmt::format (" hDCAz{}_{}_{}" , nuclei::pidName[iPID], nuclei::matter[iC], nuclei::names[iS]).data (), fmt::format (" DCAz {} {} {}" , nuclei::pidName[iPID], nuclei::matter[iC], nuclei::names[iS]).data (), HistType::kTH3D , {centAxis, ptAxes[iS], dcazAxes[iS]});
523533 }
@@ -540,15 +550,15 @@ struct nucleiSpectra {
540550 }
541551
542552 for (int iS{0 }; iS < nuclei::species; ++iS) {
543- for (int iMax{0 }; iMax < 2 ; ++iMax) {
544- nuclei::pidCuts[0 ][iS][iMax] = cfgNsigmaTPC ->get (iS, iMax);
553+ for (unsigned int iMax{0 }; iMax < nuclei::pidName. size () ; ++iMax) {
554+ nuclei::pidCuts[0 ][iS][iMax] = cfgTrackCut. TPCnSigmaMax ->get (iS, iMax);
545555 }
546556 }
547557
548558 if (doprocessMatching) {
549559 std::vector<double > occBins{-0.5 , 499.5 , 999.5 , 1999.5 , 2999.5 , 3999.5 , 4999.5 , 10000 ., 50000 .};
550560 AxisSpec occAxis{occBins, " Occupancy" };
551- for (int iC{0 }; iC < 2 ; ++iC) {
561+ for (unsigned int iC{0 }; iC < nuclei::matter. size () ; ++iC) {
552562 nuclei::hMatchingStudy[iC] = spectra.add <THnSparse>(fmt::format (" hMatchingStudy{}" , nuclei::matter[iC]).data (), " ;#it{p}_{T};#phi;#eta;n#sigma_{ITS};n#sigma{TPC};n#sigma_{TOF};Centrality" , HistType::kTHnSparseF , {{20 , 1 ., 9 .}, {10 , 0 ., o2::constants::math::TwoPI}, {10 , -1 ., 1 .}, {50 , -5 ., 5 .}, {50 , -5 ., 5 .}, {50 , 0 ., 1 .}, {8 , 0 ., 80 .}});
553563 nuclei::hMatchingStudyHadrons[iC] = spectra.add <THn>(fmt::format (" hMatchingStudyHadrons{}" , nuclei::matter[iC]).data (), " ;#it{p}_{T};#phi;#eta;Centrality;Track type; Occupancy" , HistType::kTHnF , {{23 , 0.4 , 5 .}, {20 , 0 ., o2::constants::math::TwoPI}, {10 , -1 ., 1 .}, {8 , 0 ., 80 .}, {2 , -0.5 , 1.5 }, occAxis});
554564 }
@@ -605,15 +615,15 @@ struct nucleiSpectra {
605615 {nuclei::charges[4 ] * cfgMomentumScalingBetheBloch->get (3u , 0u ) / nuclei::masses[4 ], nuclei::charges[4 ] * cfgMomentumScalingBetheBloch->get (3u , 1u ) / nuclei::masses[4 ]}};
606616
607617 int nGloTracks[2 ]{0 , 0 }, nTOFTracks[2 ]{0 , 0 };
608- for (auto & track : tracks) { // start loop over tracks
609- if (std::abs (track.eta ()) > cfgCutEta ||
610- track.tpcInnerParam () < cfgCutTpcMom ||
611- track.itsNCls () < cfgCutNclusITS ||
612- track.tpcNClsFound () < cfgCutNclusTPC ||
613- track.tpcNClsCrossedRows () < 70 ||
614- track.tpcNClsCrossedRows () < 0.8 * track.tpcNClsFindable () ||
615- track.tpcChi2NCl () > 4 . f ||
616- track.itsChi2NCl () > 36 . f ) {
618+ for (const auto & track : tracks) { // start loop over tracks
619+ if (std::abs (track.eta ()) > cfgTrackCut. EtaMax ||
620+ track.tpcInnerParam () < cfgTrackCut. TPCrigidityMin ||
621+ track.itsNCls () < cfgTrackCut. ITSnClusMin ||
622+ track.tpcNClsFound () < cfgTrackCut. TPCnClsMin ||
623+ track.tpcNClsCrossedRows () < cfgTrackCut. TPCnCrossedRowsMin ||
624+ track.tpcNClsCrossedRows () < cfgTrackCut. TPCnCrossedRowsOverFindableMin * track.tpcNClsFindable () ||
625+ track.tpcChi2NCl () > cfgTrackCut. TPCchi2ClusMax ||
626+ track.itsChi2NCl () > cfgTrackCut. ITSchi2ClusMax ) {
617627 continue ;
618628 }
619629 // temporary fix: tpcInnerParam() returns the momentum in all the software tags before
@@ -678,12 +688,12 @@ struct nucleiSpectra {
678688 }
679689 for (int iS{0 }; iS < nuclei::species; ++iS) {
680690 bool selectedTOF{false };
681- if (std::abs (dcaInfo[1 ]) > cfgDCAcut ->get (iS, 1 )) {
691+ if (std::abs (dcaInfo[1 ]) > cfgTrackCut. DcaMax ->get (iS, 1 )) {
682692 continue ;
683693 }
684694 ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<float >> fvector{mTrackParCov .getPt () * nuclei::charges[iS], mTrackParCov .getEta (), mTrackParCov .getPhi (), nuclei::masses[iS]};
685695 float y{fvector.Rapidity () + cfgCMrapidity};
686- for (int iPID{0 }; iPID < 2 ; ++iPID) { // / 0 TPC, 1 TOF
696+ for (unsigned int iPID{0 }; iPID < nuclei::pidName. size () ; ++iPID) { // / 0 TPC, 1 TOF
687697 if (selectedTPC[iS]) {
688698 if (iPID && !track.hasTOF ()) {
689699 continue ;
@@ -692,12 +702,12 @@ struct nucleiSpectra {
692702 float charge{1 .f + static_cast <float >(iS == 3 || iS == 4 )};
693703 tofMasses[iS] = correctedTpcInnerParam * charge * std::sqrt (1 .f / (beta * beta) - 1 .f ) - nuclei::masses[iS];
694704 }
695- if (!cfgCutOnReconstructedRapidity || (y > cfgCutRapidityMin && y < cfgCutRapidityMax )) {
705+ if (!cfgTrackCut. RapidityToggle || (y > cfgTrackCut. RapidityMin && y < cfgTrackCut. RapidityMax )) {
696706 if (std::abs (nSigmaTPC[iS]) < cfgNsigmaTPCcutDCAhists && (!iPID || std::abs (tofMasses[iS]) < cfgDeltaTOFmassCutDCAhists)) {
697707 nuclei::hDCAxy[iPID][iS][iC]->Fill (centrality, fvector.pt (), dcaInfo[0 ]);
698708 nuclei::hDCAz[iPID][iS][iC]->Fill (centrality, fvector.pt (), dcaInfo[1 ]);
699709 }
700- if (std::abs (dcaInfo[0 ]) < cfgDCAcut ->get (iS, 0u )) {
710+ if (std::abs (dcaInfo[0 ]) < cfgTrackCut. DcaMax ->get (iS, 0u )) {
701711 if (!iPID) { // / temporary exclusion of the TOF nsigma PID for the He3 and Alpha
702712 nuclei::hNsigma[iPID][iS][iC]->Fill (centrality, fvector.pt (), nSigma[iPID][iS]);
703713 nuclei::hNsigmaEta[iPID][iS][iC]->Fill (fvector.eta (), fvector.pt (), nSigma[iPID][iS]);
@@ -857,7 +867,7 @@ struct nucleiSpectra {
857867 }
858868 }
859869 }
860- for (auto & c : nuclei::candidates_flow) {
870+ for (const auto & c : nuclei::candidates_flow) {
861871 nucleiTableFlow (c.centFV0A , c.centFT0M , c.centFT0A , c.centFT0C , c.psiFT0A , c.psiFT0C , c.psiTPC , c.psiTPCl , c.psiTPCr , c.qFT0A , c.qFT0C , c.qTPC , c.qTPCl , c.qTPCr );
862872 }
863873 }
@@ -874,7 +884,7 @@ struct nucleiSpectra {
874884 return ;
875885 }
876886 fillDataInfo (collision, tracks);
877- for (auto & c : nuclei::candidates) {
887+ for (const auto & c : nuclei::candidates) {
878888 if (c.fillTree ) {
879889 nucleiTable (c.pt , c.eta , c.phi , c.tpcInnerParam , c.beta , c.zVertex , c.nContrib , c.DCAxy , c.DCAz , c.TPCsignal , c.ITSchi2 , c.TPCchi2 , c.TOFchi2 , c.flags , c.TPCfindableCls , c.TPCcrossedRows , c.ITSclsMap , c.TPCnCls , c.TPCnClsShared , c.clusterSizesITS );
880890 }
@@ -886,7 +896,7 @@ struct nucleiSpectra {
886896 }
887897 }
888898 }
889- for (auto & c : nuclei::candidates_flow) {
899+ for (const auto & c : nuclei::candidates_flow) {
890900 nucleiTableFlow (c.centFV0A , c.centFT0M , c.centFT0A , c.centFT0C , c.psiFT0A , c.psiFT0C , c.psiTPC , c.psiTPCl , c.psiTPCr , c.qFT0A , c.qFT0C , c.qTPC , c.qTPCl , c.qTPCr );
891901 }
892902 }
@@ -896,11 +906,11 @@ struct nucleiSpectra {
896906 void processMC (soa::Join<aod::Collisions, aod::EvSels, aod::McCollisionLabels> const & collisions, aod::McCollisions const & mcCollisions, soa::Join<TrackCandidates, aod::McTrackLabels> const & tracks, aod::McParticles const & particlesMC, aod::BCsWithTimestamps const &)
897907 {
898908 nuclei::candidates.clear ();
899- for (auto & c : mcCollisions) {
909+ for (const auto & c : mcCollisions) {
900910 spectra.fill (HIST (" hGenVtxZ" ), c.posZ ());
901911 }
902912 std::vector<bool > goodCollisions (mcCollisions.size (), false );
903- for (auto & collision : collisions) {
913+ for (const auto & collision : collisions) {
904914 if (!eventSelection (collision)) {
905915 continue ;
906916 }
@@ -938,7 +948,7 @@ struct nucleiSpectra {
938948 if (!storeIt) {
939949 continue ;
940950 }
941- if (particle.y () < cfgCutRapidityMin || particle.y () > cfgCutRapidityMax ) {
951+ if (particle.y () < cfgTrackCut. RapidityMin || particle.y () > cfgTrackCut. RapidityMax ) {
942952 continue ;
943953 }
944954
@@ -948,7 +958,7 @@ struct nucleiSpectra {
948958 if (particle.isPhysicalPrimary ()) {
949959 c.flags |= kIsPhysicalPrimary ;
950960 if (particle.has_mothers ()) {
951- for (auto & motherparticle : particle.mothers_as <aod::McParticles>()) {
961+ for (const auto & motherparticle : particle.mothers_as <aod::McParticles>()) {
952962 if (std::find (nuclei::hfMothCodes.begin (), nuclei::hfMothCodes.end (), std::abs (motherparticle.pdgCode ())) != nuclei::hfMothCodes.end ()) {
953963 c.flags |= kIsSecondaryFromWeakDecay ;
954964 motherPdgCode = motherparticle.pdgCode ();
@@ -959,7 +969,7 @@ struct nucleiSpectra {
959969 }
960970 } else if (particle.has_mothers ()) {
961971 c.flags |= kIsSecondaryFromWeakDecay ;
962- for (auto & motherparticle : particle.mothers_as <aod::McParticles>()) {
972+ for (const auto & motherparticle : particle.mothers_as <aod::McParticles>()) {
963973 motherPdgCode = motherparticle.pdgCode ();
964974 motherDecRadius = std::hypot (particle.vx () - motherparticle.vx (), particle.vy () - motherparticle.vy ());
965975 }
@@ -973,13 +983,13 @@ struct nucleiSpectra {
973983 }
974984
975985 int index{0 };
976- for (auto & particle : particlesMC) {
986+ for (const auto & particle : particlesMC) {
977987 int pdg{std::abs (particle.pdgCode ())};
978988 for (int iS{0 }; iS < nuclei::species; ++iS) {
979989 if (pdg != nuclei::codes[iS]) {
980990 continue ;
981991 }
982- if (particle.y () < cfgCutRapidityMin || particle.y () > cfgCutRapidityMax ) {
992+ if (particle.y () < cfgTrackCut. RapidityMin || particle.y () > cfgTrackCut. RapidityMax ) {
983993 continue ;
984994 }
985995
@@ -1005,7 +1015,7 @@ struct nucleiSpectra {
10051015 continue ; // skip secondaries from weak decay without mothers
10061016 }
10071017 flags |= kIsSecondaryFromWeakDecay ;
1008- for (auto & motherparticle : particle.mothers_as <aod::McParticles>()) {
1018+ for (const auto & motherparticle : particle.mothers_as <aod::McParticles>()) {
10091019 motherPdgCode = motherparticle.pdgCode ();
10101020 motherDecRadius = std::hypot (particle.vx () - motherparticle.vx (), particle.vy () - motherparticle.vy ());
10111021 }
@@ -1038,9 +1048,9 @@ struct nucleiSpectra {
10381048 const float centrality = collision.centFT0C ();
10391049 o2::aod::ITSResponse itsResponse;
10401050 for (const auto & track : tracks) {
1041- if (std::abs (track.eta ()) > cfgCutEta ||
1042- track.itsNCls () < 7 ||
1043- track.itsChi2NCl () > 36 . f ) {
1051+ if (std::abs (track.eta ()) > cfgTrackCut. EtaMax ||
1052+ track.itsNCls () < nuclei::nITSlayers ||
1053+ track.itsChi2NCl () > cfgTrackCut. ITSchi2ClusMax ) {
10441054 continue ;
10451055 }
10461056 double expBethe{tpc::BetheBlochAleph (static_cast <double >(track.tpcInnerParam () * 2 . / o2::constants::physics::MassHelium3), cfgBetheBlochParams->get (4 , 0u ), cfgBetheBlochParams->get (4 , 1u ), cfgBetheBlochParams->get (4 , 2u ), cfgBetheBlochParams->get (4 , 3u ), cfgBetheBlochParams->get (4 , 4u ))};
@@ -1062,7 +1072,7 @@ struct nucleiSpectra {
10621072 {
10631073 nuclei::candidates.clear ();
10641074 std::vector<bool > goodCollisions (mcCollisions.size (), false );
1065- for (auto & collision : collisions) {
1075+ for (const auto & collision : collisions) {
10661076 if (!eventSelection (collision)) {
10671077 continue ;
10681078 }
@@ -1085,7 +1095,7 @@ struct nucleiSpectra {
10851095 if (particle.isPhysicalPrimary ()) {
10861096 c.flags |= kIsPhysicalPrimary ;
10871097 if (particle.has_mothers ()) {
1088- for (auto & motherparticle : particle.mothers_as <aod::McParticles>()) {
1098+ for (const auto & motherparticle : particle.mothers_as <aod::McParticles>()) {
10891099 if (std::find (nuclei::hfMothCodes.begin (), nuclei::hfMothCodes.end (), std::abs (motherparticle.pdgCode ())) != nuclei::hfMothCodes.end ()) {
10901100 c.flags |= kIsSecondaryFromWeakDecay ;
10911101 motherPdgCode = motherparticle.pdgCode ();
@@ -1096,7 +1106,7 @@ struct nucleiSpectra {
10961106 }
10971107 } else if (particle.has_mothers ()) {
10981108 c.flags |= kIsSecondaryFromWeakDecay ;
1099- for (auto & motherparticle : particle.mothers_as <aod::McParticles>()) {
1109+ for (const auto & motherparticle : particle.mothers_as <aod::McParticles>()) {
11001110 motherPdgCode = motherparticle.pdgCode ();
11011111 motherDecRadius = std::hypot (particle.vx () - motherparticle.vx (), particle.vy () - motherparticle.vy ());
11021112 }
0 commit comments