@@ -75,7 +75,7 @@ static const std::vector<std::string> particleName{"p"};
7575std::array<std::shared_ptr<TH3>, kNpart > tofMass;
7676void momTotXYZ (std::array<float , 3 >& momA, std::array<float , 3 > const & momB, std::array<float , 3 > const & momC)
7777{
78- for (int i = 0 ; i < 3 ; ++i) {
78+ for (uint64_t i = 0 ; i < momA. size () ; ++i) {
7979 momA[i] = momB[i] + momC[i];
8080 }
8181}
@@ -336,7 +336,7 @@ struct ebyeMaker {
336336 break ;
337337 }
338338 }
339- if (foundPi * mcPart.pdgCode () < - 0.5 )
339+ if (foundPi * mcPart.pdgCode () < 0 )
340340 return PartTypes::kLa ;
341341 return -1 ;
342342 }
@@ -354,13 +354,14 @@ struct ebyeMaker {
354354 template <class T >
355355 bool selectV0Daughter (T const & track)
356356 {
357+ const float defNClCROverFind = 0 .8f ;
357358 if (std::abs (track.eta ()) > etaMaxV0dau) {
358359 return false ;
359360 }
360361 if (track.itsNCls () < v0trackNclusItsCut ||
361362 track.tpcNClsFound () < v0trackNclusTpcCut ||
362363 track.tpcNClsCrossedRows () < v0trackNclusTpcCut ||
363- track.tpcNClsCrossedRows () < 0.8 * track.tpcNClsFindable () ||
364+ track.tpcNClsCrossedRows () < defNClCROverFind * track.tpcNClsFindable () ||
364365 track.tpcNClsShared () > v0trackNsharedClusTpc) {
365366 return false ;
366367 }
@@ -379,6 +380,8 @@ struct ebyeMaker {
379380 template <class T >
380381 bool selectTrack (T const & track)
381382 {
383+ const float defItsChi2NClCut = 36 .f ;
384+ const float defNClCROverFind = 0 .8f ;
382385 if (std::abs (track.eta ()) > etaMax) {
383386 return false ;
384387 }
@@ -388,9 +391,9 @@ struct ebyeMaker {
388391 if (track.itsNCls () < trackNclusItsCut ||
389392 track.tpcNClsFound () < trackNclusTpcCut ||
390393 track.tpcNClsCrossedRows () < trackNcrossedRows ||
391- track.tpcNClsCrossedRows () < 0.8 * track.tpcNClsFindable () ||
394+ track.tpcNClsCrossedRows () < defNClCROverFind * track.tpcNClsFindable () ||
392395 track.tpcChi2NCl () > trackChi2Cut ||
393- track.itsChi2NCl () > 36 . f ) {
396+ track.itsChi2NCl () > defItsChi2NClCut ) {
394397 return false ;
395398 }
396399 if (doprocessRun2 || doprocessMiniRun2 || doprocessMcRun2 || doprocessMiniMcRun2) {
@@ -407,7 +410,8 @@ struct ebyeMaker {
407410 float getITSClSize (T const & track)
408411 {
409412 float sum{0 .f };
410- for (int iL{0 }; iL < 6 ; ++iL) {
413+ const int nLayers = 7 ;
414+ for (int iL{0 }; iL < nLayers; ++iL) {
411415 sum += (track.itsClusterSizes () >> (iL * 4 )) & 0xf ;
412416 }
413417 return sum / track.itsNCls ();
@@ -452,7 +456,8 @@ struct ebyeMaker {
452456 if ((Run2V0MInfo.mhVtxAmpCorrV0A != nullptr ) && (Run2V0MInfo.mhVtxAmpCorrV0C != nullptr ) && (Run2V0MInfo.mhMultSelCalib != nullptr )) {
453457 if (genName->length () != 0 ) {
454458 if (Run2V0MInfo.mMCScale != nullptr ) {
455- for (int ixpar = 0 ; ixpar < 6 ; ++ixpar) {
459+ const int nPars = 6 ;
460+ for (int ixpar = 0 ; ixpar < nPars; ++ixpar) {
456461 Run2V0MInfo.mMCScalePars [ixpar] = Run2V0MInfo.mMCScale ->GetParameter (ixpar);
457462 }
458463 } else {
@@ -664,12 +669,13 @@ struct ebyeMaker {
664669 gpu::gpustd::array<float , 2 > dcaInfo;
665670 uint8_t nTracklets[2 ]{0 , 0 };
666671 uint8_t nTracks{0 };
672+ const float tklEtaCuts[]{1.2 , 0.6 , 0.7 };
667673 for (const auto & track : tracks) {
668674
669- if (track.trackType () == 255 && std::abs (track.eta ()) < 1.2 ) { // tracklet
670- if (std::abs (track.eta ()) < 0.6 )
675+ if (track.trackType () == o2::aod::track::TrackTypeEnum::Run2Tracklet && std::abs (track.eta ()) < tklEtaCuts[ 0 ] ) { // tracklet
676+ if (std::abs (track.eta ()) < tklEtaCuts[ 1 ] )
671677 nTracklets[0 ]++;
672- else if (std::abs (track.eta ()) > 0.7 )
678+ else if (std::abs (track.eta ()) > tklEtaCuts[ 2 ] )
673679 nTracklets[1 ]++;
674680 }
675681
@@ -914,7 +920,7 @@ struct ebyeMaker {
914920 fillRecoEvent<C, T>(collision, tracks, V0s, centrality);
915921
916922 for (int iP{0 }; iP < kNpart ; ++iP) {
917- for (const auto & candidateTrack : candidateTracks[iP]) {
923+ for (auto & candidateTrack : candidateTracks[iP]) {
918924 candidateTrack.isreco = true ;
919925
920926 auto mcLab = mcLabels.rawIteratorAt (candidateTrack.globalIndex );
@@ -944,7 +950,7 @@ struct ebyeMaker {
944950 }
945951 }
946952 }
947- for (const auto & candidateV0 : candidateV0s) {
953+ for (auto & candidateV0 : candidateV0s) {
948954 candidateV0.isreco = true ;
949955 auto mcLabPos = mcLabels.rawIteratorAt (candidateV0.globalIndexPos );
950956 auto mcLabNeg = mcLabels.rawIteratorAt (candidateV0.globalIndexNeg );
@@ -957,7 +963,7 @@ struct ebyeMaker {
957963 for (const auto & posMother : mcTrackPos.template mothers_as <aod::McParticles>()) {
958964 if (posMother.globalIndex () != negMother.globalIndex ())
959965 continue ;
960- if (!((mcTrackPos.pdgCode () == PDG_t::kProton && mcTrackNeg.pdgCode () == PDT_t ::kPiMinus ) || (mcTrackPos.pdgCode () == PDG_t::kPiPlus && mcTrackNeg.pdgCode () == PDG_t::kProtonBar )))
966+ if (!((mcTrackPos.pdgCode () == PDG_t::kProton && mcTrackNeg.pdgCode () == PDG_t ::kPiMinus ) || (mcTrackPos.pdgCode () == PDG_t::kPiPlus && mcTrackNeg.pdgCode () == PDG_t::kProtonBar )))
961967 continue ;
962968 if (std::abs (posMother.pdgCode ()) != PDG_t::kLambda0 ) {
963969 continue ;
@@ -1240,7 +1246,7 @@ struct ebyeMaker {
12401246 }
12411247 miniCollTable (static_cast <int8_t >(collision.posZ () * 10 ), trigger, storeTracksNum ? nTracksColl : nTrackletsColl, cV0M);
12421248
1243- for (const auto & candidateTrack : candidateTracks[0 ]) { // protons
1249+ for (auto & candidateTrack : candidateTracks[0 ]) { // protons
12441250 auto tk = tracks.rawIteratorAt (candidateTrack.globalIndex );
12451251 float outerPID = getOuterPID (tk);
12461252 auto [itsSignal, nSigmaITS] = getITSSignal (tk, trackExtraRun2);
@@ -1432,7 +1438,7 @@ struct ebyeMaker {
14321438
14331439 miniCollTable (static_cast <int8_t >(collision.posZ () * 10 ), 0x0 , storeTracksNum ? nTracksColl : nTrackletsColl, cV0M);
14341440
1435- for (const auto & candidateTrack : candidateTracks[0 ]) { // protons
1441+ for (auto & candidateTrack : candidateTracks[0 ]) { // protons
14361442 int selMask = -1 ;
14371443 if (candidateTrack.isreco ) {
14381444 auto tk = tracks.rawIteratorAt (candidateTrack.globalIndex );
0 commit comments