diff --git a/PWGEM/Dilepton/Core/DileptonHadronMPC.h b/PWGEM/Dilepton/Core/DileptonHadronMPC.h index 6f9227bde6c..8fd7755e18f 100644 --- a/PWGEM/Dilepton/Core/DileptonHadronMPC.h +++ b/PWGEM/Dilepton/Core/DileptonHadronMPC.h @@ -93,7 +93,7 @@ using FilteredMyMuon = FilteredMyMuons::iterator; using MyEMH_electron = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, o2::aod::pwgem::dilepton::utils::EMTrack>; using MyEMH_muon = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, o2::aod::pwgem::dilepton::utils::EMFwdTrack>; -using MyEMH_track = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, o2::aod::pwgem::dilepton::utils::EMTrack>; // for charged track +using MyEMH_track = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, o2::aod::pwgem::dilepton::utils::EMTrackUL>; // for charged track template struct DileptonHadronMPC { @@ -110,7 +110,7 @@ struct DileptonHadronMPC { o2::framework::Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; o2::framework::Configurable cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"}; o2::framework::Configurable cfgDoMix{"cfgDoMix", true, "flag for event mixing between 2 leptons (i.e. R factor)"}; - o2::framework::Configurable ndepth_lepton{"ndepth_lepton", 100, "depth for event mixing between lepton-lepton"}; + o2::framework::Configurable ndepth_lepton{"ndepth_lepton", 1, "depth for event mixing between lepton-lepton"}; o2::framework::Configurable ndepth_hadron{"ndepth_hadron", 10, "depth for event mixing between hadron-hadron"}; o2::framework::Configurable ndiff_bc_mix{"ndiff_bc_mix", 594, "difference in global BC required in mixed events"}; o2::framework::ConfigurableAxis ConfVtxBins{"ConfVtxBins", {o2::framework::VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; @@ -121,6 +121,7 @@ struct DileptonHadronMPC { // Configurable cfgNtracksPV08Max{"cfgNtracksPV08Max", static_cast(1e+9), "max. multNTracksPV"}; o2::framework::Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"}; o2::framework::Configurable cfgDCAType{"cfgDCAType", 0, "type of DCA for output. 0:3D, 1:XY, 2:Z, else:3D"}; + o2::framework::Configurable cfgDoLS{"cfgDoLS", false, "flag to analyze LS"}; // ULS is always analyzed. o2::framework::ConfigurableAxis ConfMllBins{"ConfMllBins", {o2::framework::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"}; o2::framework::ConfigurableAxis ConfPtllBins{"ConfPtllBins", {o2::framework::VARIABLE_WIDTH, 0.00, 0.15, 0.50, 1.00, 1.50, 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"}; @@ -128,7 +129,7 @@ struct DileptonHadronMPC { o2::framework::ConfigurableAxis ConfPtHadronBins{"ConfPtHadronBins", {50, 0, 5}, "pT,h bins for output histograms"}; o2::framework::ConfigurableAxis ConfYllBins{"ConfYllBins", {1, -1.f, 1.f}, "yll bins for output histograms"}; // pair rapidity - o2::framework::ConfigurableAxis ConfDEtaBins{"ConfDEtaBins", {120, -6, 6}, "deta bins for output histograms"}; + o2::framework::ConfigurableAxis ConfDEtaBins{"ConfDEtaBins", {200, -10, 10}, "deta bins for output histograms"}; o2::framework::Configurable cfgNbinsDPhi{"cfgNbinsDPhi", 36, "nbins in dphi for output histograms"}; o2::framework::Configurable cfgNbinsCosNDPhi{"cfgNbinsCosNDPhi", 200, "nbins in cos(n(dphi)) for output histograms"}; o2::framework::Configurable cfgNmod{"cfgNmod", 2, "n-th harmonics"}; @@ -317,7 +318,6 @@ struct DileptonHadronMPC { Zorro zorro; o2::framework::HistogramRegistry fRegistry{"output", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject, false, false}; - static constexpr std::string_view event_cut_types[2] = {"before/", "after/"}; static constexpr std::string_view event_pair_types[2] = {"same/", "mix/"}; std::vector cent_bin_edges; @@ -857,9 +857,6 @@ struct DileptonHadronMPC { return false; } } - // if (t1.trackId() == t3.trackId() || t2.trackId() == t3.trackId()) { - // return false; - // } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { if (!cut.template IsSelectedTrack(t1) || !cut.template IsSelectedTrack(t2)) { return false; @@ -953,41 +950,6 @@ struct DileptonHadronMPC { if (!fEMTrackCut.IsSelected(t1) || !fEMTrackCut.IsSelected(t2)) { // for charged track return false; } - - // Leptons should not be in reference track sample. - if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - if (trackcuts.cfg_reftrack_type == static_cast(o2::aod::pwgem::dilepton::utils::emtrackutil::RefTrackType::kCB)) { - // for (const auto& pos : posLeptons) { // leptons per collision - // if (dielectroncuts.cfg_pid_scheme == static_cast(DielectronCut::PIDSchemes::kPIDML)) { - // if (!cut.template IsSelectedTrack(pos)) { - // continue; - // } - // } else { // cut based - // if (!cut.template IsSelectedTrack(pos)) { - // continue; - // } - // } - // // if (t1.trackId() == pos.trackId() || t2.trackId() == pos.trackId()) { - // // return false; - // // } - // } // end of pos lepton loop - - // for (const auto& neg : negLeptons) { // leptons per collision - // if (dielectroncuts.cfg_pid_scheme == static_cast(DielectronCut::PIDSchemes::kPIDML)) { - // if (!cut.template IsSelectedTrack(neg)) { - // continue; - // } - // } else { // cut based - // if (!cut.template IsSelectedTrack(neg)) { - // continue; - // } - // } - // // if (t1.trackId() == neg.trackId() || t2.trackId() == neg.trackId()) { - // // return false; - // // } - // } // end of neg lepton lopp - } - } // end of if kDielectron } // end of if same event float weight = 1.f; @@ -1115,24 +1077,28 @@ struct DileptonHadronMPC { } } } - for (const auto& [pos1, pos2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ - bool is_pair_ok = fillDilepton<0>(collision, pos1, pos2, cut); - if (is_pair_ok) { - nlspp++; - for (const auto& refTrack : refTracks_per_coll) { - fillDileptonHadron<0>(pos1, pos2, cut, refTrack); + + if (cfgDoLS) { + for (const auto& [pos1, pos2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + bool is_pair_ok = fillDilepton<0>(collision, pos1, pos2, cut); + if (is_pair_ok) { + nlspp++; + for (const auto& refTrack : refTracks_per_coll) { + fillDileptonHadron<0>(pos1, pos2, cut, refTrack); + } } } - } - for (const auto& [neg1, neg2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- - bool is_pair_ok = fillDilepton<0>(collision, neg1, neg2, cut); - if (is_pair_ok) { - nlsmm++; - for (const auto& refTrack : refTracks_per_coll) { - fillDileptonHadron<0>(neg1, neg2, cut, refTrack); + for (const auto& [neg1, neg2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + bool is_pair_ok = fillDilepton<0>(collision, neg1, neg2, cut); + if (is_pair_ok) { + nlsmm++; + for (const auto& refTrack : refTracks_per_coll) { + fillDileptonHadron<0>(neg1, neg2, cut, refTrack); + } } } } + used_trackIds_per_col.clear(); used_trackIds_per_col.shrink_to_fit(); @@ -1150,14 +1116,13 @@ struct DileptonHadronMPC { // store ref tracks for mixed event in case of kAzimuthalCorrelation if (cfgDoMix && cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonHadronAnalysisType::kAzimuthalCorrelation)) { - emh_ref->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(track.pt(), track.eta(), track.phi(), 0.139)); + emh_ref->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrackUL(track.pt(), track.eta(), track.phi())); } // store ref tracks } } // LOGF(info, "collision.globalIndex() = %d, collision.centFT0M() = %f, refTracks_per_coll.size() = %d", collision.globalIndex(), collision.centFT0M(), refTracks_per_coll.size()); for (const auto& [ref1, ref2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(refTracks_per_coll, refTracks_per_coll))) { - // TODO: remove lepton candidates from reference track sample in case of kCB. fillHadronHadron<0>(ref1, ref2, posTracks_per_coll, negTracks_per_coll, cut); } } @@ -1245,15 +1210,17 @@ struct DileptonHadronMPC { } } - for (const auto& pos1 : selected_posTracks_in_this_event) { // LS++ mix - for (const auto& pos2 : posTracks_from_event_pool) { - fillDilepton<1>(collision, pos1, pos2, cut); + if (cfgDoLS) { + for (const auto& pos1 : selected_posTracks_in_this_event) { // LS++ mix + for (const auto& pos2 : posTracks_from_event_pool) { + fillDilepton<1>(collision, pos1, pos2, cut); + } } - } - for (const auto& neg1 : selected_negTracks_in_this_event) { // LS-- mix - for (const auto& neg2 : negTracks_from_event_pool) { - fillDilepton<1>(collision, neg1, neg2, cut); + for (const auto& neg1 : selected_negTracks_in_this_event) { // LS-- mix + for (const auto& neg2 : negTracks_from_event_pool) { + fillDilepton<1>(collision, neg1, neg2, cut); + } } } } // end of loop over mixed event pool for lepton-lepton @@ -1288,60 +1255,62 @@ struct DileptonHadronMPC { } } - // for LS++ and hadron mix - for (size_t i1 = 0; i1 < selected_posTracks_in_this_event.size(); i1++) { - auto pos1 = selected_posTracks_in_this_event[i1]; - for (size_t i2 = i1 + 1; i2 < selected_posTracks_in_this_event.size(); i2++) { - auto pos2 = selected_posTracks_in_this_event[i2]; - - for (const auto& mix_dfId_collisionId : collisionIds_in_mixing_pool_hadron) { - int mix_dfId = mix_dfId_collisionId.first; - int mix_collisionId = mix_dfId_collisionId.second; - if (collision.globalIndex() == mix_collisionId && ndf == mix_dfId) { // this never happens. only protection. - continue; - } - - auto globalBC_mix = map_mixed_eventId_to_globalBC[mix_dfId_collisionId]; - uint64_t diffBC = std::max(collision.globalBC(), globalBC_mix) - std::min(collision.globalBC(), globalBC_mix); - fRegistry.fill(HIST("DileptonHadron/mix/hDiffBC"), diffBC); - if (diffBC < ndiff_bc_mix) { - continue; - } - - auto refTracks_from_event_pool = emh_ref->GetTracksPerCollision(mix_dfId_collisionId); - for (const auto& ref : refTracks_from_event_pool) { - fillDileptonHadron<1>(pos1, pos2, cut, ref); - } - - } // end of loop over mixed event pool for dilepton-hadron + if (cfgDoLS) { + // for LS++ and hadron mix + for (size_t i1 = 0; i1 < selected_posTracks_in_this_event.size(); i1++) { + auto pos1 = selected_posTracks_in_this_event[i1]; + for (size_t i2 = i1 + 1; i2 < selected_posTracks_in_this_event.size(); i2++) { + auto pos2 = selected_posTracks_in_this_event[i2]; + + for (const auto& mix_dfId_collisionId : collisionIds_in_mixing_pool_hadron) { + int mix_dfId = mix_dfId_collisionId.first; + int mix_collisionId = mix_dfId_collisionId.second; + if (collision.globalIndex() == mix_collisionId && ndf == mix_dfId) { // this never happens. only protection. + continue; + } + + auto globalBC_mix = map_mixed_eventId_to_globalBC[mix_dfId_collisionId]; + uint64_t diffBC = std::max(collision.globalBC(), globalBC_mix) - std::min(collision.globalBC(), globalBC_mix); + fRegistry.fill(HIST("DileptonHadron/mix/hDiffBC"), diffBC); + if (diffBC < ndiff_bc_mix) { + continue; + } + + auto refTracks_from_event_pool = emh_ref->GetTracksPerCollision(mix_dfId_collisionId); + for (const auto& ref : refTracks_from_event_pool) { + fillDileptonHadron<1>(pos1, pos2, cut, ref); + } + + } // end of loop over mixed event pool for dilepton-hadron + } } - } - - // for LS-- and hadron mix - for (size_t i1 = 0; i1 < selected_negTracks_in_this_event.size(); i1++) { - auto neg1 = selected_negTracks_in_this_event[i1]; - for (size_t i2 = i1 + 1; i2 < selected_negTracks_in_this_event.size(); i2++) { - auto neg2 = selected_negTracks_in_this_event[i2]; - - for (const auto& mix_dfId_collisionId : collisionIds_in_mixing_pool_hadron) { - int mix_dfId = mix_dfId_collisionId.first; - int mix_collisionId = mix_dfId_collisionId.second; - if (collision.globalIndex() == mix_collisionId && ndf == mix_dfId) { // this never happens. only protection. - continue; - } - auto globalBC_mix = map_mixed_eventId_to_globalBC[mix_dfId_collisionId]; - uint64_t diffBC = std::max(collision.globalBC(), globalBC_mix) - std::min(collision.globalBC(), globalBC_mix); - fRegistry.fill(HIST("DileptonHadron/mix/hDiffBC"), diffBC); - if (diffBC < ndiff_bc_mix) { - continue; - } - auto refTracks_from_event_pool = emh_ref->GetTracksPerCollision(mix_dfId_collisionId); - for (const auto& ref : refTracks_from_event_pool) { - fillDileptonHadron<1>(neg1, neg2, cut, ref); - } - - } // end of loop over mixed event pool for dilepton-hadron + // for LS-- and hadron mix + for (size_t i1 = 0; i1 < selected_negTracks_in_this_event.size(); i1++) { + auto neg1 = selected_negTracks_in_this_event[i1]; + for (size_t i2 = i1 + 1; i2 < selected_negTracks_in_this_event.size(); i2++) { + auto neg2 = selected_negTracks_in_this_event[i2]; + + for (const auto& mix_dfId_collisionId : collisionIds_in_mixing_pool_hadron) { + int mix_dfId = mix_dfId_collisionId.first; + int mix_collisionId = mix_dfId_collisionId.second; + if (collision.globalIndex() == mix_collisionId && ndf == mix_dfId) { // this never happens. only protection. + continue; + } + auto globalBC_mix = map_mixed_eventId_to_globalBC[mix_dfId_collisionId]; + uint64_t diffBC = std::max(collision.globalBC(), globalBC_mix) - std::min(collision.globalBC(), globalBC_mix); + fRegistry.fill(HIST("DileptonHadron/mix/hDiffBC"), diffBC); + if (diffBC < ndiff_bc_mix) { + continue; + } + + auto refTracks_from_event_pool = emh_ref->GetTracksPerCollision(mix_dfId_collisionId); + for (const auto& ref : refTracks_from_event_pool) { + fillDileptonHadron<1>(neg1, neg2, cut, ref); + } + + } // end of loop over mixed event pool for dilepton-hadron + } } } diff --git a/PWGEM/Dilepton/Utils/EMTrack.h b/PWGEM/Dilepton/Utils/EMTrack.h index d345f1c1924..14d5645b0fd 100644 --- a/PWGEM/Dilepton/Utils/EMTrack.h +++ b/PWGEM/Dilepton/Utils/EMTrack.h @@ -57,7 +57,6 @@ class EMTrack float px() const { return 1.f / std::fabs(fSigned1Pt) * std::cos(fPhi); } float py() const { return 1.f / std::fabs(fSigned1Pt) * std::sin(fPhi); } float pz() const { return 1.f / std::fabs(fSigned1Pt) * std::sinh(fEta); } - // float e() const { return std::hypot(fPt * std::cosh(fEta), fMass); } // e2 = p2 + m2 float signed1Pt() const { return fSigned1Pt; } protected: @@ -240,5 +239,34 @@ class EMPair : public EMTrack float fVz; }; +class EMTrackUL // ultra-light track. Use this when you don't care charge or DCA. e.g. dilepton-hadron correlation. +{ + public: + EMTrackUL(float pt, float eta, float phi) + { + fPt = pt; + fEta = eta; + fPhi = phi; + } + + ~EMTrackUL() {} + + float pt() const { return fPt; } + float eta() const { return fEta; } + float phi() const { return fPhi; } + + float p() const { return fPt * std::cosh(fEta); } + float px() const { return fPt * std::cos(fPhi); } + float py() const { return fPt * std::sin(fPhi); } + float pz() const { return fPt * std::sinh(fEta); } + float e(const float mass) const { return std::hypot(fPt * std::cosh(fEta), mass); } // e2 = p2 + m2 + float rapidity(const float mass) const { return std::log((std::sqrt(std::pow(mass, 2) + std::pow(fPt * std::cosh(fEta), 2)) + fPt * std::sinh(fEta)) / std::sqrt(std::pow(mass, 2) + std::pow(fPt, 2))); } + + protected: + float fPt; + float fEta; + float fPhi; +}; + } // namespace o2::aod::pwgem::dilepton::utils #endif // PWGEM_DILEPTON_UTILS_EMTRACK_H_