Skip to content

Commit 177407e

Browse files
jokonigjokonig
andauthored
[PWGEM] PhotonMeson: Add configurables for number of bins and axis range for inv. mass
- Deleted shadowed variable that was declared again inside an if-else statement Co-authored-by: jokonig <jokonig@cern.ch>
1 parent b197d72 commit 177407e

3 files changed

Lines changed: 19 additions & 10 deletions

File tree

‎PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ struct Pi0EtaToGammaGamma {
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"};
101101
o2::framework::Configurable<bool> cfgSparseFullAxes{"cfgSparseFullAxes", false, "add event plane, occupancy and z-vertex axes to Pair/same/hs and Pair/mix/hs"};
102+
o2::framework::Configurable<int> cfgNbinsMass{"cfgNbinsMass", 400, "number of bins for the mass axis in same and mixed events"};
103+
o2::framework::Configurable<std::vector<double>> cfgMassBinRange{"cfgMassBinRange", {0., 0.8}, "range for the mass-axis in GeV/c2"};
102104

103105
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"};
104106
o2::framework::Configurable<float> cfgAlphaMeson{"cfgAlphaMeson", 0.65, "photon energy asymmetry distribution parameter for specific value cut"};
@@ -428,9 +430,9 @@ struct Pi0EtaToGammaGamma {
428430
std::vector<double> epBinsForHs(ep_bin_edges.begin(), ep_bin_edges.end());
429431
std::vector<double> vtxBinsForHs(zvtx_bin_edges.begin(), zvtx_bin_edges.end());
430432
if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) {
431-
o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, false, "ee#gamma", cfgSparseFullAxes.value, occBinsForHs, epBinsForHs, vtxBinsForHs);
433+
o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, false, "ee#gamma", cfgSparseFullAxes.value, occBinsForHs, epBinsForHs, vtxBinsForHs, cfgNbinsMass, {cfgMassBinRange->at(0), cfgMassBinRange->at(1)});
432434
} else {
433-
o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, false, "#gamma#gamma", cfgSparseFullAxes.value, occBinsForHs, epBinsForHs, vtxBinsForHs);
435+
o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, false, "#gamma#gamma", cfgSparseFullAxes.value, occBinsForHs, epBinsForHs, vtxBinsForHs, cfgNbinsMass, {cfgMassBinRange->at(0), cfgMassBinRange->at(1)});
434436
}
435437
DefineEMEventCut();
436438
DefinePCMCut();

‎PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ struct Pi0EtaToGammaGammaMC {
8989
o2::framework::Configurable<std::string> fd_k0s_to_pi0{"fd_k0s_pi0", "1.0", "feed down correction to pi0"};
9090
o2::framework::Configurable<bool> cfgRequireTrueAssociation{"cfgRequireTrueAssociation", false, "flag to require true mc collision association"};
9191

92+
o2::framework::Configurable<int> cfgNbinsMass{"cfgNbinsMass", 400, "number of bins for the mass axis in same and mixed events"};
93+
o2::framework::Configurable<std::vector<double>> cfgMassBinRange{"cfgMassBinRange", {0., 0.8}, "range for the mass-axis in GeV/c2"};
94+
9295
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"};
9396
o2::framework::Configurable<float> cfgAlphaMeson{"cfgAlphaMeson", 0.65, "photon energy asymmetry distribution parameter for specific value cut"};
9497
o2::framework::Configurable<float> cfgAlphaMesonA{"cfgAlphaMesonA", 0.65, "photon energy asymmetry distribution parameter A for pT dependent cut (A * tanh(B*pT))"};
@@ -276,9 +279,9 @@ struct Pi0EtaToGammaGammaMC {
276279
{
277280
o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(&fRegistry);
278281
if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) {
279-
o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, true, "ee#gamma");
282+
o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, true, "ee#gamma", false, {}, {}, {}, cfgNbinsMass, {cfgMassBinRange->at(0), cfgMassBinRange->at(1)});
280283
} else {
281-
o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, true, "#gamma#gamma");
284+
o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, true, "#gamma#gamma", false, {}, {}, {}, cfgNbinsMass, {cfgMassBinRange->at(0), cfgMassBinRange->at(1)});
282285
}
283286
DefineEMEventCut();
284287
DefinePCMCut();

