@@ -99,6 +99,7 @@ struct Chargedkstaranalysis {
9999 Preslice<aod::McParticles> perMCCollision = o2::aod::mcparticle::mcCollisionId;
100100 bool currentIsGen = false ;
101101 bool mcClosure = false ;
102+ bool sigLossDen = false ;
102103 struct : ConfigurableGroup {
103104 ConfigurableAxis cfgvtxbins{" cfgvtxbins" , {VARIABLE_WIDTH , -10 .0f , -8 .f , -6 .f , -4 .f , -2 .f , 0 .f , 2 .f , 4 .f , 6 .f , 8 .f , 10 .f }, " Mixing bins - z-vertex" };
104105 ConfigurableAxis cfgmultbins{" cfgmultbins" , {VARIABLE_WIDTH , 0 ., 1 ., 5 ., 10 ., 30 ., 50 ., 70 ., 100 ., 110 .}, " Mixing bins - multiplicity" };
@@ -603,6 +604,8 @@ struct Chargedkstaranalysis {
603604 histos.add (" Correction/sigLoss_num_pri" , " Gen primary Kstar (|y|<0.5, selected events) in reco class" , HistType::kTH2F , {ptAxis, centAxis});
604605 histos.add (" Correction/EF_den" , " Gen events (truth class)" , HistType::kTH1F , {centAxis});
605606 histos.add (" Correction/EF_num" , " Reco events (selected events)" , HistType::kTH1F , {centAxis});
607+ histos.add (" sigLoss_den_pri_threeD" , " sigLoss_den_pri_threeD" , kTHnSparseF , {centAxis, ptAxis, thnAxisPOL}, true );
608+ histos.add (" sigLoss_den_pri_threeD_rot" , " sigLoss_den_pri_threeD_rot" , kTHnSparseF , {centAxis, ptAxis, thnAxisPOL}, true );
606609 histos.add (" Correction/hNEventsMCTruth" , " hNEventsMCTruth" , HistType::kTH1F , {AxisSpec{nSteps, 0.5 , nSteps + 0.5 , " " }});
607610 auto hstep = histos.get <TH1 >(HIST (" Correction/hNEventsMCTruth" ));
608611 hstep->GetXaxis ()->SetBinLabel (1 , " All" );
@@ -844,10 +847,20 @@ struct Chargedkstaranalysis {
844847
845848 // 2. MC Generated Path
846849 if (currentIsGen) {
847- if (isRot) {
848- histosMc.fill (HIST (" h3ChaKstarInvMassRotMcGen" ), multiplicity, mother.Pt (), mother.M (), cosTheta);
850+ if (sigLossDen) {
851+ // Fill ONLY the Signal Loss Denominator 3D Histograms
852+ if (isRot) {
853+ histos.fill (HIST (" sigLoss_den_pri_threeD_rot" ), multiplicity, mother.Pt (), cosTheta);
854+ } else {
855+ histos.fill (HIST (" sigLoss_den_pri_threeD" ), multiplicity, mother.Pt (), cosTheta);
856+ }
849857 } else {
850- histosMc.fill (HIST (" h3ChaKstarInvMassDSMcGen" ), multiplicity, mother.Pt (), mother.M (), cosTheta);
858+ // Fill standard 4D MC Gen Histograms
859+ if (isRot) {
860+ histosMc.fill (HIST (" h3ChaKstarInvMassRotMcGen" ), multiplicity, mother.Pt (), mother.M (), cosTheta);
861+ } else {
862+ histosMc.fill (HIST (" h3ChaKstarInvMassDSMcGen" ), multiplicity, mother.Pt (), mother.M (), cosTheta);
863+ }
851864 }
852865 return ;
853866 }
@@ -867,7 +880,6 @@ struct Chargedkstaranalysis {
867880 }
868881 }
869882 }
870-
871883 template <typename T>
872884 void fillInvMass (const T& mother, float multiplicity, const T& daughter1, const T& daughter2, bool isMix)
873885 {
@@ -1691,6 +1703,7 @@ struct Chargedkstaranalysis {
16911703 histos.fill (HIST (" Correction/sigLoss_num_pri" ), part.pt (), lCentrality);
16921704 }
16931705 }
1706+ sigLossDen = true ;
16941707 // To calculate the denominator -> To check the all the events have chk892
16951708 for (auto const & part : mcParticles) {
16961709 if (!part.has_mcCollision ()) {
@@ -1719,6 +1732,68 @@ struct Chargedkstaranalysis {
17191732 if (part.vt () == 0 ) {
17201733 histos.fill (HIST (" Correction/sigLoss_den_pri" ), part.pt (), lCentrality);
17211734 }
1735+ LorentzVectorSetXYZM lResoSecondary, lDecayDaughter_bach, lResoKstar, lDaughterRot;
1736+ lResoKstar = LorentzVectorSetXYZM (part.px (), part.py (), part.pz (), MassKPlusStar892);
1737+ const int pionWanted = (part.pdgCode () > 0 ) ? +kPiPlus : -kPiPlus ;
1738+ bool hasRightPion = false ;
1739+ bool hasK0sToPipi = false ;
1740+ for (const auto & d1 : part.template daughters_as <aod::McParticles>()) {
1741+ const int pdg1 = d1.pdgCode ();
1742+ if (pdg1 == pionWanted) {
1743+ lDecayDaughter_bach = LorentzVectorSetXYZM (d1.px (), d1.py (), d1.pz (), MassPionCharged);
1744+ if (helicityCfgs.genKinematicsChecks ) {
1745+ if (lDecayDaughter_bach.pt () <= trackCutCfgs.cMinPtcut || std::abs (lDecayDaughter_bach.eta ()) >= trackCutCfgs.cMaxEtacut ) {
1746+ continue ;
1747+ }
1748+ }
1749+ hasRightPion = true ;
1750+ } else if (std::abs (pdg1) == kPDGK0 ) {
1751+ for (const auto & d2 : d1.template daughters_as <aod::McParticles>()) {
1752+ if (std::abs (d2.pdgCode ()) == kPDGK0s ) {
1753+ if (helicityCfgs.genKinematicsChecks ) {
1754+ if (d2.pt () <= secondaryCutsCfgs.cSecondaryPtMin || std::abs (d2.eta ()) >= secondaryCutsCfgs.cSecondaryRapidityMax ) {
1755+ continue ;
1756+ }
1757+ }
1758+ bool seenPip = false , seenPim = false ;
1759+ for (const auto & d3 : d2.template daughters_as <aod::McParticles>()) {
1760+ if (d3.pdgCode () == +kPiPlus ) {
1761+ if (helicityCfgs.genKinematicsChecks ) {
1762+ if (d3.pt () <= trackCutCfgs.cMinPtcut || std::abs (d3.eta ()) >= trackCutCfgs.cMaxEtacut ) {
1763+ continue ;
1764+ }
1765+ }
1766+ seenPip = true ;
1767+ } else if (d3.pdgCode () == -kPiPlus ) {
1768+ if (helicityCfgs.genKinematicsChecks ) {
1769+ if (d3.pt () <= trackCutCfgs.cMinPtcut || std::abs (d3.eta ()) >= trackCutCfgs.cMaxEtacut ) {
1770+ continue ;
1771+ }
1772+ }
1773+ seenPim = true ;
1774+ }
1775+ }
1776+ if (seenPip && seenPim) {
1777+ lResoSecondary = LorentzVectorSetXYZM (d2.px (), d2.py (), d2.pz (), MassK0Short);
1778+ hasK0sToPipi = true ;
1779+ break ;
1780+ }
1781+ }
1782+ }
1783+ }
1784+ if (hasRightPion && hasK0sToPipi) {
1785+ break ;
1786+ }
1787+ }
1788+
1789+ if (!(hasRightPion && hasK0sToPipi)) {
1790+ continue ;
1791+ }
1792+ if (helicityCfgs.cCosWithKShot ) {
1793+ fillInvMass (lResoKstar, lCentrality, lResoSecondary, lDecayDaughter_bach, eventCutCfgs.confIsMix );
1794+ } else {
1795+ fillInvMass (lResoKstar, lCentrality, lDecayDaughter_bach, lResoSecondary, eventCutCfgs.confIsMix );
1796+ }
17221797 }
17231798 // To calculate the event fraction correction
17241799 for (const auto & mcid : refClassIds) {
0 commit comments