@@ -383,11 +383,9 @@ struct k892hadronphoton {
383383 histos.add (histodir + " /MC/KStar/hDCAPairDauVsPt" , " hDCAPairDauVsPt" , kTH2D , {axisDCAdau, axisPt});
384384
385385 // 1/pT Resolution:
386- if (fillResoQAhistos && histodir == " BeforeSel" ) {
387-
386+ if (fillResoQAhistos) {
388387 histos.add (histodir + " /MC/Reso/h2dKShortPtResolution" , " h2dKShortPtResolution" , kTH2D , {axisInvPt, axisDeltaPt});
389- histos.add (histodir + " /MC/Reso/h3dKShortPtResoVsTPCCR" , " h3dKShortPtResoVsTPCCR" , kTH3D , {axisInvPt, axisDeltaPt, axisTPCrows});
390- histos.add (histodir + " /MC/Reso/h3dKShortPtResoVsTPCCR" , " h3dKShortPtResoVsTPCCR" , kTH3D , {axisInvPt, axisDeltaPt, axisTPCrows});
388+ histos.add (histodir + " /MC/Reso/h2dGammaPtResolution" , " h2dGammaPtResolution" , kTH2D , {axisInvPt, axisDeltaPt});
391389 histos.add (histodir + " /MC/Reso/h2dKStarPtResolution" , " h2dKStarPtResolution" , kTH2D , {axisInvPt, axisDeltaPt});
392390 histos.add (histodir + " /MC/Reso/h2dKStarRadiusResolution" , " h2dKStarRadiusResolution" , kTH2D , {axisPt, axisDeltaPt});
393391 }
@@ -396,10 +394,16 @@ struct k892hadronphoton {
396394 if (fillBkgQAhistos) {
397395 histos.add (histodir + " /MC/BkgStudy/h2dPtVsMassKStar_All" , " h2dPtVsMassKStar_All" , kTH2D , {axisPt, axisKStarMass});
398396 histos.add (histodir + " /MC/BkgStudy/h2dPtVsMassKStar_TrueDaughters" , " h2dPtVsMassKStar_TrueDaughters" , kTH2D , {axisPt, axisKStarMass});
399- histos.add (histodir + " /MC/BkgStudy/h2dTrueDaughtersMatrix" , " h2dTrueDaughtersMatrix" , kTHnSparseD , {{10001 , -5000 .5f , +5000 .5f }, {10001 , -5000 .5f , +5000 .5f }});
397+ histos.add (histodir + " /MC/BkgStudy/h2dPtVsMassKStar_PhotonOmega" , " h2dPtVsMassKStar_PhotonOmega" , kTH2D , {axisPt, axisKStarMass});
398+ histos.add (histodir + " /MC/BkgStudy/h2dPtVsMassKStar_PhotonRho" , " h2dPtVsMassKStar_PhotonRho" , kTH2D , {axisPt, axisKStarMass});
399+ histos.add (histodir + " /MC/BkgStudy/h2dPtVsMassKStar_PhotonEta" , " h2dPtVsMassKStar_PhotonEta" , kTH2D , {axisPt, axisKStarMass});
400+ histos.add (histodir + " /MC/BkgStudy/h2dPtVsMassKStar_KShortKCharged" , " h2dPtVsMassKStar_KShortKCharged" , kTH2D , {axisPt, axisKStarMass});
401+ histos.add (histodir + " /MC/BkgStudy/h2dPtVsMassKStar_KStarPionKaon" , " h2dPtVsMassKStar_KStarPionKaon" , kTH2D , {axisPt, axisKStarMass});
400402 histos.add (histodir + " /MC/BkgStudy/h2dPtVsMassKStar_TrueGammaFakeKShort" , " h2dPtVsMassKStar_TrueGammaFakeKShort" , kTH2D , {axisPt, axisKStarMass});
401403 histos.add (histodir + " /MC/BkgStudy/h2dPtVsMassKStar_FakeGammaTrueKShort" , " h2dPtVsMassKStar_FakeGammaTrueKShort" , kTH2D , {axisPt, axisKStarMass});
402404 histos.add (histodir + " /MC/BkgStudy/h2dPtVsMassKStar_FakeDaughters" , " h2dPtVsMassKStar_FakeDaughters" , kTH2D , {axisPt, axisKStarMass});
405+ histos.add (histodir + " /MC/BkgStudy/h2dTrueDaughtersMatrix" , " h2dTrueDaughtersMatrix" , kTHnSparseD , {{10001 , -5000 .5f , +5000 .5f }, {10001 , -5000 .5f , +5000 .5f }});
406+ histos.add (histodir + " /MC/BkgStudy/h2dTrueDaughtersMatrixGrandMother" , " h2dTrueDaughtersMatrixGrandMother" , kTHnSparseD , {{10001 , -5000 .5f , +5000 .5f }, {10001 , -5000 .5f , +5000 .5f }});
403407 }
404408 }
405409 }
@@ -761,36 +765,36 @@ struct k892hadronphoton {
761765 return trkCode;
762766 }
763767
764- template <typename TKStarObject>
768+ template <int mode, typename TKStarObject>
765769 void getResolution (TKStarObject const & kstar)
766770 {
771+ // Check whether it is before or after selections
772+ static constexpr std::string_view MainDir[] = {" BeforeSel" , " AfterSel" };
767773
768774 // _______________________________________
769775 // Gamma MC association
770776 if (std::abs (kstar.photonPDGCode ()) == PDG_t::kGamma ) {
771777 if (kstar.photonmcpt () > 0 ) {
772- histos.fill (HIST (" BeforeSel/MC/Reso/h3dGammaPtResoVsTPCCR" ), 1 .f / kstar.kshortmcpt (), 1 .f / kstar.kshortPt () - 1 .f / kstar.kshortmcpt (), -1 * kstar.photonNegTPCCrossedRows ()); // 1/pT resolution
773- histos.fill (HIST (" BeforeSel/MC/Reso/h3dGammaPtResoVsTPCCR" ), 1 .f / kstar.kshortmcpt (), 1 .f / kstar.kshortPt () - 1 .f / kstar.kshortmcpt (), kstar.photonPosTPCCrossedRows ()); // 1/pT resolution
774- histos.fill (HIST (" BeforeSel/MC/Reso/h2dGammaPtResolution" ), 1 .f / kstar.photonmcpt (), 1 .f / kstar.photonPt () - 1 .f / kstar.photonmcpt ()); // pT resolution
778+ // histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dGammaPtResolution"), 1.f / kstar.photonmcpt(), kstar.photonPt() - kstar.photonmcpt());
779+ histos.fill (HIST (MainDir[mode]) + HIST (" /MC/Reso/h2dGammaPtResolution" ), 1 .f / kstar.photonmcpt (), (kstar.photonPt () - kstar.photonmcpt ()) / kstar.photonmcpt ());
775780 }
776781 }
777782
778783 // _______________________________________
779784 // KShort MC association
780785 if (std::abs (kstar.kshortPDGCode ()) == PDG_t::kK0Short ) {
781786 if (kstar.kshortmcpt () > 0 ) {
782- histos.fill (HIST (" BeforeSel/MC/Reso/h2dKShortPtResolution" ), 1 .f / kstar.kshortmcpt (), 1 .f / kstar.kshortPt () - 1 .f / kstar.kshortmcpt ()); // 1/pT resolution
783- histos.fill (HIST (" BeforeSel/MC/Reso/h3dKShortPtResoVsTPCCR" ), 1 .f / kstar.kshortmcpt (), 1 .f / kstar.kshortPt () - 1 .f / kstar.kshortmcpt (), -1 * kstar.kshortNegTPCCrossedRows ()); // 1/pT resolution
784- histos.fill (HIST (" BeforeSel/MC/Reso/h3dKShortPtResoVsTPCCR" ), 1 .f / kstar.kshortmcpt (), 1 .f / kstar.kshortPt () - 1 .f / kstar.kshortmcpt (), kstar.kshortPosTPCCrossedRows ()); // 1/pT resolution
787+ // histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dKShortPtResolution"), 1.f / kstar.kshortmcpt(), kstar.kshortPt() - kstar.kshortmcpt());
788+ histos.fill (HIST (MainDir[mode]) + HIST (" /MC/Reso/h2dKShortPtResolution" ), 1 .f / kstar.kshortmcpt (), (kstar.kshortPt () - kstar.kshortmcpt ()) / kstar.kshortmcpt ());
785789 }
786790 }
787791
788792 // _______________________________________
789793 // KStar MC association
790794 if (kstar.isKStar ()) {
791- histos.fill (HIST (" BeforeSel /MC/Reso/h2dKStarRadiusResolution" ), kstar.mcpt (), kstar.radius () - kstar.mcradius ()); // pT resolution
795+ histos.fill (HIST (MainDir[mode]) + HIST ( " /MC/Reso/h2dKStarRadiusResolution" ), kstar.mcpt (), kstar.radius () - kstar.mcradius ()); // pT resolution
792796 if (kstar.mcpt () > 0 )
793- histos.fill (HIST (" BeforeSel /MC/Reso/h2dKStarPtResolution" ), 1 .f / kstar.mcpt (), 1 .f / kstar.pt () - 1 .f / kstar.mcpt ()); // pT resolution
797+ histos.fill (HIST (MainDir[mode]) + HIST ( " /MC/Reso/h2dKStarPtResolution" ), 1 .f / kstar.mcpt (), ( 1 .f / kstar.pt () - 1 .f / kstar.mcpt ()) / ( 1 . f / kstar. mcpt () )); // pT resolution
794798 }
795799 }
796800
@@ -804,18 +808,40 @@ struct k892hadronphoton {
804808 bool fIsKStar = kstar.isKStar ();
805809 int photonPDGCode = kstar.photonPDGCode ();
806810 int photonPDGCodeMother = kstar.photonPDGCodeMother ();
811+ int photonPDGCodeGrandMother = kstar.photonPDGCodeGrandMother ();
812+ int photonGlobalIndexGrandMother = kstar.photonGlobalIndexGrandMother ();
807813 int kshortPDGCode = kstar.kshortPDGCode ();
808814 int kshortPDGCodeMother = kstar.kshortPDGCodeMother ();
815+ int kshortPDGCodeGrandMother = kstar.kshortPDGCodeGrandMother ();
816+ int kshortGlobalIndexGrandMother = kstar.kshortGlobalIndexGrandMother ();
809817 float kstarpT = kstar.pt ();
810818 float kstarMass = kstar.kstarMass ();
811819
812820 histos.fill (HIST (MainDir[mode]) + HIST (" /MC/BkgStudy/h2dPtVsMassKStar_All" ), kstarpT, kstarMass);
813821
814822 // _______________________________________
815- // Real Gamma x Real KShort - but not from the same kstar!
816- if ((!fIsKStar )) { // (std::abs(photonPDGCode) == PDG_t::kGamma) && (std::abs(KShortPDGCode ) == PDG_t::kK0Short) &&
823+ // Real Gamma x Real KShort - but not direct decays from the same kstar!
824+ if ((!fIsKStar ) && (std::abs (photonPDGCode) == PDG_t::kGamma ) && (std::abs (kshortPDGCode ) == PDG_t::kK0Short )) {
817825 histos.fill (HIST (MainDir[mode]) + HIST (" /MC/BkgStudy/h2dPtVsMassKStar_TrueDaughters" ), kstarpT, kstarMass);
818826 histos.fill (HIST (MainDir[mode]) + HIST (" /MC/BkgStudy/h2dTrueDaughtersMatrix" ), kshortPDGCodeMother, photonPDGCodeMother);
827+ histos.fill (HIST (MainDir[mode]) + HIST (" /MC/BkgStudy/h2dTrueDaughtersMatrixGrandMother" ), kshortPDGCodeGrandMother, photonPDGCodeGrandMother);
828+
829+ // coming from the same kstar (coupled), but via a different decay channel (K* -> K0 pi0 -> K0s gamma)
830+ if (std::abs (kshortPDGCodeGrandMother) == o2::constants::physics::Pdg::kK0Star892 && std::abs (photonPDGCodeGrandMother) == o2::constants::physics::Pdg::kK0Star892 && (photonGlobalIndexGrandMother == kshortGlobalIndexGrandMother)) // K*(892)0
831+ histos.fill (HIST (MainDir[mode]) + HIST (" /MC/BkgStudy/h2dPtVsMassKStar_KStarPionKaon" ), kstarpT, kstarMass);
832+
833+ // Break down of different photon / kshort sources
834+ if (std::abs (photonPDGCodeGrandMother) == o2::constants::physics::Pdg::kOmega ) // omega(782)
835+ histos.fill (HIST (MainDir[mode]) + HIST (" /MC/BkgStudy/h2dPtVsMassKStar_PhotonOmega" ), kstarpT, kstarMass);
836+
837+ if (std::abs (photonPDGCodeGrandMother) == PDG_t::kRho770Plus ) // rho+-(770)
838+ histos.fill (HIST (MainDir[mode]) + HIST (" /MC/BkgStudy/h2dPtVsMassKStar_PhotonRho" ), kstarpT, kstarMass);
839+
840+ if (std::abs (photonPDGCodeMother) == o2::constants::physics::Pdg::kEta ) // eta
841+ histos.fill (HIST (MainDir[mode]) + HIST (" /MC/BkgStudy/h2dPtVsMassKStar_PhotonEta" ), kstarpT, kstarMass);
842+
843+ if (std::abs (kshortPDGCodeGrandMother) == o2::constants::physics::Pdg::kKPlusStar892 ) // K*(892)+-
844+ histos.fill (HIST (MainDir[mode]) + HIST (" /MC/BkgStudy/h2dPtVsMassKStar_KShortKCharged" ), kstarpT, kstarMass);
819845 }
820846
821847 // _______________________________________
@@ -978,8 +1004,8 @@ struct k892hadronphoton {
9781004
9791005 // _______________________________________
9801006 // pT resolution histos
981- if ((mode == 0 ) && fillResoQAhistos)
982- getResolution (kstar);
1007+ if (fillResoQAhistos)
1008+ getResolution<mode> (kstar);
9831009 }
9841010 }
9851011 }
0 commit comments