@@ -344,7 +344,6 @@ struct Chargedkstaranalysis {
344344 AxisSpec thnAxisPhi = {axisCfgs.configThnAxisPhi , " Configurabel phi axis" }; // 0 to 2pi
345345 // THnSparse
346346 AxisSpec mcLabelAxis = {5 , -0.5 , 4.5 , " MC Label" };
347-
348347 if (!doprocessMC) {
349348 histos.add (" hEvtSelInfo" , " hEvtSelInfo" , kTH1F , {{5 , 0 , 5.0 }});
350349 auto hCutFlow = histos.get <TH1>(HIST (" hEvtSelInfo" ));
@@ -403,7 +402,6 @@ struct Chargedkstaranalysis {
403402
404403 histos.add (" QA/before/CentDist" , " Centrality distribution" , {HistType::kTH1D , {centAxis}});
405404 histos.add (" QA/before/CentDist1" , " Centrality distribution" , HistType::kTH1F , {{110 , 0 , 110 }});
406-
407405 histos.add (" QA/trkbpionTPCPIDME" , " TPC PID of bachelor pion candidates" , HistType::kTH2D , {ptAxisQA, pidQAAxis});
408406
409407 // Bachelor pion
@@ -744,88 +742,7 @@ struct Chargedkstaranalysis {
744742
745743 return returnFlag;
746744 }
747- template <typename TrackTemplate, typename V0Template>
748- bool isTrueKstar (const TrackTemplate& bTrack, const V0Template& K0scand)
749- {
750- if (std::abs (bTrack.PDGCode ()) != kPiPlus ) // Are you pion?
751- return false ;
752- if (std::abs (K0scand.PDGCode ()) != kPDGK0s ) // Are you K0s?
753- return false ;
754-
755- auto motherbTrack = bTrack.template mothers_as <aod::McParticles>();
756- auto motherkV0 = K0scand.template mothers_as <aod::McParticles>();
757-
758- // Check bTrack first
759- if (std::abs (motherbTrack.pdgCode ()) != kKstarPlus ) // Are you charged Kstar's daughter?
760- return false ; // Apply first since it's more restrictive
761-
762- if (std::abs (motherkV0.pdgCode ()) != kPDGK0 ) // Is it K0s?
763- return false ;
764- // Check if K0s's mother is K0 (311)
765- auto motherK0 = motherkV0.template mothers_as <aod::McParticles>();
766- if (std::abs (motherK0.pdgCode ()) != kPDGK0 )
767- return false ;
768-
769- // Check if K0's mother is Kstar (323)
770- auto motherKstar = motherK0.template mothers_as <aod::McParticles>();
771- if (std::abs (motherKstar.pdgCode ()) != kKstarPlus )
772- return false ;
773-
774- // Check if bTrack and K0 have the same mother (global index)
775- if (motherbTrack.globalIndex () != motherK0.globalIndex ())
776- return false ;
777-
778- return true ;
779- }
780-
781745 int count = 0 ;
782- template <typename V0T, typename TrkT>
783- bool matchRecoToTruthKstar (V0T const & v0, TrkT const & trk)
784- {
785- if (!v0.has_mcParticle () || !trk.has_mcParticle ())
786- return false ;
787-
788- auto mcK0s = v0.template mcParticle_as <MCTrueTrackCandidates>();
789- auto mcPi = trk.template mcParticle_as <MCTrueTrackCandidates>();
790-
791- if (std::abs (mcK0s.pdgCode ()) != kPDGK0s )
792- return false ;
793- if (std::abs (mcPi.pdgCode ()) != kPiPlus )
794- return false ;
795-
796- MCTrueTrackCandidates::iterator kstarFromPi;
797- bool havePiKstar = false ;
798- for (const auto & m1 : mcPi.template mothers_as <MCTrueTrackCandidates>()) {
799- if (std::abs (m1.pdgCode ()) == kKstarPlus ) {
800- kstarFromPi = m1;
801- havePiKstar = true ;
802- break ;
803- }
804- }
805- if (!havePiKstar) {
806- return false ;
807- }
808-
809- bool shareSameKstar = false ;
810- for (const auto & m1 : mcK0s.template mothers_as <MCTrueTrackCandidates>()) {
811- if (std::abs (m1.pdgCode ()) == kPDGK0 ) {
812- for (const auto & m2 : m1.template mothers_as <MCTrueTrackCandidates>()) {
813- if (m2.globalIndex () == kstarFromPi.globalIndex ()) {
814- shareSameKstar = true ;
815- break ;
816- }
817- }
818- if (shareSameKstar)
819- break ;
820- }
821- }
822- if (!shareSameKstar) {
823- return false ;
824- }
825-
826- return true ;
827- } // matchRecoToTruthKstar
828-
829746 template <typename T>
830747 void fillKstarHist (bool isRot, float multiplicity, const T& mother, double cosTheta)
831748 {
@@ -1313,7 +1230,6 @@ struct Chargedkstaranalysis {
13131230 histos.fill (HIST (" QA/MC/QACent_woCut" ), lCentrality);
13141231 histos.fill (HIST (" QA/MC/QAvtxz_woCut" ), coll.posZ ());
13151232 }
1316-
13171233 if (!colCuts.isSelected (coll))
13181234 continue ;
13191235 if (rctCut.requireRCTFlagChecker && !rctCut.rctChecker (coll))
@@ -1408,9 +1324,7 @@ struct Chargedkstaranalysis {
14081324
14091325 if (!coll.has_mcCollision ())
14101326 continue ;
1411-
14121327 const auto mcid = coll.mcCollisionId ();
1413-
14141328 if (allowedMcIds.count (mcid) == 0 )
14151329 continue ; // To check the event is allowed or not
14161330
@@ -1427,7 +1341,6 @@ struct Chargedkstaranalysis {
14271341 }
14281342 if (!selectionK0s (coll, v0))
14291343 continue ;
1430-
14311344 auto trks = tracks.sliceBy (perCollision, v0.collisionId ()); // Grouping the tracks with the v0s, means only those tracks that belong to the same collision as v0
14321345 for (const auto & bTrack : trks) {
14331346 if (bTrack.collisionId () != v0.collisionId ())
@@ -1436,7 +1349,6 @@ struct Chargedkstaranalysis {
14361349 continue ;
14371350 if (!selectionPIDPion (bTrack))
14381351 continue ;
1439-
14401352 LorentzVectorSetXYZM lResoSecondary, lDecayDaughter_bach, lResoKstar, lDaughterRot;
14411353
14421354 lResoSecondary = LorentzVectorSetXYZM (v0.px (), v0.py (), v0.pz (), MassK0Short);
@@ -1447,7 +1359,6 @@ struct Chargedkstaranalysis {
14471359 const double yreco = lResoKstar.Rapidity ();
14481360 if (std::abs (yreco) > kstarCutCfgs.cKstarMaxRap )
14491361 continue ;
1450-
14511362 // Since we are doing the MC study and we know about the PDG code of each particle let's try to check the things which we have
14521363 if (!v0.has_mcParticle () || !bTrack.has_mcParticle ())
14531364 continue ;
@@ -1470,6 +1381,24 @@ struct Chargedkstaranalysis {
14701381 if (!havePiKstar) {
14711382 continue ;
14721383 }
1384+ // Loops over all the mother's of K0s and check if this K0s comming from a kstar and also share the smae mother as of the pion
1385+ bool shareSameKstar = false ;
1386+ for (const auto & m1 : mcK0s.template mothers_as <MCTrueTrackCandidates>()) {
1387+ if (std::abs (m1.pdgCode ()) == kPDGK0 ) {
1388+ for (const auto & m2 : m1.template mothers_as <MCTrueTrackCandidates>()) {
1389+ if (m2.globalIndex () == kstarFromPi.globalIndex ()) {
1390+ shareSameKstar = true ;
1391+ break ;
1392+ }
1393+ }
1394+ if (shareSameKstar)
1395+ break ;
1396+ }
1397+ }
1398+ if (!shareSameKstar) {
1399+ continue ;
1400+ }
1401+
14731402 histos.fill (HIST (" EffKstar/recoKstar" ), ptreco, lCentrality);
14741403 if (helicityCfgs.cBoostKShot ) {
14751404 fillInvMass (lResoKstar, lCentrality, lResoSecondary, lDecayDaughter_bach, eventCutCfgs.confIsMix );
0 commit comments