Skip to content
Merged
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
26 changes: 23 additions & 3 deletions PWGEM/Dilepton/Tasks/dileptonPolarization.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
ConfigurableAxis ConfEPBins{"ConfEPBins", {1, -M_PI / 2, +M_PI / 2}, "Mixing bins - event plane angle"};
ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"};
Configurable<int> cfgPolarizationFrame{"cfgPolarizationFrame", 0, "frame of polarization. 0:CS, 1:HX, else:FATAL"};
Configurable<bool> cfgUseAbs{"cfgUseAbs", false, "flag to use absolute value for cos_theta and phi"}; // this is to increase statistics per bin.

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"};
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"};
Expand Down Expand Up @@ -175,6 +176,8 @@
} else if (cfgPairType.value == static_cast<int>(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon)) {
leptonM1 = o2::constants::physics::MassMuon;
leptonM2 = o2::constants::physics::MassMuon;
} else {
LOG(fatal) << "Please select either dielectron or dimuon";
}

if (ConfVtxBins.value[0] == VARIABLE_WIDTH) {
Expand Down Expand Up @@ -488,6 +491,11 @@
o2::math_utils::bringToPMPi(phiPol);
float quadmom = (3.f * std::pow(cos_thetaPol, 2) - 1.f) / 2.f;

if (cfgUseAbs) {
cos_thetaPol = std::fabs(cos_thetaPol);
phiPol = std::fabs(phiPol);
}

if (dilepton.sign1() * dilepton.sign2() < 0) { // ULS
fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), cos_thetaPol, phiPol, quadmom, weight);
} else if (dilepton.sign1() > 0 && dilepton.sign2() > 0) { // LS++
Expand All @@ -500,21 +508,21 @@
int mbin = lower_bound(mll_bin_edges.begin(), mll_bin_edges.end(), v12.M()) - mll_bin_edges.begin() - 1;
if (mbin < 0) {
mbin = 0;
} else if (static_cast<int>(mll_bin_edges.size()) - 2 < mbin) {

Check failure on line 511 in PWGEM/Dilepton/Tasks/dileptonPolarization.cxx

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.
mbin = static_cast<int>(mll_bin_edges.size()) - 2;
}

int ptbin = lower_bound(ptll_bin_edges.begin(), ptll_bin_edges.end(), v12.Pt()) - ptll_bin_edges.begin() - 1;
if (ptbin < 0) {
ptbin = 0;
} else if (static_cast<int>(ptll_bin_edges.size()) - 2 < ptbin) {

Check failure on line 518 in PWGEM/Dilepton/Tasks/dileptonPolarization.cxx

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.
ptbin = static_cast<int>(ptll_bin_edges.size()) - 2;
}

int etabin = lower_bound(etall_bin_edges.begin(), etall_bin_edges.end(), v12.Eta()) - etall_bin_edges.begin() - 1;
if (etabin < 0) {
etabin = 0;
} else if (static_cast<int>(etall_bin_edges.size()) - 2 < etabin) {

Check failure on line 525 in PWGEM/Dilepton/Tasks/dileptonPolarization.cxx

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.
etabin = static_cast<int>(etall_bin_edges.size()) - 2;
}

Expand All @@ -523,7 +531,7 @@
int phibin = lower_bound(phill_bin_edges.begin(), phill_bin_edges.end(), phi12) - phill_bin_edges.begin() - 1;
if (phibin < 0) {
phibin = 0;
} else if (static_cast<int>(phill_bin_edges.size()) - 2 < phibin) {

Check failure on line 534 in PWGEM/Dilepton/Tasks/dileptonPolarization.cxx

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.
phibin = static_cast<int>(phill_bin_edges.size()) - 2;
}

Expand Down Expand Up @@ -618,21 +626,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 629 in PWGEM/Dilepton/Tasks/dileptonPolarization.cxx

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 636 in PWGEM/Dilepton/Tasks/dileptonPolarization.cxx

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 643 in PWGEM/Dilepton/Tasks/dileptonPolarization.cxx

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 All @@ -647,7 +655,7 @@

if (occbin < 0) {
occbin = 0;
} else if (static_cast<int>(occ_bin_edges.size()) - 2 < occbin) {

Check failure on line 658 in PWGEM/Dilepton/Tasks/dileptonPolarization.cxx

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.
occbin = static_cast<int>(occ_bin_edges.size()) - 2;
}

Expand Down Expand Up @@ -682,14 +690,14 @@
int mbin = lower_bound(mll_bin_edges.begin(), mll_bin_edges.end(), empair1.mass()) - mll_bin_edges.begin() - 1;
if (mbin < 0) {
mbin = 0;
} else if (static_cast<int>(mll_bin_edges.size()) - 2 < mbin) {

Check failure on line 693 in PWGEM/Dilepton/Tasks/dileptonPolarization.cxx

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.
mbin = static_cast<int>(mll_bin_edges.size()) - 2;
}

int ptbin = lower_bound(ptll_bin_edges.begin(), ptll_bin_edges.end(), empair1.pt()) - ptll_bin_edges.begin() - 1;
if (ptbin < 0) {
ptbin = 0;
} else if (static_cast<int>(ptll_bin_edges.size()) - 2 < ptbin) {

Check failure on line 700 in PWGEM/Dilepton/Tasks/dileptonPolarization.cxx

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.
ptbin = static_cast<int>(ptll_bin_edges.size()) - 2;
}

Expand All @@ -711,14 +719,18 @@
auto empair2 = std::get<4>(pair2);
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())};

