Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
201 changes: 85 additions & 116 deletions PWGEM/Dilepton/Core/DileptonHadronMPC.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@

using MyEMH_electron = o2::aod::pwgem::dilepton::utils::EventMixingHandler<std::tuple<int, int, int, int>, std::pair<int, int>, o2::aod::pwgem::dilepton::utils::EMTrack>;
using MyEMH_muon = o2::aod::pwgem::dilepton::utils::EventMixingHandler<std::tuple<int, int, int, int>, std::pair<int, int>, o2::aod::pwgem::dilepton::utils::EMFwdTrack>;
using MyEMH_track = o2::aod::pwgem::dilepton::utils::EventMixingHandler<std::tuple<int, int, int, int>, std::pair<int, int>, o2::aod::pwgem::dilepton::utils::EMTrack>; // for charged track
using MyEMH_track = o2::aod::pwgem::dilepton::utils::EventMixingHandler<std::tuple<int, int, int, int>, std::pair<int, int>, o2::aod::pwgem::dilepton::utils::EMTrackUL>; // for charged track

template <o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType pairtype, typename TEMH, typename... Types>
struct DileptonHadronMPC {
Expand All @@ -110,7 +110,7 @@
o2::framework::Configurable<int> cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"};
o2::framework::Configurable<int> cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"};
o2::framework::Configurable<bool> cfgDoMix{"cfgDoMix", true, "flag for event mixing between 2 leptons (i.e. R factor)"};
o2::framework::Configurable<int> ndepth_lepton{"ndepth_lepton", 100, "depth for event mixing between lepton-lepton"};
o2::framework::Configurable<int> ndepth_lepton{"ndepth_lepton", 1, "depth for event mixing between lepton-lepton"};
o2::framework::Configurable<int> ndepth_hadron{"ndepth_hadron", 10, "depth for event mixing between hadron-hadron"};
o2::framework::Configurable<uint64_t> 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"};
Expand All @@ -121,14 +121,15 @@
// Configurable<int> cfgNtracksPV08Max{"cfgNtracksPV08Max", static_cast<int>(1e+9), "max. multNTracksPV"};
o2::framework::Configurable<bool> cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"};
o2::framework::Configurable<uint> cfgDCAType{"cfgDCAType", 0, "type of DCA for output. 0:3D, 1:XY, 2:Z, else:3D"};
o2::framework::Configurable<bool> 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"};
o2::framework::ConfigurableAxis ConfDCAllBins{"ConfDCAllBins", {o2::framework::VARIABLE_WIDTH, 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}, "DCAll bins for output histograms"};

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<int> cfgNbinsDPhi{"cfgNbinsDPhi", 36, "nbins in dphi for output histograms"};
o2::framework::Configurable<int> cfgNbinsCosNDPhi{"cfgNbinsCosNDPhi", 200, "nbins in cos(n(dphi)) for output histograms"};
o2::framework::Configurable<int> cfgNmod{"cfgNmod", 2, "n-th harmonics"};
Expand Down Expand Up @@ -317,7 +318,6 @@
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<float> cent_bin_edges;
Expand Down Expand Up @@ -443,10 +443,10 @@
}

// In case override, don't proceed, please - no CCDB access required
if (d_bz_input > -990) {

Check failure on line 446 in PWGEM/Dilepton/Core/DileptonHadronMPC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
d_bz = d_bz_input;
o2::parameters::GRPMagField grpmag;
if (std::fabs(d_bz) > 1e-5) {

Check failure on line 449 in PWGEM/Dilepton/Core/DileptonHadronMPC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
grpmag.setL3Current(30000.f / (d_bz / 5.0f));
}
o2::base::Propagator::initFieldFromGRP(&grpmag);
Expand Down Expand Up @@ -521,7 +521,7 @@
pair_dca_axis_title = "DCA_{ee}^{3D} (#sigma)";
if (cfgDCAType == 1) {
pair_dca_axis_title = "DCA_{ee}^{XY} (#sigma)";
} else if (cfgDCAType == 2) {

Check failure on line 524 in PWGEM/Dilepton/Core/DileptonHadronMPC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
pair_dca_axis_title = "DCA_{ee}^{Z} (#sigma)";
}
deta_axis_title = "#Delta#eta = #eta_{ee} - #eta_{h}";
Expand Down Expand Up @@ -699,7 +699,7 @@
fDimuonCut.SetMatchingChi2MCHMID(0.f, dimuoncuts.cfg_max_matching_chi2_mchmid);
fDimuonCut.SetDCAxy(0.f, dimuoncuts.cfg_max_dcaxy);
fDimuonCut.SetRabs(dimuoncuts.cfg_min_rabs, dimuoncuts.cfg_max_rabs);
fDimuonCut.SetMaxPDCARabsDep([&](float rabs) { return (rabs < 26.5 ? 594.f : 324.f); });

Check failure on line 702 in PWGEM/Dilepton/Core/DileptonHadronMPC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
fDimuonCut.SetMaxdPtdEtadPhiwrtMCHMID(dimuoncuts.cfg_max_relDPt_wrt_matchedMCHMID, dimuoncuts.cfg_max_DEta_wrt_matchedMCHMID, dimuoncuts.cfg_max_DPhi_wrt_matchedMCHMID); // this is relevant for global muons
fDimuonCut.SetMFTHitMap(dimuoncuts.requireMFTHitMap, dimuoncuts.requiredMFTDisks);
fDimuonCut.EnableTTCA(dimuoncuts.enableTTCA);
Expand Down Expand Up @@ -775,7 +775,7 @@
pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t2));
if (cfgDCAType == 1) {
pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t2));
} else if (cfgDCAType == 2) {

Check failure on line 778 in PWGEM/Dilepton/Core/DileptonHadronMPC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2));
}
} else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) {
Expand Down Expand Up @@ -857,9 +857,6 @@
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<false>(t1) || !cut.template IsSelectedTrack<false>(t2)) {
return false;
Expand Down Expand Up @@ -906,7 +903,7 @@
ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), leptonM2);
ROOT::Math::PtEtaPhiMVector v12 = v1 + v2;

