Skip to content

Commit 73405a7

Browse files
nstrangmNicolas Strangmann
andauthored
[PWGEM/PhotonMeson] Changes to BC wise pi0 task (AliceO2Group#11091)
Co-authored-by: Nicolas Strangmann <[email protected]>
1 parent e0e0b91 commit 73405a7

File tree

3 files changed

+23
-16
lines changed

3 files changed

+23
-16
lines changed

PWGEM/PhotonMeson/DataModel/bcWiseTables.h

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#ifndef PWGEM_PHOTONMESON_DATAMODEL_BCWISETABLES_H_
2020
#define PWGEM_PHOTONMESON_DATAMODEL_BCWISETABLES_H_
2121

22+
#include <limits>
23+
2224
#include "Framework/AnalysisDataModel.h"
2325

2426
namespace o2::aod
@@ -96,14 +98,14 @@ DECLARE_SOA_COLUMN(StoredM02, storedM02, int16_t); //! shower shape
9698
DECLARE_SOA_COLUMN(StoredTime, storedTime, int16_t); //! cluster time (10 ps resolution)
9799
DECLARE_SOA_COLUMN(StoredIsExotic, storedIsExotic, bool); //! flag to mark cluster as exotic
98100

99-
DECLARE_SOA_DYNAMIC_COLUMN(Definition, definition, [](int8_t storedDefinition) -> int8_t { return storedDefinition; }); //! cluster definition, see EMCALClusterDefinition.h
100-
DECLARE_SOA_DYNAMIC_COLUMN(E, e, [](int16_t storedE) -> float { return storedE / emdownscaling::downscalingFactors[emdownscaling::kEnergy]; }); //! cluster energy (GeV)
101-
DECLARE_SOA_DYNAMIC_COLUMN(Eta, eta, [](int16_t storedEta) -> float { return storedEta / emdownscaling::downscalingFactors[emdownscaling::kEta]; }); //! cluster pseudorapidity
102-
DECLARE_SOA_DYNAMIC_COLUMN(Phi, phi, [](uint16_t storedPhi) -> float { return storedPhi / emdownscaling::downscalingFactors[emdownscaling::kPhi]; }); //! cluster azimuthal angle (0 to 2pi)
103-
DECLARE_SOA_DYNAMIC_COLUMN(NCells, nCells, [](int16_t storedNCells) -> int16_t { return storedNCells; }); //! number of cells in cluster
104-
DECLARE_SOA_DYNAMIC_COLUMN(M02, m02, [](int16_t storedM02) -> float { return storedM02 / emdownscaling::downscalingFactors[emdownscaling::kM02]; }); //! shower shape long axis
105-
DECLARE_SOA_DYNAMIC_COLUMN(Time, time, [](int16_t storedTime) -> float { return storedTime / emdownscaling::downscalingFactors[emdownscaling::kTime]; }); //! cluster time (ns)
106-
DECLARE_SOA_DYNAMIC_COLUMN(IsExotic, isExotic, [](bool storedIsExotic) -> bool { return storedIsExotic; }); //! flag to mark cluster as exotic
101+
DECLARE_SOA_DYNAMIC_COLUMN(Definition, definition, [](int8_t storedDefinition) -> int8_t { return storedDefinition; }); //! cluster definition, see EMCALClusterDefinition.h
102+
DECLARE_SOA_DYNAMIC_COLUMN(E, e, [](int16_t storedE) -> float { return storedE / emdownscaling::downscalingFactors[emdownscaling::kEnergy] + std::numeric_limits<float>::epsilon(); }); //! cluster energy (GeV)
103+
DECLARE_SOA_DYNAMIC_COLUMN(Eta, eta, [](int16_t storedEta) -> float { return storedEta / emdownscaling::downscalingFactors[emdownscaling::kEta] + std::numeric_limits<float>::epsilon(); }); //! cluster pseudorapidity
104+
DECLARE_SOA_DYNAMIC_COLUMN(Phi, phi, [](uint16_t storedPhi) -> float { return storedPhi / emdownscaling::downscalingFactors[emdownscaling::kPhi] + std::numeric_limits<float>::epsilon(); }); //! cluster azimuthal angle (0 to 2pi)
105+
DECLARE_SOA_DYNAMIC_COLUMN(NCells, nCells, [](int16_t storedNCells) -> int16_t { return storedNCells; }); //! number of cells in cluster
106+
DECLARE_SOA_DYNAMIC_COLUMN(M02, m02, [](int16_t storedM02) -> float { return storedM02 / emdownscaling::downscalingFactors[emdownscaling::kM02] + std::numeric_limits<float>::epsilon(); }); //! shower shape long axis
107+
DECLARE_SOA_DYNAMIC_COLUMN(Time, time, [](int16_t storedTime) -> float { return storedTime / emdownscaling::downscalingFactors[emdownscaling::kTime] + std::numeric_limits<float>::epsilon(); }); //! cluster time (ns)
108+
DECLARE_SOA_DYNAMIC_COLUMN(IsExotic, isExotic, [](bool storedIsExotic) -> bool { return storedIsExotic; }); //! flag to mark cluster as exotic
107109

108110
DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](float storedE, float storedEta) -> float { return storedE / emdownscaling::downscalingFactors[emdownscaling::kEnergy] / std::cosh(storedEta / emdownscaling::downscalingFactors[emdownscaling::kEta]); }); //! cluster pt, assuming m=0 (photons)
109111
} // namespace bcwisecluster
@@ -120,7 +122,7 @@ DECLARE_SOA_COLUMN(IsAccepted, isAccepted, bool); //! Both decay photons are wit
120122
DECLARE_SOA_COLUMN(IsPrimary, isPrimary, bool); //! mcParticle.isPhysicalPrimary() || mcParticle.producedByGenerator()
121123
DECLARE_SOA_COLUMN(IsFromWD, isFromWD, bool); //! Pi0 from a weak decay according to pwgem::photonmeson::utils::mcutil::IsFromWD
122124