float cos_thetaPol = 999, phiPol = 999.f;
float cos_thetaPol = 999.f, phiPol = 999.f;
if (cfgPolarizationFrame == 0) {
o2::aod::pwgem::dilepton::utils::pairutil::getAngleCS(arrM, arrD, beamE1, beamE2, beamP1, beamP2, cos_thetaPol, phiPol);
} else if (cfgPolarizationFrame == 1) {
o2::aod::pwgem::dilepton::utils::pairutil::getAngleHX(arrM, arrD, beamE1, beamE2, beamP1, beamP2, cos_thetaPol, phiPol);
}
o2::math_utils::bringToPMPi(phiPol);
float quadmom = (3.f * std::pow(cos_thetaPol, 2) - 1.f) / 2.f;
if (cfgUseAbs) {
cos_thetaPol = std::fabs(cos_thetaPol);
phiPol = std::fabs(phiPol);
}
fRegistry.fill(HIST("Pair/mix/uls/hs"), empair1.mass(), empair1.pt(), empair1.getPairDCA(), empair1.rapidity(), cos_thetaPol, phiPol, quadmom, weight);
}
} // end of ULS
Expand Down Expand Up @@ -760,14 +772,18 @@
auto empair2 = std::get<4>(pair2);
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())};

float cos_thetaPol = 999, phiPol = 999.f;
float cos_thetaPol = 999.f, phiPol = 999.f;
if (cfgPolarizationFrame == 0) {
o2::aod::pwgem::dilepton::utils::pairutil::getAngleCS(arrM, arrD, beamE1, beamE2, beamP1, beamP2, cos_thetaPol, phiPol);
} else if (cfgPolarizationFrame == 1) {
o2::aod::pwgem::dilepton::utils::pairutil::getAngleHX(arrM, arrD, beamE1, beamE2, beamP1, beamP2, cos_thetaPol, phiPol);
}
o2::math_utils::bringToPMPi(phiPol);
float quadmom = (3.f * std::pow(cos_thetaPol, 2) - 1.f) / 2.f;
if (cfgUseAbs) {
cos_thetaPol = std::fabs(cos_thetaPol);
phiPol = std::fabs(phiPol);
}
fRegistry.fill(HIST("Pair/mix/lspp/hs"), empair1.mass(), empair1.pt(), empair1.getPairDCA(), empair1.rapidity(), cos_thetaPol, phiPol, quadmom, weight);
}
} // end of LS++
Expand Down Expand Up @@ -809,14 +825,18 @@
auto empair2 = std::get<4>(pair2);
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())};

float cos_thetaPol = 999, phiPol = 999.f;
float cos_thetaPol = 999.f, phiPol = 999.f;
if (cfgPolarizationFrame == 0) {
o2::aod::pwgem::dilepton::utils::pairutil::getAngleCS(arrM, arrD, beamE1, beamE2, beamP1, beamP2, cos_thetaPol, phiPol);
} else if (cfgPolarizationFrame == 1) {
o2::aod::pwgem::dilepton::utils::pairutil::getAngleHX(arrM, arrD, beamE1, beamE2, beamP1, beamP2, cos_thetaPol, phiPol);
}
o2::math_utils::bringToPMPi(phiPol);
float quadmom = (3.f * std::pow(cos_thetaPol, 2) - 1.f) / 2.f;
if (cfgUseAbs) {
cos_thetaPol = std::fabs(cos_thetaPol);
phiPol = std::fabs(phiPol);
}
fRegistry.fill(HIST("Pair/mix/lsmm/hs"), empair1.mass(), empair1.pt(), empair1.getPairDCA(), empair1.rapidity(), cos_thetaPol, phiPol, quadmom, weight);
}
} // end of LS--
Expand Down
Loading