Skip to content

Commit bf13110

Browse files
authored
[PWGEM/Dilepton] add a task to evaluate pair acc. in MC (#13477)
1 parent 1bc012e commit bf13110

File tree

6 files changed

+486
-44
lines changed

6 files changed

+486
-44
lines changed

PWGEM/Dilepton/Core/Dilepton.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ struct Dilepton {
131131
// ConfigurableAxis ConfMmumuBins{"ConfMmumuBins", {VARIABLE_WIDTH, 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.10, 4.20, 4.30, 4.40, 4.50, 4.60, 4.70, 4.80, 4.90, 5.00, 5.10, 5.20, 5.30, 5.40, 5.50, 5.60, 5.70, 5.80, 5.90, 6.00, 6.10, 6.20, 6.30, 6.40, 6.50, 6.60, 6.70, 6.80, 6.90, 7.00, 7.10, 7.20, 7.30, 7.40, 7.50, 7.60, 7.70, 7.80, 7.90, 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.50, 12.00}, "mmumu bins for output histograms"}; // for dimuon. one can copy bins here to hyperloop page.
132132

133133
ConfigurableAxis ConfSPBins{"ConfSPBins", {200, -5, 5}, "SP bins for flow analysis"};
134-
ConfigurableAxis ConfPolarizationPhiBins{"ConfPolarizationPhiBins", {1, 0.f, 2 * M_PI}, "phi bins for polarization analysis"};
135134
ConfigurableAxis ConfPolarizationCosThetaBins{"ConfPolarizationCosThetaBins", {20, -1.f, 1.f}, "cos(theta) bins for polarization analysis"};
135+
ConfigurableAxis ConfPolarizationPhiBins{"ConfPolarizationPhiBins", {1, -M_PI, M_PI}, "phi bins for polarization analysis"};
136136
ConfigurableAxis ConfPolarizationQuadMomBins{"ConfPolarizationQuadMomBins", {15, -0.5, 1}, "quadrupole moment bins for polarization analysis"}; // quardrupole moment <(3 x cos^2(theta) -1)/2>
137137

138138
EMEventCut fEMEventCut;
@@ -973,7 +973,7 @@ struct Dilepton {
973973
} else if (cfgPolarizationFrame == 1) {
974974
o2::aod::pwgem::dilepton::utils::pairutil::getAngleHX(std::array<float, 4>{t1.px(), t1.py(), t1.pz(), leptonM1}, std::array<float, 4>{t2.px(), t2.py(), t2.pz(), leptonM2}, beamE1, beamE2, beamP1, beamP2, t1.sign(), cos_thetaPol, phiPol);
975975
}
976-
o2::math_utils::bringTo02Pi(phiPol);
976+
o2::math_utils::bringToPMPi(phiPol);
977977

978978
if (t1.sign() * t2.sign() < 0) { // ULS
979979
fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), aco, asym, std::fabs(dphi_e_ee), cos_thetaPol, weight);
@@ -1030,7 +1030,7 @@ struct Dilepton {
10301030
} else if (cfgPolarizationFrame == 1) {
10311031
o2::aod::pwgem::dilepton::utils::pairutil::getAngleHX(std::array<float, 4>{t1.px(), t1.py(), t1.pz(), leptonM1}, std::array<float, 4>{t2.px(), t2.py(), t2.pz(), leptonM2}, beamE1, beamE2, beamP1, beamP2, t1.sign(), cos_thetaPol, phiPol);
10321032
}
1033-
o2::math_utils::bringTo02Pi(phiPol);
1033+
o2::math_utils::bringToPMPi(phiPol);
10341034
float quadmom = (3.f * std::pow(cos_thetaPol, 2) - 1.f) / 2.f;
10351035

10361036
if (t1.sign() * t2.sign() < 0) { // ULS

PWGEM/Dilepton/Core/DileptonMC.h

Lines changed: 50 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include "Math/Vector4D.h"
4848
#include "TString.h"
4949

50+
#include <algorithm>
5051
#include <array>
5152
#include <format>
5253
#include <map>
@@ -127,8 +128,8 @@ struct DileptonMC {
127128
Configurable<int> cfg_nbin_aco{"cfg_nbin_aco", 1, "number of bins for acoplanarity"}; // 10
128129
Configurable<int> cfg_nbin_asym_pt{"cfg_nbin_asym_pt", 1, "number of bins for pt asymmetry"}; // 10
129130
Configurable<int> cfg_nbin_dphi_e_ee{"cfg_nbin_dphi_e_ee", 1, "number of bins for dphi_ee_e"}; // 18
130-
ConfigurableAxis ConfPolarizationPhiBins{"ConfPolarizationPhiBins", {1, 0.f, 2 * M_PI}, "phi bins for polarization analysis"};
131131
ConfigurableAxis ConfPolarizationCosThetaBins{"ConfPolarizationCosThetaBins", {1, -1.f, 1.f}, "cos(theta) bins for polarization analysis"};
132+
ConfigurableAxis ConfPolarizationPhiBins{"ConfPolarizationPhiBins", {1, -M_PI, M_PI}, "phi bins for polarization analysis"};
132133
Configurable<int> cfgPolarizationFrame{"cfgPolarizationFrame", 0, "frame of polarization. 0:CS, 1:HX, else:FATAL"};
133134
ConfigurableAxis ConfPolarizationQuadMomBins{"ConfPolarizationQuadMomBins", {1, -0.5, 1}, "quadrupole moment bins for polarization analysis"}; // quardrupole moment <(3 x cos^2(theta) -1)/2>
134135

@@ -803,27 +804,57 @@ struct DileptonMC {
803804
}
804805

805806
template <typename TTrack, typename TMCParticles>
806-
int FindLF(TTrack const& posmc, TTrack const& negmc, TMCParticles const& mcparticles)
807+
int FindSMULS(TTrack const& t1mc, TTrack const& t2mc, TMCParticles const& mcparticles)
807808
{
808809
int arr[] = {
809-
FindCommonMotherFrom2Prongs(posmc, negmc, -pdg_lepton, pdg_lepton, 22, mcparticles),
810-
FindCommonMotherFrom2Prongs(posmc, negmc, -pdg_lepton, pdg_lepton, 111, mcparticles),
811-
FindCommonMotherFrom2Prongs(posmc, negmc, -pdg_lepton, pdg_lepton, 221, mcparticles),
812-
FindCommonMotherFrom2Prongs(posmc, negmc, -pdg_lepton, pdg_lepton, 331, mcparticles),
813-
FindCommonMotherFrom2Prongs(posmc, negmc, -pdg_lepton, pdg_lepton, 113, mcparticles),
814-
FindCommonMotherFrom2Prongs(posmc, negmc, -pdg_lepton, pdg_lepton, 223, mcparticles),
815-
FindCommonMotherFrom2Prongs(posmc, negmc, -pdg_lepton, pdg_lepton, 333, mcparticles),
816-
FindCommonMotherFrom2Prongs(posmc, negmc, -pdg_lepton, pdg_lepton, 443, mcparticles),
817-
FindCommonMotherFrom2Prongs(posmc, negmc, -pdg_lepton, pdg_lepton, 100443, mcparticles)
818-
// FindCommonMotherFrom2Prongs(posmc, negmc, -pdg_lepton, pdg_lepton, 553, mcparticles),
819-
// FindCommonMotherFrom2Prongs(posmc, negmc, -pdg_lepton, pdg_lepton, 100553, mcparticles),
820-
// FindCommonMotherFrom2Prongs(posmc, negmc, -pdg_lepton, pdg_lepton, 200553, mcparticles)
810+
FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 22, mcparticles),
811+
FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 111, mcparticles),
812+
FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 221, mcparticles),
813+
FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 331, mcparticles),
814+
FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 113, mcparticles),
815+
FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 223, mcparticles),
816+
FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 333, mcparticles),
817+
FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 443, mcparticles),
818+
FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 100443, mcparticles)
819+
// FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 553, mcparticles),
820+
// FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 100553, mcparticles),
821+
// FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 200553, mcparticles)
821822
};
822823
int size = sizeof(arr) / sizeof(*arr);
823824
int max = *std::max_element(arr, arr + size);
824825
return max;
825826
}
826827