123-
DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](uint16_t storedpt) -> float { return storedpt / emdownscaling::downscalingFactors[emdownscaling::kpT]; }); //! pT of pi0 (GeV)
125+
DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](uint16_t storedpt) -> float { return storedpt / emdownscaling::downscalingFactors[emdownscaling::kpT] + std::numeric_limits<float>::epsilon(); }); //! pT of pi0 (GeV)
124126
} // namespace bcwisemcpi0s
125127

126128
DECLARE_SOA_TABLE(BCWiseMCPi0s, "AOD", "BCWISEMCPI0", //! table of pi0s on MC level
@@ -132,7 +134,7 @@ namespace bcwisemccluster
132134
DECLARE_SOA_COLUMN(Pi0ID, pi0ID, int32_t); //! Index of the mother pi0 (-1 if not from pi0)
133135
DECLARE_SOA_COLUMN(StoredTrueE, storedTrueE, uint16_t); //! energy of cluster inducing particle (1 MeV -> Maximum cluster energy of ~65 GeV)
134136

135-
DECLARE_SOA_DYNAMIC_COLUMN(TrueE, trueE, [](uint16_t storedTrueE) -> float { return storedTrueE / emdownscaling::downscalingFactors[emdownscaling::kEnergy]; }); //! energy of cluster inducing particle (GeV)
137+
DECLARE_SOA_DYNAMIC_COLUMN(TrueE, trueE, [](uint16_t storedTrueE) -> float { return storedTrueE / emdownscaling::downscalingFactors[emdownscaling::kEnergy] + std::numeric_limits<float>::epsilon(); }); //! energy of cluster inducing particle (GeV)
136138
} // namespace bcwisemccluster
137139

138140
DECLARE_SOA_TABLE(BCWiseMCClusters, "AOD", "BCWISEMCCLS", //! table of MC information for clusters -> To be joined with the cluster table

PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ struct bcWiseClusterSkimmer {
107107
template <typename OutputType, typename InputType>
108108
OutputType convertForStorage(InputType const& valueIn, Observables observable)
109109
{
110-
double valueToBeChecked = valueIn * downscalingFactors[observable];
110+
double valueToBeChecked = std::round(valueIn * downscalingFactors[observable]);
111111
if (valueToBeChecked < std::numeric_limits<OutputType>::lowest()) {
112112
LOG(warning) << "Value " << valueToBeChecked << " of observable " << observable << " below lowest possible value of " << typeid(OutputType).name() << ": " << static_cast<float>(std::numeric_limits<OutputType>::lowest());
113113
valueToBeChecked = static_cast<float>(std::numeric_limits<OutputType>::lowest());

PWGEM/PhotonMeson/Tasks/emcalBcWisePi0.cxx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ struct EmcalBcWisePi0 {
104104
mHistManager.add("Generated/pi0_AllBCs", "pT spectrum of generated pi0s in all BCs;#bf{#it{p}_{T} (GeV/#it{c})};#bf{#it{N}_{#pi^{0}}^{gen}}", HistType::kTH1F, {{200, 0, 20}});
105105
mHistManager.add("Generated/pi0_TVX", "pT spectrum of generated pi0s in TVX triggered BCs;#bf{#it{p}_{T} (GeV/#it{c})};#bf{#it{N}_{#pi^{0}}^{gen}}", HistType::kTH1F, {{200, 0, 20}});
106106
mHistManager.add("Generated/pi0_kTVXinEMC", "pT spectrum of generated pi0s in kTVXinEMC triggered BCs;#bf{#it{p}_{T} (GeV/#it{c})};#bf{#it{N}_{#pi^{0}}^{gen}}", HistType::kTH1F, {{200, 0, 20}});
107+
mHistManager.add("Accepted/pi0_kTVXinEMC", "pT spectrum of accepted pi0s in kTVXinEMC triggered BCs;#bf{#it{p}_{T} (GeV/#it{c})};#bf{#it{N}_{#pi^{0}}^{acc}}", HistType::kTH1F, {{200, 0, 20}});
107108
}
108109
}
109110

@@ -273,11 +274,15 @@ struct EmcalBcWisePi0 {
273274
void fillGeneratedPi0Hists(const auto& mcPi0s, const auto& bc)
274275
{
275276
for (const auto& mcPi0 : mcPi0s) {
276-
mHistManager.fill(HIST("Generated/pi0_AllBCs"), mcPi0.pt());
277-
if (bc.hasTVX())
278-
mHistManager.fill(HIST("Generated/pi0_TVX"), mcPi0.pt());
279-
if (bc.haskTVXinEMC())
280-
mHistManager.fill(HIST("Generated/pi0_kTVXinEMC"), mcPi0.pt());
277+
if (mcPi0.isPrimary()) {
278+
mHistManager.fill(HIST("Generated/pi0_AllBCs"), mcPi0.pt());
279+
if (bc.hasTVX())
280+
mHistManager.fill(HIST("Generated/pi0_TVX"), mcPi0.pt());
281+
if (bc.haskTVXinEMC())
282+
mHistManager.fill(HIST("Generated/pi0_kTVXinEMC"), mcPi0.pt());
283+
if (mcPi0.isAccepted() && bc.haskTVXinEMC())
284+
mHistManager.fill(HIST("Accepted/pi0_kTVXinEMC"), mcPi0.pt());
285+
}
281286
}
282287
}
283288

0 commit comments

Comments
 (0)