ROOT::Math::PtEtaPhiMVector v3(t3.pt(), t3.eta(), t3.phi(), 0.139); // mass of hadron does not matter.

Check failure on line 906 in PWGEM/Dilepton/Core/DileptonHadronMPC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-mass]

Avoid hard-coded particle masses. Use o2::constants::physics::Mass... instead.
float deta = v12.Eta() - v3.Eta();
float dphi = v12.Phi() - v3.Phi();

Expand All @@ -915,7 +912,7 @@
pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t2));
if (cfgDCAType == 1) {
pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t2));
} else if (cfgDCAType == 2) {

Check failure on line 915 in PWGEM/Dilepton/Core/DileptonHadronMPC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2));
}
} else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) {
Expand Down Expand Up @@ -953,41 +950,6 @@
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<int>(o2::aod::pwgem::dilepton::utils::emtrackutil::RefTrackType::kCB)) {
// for (const auto& pos : posLeptons) { // leptons per collision
// if (dielectroncuts.cfg_pid_scheme == static_cast<int>(DielectronCut::PIDSchemes::kPIDML)) {
// if (!cut.template IsSelectedTrack<false>(pos)) {
// continue;
// }
// } else { // cut based
// if (!cut.template IsSelectedTrack<false>(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<int>(DielectronCut::PIDSchemes::kPIDML)) {
// if (!cut.template IsSelectedTrack<false>(neg)) {
// continue;
// }
// } else { // cut based
// if (!cut.template IsSelectedTrack<false>(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;
Expand Down Expand Up @@ -1115,24 +1077,28 @@
}
}
}
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();

Expand All @@ -1150,14 +1116,13 @@

// store ref tracks for mixed event in case of kAzimuthalCorrelation
if (cfgDoMix && cfgAnalysisType == static_cast<int>(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);
}
}
Expand All @@ -1170,21 +1135,21 @@
int zbin = lower_bound(zvtx_bin_edges.begin(), zvtx_bin_edges.end(), collision.posZ()) - zvtx_bin_edges.begin() - 1;
if (zbin < 0) {
zbin = 0;
} else if (static_cast<int>(zvtx_bin_edges.size()) - 2 < zbin) {

Check failure on line 1138 in PWGEM/Dilepton/Core/DileptonHadronMPC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
zbin = static_cast<int>(zvtx_bin_edges.size()) - 2;
}

int centbin = lower_bound(cent_bin_edges.begin(), cent_bin_edges.end(), centrality) - cent_bin_edges.begin() - 1;
if (centbin < 0) {
centbin = 0;
} else if (static_cast<int>(cent_bin_edges.size()) - 2 < centbin) {

Check failure on line 1145 in PWGEM/Dilepton/Core/DileptonHadronMPC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
centbin = static_cast<int>(cent_bin_edges.size()) - 2;
}

int epbin = lower_bound(ep_bin_edges.begin(), ep_bin_edges.end(), ep2) - ep_bin_edges.begin() - 1;
if (epbin < 0) {
epbin = 0;
} else if (static_cast<int>(ep_bin_edges.size()) - 2 < epbin) {

Check failure on line 1152 in PWGEM/Dilepton/Core/DileptonHadronMPC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
epbin = static_cast<int>(ep_bin_edges.size()) - 2;
}

Expand Down Expand Up @@ -1245,15 +1210,17 @@
}
}

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
Expand Down Expand Up @@ -1288,60 +1255,62 @@
}
}

// 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
}
}
}

Expand Down
30 changes: 29 additions & 1 deletion PWGEM/Dilepton/Utils/EMTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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))); }
Comment on lines +258 to +263
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RecoDecayPtEtaPhi does all these.


protected:
float fPt;
float fEta;
float fPhi;
};

} // namespace o2::aod::pwgem::dilepton::utils
#endif // PWGEM_DILEPTON_UTILS_EMTRACK_H_
Loading