‎PWGEM/PhotonMeson/Utils/NMHistograms.h‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <TPDGCode.h>
3030
#include <TString.h>
3131

32+
#include <array>
3233
#include <vector>
3334

3435
namespace o2::aod::pwgem::photonmeson::utils::nmhistogram
@@ -40,12 +41,15 @@ namespace o2::aod::pwgem::photonmeson::utils::nmhistogram
4041
/// \param occBins data only: occupancy bin edges
4142
/// \param epBins data only: event plane bin edges
4243
/// \param vtxBins data only: z-vertex bin edges
43-
inline void addNMHistograms(o2::framework::HistogramRegistry* fRegistry, bool isMC,
44+
inline void addNMHistograms(o2::framework::HistogramRegistry* fRegistry,
45+
bool isMC,
4446
const char* pairname = "#gamma#gamma",
4547
bool sparseFullAxes = false,
4648
std::vector<double> const& occBins = {0, 500, 1000, 2000, 3000, 5000, 10000},
4749
std::vector<double> const& epBins = {-o2::constants::math::PIHalf, -o2::constants::math::PIQuarter, 0, o2::constants::math::PIQuarter, o2::constants::math::PIHalf},
48-
std::vector<double> const& vtxBins = {-10, -8, -6, -4, -2, 0, 2, 4, 6, 8, 10})
50+
std::vector<double> const& vtxBins = {-10, -8, -6, -4, -2, 0, 2, 4, 6, 8, 10},
51+
const int nBinsMass = 400,
52+
const std::array<double, 2> massBinRange = {0., 0.8})
4953
{
5054
// !!Don't change pt,eta,y binning. These binnings have to be consistent with binned data at skimming.!!
5155
std::vector<double> ptbins;
@@ -63,7 +67,10 @@ inline void addNMHistograms(o2::framework::HistogramRegistry* fRegistry, bool is
6367
ptbins.emplace_back(1.0 * (i - 61) + 10.0); // from 10 to 20 GeV/c, every 1 GeV/c
6468
}
6569
const o2::framework::AxisSpec axis_pt{ptbins, Form("p_{T,%s} (GeV/c)", pairname)};
66-
const o2::framework::AxisSpec axis_mass{400, 0, 0.8, Form("m_{%s} (GeV/c^{2})", pairname)};
70+
const o2::framework::AxisSpec axis_mass{nBinsMass, massBinRange[0], massBinRange[1], Form("m_{%s} (GeV/c^{2})", pairname)};
71+
const o2::framework::AxisSpec axis_occ{occBins, "occupancy"};
72+
const o2::framework::AxisSpec axis_ep{epBins, "#Psi_{2} (rad)"};
73+
const o2::framework::AxisSpec axis_vtx{vtxBins, "Z_{vtx} (cm)"};
6774

6875
if (isMC) {
6976
fRegistry->add("Pair/Pi0/hs_Primary", "rec. true pi0", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt}, true);
@@ -88,9 +95,6 @@ inline void addNMHistograms(o2::framework::HistogramRegistry* fRegistry, bool is
8895
fRegistry->get<TH2>(HIST("Generated/Eta/hPtY"))->SetYTitle("rapidity |y|");
8996
} else {
9097
if (sparseFullAxes) {
91-
const o2::framework::AxisSpec axis_occ{occBins, "occupancy"};
92-
const o2::framework::AxisSpec axis_ep{epBins, "#Psi_{2} (rad)"};
93-
const o2::framework::AxisSpec axis_vtx{vtxBins, "Z_{vtx} (cm)"};
9498
fRegistry->add("Pair/same/hs", "diphoton",
9599
o2::framework::HistType::kTHnSparseD,
96100
{axis_mass, axis_pt, axis_ep, axis_occ, axis_vtx}, true);

0 commit comments

Comments
 (0)