@@ -65,7 +65,8 @@ struct AssociateMCInfoPhoton {
6565 Configurable<float > margin_z_gen{" margin_z_gen" , 15 .f , " margin for Z of true photon conversion point to store generated information" };
6666 Configurable<float > max_rxy_gen{" max_rxy_gen" , 100 , " max rxy to store generated information" };
6767 Configurable<bool > requireGammaGammaDecay{" requireGammaGammaDecay" , false , " require gamma gamma decay for generated pi0 and eta meson" };
68-
68+ Configurable<float > cfg_max_eta_photon{" cfg_max_eta_gamma" , 0.8 , " max eta for photons at PV" };
69+
6970 HistogramRegistry registry{" EMMCEvent" };
7071
7172 void init (o2::framework::InitContext&)
@@ -98,6 +99,7 @@ struct AssociateMCInfoPhoton {
9899
99100 for (uint i = 0 ; i < NParticleNames; i++) {
100101 registry.add <TH2>(Form (" Generated/h2PtY_%s" , ParticleNames[i].data ()), Form (" Generated %s" , ParticleNames[i].data ()), kTH2F , {axisPt, axisRapidity}, true );
102+ registry.add <TH2>(Form (" Generated/h2PtY_Accepted_%s" , ParticleNames[i].data ()), Form (" Generated %s" , ParticleNames[i].data ()), kTH2F , {axisPt, axisRapidity}, true );
101103 }
102104
103105 // reserve space for generated vectors if that process enabled
@@ -170,6 +172,19 @@ struct AssociateMCInfoPhoton {
170172 for (const auto & mcParticle : groupedMcParticles) { // store necessary information for denominator of efficiency
171173 if ((mcParticle.isPhysicalPrimary () || mcParticle.producedByGenerator ()) && std::fabs (mcParticle.y ()) < 0 .9f && mcParticle.pt () < 20 .f ) {
172174 auto binNumber = hBinFinder->FindBin (mcParticle.pt (), std::fabs (mcParticle.y ())); // caution: pack
175+ size_t lNDaughters = 0 ;
176+ size_t mesonAccepted = 0 ;
177+ if (mcParticle.has_daughters ()) {
178+ auto lDaughters = mcParticle.daughters_as <aod::McParticles>();
179+ lNDaughters = lDaughters.size ();
180+ auto lDaughter0 = lDaughters.begin ();
181+ if (lNDaughters == 2 ) {
182+ auto lDaughter1 = lDaughters.iteratorAt (1 );
183+ if ( std::fabs (lDaughter0.eta ())< cfg_max_eta_photon && std::fabs (lDaughter1.eta ()) < cfg_max_eta_photon){
184+ mesonAccepted = 1 ;
185+ }
186+ }
187+ }
173188 switch (std::abs (mcParticle.pdgCode ())) {
174189 case PDG_t::kGamma :
175190 registry.fill (HIST (" Generated/h2PtY_Gamma" ), mcParticle.pt (), std::fabs (mcParticle.y ()));
@@ -180,12 +195,18 @@ struct AssociateMCInfoPhoton {
180195 continue ;
181196 registry.fill (HIST (" Generated/h2PtY_Pi0" ), mcParticle.pt (), std::fabs (mcParticle.y ()));
182197 genPi0[binNumber]++;
198+ if (mesonAccepted == 1 ){
199+ registry.fill (HIST (" Generated/h2PtY_Accepted_Pi0" ), mcParticle.pt (), std::fabs (mcParticle.y ()));
200+ }
183201 break ;
184202 case Pdg::kEta :
185203 if (requireGammaGammaDecay && !isGammaGammaDecay (mcParticle, mcParticles))
186204 continue ;
187205 registry.fill (HIST (" Generated/h2PtY_Eta" ), mcParticle.pt (), std::fabs (mcParticle.y ()));
188206 genEta[binNumber]++;
207+ if (mesonAccepted == 1 ){
208+ registry.fill (HIST (" Generated/h2PtY_Accepted_Eta" ), mcParticle.pt (), std::fabs (mcParticle.y ()));
209+ }
189210 break ;
190211 default :
191212 break ;
0 commit comments