828+
template <typename TTrack, typename TMCParticles>
829+
int FindSMLSPP(TTrack const& t1mc, TTrack const& t2mc, TMCParticles const& mcparticles)
830+
{
831+
int arr[] = {
832+
FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 111, mcparticles),
833+
FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 221, mcparticles),
834+
FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 331, mcparticles),
835+
FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 113, mcparticles),
836+
FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 223, mcparticles),
837+
FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 333, mcparticles)};
838+
int size = sizeof(arr) / sizeof(*arr);
839+
int max = *std::max_element(arr, arr + size);
840+
return max;
841+
}
842+
843+
template <typename TTrack, typename TMCParticles>
844+
int FindSMLSMM(TTrack const& t1mc, TTrack const& t2mc, TMCParticles const& mcparticles)
845+
{
846+
int arr[] = {
847+
FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 111, mcparticles),
848+
FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 221, mcparticles),
849+
FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 331, mcparticles),
850+
FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 113, mcparticles),
851+
FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 223, mcparticles),
852+
FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 333, mcparticles)};
853+
int size = sizeof(arr) / sizeof(*arr);
854+
int max = *std::max_element(arr, arr + size);
855+
return max;
856+
}
857+
827858
template <bool isSmeared, typename T>
828859
bool isInAcceptance(T const& lepton)
829860
{
@@ -1490,7 +1521,7 @@ struct DileptonMC {
14901521
} else if (cfgPolarizationFrame == 1) {
14911522
o2::aod::pwgem::dilepton::utils::pairutil::getAngleHX(arrP1, arrP2, beamE1, beamE2, beamP1, beamP2, t1.sign(), cos_thetaPol, phiPol);
14921523
}
1493-
o2::math_utils::bringTo02Pi(phiPol);
1524+
o2::math_utils::bringToPMPi(phiPol);
14941525
float quadmom = (3.f * std::pow(cos_thetaPol, 2) - 1.f) / 2.f;
14951526

14961527
if ((FindCommonMotherFrom2ProngsWithoutPDG(t1mc, t2mc) > 0 || IsHF(t1mc, t2mc, mcparticles) > 0) && is_pair_from_same_mcevent) { // for bkg study
@@ -1533,7 +1564,7 @@ struct DileptonMC {
15331564
if (cfgRequireTrueAssociation && (t1mc.emmceventId() != collision.emmceventId() || t2mc.emmceventId() != collision.emmceventId())) {
15341565
return false;
15351566
}
1536-
int mother_id = FindLF(t1mc, t2mc, mcparticles);
1567+
int mother_id = std::max({FindSMULS(t1mc, t2mc, mcparticles), FindSMULS(t2mc, t1mc, mcparticles), FindSMLSPP(t1mc, t2mc, mcparticles), FindSMLSMM(t1mc, t2mc, mcparticles)});
15371568
int hfee_type = IsHF(t1mc, t2mc, mcparticles);
15381569
if (mother_id < 0 && hfee_type < 0) {
15391570
return false;
@@ -1708,7 +1739,7 @@ struct DileptonMC {
17081739
return false;
17091740
}
17101741

1711-
int mother_id = FindLF(t1, t2, mcparticles);
1742+
int mother_id = std::max({FindSMULS(t1, t2, mcparticles), FindSMULS(t2, t1, mcparticles), FindSMLSPP(t1, t2, mcparticles), FindSMLSMM(t1, t2, mcparticles)});
17121743
int hfee_type = IsHF(t1, t2, mcparticles);
17131744
if (mother_id < 0 && hfee_type < 0) {
17141745
return false;
@@ -1797,7 +1828,7 @@ struct DileptonMC {
17971828
} else if (cfgPolarizationFrame == 1) {
17981829
o2::aod::pwgem::dilepton::utils::pairutil::getAngleHX(arrP1, arrP2, beamE1, beamE2, beamP1, beamP2, -t1.pdgCode() / pdg_lepton, cos_thetaPol, phiPol);
17991830
}
1800-
o2::math_utils::bringTo02Pi(phiPol);
1831+
o2::math_utils::bringToPMPi(phiPol);
18011832
float quadmom = (3.f * std::pow(cos_thetaPol, 2) - 1.f) / 2.f;
18021833

18031834
// bool isInAcc = isInAcceptance<isSmeared>(t1) && isInAcceptance<isSmeared>(t2);
@@ -2226,7 +2257,7 @@ struct DileptonMC {
22262257
if (!((t1mc.isPhysicalPrimary() || t1mc.producedByGenerator()) && (t2mc.isPhysicalPrimary() || t2mc.producedByGenerator()))) {
22272258
return false;
22282259
}
2229-
int mother_id = FindLF(t1mc, t2mc, mcparticles);
2260+
int mother_id = std::max({FindSMULS(t1mc, t2mc, mcparticles), FindSMULS(t2mc, t1mc, mcparticles), FindSMLSPP(t1mc, t2mc, mcparticles), FindSMLSMM(t1mc, t2mc, mcparticles)});
22302261
int hfee_type = IsHF(t1mc, t2mc, mcparticles);
22312262
if (mother_id < 0 && hfee_type < 0) {
22322263
return false;

PWGEM/Dilepton/TableProducer/associateMCinfoDilepton.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ struct AssociateMCInfoDilepton {
6060
Configurable<int> n_dummy_loop{"n_dummy_loop", 0, "for loop runs over n times"};
6161
Configurable<float> down_scaling_omega{"down_scaling_omega", 1.1, "down scaling factor to store omega"};
6262
Configurable<float> down_scaling_phi{"down_scaling_phi", 1.1, "down scaling factor to store phi"};
63-
Configurable<float> min_eta_gen_primary{"min_eta_gen_primary", -1.5, "min rapidity Y to store generated information"}; // smearing is applied at analysis stage. set wider value.
64-
Configurable<float> max_eta_gen_primary{"max_eta_gen_primary", +1.5, "max rapidity Y to store generated information"}; // smearing is applied at analysis stage. set wider value.
65-
Configurable<float> min_eta_gen_primary_fwd{"min_eta_gen_primary_fwd", -5.0, "min eta to store generated information"}; // smearing is applied at analysis stage. set wider value.
66-
Configurable<float> max_eta_gen_primary_fwd{"max_eta_gen_primary_fwd", -1.5, "max eta to store generated information"}; // smearing is applied at analysis stage. set wider value.
63+
Configurable<float> min_eta_gen_primary{"min_eta_gen_primary", -1.5, "min eta to store generated information"}; // smearing is applied at analysis stage. set wider value.
64+
Configurable<float> max_eta_gen_primary{"max_eta_gen_primary", +1.5, "max eta to store generated information"}; // smearing is applied at analysis stage. set wider value.
65+
Configurable<float> min_eta_gen_primary_fwd{"min_eta_gen_primary_fwd", -6.0, "min eta to store generated information"}; // smearing is applied at analysis stage. set wider value.
66+
Configurable<float> max_eta_gen_primary_fwd{"max_eta_gen_primary_fwd", -1.0, "max eta to store generated information"}; // smearing is applied at analysis stage. set wider value.
6767

6868
HistogramRegistry registry{"EMMCEvent"};
6969
std::mt19937 engine;

PWGEM/Dilepton/Tasks/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,7 @@ o2physics_add_dpl_workflow(study-dcafitter
171171
PUBLIC_LINK_LIBRARIES O2::Framework O2::DCAFitter O2Physics::AnalysisCore
172172
COMPONENT_NAME Analysis)
173173

174+
o2physics_add_dpl_workflow(evaluate-acceptance
175+
SOURCES evaluateAcceptance.cxx
176+
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
177+
COMPONENT_NAME Analysis)

0 commit comments

Comments
 (0)