@@ -933,44 +933,48 @@ struct HeavyionMultiplicity {
933933 if (!isTrackSelected (Rectrack)) {
934934 continue ;
935935 }
936+ if (!Rectrack.has_mcParticle ()) {
937+ histos.fill (HIST (" hRecMCdndeta" ), RecCol.posZ (), selColCent (RecCol), selColOccu (RecCol), Rectrack.eta (), Rectrack.phi (), static_cast <double >(kRecoBkg ));
938+ continue ;
939+ }
940+ auto mcpart = Rectrack.mcParticle ();
941+ if (RecCol.mcCollisionId () != mcpart.mcCollisionId ()) {
942+ continue ;
943+ }
936944 histos.fill (HIST (" hRecMCphivseta" ), Rectrack.phi (), Rectrack.eta ());
937945 histos.fill (HIST (" hRecMCdndeta" ), RecCol.posZ (), selColCent (RecCol), selColOccu (RecCol), Rectrack.eta (), Rectrack.phi (), static_cast <double >(kRecoAll ));
938- if (Rectrack.has_mcParticle ()) {
939- int pid = 0 ;
940- auto mcpart = Rectrack.mcParticle ();
941- histos.fill (HIST (" etaResolution" ), Rectrack.eta (), Rectrack.eta () - mcpart.eta ());
942- if (mcpart.isPhysicalPrimary ()) {
943- switch (std::abs (mcpart.pdgCode ())) {
944- case PDG_t::kPiPlus :
945- pid = kRecoPion ;
946- break ;
947- case PDG_t::kKPlus :
948- pid = kRecoKaon ;
949- break ;
950- case PDG_t::kProton :
951- pid = kRecoProton ;
952- break ;
953- default :
954- pid = kRecoOther ;
955- break ;
956- }
957- } else {
958- pid = kRecoSecondary ;
959- }
960- if (mcpart.has_mothers ()) {
961- auto mcpartMother = mcpart.template mothers_as <aod::McParticles>().front ();
962- if (mcpartMother.pdgCode () == PDG_t::kK0Short || std::abs (mcpartMother.pdgCode ()) == PDG_t::kLambda0 ) {
963- pid = kRecoWeakDecay ;
964- }
965- }
966- if (find (mclabels.begin (), mclabels.end (), Rectrack.mcParticleId ()) != mclabels.end ()) {
967- pid = kRecoFake ;
946+
947+ int pid = 0 ;
948+ histos.fill (HIST (" etaResolution" ), Rectrack.eta (), Rectrack.eta () - mcpart.eta ());
949+ if (mcpart.isPhysicalPrimary ()) {
950+ switch (std::abs (mcpart.pdgCode ())) {
951+ case PDG_t::kPiPlus :
952+ pid = kRecoPion ;
953+ break ;
954+ case PDG_t::kKPlus :
955+ pid = kRecoKaon ;
956+ break ;
957+ case PDG_t::kProton :
958+ pid = kRecoProton ;
959+ break ;
960+ default :
961+ pid = kRecoOther ;
962+ break ;
968963 }
969- mclabels.push_back (Rectrack.mcParticleId ());
970- histos.fill (HIST (" hRecMCdndeta" ), RecCol.posZ (), selColCent (RecCol), selColOccu (RecCol), mcpart.eta (), mcpart.phi (), static_cast <double >(pid));
971964 } else {
972- histos. fill ( HIST ( " hRecMCdndeta " ), RecCol. posZ (), selColCent (RecCol), selColOccu (RecCol), Rectrack. eta (), Rectrack. phi (), static_cast < double >( kRecoBkg )) ;
965+ pid = kRecoSecondary ;
973966 }
967+ if (mcpart.has_mothers ()) {
968+ auto mcpartMother = mcpart.template mothers_as <aod::McParticles>().front ();
969+ if (mcpartMother.pdgCode () == PDG_t::kK0Short || std::abs (mcpartMother.pdgCode ()) == PDG_t::kLambda0 ) {
970+ pid = kRecoWeakDecay ;
971+ }
972+ }
973+ if (find (mclabels.begin (), mclabels.end (), Rectrack.mcParticleId ()) != mclabels.end ()) {
974+ pid = kRecoFake ;
975+ }
976+ mclabels.push_back (Rectrack.mcParticleId ());
977+ histos.fill (HIST (" hRecMCdndeta" ), RecCol.posZ (), selColCent (RecCol), selColOccu (RecCol), mcpart.eta (), mcpart.phi (), static_cast <double >(pid));
974978 } // track (mcrec) loop
975979 } // collision loop
976980 }
0 commit comments