@@ -91,6 +91,7 @@ static const std::vector<std::string> betheBlochParNames{"p0", "p1", "p2", "p3",
9191// constexpr float pionchargedMass = o2::constants::physics::MassPiPlus;
9292constexpr int Li4PDG = 1000030040 ;
9393constexpr int ProtonPDG = PDG_t::kProton ;
94+ constexpr int PionPDG = PDG_t::kPiPlus ;
9495constexpr int He3PDG = o2::constants::physics::Pdg::kHelium3 ;
9596constexpr float CommonInite = 0 .0f ;
9697// constexpr int pichargedPDG = 211;
@@ -162,6 +163,10 @@ struct He3HadCandidate {
162163 float etaHadMC = -99 .f;
163164 float phiHadMC = -99 .f;
164165
166+ bool isHe3Primary = false ;
167+ bool isHadPrimary = false ;
168+ bool isMotherLi4 = false ;
169+
165170 // collision information
166171 int32_t collisionID = 0 ;
167172};
@@ -638,17 +643,26 @@ struct he3HadronFemto {
638643 }
639644
640645 template <typename Mc>
641- void fillCandidateInfoMC (const Mc& mctrackHe3, const Mc& mctrackHad, const Mc& mctrackMother, He3HadCandidate& he3Hadcand)
646+ void fillCandidateInfoMC (const Mc& mctrackHe3, const Mc& mctrackHad, He3HadCandidate& he3Hadcand)
642647 {
648+ LOG (info) << " --------------------------Filling candidate info MC" ;
643649 he3Hadcand.momHe3MC = mctrackHe3.pt () * (mctrackHe3.pdgCode () > 0 ? 1 : -1 );
644650 he3Hadcand.etaHe3MC = mctrackHe3.eta ();
645651 he3Hadcand.phiHe3MC = mctrackHe3.phi ();
646652 he3Hadcand.momHadMC = mctrackHad.pt () * (mctrackHad.pdgCode () > 0 ? 1 : -1 );
647653 he3Hadcand.etaHadMC = mctrackHad.eta ();
648654 he3Hadcand.phiHadMC = mctrackHad.phi ();
655+ he3Hadcand.isHe3Primary = mctrackHe3.isPhysicalPrimary ();
656+ he3Hadcand.isHadPrimary = mctrackHad.isPhysicalPrimary ();
657+ }
658+
659+ template <typename Mc>
660+ void fillMotherInfoMC (const Mc& mctrackHe3, const Mc& mctrackHad, const Mc& mctrackMother, He3HadCandidate& he3Hadcand)
661+ {
649662 he3Hadcand.l4PtMC = mctrackMother.pt () * (mctrackMother.pdgCode () > 0 ? 1 : -1 );
650663 const double eLit = mctrackHe3.e () + mctrackHad.e ();
651664 he3Hadcand.l4MassMC = std::sqrt (eLit * eLit - mctrackMother.p () * mctrackMother.p ());
665+ he3Hadcand.isMotherLi4 = std::abs (mctrackMother.pdgCode ()) == Li4PDG;
652666 }
653667
654668 template <typename Ttrack>
@@ -763,7 +777,10 @@ struct he3HadronFemto {
763777 he3Hadcand.etaHadMC ,
764778 he3Hadcand.phiHadMC ,
765779 he3Hadcand.l4PtMC ,
766- he3Hadcand.l4MassMC );
780+ he3Hadcand.l4MassMC ,
781+ he3Hadcand.isMotherLi4 ,
782+ he3Hadcand.isHe3Primary ,
783+ he3Hadcand.isHadPrimary );
767784 }
768785 if (settingFillMultiplicity) {
769786 outputMultiplicityTable (
@@ -836,7 +853,8 @@ struct he3HadronFemto {
836853 }
837854 if (daughtHe3 && daughtHad) {
838855 He3HadCandidate he3Hadcand;
839- fillCandidateInfoMC (mcHe3, mcHad, mcParticle, he3Hadcand);
856+ fillCandidateInfoMC (mcHe3, mcHad, he3Hadcand);
857+ fillMotherInfoMC (mcHe3, mcHad, mcParticle, he3Hadcand);
840858 auto collision = collisions.rawIteratorAt (he3Hadcand.collisionID );
841859 fillTable (he3Hadcand, collision, /* isMC*/ true );
842860 }
@@ -945,7 +963,8 @@ struct he3HadronFemto {
945963 if (!fillCandidateInfo (heTrack, prTrack, collBracket, collisions, he3Hadcand, tracks, /* mix*/ false )) {
946964 continue ;
947965 }
948- fillCandidateInfoMC (mctrackHe3, mctrackHad, mothertrack, he3Hadcand);
966+ fillCandidateInfoMC (mctrackHe3, mctrackHad, he3Hadcand);
967+ fillMotherInfoMC (mctrackHe3, mctrackHad, mothertrack, he3Hadcand);
949968 fillHistograms (he3Hadcand);
950969 auto collision = collisions.rawIteratorAt (he3Hadcand.collisionID );
951970 fillTable (he3Hadcand, collision, /* isMC*/ true );
@@ -959,6 +978,61 @@ struct he3HadronFemto {
959978 }
960979 PROCESS_SWITCH (he3HadronFemto, processMC, " Process MC" , false );
961980
981+ void processPiHe3MC (const CollisionsFullMC& collisions, const aod::BCsWithTimestamps& bcs, const TrackCandidatesMC& tracks, const aod::McParticles& /* mcParticles */ )
982+ {
983+ mGoodCollisions .clear ();
984+ mGoodCollisions .resize (collisions.size (), false );
985+
986+ LOG (info) << " processPiHe3MC begin" ;
987+
988+ for (const auto & collision : collisions) {
989+
990+ mTrackPairs .clear ();
991+
992+ if (!selectCollision</* isMC*/ true >(collision, bcs)) {
993+ continue ;
994+ }
995+
996+ const uint64_t collIdx = collision.globalIndex ();
997+ mGoodCollisions [collIdx] = true ;
998+ auto trackTableThisCollision = tracks.sliceBy (mPerColMC , collIdx);
999+ trackTableThisCollision.bindExternalIndices (&tracks);
1000+
1001+ pairTracksSameEvent (trackTableThisCollision);
1002+
1003+ for (const auto & trackPair : mTrackPairs ) {
1004+
1005+ auto heTrack = tracks.rawIteratorAt (trackPair.tr0Idx );
1006+ auto piTrack = tracks.rawIteratorAt (trackPair.tr1Idx );
1007+ auto collBracket = trackPair.collBracket ;
1008+
1009+ if (!heTrack.has_mcParticle () || !piTrack.has_mcParticle ()) {
1010+ continue ;
1011+ }
1012+
1013+ auto mctrackHe3 = heTrack.mcParticle ();
1014+ auto mctrackHad = piTrack.mcParticle ();
1015+
1016+ if (std::abs (mctrackHe3.pdgCode ()) != He3PDG || std::abs (mctrackHad.pdgCode ()) != PionPDG) {
1017+ continue ;
1018+ }
1019+ LOG (info) << " only pi-He3" ;
1020+
1021+ He3HadCandidate he3Hadcand;
1022+ if (!fillCandidateInfo (heTrack, piTrack, collBracket, collisions, he3Hadcand, tracks, /* mix*/ false )) {
1023+ continue ;
1024+ }
1025+
1026+ fillCandidateInfoMC (mctrackHe3, mctrackHad, he3Hadcand);
1027+ fillHistograms (he3Hadcand);
1028+ LOG (info) << " fillHistograms done" ;
1029+ auto collision = collisions.rawIteratorAt (he3Hadcand.collisionID );
1030+ fillTable (he3Hadcand, collision, /* isMC*/ true );
1031+ }
1032+ }
1033+ }
1034+ PROCESS_SWITCH (he3HadronFemto, processPiHe3MC, " Process pi-He3 MC" , false );
1035+
9621036 void processSameEventPools (const CollisionsFull& collisions, const TrackCandidates& tracks, const aod::AmbiguousTracks& ambiguousTracks, const aod::BCsWithTimestamps& bcs)
9631037 {
9641038 mGoodCollisions .clear ();
@@ -1073,7 +1147,8 @@ struct he3HadronFemto {
10731147 if (!fillCandidateInfo (heTrack, prTrack, collBracket, collisions, he3Hadcand, tracks, /* mix*/ false )) {
10741148 continue ;
10751149 }
1076- fillCandidateInfoMC (mctrackHe3, mctrackHad, mothertrackHe, he3Hadcand);
1150+ fillCandidateInfoMC (mctrackHe3, mctrackHad, he3Hadcand);
1151+ fillMotherInfoMC (mctrackHe3, mctrackHad, mothertrackHe, he3Hadcand);
10771152 fillHistograms (he3Hadcand);
10781153 auto collision = collisions.rawIteratorAt (he3Hadcand.collisionID );
10791154 fillTable (he3Hadcand, collision, /* isMC*/ true );
0 commit comments