@@ -104,6 +104,7 @@ struct DileptonMC {
104104 Configurable<bool > cfgApplyWeightTTCA{" cfgApplyWeightTTCA" , false , " flag to apply weighting by 1/N" };
105105 Configurable<uint> cfgDCAType{" cfgDCAType" , 0 , " type of DCA for output. 0:3D, 1:XY, 2:Z, else:3D" };
106106 Configurable<bool > cfgFillUnfolding{" cfgFillUnfolding" , false , " flag to fill histograms for unfolding" };
107+ Configurable<bool > cfgRequireTrueAssociation{" cfgRequireTrueAssociation" , false , " flag to require true mc collision association" };
107108
108109 ConfigurableAxis ConfMllBins{"ConfMllBins", {VARIABLE_WIDTH, 0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39, 0.40, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.50, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.60, 0.61, 0.62, 0.63, 0.64, 0.65, 0.66, 0.67, 0.68, 0.69, 0.70, 0.71, 0.72, 0.73, 0.74, 0.75, 0.76, 0.77, 0.78, 0.79, 0.80, 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87, 0.88, 0.89, 0.90, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1.00, 1.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.10, 2.20, 2.30, 2.40, 2.50, 2.60, 2.70, 2.75, 2.80, 2.85, 2.90, 2.95, 3.00, 3.05, 3.10, 3.15, 3.20, 3.25, 3.30, 3.35, 3.40, 3.45, 3.50, 3.55, 3.60, 3.65, 3.70, 3.75, 3.80, 3.85, 3.90, 3.95, 4.00}, "mll bins for output histograms"};
109110 ConfigurableAxis ConfPtllBins{" ConfPtllBins" , {VARIABLE_WIDTH, 0.00 , 0.10 , 0.20 , 0.30 , 0.40 , 0.50 , 0.60 , 0.70 , 0.80 , 0.90 , 1.00 , 1.10 , 1.20 , 1.30 , 1.40 , 1.50 , 1.60 , 1.70 , 1.80 , 1.90 , 2.00 , 2.50 , 3.00 , 3.50 , 4.00 , 4.50 , 5.00 , 6.00 , 7.00 , 8.00 , 9.00 , 10.00 }, " pTll bins for output histograms" };
@@ -292,7 +293,8 @@ struct DileptonMC {
292293 {
293294 // event info
294295 o2::aod::pwgem::dilepton::utils::eventhistogram::addEventHistograms (&fRegistry );
295- fRegistry .add (" MCEvent/before/hZvtx" , " vertex z; Z_{vtx} (cm)" , kTH1F , {{100 , -50 , +50 }}, false );
296+ fRegistry .add (" MCEvent/before/hZvtx" , " mc vertex z; Z_{vtx} (cm)" , kTH1F , {{100 , -50 , +50 }}, false );
297+ fRegistry .add (" MCEvent/before/hZvtx_rec" , " rec. mc vertex z; Z_{vtx} (cm)" , kTH1F , {{100 , -50 , +50 }}, false );
296298 fRegistry .addClone (" MCEvent/before/" , " MCEvent/after/" );
297299
298300 std::string mass_axis_title = " m_{ll} (GeV/c^{2})" ;
@@ -782,7 +784,7 @@ struct DileptonMC {
782784 {
783785 auto t1mc = mcparticles.iteratorAt (t1.emmcparticleId ());
784786 auto t2mc = mcparticles.iteratorAt (t2.emmcparticleId ());
785- bool is_from_same_mcevent = t1mc.emmceventId () == t2mc.emmceventId ();
787+ bool is_pair_from_same_mcevent = ( t1mc.emmceventId () == t2mc.emmceventId () );
786788
787789 auto mccollision1 = t1mc.template emmcevent_as <TMCCollisions>();
788790 auto mccollision2 = t2mc.template emmcevent_as <TMCCollisions>();
@@ -913,10 +915,10 @@ struct DileptonMC {
913915 o2::aod::pwgem::dilepton::utils::pairutil::getAngleCS<false >(t1, t2, leptonM1, leptonM2, beamE1, beamE2, beamP1, beamP2, cos_thetaCS, phiCS);
914916 o2::math_utils::bringToPMPi (phiCS);
915917
916- if ((FindCommonMotherFrom2ProngsWithoutPDG (t1mc, t2mc) > 0 || IsHF (t1mc, t2mc, mcparticles) > 0 ) && is_from_same_mcevent ) { // for bkg study
917- if (abs (t1mc.pdgCode ()) != pdg_lepton || abs (t2mc.pdgCode ()) != pdg_lepton) { // hh or eh correlated bkg
918- if (abs (t1mc.pdgCode ()) != pdg_lepton && abs (t2mc.pdgCode ()) != pdg_lepton) { // hh correlated bkg
919- if (t1.sign () * t2.sign () < 0 ) { // ULS
918+ if ((FindCommonMotherFrom2ProngsWithoutPDG (t1mc, t2mc) > 0 || IsHF (t1mc, t2mc, mcparticles) > 0 ) && is_pair_from_same_mcevent ) { // for bkg study
919+ if (abs (t1mc.pdgCode ()) != pdg_lepton || abs (t2mc.pdgCode ()) != pdg_lepton) { // hh or eh correlated bkg
920+ if (abs (t1mc.pdgCode ()) != pdg_lepton && abs (t2mc.pdgCode ()) != pdg_lepton) { // hh correlated bkg
921+ if (t1.sign () * t2.sign () < 0 ) { // ULS
920922 fRegistry .fill (HIST (" Pair/corr_bkg_hh/uls/hs" ), v12.M (), v12.Pt (), v12.Rapidity (), dphi, deta, abs (cos_thetaCS), abs (phiCS), aco, asym, abs (dphi_e_ee), pair_dca, weight);
921923 } else if (t1.sign () > 0 && t2.sign () > 0 ) { // LS++
922924 fRegistry .fill (HIST (" Pair/corr_bkg_hh/lspp/hs" ), v12.M (), v12.Pt (), v12.Rapidity (), dphi, deta, abs (cos_thetaCS), abs (phiCS), aco, asym, abs (dphi_e_ee), pair_dca, weight);
@@ -947,7 +949,10 @@ struct DileptonMC {
947949 return false ;
948950 }
949951
950- if (!is_from_same_mcevent) {
952+ if (!is_pair_from_same_mcevent) {
953+ return false ;
954+ }
955+ if (cfgRequireTrueAssociation && (t1mc.emmceventId () != collision.emmceventId () || t2mc.emmceventId () != collision.emmceventId ())) {
951956 return false ;
952957 }
953958 int mother_id = FindLF (t1mc, t2mc, mcparticles);
@@ -1254,6 +1259,7 @@ struct DileptonMC {
12541259 if (centralities[cfgCentEstimator] < cfgCentMin || cfgCentMax < centralities[cfgCentEstimator]) {
12551260 continue ;
12561261 }
1262+ fRegistry .fill (HIST (" MCEvent/before/hZvtx_rec" ), mccollision.posZ ());
12571263 if (!fEMEventCut .IsSelected (collision)) {
12581264 continue ;
12591265 }
0 commit comments