Skip to content

Commit 272ec9b

Browse files
Ana Marin GarciaAna Marin Garcia
authored andcommitted
Store the mixing categories if flag is true
1 parent 2e700dd commit 272ec9b

2 files changed

Lines changed: 53 additions & 9 deletions

File tree

‎PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h‎

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ struct Pi0EtaToGammaGamma {
9898
o2::framework::ConfigurableAxis ConfCentBins{"ConfCentBins", {o2::framework::VARIABLE_WIDTH, 0.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.f, 999.f}, "Mixing bins - centrality"};
9999
o2::framework::ConfigurableAxis ConfEPBins{"ConfEPBins", {o2::framework::VARIABLE_WIDTH, -o2::constants::math::PIHalf, -o2::constants::math::PIQuarter, 0.0f, +o2::constants::math::PIQuarter, +o2::constants::math::PIHalf}, "Mixing bins - event plane angle"};
100100
o2::framework::ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {o2::framework::VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"};
101+
o2::framework::Configurable<bool> cfgSparseFullAxes{"cfgSparseFullAxes", false, "add event plane, occupancy and z-vertex axes to Pair/same/hs and Pair/mix/hs"};
101102

102103
o2::framework::Configurable<int> cfgAlphaMesonCut{"cfgAlphaMesonCut", 0, "flag for photon energy asymmetry distribution cut: 0: no cut, 1: cut specific value, 2: cut depending on pT"};
103104
o2::framework::Configurable<float> cfgAlphaMeson{"cfgAlphaMeson", 0.65, "photon energy asymmetry distribution parameter for specific value cut"};
@@ -423,10 +424,13 @@ struct Pi0EtaToGammaGamma {
423424
emh2 = new o2::aod::pwgem::dilepton::utils::EventMixingHandler<std::tuple<int, int, int, int>, std::pair<int, int>, o2::aod::pwgem::photonmeson::utils::EMPhoton>(ndepth);
424425

425426
o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(&fRegistry);
427+
std::vector<double> occBinsForHs(occ_bin_edges.begin(), occ_bin_edges.end());
428+
std::vector<double> epBinsForHs(ep_bin_edges.begin(), ep_bin_edges.end());
429+
std::vector<double> vtxBinsForHs(zvtx_bin_edges.begin(), zvtx_bin_edges.end());
426430
if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) {
427-
o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, false, "ee#gamma");
431+
o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, false, cfgSparseFullAxes.value, occBinsForHs, epBinsForHs, vtxBinsForHs, "ee#gamma");
428432
} else {
429-
o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, false, "#gamma#gamma");
433+
o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, false, cfgSparseFullAxes.value, occBinsForHs, epBinsForHs, vtxBinsForHs, "#gamma#gamma");
430434
}
431435
DefineEMEventCut();
432436
DefinePCMCut();
@@ -800,6 +804,8 @@ struct Pi0EtaToGammaGamma {
800804
occbin = static_cast<int>(occ_bin_edges.size()) - 2;
801805
}
802806

807+
float occupancy = (cfgOccupancyEstimator == 1) ? static_cast<float>(collision.trackOccupancyInTimeRange()) : collision.ft0cOccupancyInTimeRange();
808+
803809
// LOGF(info, "collision.globalIndex() = %d, collision.posZ() = %f, centrality = %f, ep2 = %f, collision.trackOccupancyInTimeRange() = %d, zbin = %d, centbin = %d, epbin = %d, occbin = %d", collision.globalIndex(), collision.posZ(), centrality, ep2, collision.trackOccupancyInTimeRange(), zbin, centbin, epbin, occbin);
804810

805811
std::tuple<int, int, int, int> key_bin = std::make_tuple(zbin, centbin, epbin, occbin);
@@ -859,7 +865,11 @@ struct Pi0EtaToGammaGamma {
859865
continue;
860866
}
861867

862-
fRegistry.fill(HIST("Pair/same/hs"), veeg.M(), veeg.Pt(), weight);
868+
if (cfgSparseFullAxes.value) {
869+
fRegistry.fill(HIST("Pair/same/hs"), veeg.M(), veeg.Pt(), ep2, occupancy, collision.posZ(), weight);
870+
} else {
871+
fRegistry.fill(HIST("Pair/same/hs"), veeg.M(), veeg.Pt(), weight);
872+
}
863873

