@@ -466,22 +466,12 @@ struct Pi0EtaToGammaGammaMC {
466466 auto g1mc = mcparticles.iteratorAt (photonid1);
467467 auto g2mc = mcparticles.iteratorAt (photonid2);
468468
469- if constexpr (pairtype == PairType::kPCMPCM ) {
470- if (!IsConversionPointInAcceptance (g1mc, maxRgen, maxY_track, margin_z_mc, mcparticles)) {
471- continue ;
472- }
473- if (!IsConversionPointInAcceptance (g2mc, maxRgen, maxY_track, margin_z_mc, mcparticles)) {
474- continue ;
475- }
476- }
477-
478469 pi0id = FindCommonMotherFrom2Prongs (g1mc, g2mc, 22 , 22 , 111 , mcparticles);
479470 etaid = FindCommonMotherFrom2Prongs (g1mc, g2mc, 22 , 22 , 221 , mcparticles);
480471
481472 if (pi0id < 0 && etaid < 0 ) {
482473 continue ;
483474 }
484-
485475 ROOT::Math::PtEtaPhiMVector v1 (g1.pt (), g1.eta (), g1.phi (), 0 .);
486476 ROOT::Math::PtEtaPhiMVector v2 (g2.pt (), g2.eta (), g2.phi (), 0 .);
487477 ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;
@@ -492,12 +482,25 @@ struct Pi0EtaToGammaGammaMC {
492482 if (pi0id > 0 ) {
493483 auto pi0mc = mcparticles.iteratorAt (pi0id);
494484 if (pi0mc.isPhysicalPrimary () || pi0mc.producedByGenerator ()) {
485+ if constexpr (pairtype == PairType::kPCMPCM ) {
486+ if (!IsConversionPointInAcceptance (g1mc, maxRgen, maxY_track, margin_z_mc, mcparticles) || !IsConversionPointInAcceptance (g2mc, maxRgen, maxY_track, margin_z_mc, mcparticles)) {
487+ continue ;
488+ }
489+ }
495490 reinterpret_cast <TH2F*>(list_pair_ss->FindObject (Form (" %s_%s" , cut.GetName (), cut.GetName ()))->FindObject (paircut.GetName ())->FindObject (" hMggPt_Pi0_Primary" ))->Fill (v12.M (), v12.Pt ());
496491 } else if (IsFromWD (pi0mc.emmcevent (), pi0mc, mcparticles)) {
497492 reinterpret_cast <TH2F*>(list_pair_ss->FindObject (Form (" %s_%s" , cut.GetName (), cut.GetName ()))->FindObject (paircut.GetName ())->FindObject (" hMggPt_Pi0_FromWD" ))->Fill (v12.M (), v12.Pt ());
498493 }
499494 } else if (etaid > 0 ) {
500- reinterpret_cast <TH2F*>(list_pair_ss->FindObject (Form (" %s_%s" , cut.GetName (), cut.GetName ()))->FindObject (paircut.GetName ())->FindObject (" hMggPt_Eta_Primary" ))->Fill (v12.M (), v12.Pt ());
495+ auto etamc = mcparticles.iteratorAt (etaid);
496+ if (etamc.isPhysicalPrimary () || etamc.producedByGenerator ()) {
497+ if constexpr (pairtype == PairType::kPCMPCM ) {
498+ if (!IsConversionPointInAcceptance (g1mc, maxRgen, maxY_track, margin_z_mc, mcparticles) || !IsConversionPointInAcceptance (g2mc, maxRgen, maxY_track, margin_z_mc, mcparticles)) {
499+ continue ;
500+ }
501+ }
502+ reinterpret_cast <TH2F*>(list_pair_ss->FindObject (Form (" %s_%s" , cut.GetName (), cut.GetName ()))->FindObject (paircut.GetName ())->FindObject (" hMggPt_Eta_Primary" ))->Fill (v12.M (), v12.Pt ());
503+ }
501504 }
502505 } // end of combination
503506 } // end of paircutloop
@@ -515,6 +518,9 @@ struct Pi0EtaToGammaGammaMC {
515518 continue ;
516519 }
517520
521+ int photonid1 = -1 ;
522+ int photonid2 = -1 ;
523+
518524 if constexpr (pairtype == PairType::kPCMPHOS || pairtype == PairType::kPCMEMC ) {
519525 auto pos = g1.template posTrack_as <MyMCV0Legs>();
520526 auto ele = g1.template negTrack_as <MyMCV0Legs>();
@@ -542,20 +548,14 @@ struct Pi0EtaToGammaGammaMC {
542548 auto ele2mc = ele2.template emmcparticle_as <aod::EMMCParticles>();
543549 // LOGF(info,"pos1mc.globalIndex() = %d , ele1mc.globalIndex() = %d , pos2mc.globalIndex() = %d , ele2mc.globalIndex() = %d", pos1mc.globalIndex(), ele1mc.globalIndex(), pos2mc.globalIndex(), ele2mc.globalIndex());
544550
545- int photonid1 = FindCommonMotherFrom2Prongs (pos1mc, ele1mc, -11 , 11 , 22 , mcparticles); // real photon
551+ photonid1 = FindCommonMotherFrom2Prongs (pos1mc, ele1mc, -11 , 11 , 22 , mcparticles); // real photon
546552 if (photonid1 < 0 ) {
547553 continue ;
548554 }
549555 auto g1mc = mcparticles.iteratorAt (photonid1);
550556
551- if constexpr (pairtype == PairType::kPCMDalitzEE || pairtype == kPCMDalitzMuMu ) {
552- if (!IsConversionPointInAcceptance (g1mc, maxRgen, maxY_track, margin_z_mc, mcparticles)) {
553- continue ;
554- }
555- }
556-
557- if (cut2.IsPhotonConversionSelected ()) { // v0photon + photon conversion on ITSib stored in dielectron table. pi0 -> gamma gamma
558- int photonid2 = FindCommonMotherFrom2Prongs (pos2mc, ele2mc, -11 , 11 , 22 , mcparticles); // photon conversion stored in dielectron table
557+ if (cut2.IsPhotonConversionSelected ()) { // v0photon + photon conversion on ITSib stored in dielectron table. pi0 -> gamma gamma
558+ photonid2 = FindCommonMotherFrom2Prongs (pos2mc, ele2mc, -11 , 11 , 22 , mcparticles); // photon conversion stored in dielectron table
559559 if (photonid2 < 0 ) {
560560 continue ;
561561 }
@@ -581,7 +581,7 @@ struct Pi0EtaToGammaGammaMC {
581581 auto ele2mc = ele2.template emmcparticle_as <aod::EMMCParticles>();
582582 // LOGF(info,"pos1mc.globalIndex() = %d , ele1mc.globalIndex() = %d , pos2mc.globalIndex() = %d , ele2mc.globalIndex() = %d", pos1mc.globalIndex(), ele1mc.globalIndex(), pos2mc.globalIndex(), ele2mc.globalIndex());
583583
584- int photonid1 = FindCommonMotherFrom2Prongs (pos1mc, ele1mc, -11 , 11 , 22 , mcparticles); // real photon
584+ photonid1 = FindCommonMotherFrom2Prongs (pos1mc, ele1mc, -11 , 11 , 22 , mcparticles); // real photon
585585 if (photonid1 < 0 ) {
586586 continue ;
587587 }
@@ -606,12 +606,27 @@ struct Pi0EtaToGammaGammaMC {
606606 if (pi0id > 0 ) {
607607 auto pi0mc = mcparticles.iteratorAt (pi0id);
608608 if (pi0mc.isPhysicalPrimary () || pi0mc.producedByGenerator ()) {
609+ if constexpr (pairtype == PairType::kPCMDalitzEE || pairtype == kPCMDalitzMuMu ) {
610+ auto g1mc = mcparticles.iteratorAt (photonid1);
611+ if (!IsConversionPointInAcceptance (g1mc, maxRgen, maxY_track, margin_z_mc, mcparticles)) {
612+ continue ;
613+ }
614+ }
609615 reinterpret_cast <TH2F*>(list_pair_ss->FindObject (Form (" %s_%s" , cut1.GetName (), cut2.GetName ()))->FindObject (paircut.GetName ())->FindObject (" hMggPt_Pi0_Primary" ))->Fill (v12.M (), v12.Pt ());
610616 } else if (IsFromWD (pi0mc.emmcevent (), pi0mc, mcparticles)) {
611617 reinterpret_cast <TH2F*>(list_pair_ss->FindObject (Form (" %s_%s" , cut1.GetName (), cut2.GetName ()))->FindObject (paircut.GetName ())->FindObject (" hMggPt_Pi0_FromWD" ))->Fill (v12.M (), v12.Pt ());
612618 }
613619 } else if (etaid > 0 ) {
614- reinterpret_cast <TH2F*>(list_pair_ss->FindObject (Form (" %s_%s" , cut1.GetName (), cut2.GetName ()))->FindObject (paircut.GetName ())->FindObject (" hMggPt_Eta_Primary" ))->Fill (v12.M (), v12.Pt ());
620+ auto etamc = mcparticles.iteratorAt (etaid);
621+ if (etamc.isPhysicalPrimary () || etamc.producedByGenerator ()) {
622+ if constexpr (pairtype == PairType::kPCMDalitzEE || pairtype == kPCMDalitzMuMu ) {
623+ auto g1mc = mcparticles.iteratorAt (photonid1);
624+ if (!IsConversionPointInAcceptance (g1mc, maxRgen, maxY_track, margin_z_mc, mcparticles)) {
625+ continue ;
626+ }
627+ }
628+ reinterpret_cast <TH2F*>(list_pair_ss->FindObject (Form (" %s_%s" , cut1.GetName (), cut2.GetName ()))->FindObject (paircut.GetName ())->FindObject (" hMggPt_Eta_Primary" ))->Fill (v12.M (), v12.Pt ());
629+ }
615630 }
616631
617632 } // end of combination
@@ -656,25 +671,6 @@ struct Pi0EtaToGammaGammaMC {
656671 }
657672
658673 auto mccollision = collision.emmcevent ();
659- reinterpret_cast <TH1F*>(list_gen_pair->FindObject (" hZvtx_before" ))->Fill (mccollision.posZ ());
660- reinterpret_cast <TH1F*>(list_gen_pair->FindObject (" hCollisionCounter" ))->Fill (1.0 ); // all
661- if (!collision.sel8 ()) {
662- continue ;
663- }
664- reinterpret_cast <TH1F*>(list_gen_pair->FindObject (" hCollisionCounter" ))->Fill (2.0 ); // FT0VX i.e. FT0and
665-
666- if (collision.numContrib () < 0.5 ) {
667- continue ;
668- }
669- reinterpret_cast <TH1F*>(list_gen_pair->FindObject (" hCollisionCounter" ))->Fill (3.0 ); // Ncontrib > 0
670-
671- if (abs (collision.posZ ()) > 10.0 ) {
672- continue ;
673- }
674-
675- reinterpret_cast <TH1F*>(list_gen_pair->FindObject (" hZvtx_after" ))->Fill (mccollision.posZ ());
676- reinterpret_cast <TH1F*>(list_gen_pair->FindObject (" hCollisionCounter" ))->Fill (4.0 ); // |Zvtx| < 10 cm
677-
678674 auto mctracks_coll = mcparticles.sliceBy (perMcCollision, mccollision.globalIndex ());
679675 for (auto & mctrack : mctracks_coll) {
680676 if (abs (mctrack.y ()) > maxY_track) {
0 commit comments