@@ -282,14 +282,21 @@ struct UpcRhoAnalysis {
282282 rMC.add (" MC/collisions/hRunNumberVsNumOfCollisionRecos" , " ;number of collision reconstructions;run number;counts" , kTH2D , {{6 , -0.5 , 5.5 }, runNumberAxis});
283283 // tracks
284284 rMC.add (" MC/tracks/all/hPdgCode" , " ;pdg code;counts" , kTH1D , {{2001 , -1000.5 , 1000.5 }});
285+ rMC.add (" MC/tracks/all/hMotherPdgCode" , " ;mother pdg code;counts" , kTH1D , {{2001 , -1000.5 , 1000.5 }});
285286 rMC.add (" MC/tracks/all/hProducedByGenerator" , " ;produced by generator;counts" , kTH1D , {{2 , -0.5 , 1.5 }});
286287 rMC.add (" MC/tracks/all/hIsPhysicalPrimary" , " ;is physical primary;counts" , kTH1D , {{2 , -0.5 , 1.5 }});
287288 rMC.add (" MC/tracks/all/hPt" , " ;#it{p}_{T} (GeV/#it{c});counts" , kTH1D , {ptAxis});
288289 rMC.add (" MC/tracks/all/hEta" , " ;#it{#eta};counts" , kTH1D , {etaAxis});
289290 rMC.add (" MC/tracks/all/hPhi" , " ;#it{#phi};counts" , kTH1D , {phiAxis});
291+ rMC.addClone (" MC/tracks/all/" , " MC/tracks/primaries/" );
292+ rMC.addClone (" MC/tracks/all/" , " MC/tracks/prodByGen/" );
290293 rMC.add (" MC/tracks/hPt" , " ;#it{p}_{T leading} (GeV/#it{c});#it{p}_{T subleading} (GeV/#it{c});counts" , kTH2D , {ptAxis, ptAxis});
291294 rMC.add (" MC/tracks/hEta" , " ;#it{#eta}_{leading};#it{#eta}_{subleading};counts" , kTH2D , {etaAxis, etaAxis});
292295 rMC.add (" MC/tracks/hPhi" , " ;#it{#phi}_{leading};#it{#phi}_{subleading};counts" , kTH2D , {phiAxis, phiAxis});
296+ // resolution
297+ rMC.add (" MC/resolution/tracks/hPt" , " ;#it{p}_{T, reco} - #it{p}_{T, true} (GeV/#it{c});counts" , kTH1D , {{200 , -1.0 , 1.0 }});
298+ rMC.add (" MC/resolution/tracks/hEta" , " ;#it{#eta}_{reco} - #it{#eta}_{true};counts" , kTH1D , {{200 , -0.2 , 0.2 }});
299+ rMC.add (" MC/resolution/tracks/hPhi" , " ;#it{#phi}_{reco} - #it{#phi}_{true} (rad);counts" , kTH1D , {{200 , -0.2 , 0.2 }});
293300 // system
294301 rMC.add (" MC/system/hM" , " ;#it{m} (GeV/#it{c}^{2});counts" , kTH1D , {mAxis });
295302 rMC.add (" MC/system/hPt" , " ;#it{p}_{T} (GeV/#it{c});counts" , kTH1D , {ptAxis});
@@ -817,18 +824,41 @@ struct UpcRhoAnalysis {
817824 rMC.fill (HIST (" MC/tracks/all/hPt" ), pt (mcParticle.px (), mcParticle.py ()));
818825 rMC.fill (HIST (" MC/tracks/all/hEta" ), eta (mcParticle.px (), mcParticle.py (), mcParticle.pz ()));
819826 rMC.fill (HIST (" MC/tracks/all/hPhi" ), phi (mcParticle.px (), mcParticle.py ()));
820- if (!mcParticle.isPhysicalPrimary () || std::abs (mcParticle.pdgCode ()) != kPiPlus )
821- continue ;
822- cutMcParticles.push_back (mcParticle);
823- ROOT::Math::PxPyPzMVector pionLV;
824- pionLV.SetPxPyPzE (mcParticle.px (), mcParticle.py (), mcParticle.pz (), mcParticle.e ());
825- mcParticlesLVs.push_back (pionLV);
827+ if (mcParticle.producedByGenerator ()) {
828+ rMC.fill (HIST (" MC/tracks/prodByGen/hPdgCode" ), mcParticle.pdgCode ());
829+ rMC.fill (HIST (" MC/tracks/prodByGen/hProducedByGenerator" ), mcParticle.producedByGenerator ());
830+ rMC.fill (HIST (" MC/tracks/prodByGen/hIsPhysicalPrimary" ), mcParticle.isPhysicalPrimary ());
831+ rMC.fill (HIST (" MC/tracks/prodByGen/hPt" ), pt (mcParticle.px (), mcParticle.py ()));
832+ rMC.fill (HIST (" MC/tracks/prodByGen/hEta" ), eta (mcParticle.px (), mcParticle.py (), mcParticle.pz ()));
833+ rMC.fill (HIST (" MC/tracks/prodByGen/hPhi" ), phi (mcParticle.px (), mcParticle.py ()));
834+ }
835+ if (mcParticle.isPhysicalPrimary ()) {
836+ rMC.fill (HIST (" MC/tracks/primaries/hPdgCode" ), mcParticle.pdgCode ());
837+ rMC.fill (HIST (" MC/tracks/primaries/hProducedByGenerator" ), mcParticle.producedByGenerator ());
838+ rMC.fill (HIST (" MC/tracks/primaries/hIsPhysicalPrimary" ), mcParticle.isPhysicalPrimary ());
839+ rMC.fill (HIST (" MC/tracks/primaries/hPt" ), pt (mcParticle.px (), mcParticle.py ()));
840+ rMC.fill (HIST (" MC/tracks/primaries/hEta" ), eta (mcParticle.px (), mcParticle.py (), mcParticle.pz ()));
841+ rMC.fill (HIST (" MC/tracks/primaries/hPhi" ), phi (mcParticle.px (), mcParticle.py ()));
842+ }
843+ if (mcParticle.has_daughters ()) {
844+ rMC.fill (HIST (" MC/tracks/all/hMotherPdgCode" ), mcParticle.pdgCode ());
845+ if (mcParticle.pdgCode () != kRho770_0 )
846+ continue ; // consider only rho0s
847+ for (const auto & daughter : mcParticle.template daughters_as <T>()) {
848+ if (!daughter.isPhysicalPrimary () || std::abs (daughter.pdgCode ()) != kPiPlus )
849+ continue ;
850+ cutMcParticles.push_back (daughter);
851+ ROOT::Math::PxPyPzMVector pionLV;
852+ pionLV.SetPxPyPzE (daughter.px (), daughter.py (), daughter.pz (), daughter.e ());
853+ mcParticlesLVs.push_back (pionLV);
854+ }
855+ }
826856 }
827857 rMC.fill (HIST (" MC/collisions/hNPions" ), cutMcParticles.size ());
828858
829859 if (static_cast <int >(cutMcParticles.size ()) != numPions)
830860 return ;
831- if (mcParticlesLVs.size () != cutMcParticles.size ())
861+ if (mcParticlesLVs.size () != cutMcParticles.size ()) // sanity check
832862 return ;
833863 if (tracksTotalChargeMC (cutMcParticles) != 0 ) // shouldn't happen in theory
834864 return ;
0 commit comments