864874
std::pair<int, int> tuple_tmp_id2 = std::make_pair(pos2.trackId(), ele2.trackId());
865875
if (std::find(used_photonIds_per_col.begin(), used_photonIds_per_col.end(), g1.globalIndex()) == used_photonIds_per_col.end()) {
@@ -953,7 +963,11 @@ struct Pi0EtaToGammaGamma {
953963
wpair *= g2.omegaMBWeight();
954964
}
955965

956-
fRegistry.fill(HIST("Pair/same/hs"), v12.M(), v12.Pt(), wpair);
966+
if (cfgSparseFullAxes.value) {
967+
fRegistry.fill(HIST("Pair/same/hs"), v12.M(), v12.Pt(), ep2, occupancy, collision.posZ(), wpair);
968+
} else {
969+
fRegistry.fill(HIST("Pair/same/hs"), v12.M(), v12.Pt(), wpair);
970+
}
957971

958972
if (std::find(used_photonIds_per_col.begin(), used_photonIds_per_col.end(), g1.globalIndex()) == used_photonIds_per_col.end()) {
959973
auto emphoton1 = o2::aod::pwgem::photonmeson::utils::EMPhoton(g1.pt(), g1.eta(), g1.phi(), 0);
@@ -1047,7 +1061,11 @@ struct Pi0EtaToGammaGamma {
10471061
continue;
10481062
}
10491063

1050-
fRegistry.fill(HIST("Pair/mix/hs"), v12.M(), v12.Pt(), weight);
1064+
if (cfgSparseFullAxes.value) {
1065+
fRegistry.fill(HIST("Pair/mix/hs"), v12.M(), v12.Pt(), ep2, occupancy, collision.posZ(), weight);
1066+
} else {
1067+
fRegistry.fill(HIST("Pair/mix/hs"), v12.M(), v12.Pt(), weight);
1068+
}
10511069
}
10521070
}
10531071
} // end of loop over mixed event pool
@@ -1082,7 +1100,11 @@ struct Pi0EtaToGammaGamma {
10821100
if (std::fabs(v12.Rapidity()) > maxY) {
10831101
continue;
10841102
}
1085-
fRegistry.fill(HIST("Pair/mix/hs"), v12.M(), v12.Pt(), weight);
1103+
if (cfgSparseFullAxes.value) {
1104+
fRegistry.fill(HIST("Pair/mix/hs"), v12.M(), v12.Pt(), ep2, occupancy, collision.posZ(), weight);
1105+
} else {
1106+
fRegistry.fill(HIST("Pair/mix/hs"), v12.M(), v12.Pt(), weight);
1107+
}
10861108
}
10871109
}
10881110
} // end of loop over mixed event pool
@@ -1115,7 +1137,11 @@ struct Pi0EtaToGammaGamma {
11151137
if (std::fabs(v12.Rapidity()) > maxY) {
11161138
continue;
11171139
}
1118-
fRegistry.fill(HIST("Pair/mix/hs"), v12.M(), v12.Pt(), weight);
1140+
if (cfgSparseFullAxes.value) {
1141+
fRegistry.fill(HIST("Pair/mix/hs"), v12.M(), v12.Pt(), ep2, occupancy, collision.posZ(), weight);
1142+
} else {
1143+
fRegistry.fill(HIST("Pair/mix/hs"), v12.M(), v12.Pt(), weight);
1144+
}
11191145
}
11201146
}
11211147
} // end of loop over mixed event pool

‎PWGEM/PhotonMeson/Utils/NMHistograms.h‎

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@
3232

3333
namespace o2::aod::pwgem::photonmeson::utils::nmhistogram
3434
{
35-
inline void addNMHistograms(o2::framework::HistogramRegistry* fRegistry, bool isMC, const char* pairname = "#gamma#gamma")
35+
inline void addNMHistograms(o2::framework::HistogramRegistry* fRegistry, bool isMC,
36+
bool sparseFullAxes = false,
37+
std::vector<double> const& occBins = {0, 500, 1000, 2000, 3000, 5000, 10000},
38+
std::vector<double> const& epBins = {-M_PI/2, -M_PI/4, 0, M_PI/4, M_PI/2},
39+
std::vector<double> const& vtxBins = {-10, -8, -6, -4, -2, 0, 2, 4, 6, 8, 10},
40+
const char* pairname = "#gamma#gamma")
3641
{
3742
// !!Don't change pt,eta,y binning. These binnings have to be consistent with binned data at skimming.!!
3843
std::vector<double> ptbins;
@@ -51,6 +56,9 @@ inline void addNMHistograms(o2::framework::HistogramRegistry* fRegistry, bool is
5156
}
5257
const o2::framework::AxisSpec axis_pt{ptbins, Form("p_{T,%s} (GeV/c)", pairname)};
5358
const o2::framework::AxisSpec axis_mass{400, 0, 0.8, Form("m_{%s} (GeV/c^{2})", pairname)};
59+
const o2::framework::AxisSpec axis_occ{occBins, "occupancy"};
60+
const o2::framework::AxisSpec axis_ep {epBins, "#Psi_{2} (rad)"};
61+
const o2::framework::AxisSpec axis_vtx{vtxBins, "Z_{vtx} (cm)"};
5462

5563
if (isMC) {
5664
fRegistry->add("Pair/Pi0/hs_Primary", "rec. true pi0", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt}, true);
@@ -74,9 +82,19 @@ inline void addNMHistograms(o2::framework::HistogramRegistry* fRegistry, bool is
7482
fRegistry->get<TH2>(HIST("Generated/Eta/hPtY"))->SetXTitle("p_{T} (GeV/c)");
7583
fRegistry->get<TH2>(HIST("Generated/Eta/hPtY"))->SetYTitle("rapidity |y|");
7684
} else {
77-
fRegistry->add("Pair/same/hs", "diphoton", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt}, true);
85+
if (sparseFullAxes) {
86+
fRegistry->add("Pair/same/hs", "diphoton",
87+
o2::framework::HistType::kTHnSparseD,
88+
{axis_mass, axis_pt, axis_ep, axis_occ, axis_vtx}, true);
89+
} else {
90+
fRegistry->add("Pair/same/hs", "diphoton",
91+
o2::framework::HistType::kTHnSparseD,
92+
{axis_mass, axis_pt}, true);
93+
}
7894
fRegistry->addClone("Pair/same/", "Pair/mix/");
7995
}
96+
97+
8098
}
8199

82100
template <typename TDiphoton, o2::soa::is_iterator TMCParitlce, o2::soa::is_table TMCParticles, o2::soa::is_table TMCCollisions>

0 commit comments

Comments
 (0)