@@ -469,14 +469,15 @@ struct AntinucleiInJets {
469469
470470 // loop over reconstructed jets
471471 bool isAtLeastOneJetSelected = false ;
472- for (auto & jet : jets) { // o2-linter: disable=[const-ref-in-for-loop]
472+ for (const auto & jet : jets) {
473473
474474 // jet must be fully contained in the acceptance
475475 if ((std::fabs (jet.eta ()) + rJet) > (maxEta - deltaEtaEdge))
476476 continue ;
477477
478478 // jet pt must be larger than threshold
479- fastjet::PseudoJet jetMinusBkg = backgroundSub.doRhoAreaSub (jet, rhoPerp, rhoMPerp);
479+ auto jetForSub = jet;
480+ fastjet::PseudoJet jetMinusBkg = backgroundSub.doRhoAreaSub (jetForSub, rhoPerp, rhoMPerp);
480481 if (getCorrectedPt (jetMinusBkg.pt ()) < minJetPt)
481482 continue ;
482483 isAtLeastOneJetSelected = true ;
@@ -694,7 +695,7 @@ struct AntinucleiInJets {
694695 // loop over reconstructed jets
695696 int njetsInAcc (0 );
696697 int njetsHighPt (0 );
697- for (auto & jet : jets) { // o2-linter: disable=[const-ref-in-for-loop]
698+ for (const auto & jet : jets) {
698699
699700 // jet must be fully contained in the acceptance
700701 if ((std::fabs (jet.eta ()) + rJet) > (maxEta - deltaEtaEdge))
@@ -704,7 +705,8 @@ struct AntinucleiInJets {
704705 double ptJetBeforeSub = jet.pt ();
705706
706707 // jet pt must be larger than threshold
707- fastjet::PseudoJet jetMinusBkg = backgroundSub.doRhoAreaSub (jet, rhoPerp, rhoMPerp);
708+ auto jetForSub = jet;
709+ fastjet::PseudoJet jetMinusBkg = backgroundSub.doRhoAreaSub (jetForSub, rhoPerp, rhoMPerp);
708710 double ptJetAfterSub = jet.pt ();
709711 registryQC.fill (HIST (" jetPtDifference" ), ptJetAfterSub - ptJetBeforeSub);
710712
@@ -785,27 +787,27 @@ struct AntinucleiInJets {
785787 if (!particle.isPhysicalPrimary ())
786788 continue ;
787789
788- if (particle.pdgCode () == - 2212 ) {
790+ if (particle.pdgCode () == kProtonBar ) {
789791 registryMC.fill (HIST (" antiproton_eta_pt_pythia" ), particle.pt (), particle.eta ());
790792 }
791793
792794 if (particle.eta () < minEta || particle.eta () > maxEta)
793795 continue ;
794796
795797 switch (particle.pdgCode ()) {
796- case - 2212 :
798+ case kProtonBar :
797799 registryMC.fill (HIST (" antiproton_incl_gen" ), particle.pt ());
798800 break ;
799- case 1000010020 :
801+ case o2::constants::physics::Pdg:: kDeuteron :
800802 registryMC.fill (HIST (" deuteron_incl_gen" ), particle.pt ());
801803 break ;
802- case -1000010020 :
804+ case -o2::constants::physics::Pdg:: kDeuteron :
803805 registryMC.fill (HIST (" antideuteron_incl_gen" ), particle.pt ());
804806 break ;
805- case 1000020030 :
807+ case o2::constants::physics::Pdg:: kHelium3 :
806808 registryMC.fill (HIST (" helium3_incl_gen" ), particle.pt ());
807809 break ;
808- case -1000020030 :
810+ case -o2::constants::physics::Pdg:: kHelium3 :
809811 registryMC.fill (HIST (" antihelium3_incl_gen" ), particle.pt ());
810812 break ;
811813 }
@@ -860,17 +862,17 @@ struct AntinucleiInJets {
860862 if ((2.0 * track.pt ()) > ptMaxItsPidHel)
861863 passedItsPidHel = true ;
862864
863- if (particle.pdgCode () == - 2212 )
865+ if (particle.pdgCode () == kProtonBar )
864866 registryMC.fill (HIST (" antiproton_incl_all" ), track.pt ());
865867
866868 if (!particle.isPhysicalPrimary ())
867869 continue ;
868870
869- if (particle.pdgCode () == - 2212 )
871+ if (particle.pdgCode () == kProtonBar )
870872 registryMC.fill (HIST (" antiproton_incl_prim" ), track.pt ());
871873
872874 // antiprotons
873- if (particle.pdgCode () == - 2212 && passedItsPidProt) {
875+ if (particle.pdgCode () == kProtonBar && passedItsPidProt) {
874876 if (nsigmaTPCPr > minNsigmaTpc && nsigmaTPCPr < maxNsigmaTpc) {
875877 registryMC.fill (HIST (" antiproton_incl_rec_tpc" ), track.pt ());
876878 if (track.hasTOF () && nsigmaTOFPr > minNsigmaTof && nsigmaTOFPr < maxNsigmaTof)
@@ -879,7 +881,7 @@ struct AntinucleiInJets {
879881 }
880882
881883 // antideuterons
882- if (particle.pdgCode () == -1000010020 && passedItsPidDeut) {
884+ if (particle.pdgCode () == -o2::constants::physics::Pdg:: kDeuteron && passedItsPidDeut) {
883885 if (nsigmaTPCDe > minNsigmaTpc && nsigmaTPCDe < maxNsigmaTpc) {
884886 registryMC.fill (HIST (" antideuteron_incl_rec_tpc" ), track.pt ());
885887 if (track.hasTOF () && nsigmaTOFDe > minNsigmaTof && nsigmaTOFDe < maxNsigmaTof)
@@ -888,7 +890,7 @@ struct AntinucleiInJets {
888890 }
889891
890892 // deuterons
891- if (particle.pdgCode () == 1000010020 && passedItsPidDeut) {
893+ if (particle.pdgCode () == o2::constants::physics::Pdg:: kDeuteron && passedItsPidDeut) {
892894 if (nsigmaTPCDe > minNsigmaTpc && nsigmaTPCDe < maxNsigmaTpc) {
893895 registryMC.fill (HIST (" deuteron_incl_rec_tpc" ), track.pt ());
894896 if (track.hasTOF () && nsigmaTOFDe > minNsigmaTof && nsigmaTOFDe < maxNsigmaTof)
@@ -897,14 +899,14 @@ struct AntinucleiInJets {
897899 }
898900
899901 // antihelium3
900- if (particle.pdgCode () == -1000020030 && passedItsPidHel) {
902+ if (particle.pdgCode () == -o2::constants::physics::Pdg:: kHelium3 && passedItsPidHel) {
901903 if (nsigmaTPCHe > minNsigmaTpc && nsigmaTPCHe < maxNsigmaTpc) {
902904 registryMC.fill (HIST (" antihelium3_incl_rec_tpc" ), 2.0 * track.pt ());
903905 }
904906 }
905907
906908 // helium3
907- if (particle.pdgCode () == 1000020030 && passedItsPidHel) {
909+ if (particle.pdgCode () == o2::constants::physics::Pdg:: kHelium3 && passedItsPidHel) {
908910 if (nsigmaTPCHe > minNsigmaTpc && nsigmaTPCHe < maxNsigmaTpc) {
909911 registryMC.fill (HIST (" helium3_incl_rec_tpc" ), 2.0 * track.pt ());
910912 }
@@ -947,14 +949,15 @@ struct AntinucleiInJets {
947949 auto [rhoPerp, rhoMPerp] = backgroundSub.estimateRhoPerpCone (fjParticles, jets);
948950
949951 // loop over jets
950- for (auto & jet : jets) { // o2-linter: disable=[const-ref-in-for-loop]
952+ for (const auto & jet : jets) {
951953
952954 // jet must be fully contained in the acceptance
953955 if ((std::fabs (jet.eta ()) + rJet) > (maxEta - deltaEtaEdge))
954956 continue ;
955957
956958 // jet pt must be larger than threshold
957- fastjet::PseudoJet jetMinusBkg = backgroundSub.doRhoAreaSub (jet, rhoPerp, rhoMPerp);
959+ auto jetForSub = jet;
960+ fastjet::PseudoJet jetMinusBkg = backgroundSub.doRhoAreaSub (jetForSub, rhoPerp, rhoMPerp);
958961 if (jetMinusBkg.pt () < minJetPt)
959962 continue ;
960963
@@ -970,7 +973,7 @@ struct AntinucleiInJets {
970973 // loop over jet constituents
971974 for (const auto & particle : jetConstituents) {
972975
973- if (particle.user_index () != - 2212 )
976+ if (particle.user_index () != kProtonBar )
974977 continue ;
975978 registryMC.fill (HIST (" antiproton_jet_gen" ), particle.pt ());
976979 registryMC.fill (HIST (" antiproton_eta_pt_jet" ), particle.pt (), particle.eta ());
@@ -993,7 +996,7 @@ struct AntinucleiInJets {
993996 if (deltaRUe1 > coneRadius && deltaRUe2 > coneRadius)
994997 continue ;
995998
996- if (particle.pdgCode () != - 2212 )
999+ if (particle.pdgCode () != kProtonBar )
9971000 continue ;
9981001
9991002 registryMC.fill (HIST (" antiproton_ue_gen" ), particle.pt ());
@@ -1037,7 +1040,7 @@ struct AntinucleiInJets {
10371040 auto [rhoPerp, rhoMPerp] = backgroundSub.estimateRhoPerpCone (fjParticles, jets);
10381041
10391042 // loop over reconstructed jets
1040- for (auto & jet : jets) { // o2-linter: disable=[const-ref-in-for-loop]
1043+ for (const auto & jet : jets) {
10411044
10421045 // get jet constituents
10431046 std::vector<fastjet::PseudoJet> jetConstituents = jet.constituents ();
@@ -1062,7 +1065,8 @@ struct AntinucleiInJets {
10621065 registryMC.fill (HIST (" detectorResponseMatrix" ), jetPtGen, jetPtGen - jet.pt ()); // maybe it should be filled after bkg sub
10631066
10641067 // jet pt must be larger than threshold
1065- fastjet::PseudoJet jetMinusBkg = backgroundSub.doRhoAreaSub (jet, rhoPerp, rhoMPerp);
1068+ auto jetForSub = jet;
1069+ fastjet::PseudoJet jetMinusBkg = backgroundSub.doRhoAreaSub (jetForSub, rhoPerp, rhoMPerp);
10661070 if (getCorrectedPt (jetMinusBkg.pt ()) < minJetPt)
10671071 continue ;
10681072
@@ -1090,7 +1094,7 @@ struct AntinucleiInJets {
10901094 if (!track.has_mcParticle ())
10911095 continue ;
10921096 const auto mcparticle = track.mcParticle ();
1093- if (mcparticle.pdgCode () != - 2212 )
1097+ if (mcparticle.pdgCode () != kProtonBar )
10941098 continue ;
10951099
10961100 // variables
@@ -1135,7 +1139,7 @@ struct AntinucleiInJets {
11351139 if (!track.has_mcParticle ())
11361140 continue ;
11371141 const auto mcparticle = track.mcParticle ();
1138- if (mcparticle.pdgCode () != - 2212 )
1142+ if (mcparticle.pdgCode () != kProtonBar )
11391143 continue ;
11401144
11411145 double deltaEtaUe1 = track.eta () - ueAxis1.Eta ();
@@ -1218,14 +1222,15 @@ struct AntinucleiInJets {
12181222 auto [rhoPerp, rhoMPerp] = backgroundSub.estimateRhoPerpCone (fjParticles, jets);
12191223
12201224 // loop over reconstructed jets
1221- for (auto & jet : jets) {
1225+ for (const auto & jet : jets) {
12221226
12231227 // jet must be fully contained in the acceptance
12241228 if ((std::fabs (jet.eta ()) + rJet) > (maxEta - deltaEtaEdge))
12251229 continue ;
12261230
12271231 // jet pt must be larger than threshold
1228- fastjet::PseudoJet jetMinusBkg = backgroundSub.doRhoAreaSub (jet, rhoPerp, rhoMPerp);
1232+ auto jetForSub = jet;
1233+ fastjet::PseudoJet jetMinusBkg = backgroundSub.doRhoAreaSub (jetForSub, rhoPerp, rhoMPerp);
12291234 if (getCorrectedPt (jetMinusBkg.pt ()) < minJetPt)
12301235 continue ;
12311236
0 commit comments