Skip to content

Commit a8212fb

Browse files
authored
[PWGEM/Dilepton] add a beta histogram in dileptonPolarization.cxx (#14056)
1 parent 54d8936 commit a8212fb

File tree

2 files changed

+52
-29
lines changed

2 files changed

+52
-29
lines changed

PWGEM/Dilepton/Tasks/dileptonPolarization.cxx

Lines changed: 51 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ struct DileptonPolarization {
7777
ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"};
7878
Configurable<int> cfgPolarizationFrame{"cfgPolarizationFrame", 0, "frame of polarization. 0:CS, 1:HX, else:FATAL"};
7979
Configurable<bool> cfgUseAbs{"cfgUseAbs", false, "flag to use absolute value for cos_theta and phi"}; // this is to increase statistics per bin.
80+
Configurable<bool> cfgDoULS{"cfgDoULS", true, "flag to perform ULS pairing"};
81+
Configurable<bool> cfgDoLS{"cfgDoLS", true, "flag to perform LS pairing"};
8082

8183
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, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 7.5, 8.00, 8.10, 8.20, 8.30, 8.40, 8.50, 8.60, 8.70, 8.80, 8.90, 9.00, 9.10, 9.20, 9.30, 9.40, 9.50, 9.60, 9.70, 9.80, 9.90, 10.00, 10.10, 10.20, 10.30, 10.40, 10.50, 10.60, 10.70, 10.80, 10.90, 11.00, 11.1, 11.2, 11.3, 11.4, 11.50, 11.6, 11.7, 11.8, 11.9, 12.0}, "mll bins for output histograms"};
8284
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"};
@@ -124,10 +126,10 @@ struct DileptonPolarization {
124126

125127
struct : ConfigurableGroup {
126128
std::string prefix = "accBins";
127-
Configurable<float> cfgDM{"cfgDM", 0.1, "dm for lorentz boost"};
128-
Configurable<float> cfgDPt{"cfgDPt", 0.1, "dpT for lorentz boost"};
129-
Configurable<float> cfgDEta{"cfgDEta", 0.1, "deta for lorentz boost"};
130-
Configurable<float> cfgDPhi{"cfgDPhi", 0.1, "dphi (rad.) for lorentz boost"};
129+
Configurable<float> cfgRelDM{"cfgRelDM", 0.01, "rel. dm for lorentz boost"};
130+
Configurable<float> cfgRelDPx{"cfgRelDPx", 0.01, "rel. dpx for lorentz boost"};
131+
Configurable<float> cfgRelDPy{"cfgRelDPy", 0.01, "rel. dpy for lorentz boost"};
132+
Configurable<float> cfgRelDPz{"cfgRelDPz", 0.01, "rel. dpz for lorentz boost"};
131133
} accBins;
132134

133135
Service<o2::ccdb::BasicCCDBManager> ccdb;
@@ -374,11 +376,15 @@ struct DileptonPolarization {
374376
const AxisSpec axis_phi{ConfPolarizationPhiBins, Form("#varphi^{%s} (rad.)", frameName.data())};
375377
const AxisSpec axis_quadmom{ConfPolarizationQuadMomBins, Form("#frac{3 cos^{2}(#theta^{%s}) -1}{2}", frameName.data())};
376378
fRegistry.add("Pair/same/uls/hs", "dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_cos_theta, axis_phi, axis_quadmom}, true);
377-
fRegistry.add("Pair/same/uls/hEta", "#eta_{ll}", kTH1D, {{2000, -10, 10}}, true);
378379

379380
fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/");
380381
fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/");
381382
fRegistry.addClone("Pair/same/", "Pair/mix/");
383+
fRegistry.add("Pair/same/uls/hEta", "#eta_{ll}", kTH1D, {{2000, -10, 10}}, true);
384+
fRegistry.add("Pair/mix/uls/hBeta", "#beta for Lorentz boost;#beta^{same};(#beta^{mix} - #beta^{same})/#beta^{same}", kTH2D, {{100, 0, 1}, {400, -0.2, 0.2}}, true);
385+
fRegistry.add("Pair/mix/uls/hBetaX", "#beta_{X} for Lorentz boost;#beta_{x}^{same};(#beta_{x}^{mix} - #beta_{x}^{same})/#beta_{x}^{same}", kTH2D, {{100, 0, 1}, {400, -0.2, 0.2}}, true);
386+
fRegistry.add("Pair/mix/uls/hBetaY", "#beta_{Y} for Lorentz boost;#beta_{y}^{same};(#beta_{y}^{mix} - #beta_{y}^{same})/#beta_{y}^{same}", kTH2D, {{100, 0, 1}, {400, -0.2, 0.2}}, true);
387+
fRegistry.add("Pair/mix/uls/hBetaZ", "#beta_{Z} for Lorentz boost;#beta_{z}^{same};(#beta_{z}^{mix} - #beta_{z}^{same})/#beta_{z}^{same}", kTH2D, {{100, 0, 1}, {400, -0.2, 0.2}}, true);
382388
}
383389

384390
template <int ev_id, typename TCollision, typename TDilepton>
@@ -475,7 +481,7 @@ struct DileptonPolarization {
475481
auto v_pos = empair1.getPositiveLeg(); // pt, eta, phi, M
476482
auto arrD = std::array<float, 4>{static_cast<float>(v_pos.Px()), static_cast<float>(v_pos.Py()), static_cast<float>(v_pos.Pz()), leptonM1};
477483

478-
auto pairs_from_col2_sliced = std::views::filter(pairs_from_col2, [&](EMPair t) { return std::fabs(t.mass() - empair1.mass()) < accBins.cfgDM && std::fabs(t.pt() - empair1.pt()) < accBins.cfgDPt && std::fabs(t.eta() - empair1.eta()) < accBins.cfgDEta && std::fabs(RecoDecay::constrainAngle(t.phi() - empair1.phi(), -o2::constants::math::PI, 1U)) < accBins.cfgDPhi; });
484+
auto pairs_from_col2_sliced = std::views::filter(pairs_from_col2, [&](EMPair t) { return std::fabs(t.mass() - empair1.mass()) / empair1.mass() < accBins.cfgRelDM && std::fabs((t.px() - empair1.px()) / empair1.px()) < accBins.cfgRelDPx && std::fabs((t.py() - empair1.py()) / empair1.py()) < accBins.cfgRelDPy && std::fabs((t.pz() - empair1.pz()) / empair1.pz()) < accBins.cfgRelDPz; });
479485
for (const auto& empair2 : pairs_from_col2_sliced) {
480486
auto arrM = std::array<float, 4>{static_cast<float>(empair2.px()), static_cast<float>(empair2.py()), static_cast<float>(empair2.pz()), static_cast<float>(empair2.mass())};
481487
// LOGF(info, "[col1, col2] : empair1.mass() = %f, empair1.pt() = %f, empair1.eta() = %f, empair1.phi() = %f, empair2.mass() = %f, empair2.pt() = %f, empair2.eta() = %f, empair2.phi() = %f", empair1.mass(), empair1.pt(), empair1.eta(), empair1.phi(), empair2.mass(), empair2.pt(), empair2.eta(), empair2.phi());
@@ -493,14 +499,18 @@ struct DileptonPolarization {
493499
phiPol = std::fabs(phiPol);
494500
}
495501
fRegistry.fill(HIST("Pair/mix/") + HIST(pair_sign_types[signType]) + HIST("hs"), empair1.mass(), empair1.pt(), empair1.getPairDCA(), empair1.rapidity(), cos_thetaPol, phiPol, quadmom, weight);
502+
fRegistry.fill(HIST("Pair/mix/") + HIST(pair_sign_types[signType]) + HIST("hBeta"), empair1.p() / empair1.e(), (empair2.p() / empair2.e() - empair1.p() / empair1.e()) / (empair1.p() / empair1.e()));
503+
fRegistry.fill(HIST("Pair/mix/") + HIST(pair_sign_types[signType]) + HIST("hBetaX"), empair1.px() / empair1.e(), (empair2.px() / empair2.e() - empair1.px() / empair1.e()) / (empair1.px() / empair1.e()));
504+
fRegistry.fill(HIST("Pair/mix/") + HIST(pair_sign_types[signType]) + HIST("hBetaY"), empair1.py() / empair1.e(), (empair2.py() / empair2.e() - empair1.py() / empair1.e()) / (empair1.py() / empair1.e()));
505+
fRegistry.fill(HIST("Pair/mix/") + HIST(pair_sign_types[signType]) + HIST("hBetaZ"), empair1.pz() / empair1.e(), (empair2.pz() / empair2.e() - empair1.pz() / empair1.e()) / (empair1.pz() / empair1.e()));
496506
}
497507
}
498508

499509
for (const auto& empair2 : pairs_from_col2) {
500510
auto v_pos = empair2.getPositiveLeg(); // pt, eta, phi, M
501511
auto arrD = std::array<float, 4>{static_cast<float>(v_pos.Px()), static_cast<float>(v_pos.Py()), static_cast<float>(v_pos.Pz()), leptonM2};
502512

503-
auto pairs_from_col1_sliced = std::views::filter(pairs_from_col1, [&](EMPair t) { return std::fabs(t.mass() - empair2.mass()) < accBins.cfgDM && std::fabs(t.pt() - empair2.pt()) < accBins.cfgDPt && std::fabs(t.eta() - empair2.eta()) < accBins.cfgDEta && std::fabs(RecoDecay::constrainAngle(t.phi() - empair2.phi(), -o2::constants::math::PI, 1U)) < accBins.cfgDPhi; });
513+
auto pairs_from_col1_sliced = std::views::filter(pairs_from_col1, [&](EMPair t) { return std::fabs(t.mass() - empair2.mass()) / empair2.mass() < accBins.cfgRelDM && std::fabs((t.px() - empair2.px()) / empair2.px()) < accBins.cfgRelDPx && std::fabs((t.py() - empair2.py()) / empair2.py()) < accBins.cfgRelDPy && std::fabs((t.pz() - empair2.pz()) / empair2.pz()) < accBins.cfgRelDPz; });
504514
for (const auto& empair1 : pairs_from_col1_sliced) {
505515
auto arrM = std::array<float, 4>{static_cast<float>(empair1.px()), static_cast<float>(empair1.py()), static_cast<float>(empair1.pz()), static_cast<float>(empair2.mass())};
506516
// LOGF(info, "[col2, col1] : empair2.mass() = %f, empair2.pt() = %f, empair2.eta() = %f, empair2.phi() = %f, empair1.mass() = %f, empair1.pt() = %f, empair1.eta() = %f, empair1.phi() = %f", empair2.mass(), empair2.pt(), empair2.eta(), empair2.phi(), empair1.mass(), empair1.pt(), empair1.eta(), empair1.phi());
@@ -518,6 +528,10 @@ struct DileptonPolarization {
518528
phiPol = std::fabs(phiPol);
519529
}
520530
fRegistry.fill(HIST("Pair/mix/") + HIST(pair_sign_types[signType]) + HIST("hs"), empair2.mass(), empair2.pt(), empair2.getPairDCA(), empair2.rapidity(), cos_thetaPol, phiPol, quadmom, weight);
531+
fRegistry.fill(HIST("Pair/mix/") + HIST(pair_sign_types[signType]) + HIST("hBeta"), empair2.p() / empair2.e(), (empair1.p() / empair1.e() - empair2.p() / empair2.e()) / (empair2.p() / empair2.e()));
532+
fRegistry.fill(HIST("Pair/mix/") + HIST(pair_sign_types[signType]) + HIST("hBetaX"), empair2.px() / empair2.e(), (empair1.px() / empair1.e() - empair2.px() / empair2.e()) / (empair2.px() / empair2.e()));
533+
fRegistry.fill(HIST("Pair/mix/") + HIST(pair_sign_types[signType]) + HIST("hBetaY"), empair2.py() / empair2.e(), (empair1.py() / empair1.e() - empair2.py() / empair2.e()) / (empair2.py() / empair2.e()));
534+
fRegistry.fill(HIST("Pair/mix/") + HIST(pair_sign_types[signType]) + HIST("hBetaZ"), empair2.pz() / empair2.e(), (empair1.pz() / empair1.e() - empair2.pz() / empair2.e()) / (empair2.pz() / empair2.e()));
521535
}
522536
}
523537

@@ -612,31 +626,34 @@ struct DileptonPolarization {
612626
// LOGF(info, "collision.globalIndex() = %d, dileptons_uls_per_coll.size() = %d, dileptons_lspp_per_coll.size() = %d, dileptons_lsmm_per_coll.size() = %d", collision.globalIndex(), dileptons_uls_per_coll.size(), dileptons_lspp_per_coll.size(), dileptons_lsmm_per_coll.size());
613627

614628
int nuls = 0, nlspp = 0, nlsmm = 0;
615-
for (const auto& dilepton : dileptons_uls_per_coll) { // ULS
616-
bool is_pair_ok = fillPairInfo<0>(collision, dilepton);
617-
if (is_pair_ok) {
618-
nuls++;
629+
if (cfgDoULS) {
630+
for (const auto& dilepton : dileptons_uls_per_coll) { // ULS
631+
bool is_pair_ok = fillPairInfo<0>(collision, dilepton);
632+
if (is_pair_ok) {
633+
nuls++;
634+
}
619635
}
620636
}
621-
for (const auto& dilepton : dileptons_lspp_per_coll) { // LS++
622-
bool is_pair_ok = fillPairInfo<0>(collision, dilepton);
623-
if (is_pair_ok) {
624-
nlspp++;
637+
638+
if (cfgDoLS) {
639+
for (const auto& dilepton : dileptons_lspp_per_coll) { // LS++
640+
bool is_pair_ok = fillPairInfo<0>(collision, dilepton);
641+
if (is_pair_ok) {
642+
nlspp++;
643+
}
625644
}
626-
}
627-
for (const auto& dilepton : dileptons_lsmm_per_coll) { // LS--
628-
bool is_pair_ok = fillPairInfo<0>(collision, dilepton);
629-
if (is_pair_ok) {
630-
nlsmm++;
645+
for (const auto& dilepton : dileptons_lsmm_per_coll) { // LS--
646+
bool is_pair_ok = fillPairInfo<0>(collision, dilepton);
647+
if (is_pair_ok) {
648+
nlsmm++;
649+
}
631650
}
632651
}
633652

634653
if (!cfgDoMix || !(nuls > 0 || nlspp > 0 || nlsmm > 0)) {
635654
continue;
636655
}
637656

638-
// LOGF(info, "collision.globalIndex() = %d, collision.posZ() = %f, centrality = %f, ep2 = %f, collision.ft0cOccupancyInTimeRange() = %f, zbin = %d, centbin = %d, epbin = %d, occbin = %d", collision.globalIndex(), collision.posZ(), centrality, ep2, collision.ft0cOccupancyInTimeRange(), zbin, centbin, epbin, occbin);
639-
640657
auto key_bin = std::make_tuple(zbin, centbin, epbin, occbin);
641658
auto key_df_collision = std::make_pair(ndf, collision.globalIndex()); // this gives the current event.
642659

@@ -657,13 +674,18 @@ struct DileptonPolarization {
657674
auto collisionIds_in_mixing_pool = emh_pair_uls->GetCollisionIdsFromEventPool(key_bin);
658675
LOGF(info, "iz = %d, icent = %d, iep = %d, iocc = %d, collisionIds_in_mixing_pool.size() = %d", iz, icent, iep, iocc, collisionIds_in_mixing_pool.size());
659676

660-
fillMixedPairInfo<0>(collisionIds_in_mixing_pool, emh_pair_uls);
661-
fillMixedPairInfo<1>(collisionIds_in_mixing_pool, emh_pair_lspp);
662-
fillMixedPairInfo<2>(collisionIds_in_mixing_pool, emh_pair_lsmm);
663-
}
664-
}
665-
}
666-
}
677+
if (cfgDoULS) {
678+
fillMixedPairInfo<0>(collisionIds_in_mixing_pool, emh_pair_uls);
679+
}
680+
if (cfgDoLS) {
681+
fillMixedPairInfo<1>(collisionIds_in_mixing_pool, emh_pair_lspp);
682+
fillMixedPairInfo<2>(collisionIds_in_mixing_pool, emh_pair_lsmm);
683+
}
684+
685+
} // end of iocc loop
686+
} // end of iep loop
687+
} // end of icent loop
688+
} // end of iz loop
667689

668690
delete emh_pair_uls;
669691
emh_pair_uls = 0x0;

PWGEM/Dilepton/Utils/EMTrack.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class EMTrack
5757
float px() const { return fPt * std::cos(fPhi); }
5858
float py() const { return fPt * std::sin(fPhi); }
5959
float pz() const { return fPt * std::sinh(fEta); }
60+
float e() const { return std::sqrt(std::pow(fPt * std::cosh(fEta), 2) + std::pow(fMass, 2)); } // e2 = p2 + m2
6061
float signed1Pt() const { return fCharge * 1.f / fPt; }
6162

6263
protected:

0 commit comments

Comments
 (0)