Skip to content

Commit 07cc60c

Browse files
committed
[PWGJE] taskEmcExtensiveMcQa: Add more cluster energy informations
- Add centrality as an extra axis, for pp this should be set to size 1 from -1.5 to -0.5, since the default value for cent is -1.f - Add leading particle energy axis, its true generated momentum and the ratio between these two - Add number of contributors to clusters as an extra axis - Add a new histogram which stores the cluster energy vs the number of contributors vs the leading particle energy deposition vs the leading particle momentum vs the ratio of the last two vs cent - Increased detail for PoI: - Electrons are now seperated between priamry and secondary - Add Muons - Split Hadron in charged and neutral, where neutral means Neutron, K0L, K0S, Lambda0, Xi0 and Sigma0
1 parent 01f0c1b commit 07cc60c

File tree

1 file changed

+57
-17
lines changed

1 file changed

+57
-17
lines changed

PWGJE/Tasks/taskEmcExtensiveMcQa.cxx

Lines changed: 57 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
#include <CCDB/BasicCCDBManager.h>
2626
#include <CommonConstants/MathConstants.h>
27+
#include <CommonConstants/PhysicsConstants.h>
2728
#include <EMCALBase/Geometry.h>
2829
#include <Framework/ASoA.h>
2930
#include <Framework/AnalysisDataModel.h>
@@ -35,6 +36,8 @@
3536
#include <Framework/InitContext.h>
3637
#include <Framework/runDataProcessing.h>
3738

39+
#include <TPDGCode.h>
40+
3841
#include <algorithm>
3942
#include <array>
4043
#include <climits>
@@ -46,24 +49,32 @@
4649
using namespace o2::aod;
4750
using namespace o2::framework;
4851
using namespace o2::framework::expressions;
52+
using namespace o2::constants;
4953
using namespace o2::hf_evsel;
5054
using namespace o2::hf_centrality;
5155
using CollisionEvSels = o2::soa::Join<o2::aod::Collisions, o2::aod::EvSels>;
5256
using BcEvSelIt = o2::soa::Join<o2::aod::BCs, o2::aod::BcSels>::iterator;
5357
using SelectedClusters = o2::soa::Filtered<o2::soa::Join<o2::aod::EMCALClusters, o2::aod::EMCALMCClusters>>;
5458

59+
namespace poi
60+
{
5561
enum PoI {
5662
kPhoton = 0,
57-
kElectron = 1,
58-
kHadron = 2,
59-
kNPoI = 3
63+
kElectronPrim = 1,
64+
kElectronSec = 2,
65+
kMuon = 3,
66+
kHadronCharge = 4,
67+
kHadronNeutral = 5,
68+
kNPoI = 6
6069
};
70+
} // namespace poi
6171

6272
/// \struct TaskEmcExtensiveMcQa
6373
struct TaskEmcExtensiveMcQa {
6474

6575
static constexpr int NSM = 20; // there 20 supermodlues for the EMCal
66-
std::array<int, 2> arrPoIPDG = {22, 11};
76+
std::array<int, 6> arrPDGHadronNeutral = {kNeutron, kK0Short, kK0Long, kLambda0, physics::kXi0, kSigma0};
77+
std::array<int, 2> arrPoIPDG = {kGamma, kElectron};
6778

6879
SliceCache cache;
6980
Preslice<SelectedClusters> psClusterPerCollision = o2::aod::emcalcluster::collisionId;
@@ -88,10 +99,13 @@ struct TaskEmcExtensiveMcQa {
8899
ConfigurableAxis nClustersBinning{"nClustersBinning", {201, -0.5, 200.5}, "binning for the number of clusters"};
89100

90101
ConfigurableAxis clusterEnergy{"clusterEnergy", {100, 0., 10}, "binning for the cluster energy in GeV"};
91-
ConfigurableAxis clusterTimeBinning{"clusterTimeBinning", {1500, -600, 900}, "binning for the cluster time in ns"};
102+
ConfigurableAxis clusterTimeBinning{"clusterTimeBinning", {100, -50, 50}, "binning for the cluster time in ns"};
92103
ConfigurableAxis clusterM02{"clusterM02", {100, 0., 2.0}, "binning for the cluster M02"};
93104
ConfigurableAxis clusterNCellBinning{"clusterNCellBinning", {100, 0.5, 100.5}, "binning for the number of cells per cluster"};
94105
ConfigurableAxis clusterOriginRadius{"clusterOriginRadius", {225, 0., 450}, "binning for the radial original point of the main contributor of a cluster"};
106+
ConfigurableAxis clusterNContributor{"clusterNContributor", {20, 0.5, 20.5}, "binning for the number of contributor of a cluster"};
107+
ConfigurableAxis clusterEnergyRatio{"clusterEnergyRatio", {100, 0., 10.}, "binning for ratio of the deposited energy of the leading particle to its generated momentum cluster"};
108+
ConfigurableAxis collisionCent{"collisionCent", {10, 0., 100.}, "binning for the event centrality"};
95109

96110
std::vector<float> mCellTime;
97111

@@ -103,20 +117,26 @@ struct TaskEmcExtensiveMcQa {
103117

104118
// create common axes
105119
const AxisSpec numberClustersAxis{nClustersBinning, "#it{N}_{cl}/ #it{N}_{event}"};
106-
const AxisSpec axisParticle = {PoI::kNPoI, -0.5f, +PoI::kNPoI - 0.5f, ""};
120+
const AxisSpec axisParticle = {poi::kNPoI, -0.5f, +poi::kNPoI - 0.5f, ""};
107121
const AxisSpec axisEnergy{clusterEnergy, "#it{E}_{cl} (GeV)"};
108122
const AxisSpec axisTime{clusterTimeBinning, "#it{t}_{cl} (ns)"};
109123
const AxisSpec axisM02{clusterM02, "#it{M}_{02}"};
110124
const AxisSpec axisNCell{clusterNCellBinning, "#it{N}_{cells}"};
111125
const AxisSpec axisRadius{clusterOriginRadius, "#it{R}_{origin} (cm)"};
126+
const AxisSpec axisNContributor{clusterNContributor, "#it{N}_{particles}"};
127+
const AxisSpec axisCent{collisionCent, "cent (%)"};
128+
const AxisSpec axisLeadingEnergy{clusterEnergy, "#it{E}_{lead} (GeV)"};
129+
const AxisSpec axisLeadingGenMomentum{clusterEnergy, "#it{p}_{lead, gen} (GeV/#it{c})"};
130+
const AxisSpec axisLeadingRatio{clusterEnergy, "#it{E}_{lead}/#it{p}_{lead, gen} (#it{c})"};
112131

113132
// create histograms
114133

115134
// event properties
116135
mHistManager.add("numberOfClustersEvents", "number of clusters per event (selected events)", HistType::kTH1D, {numberClustersAxis});
117136

118137
// cluster properties (matched clusters)
119-
mHistManager.add("hSparseClusterQA", "THn for Cluster QA", HistType::kTHnSparseF, {axisEnergy, axisTime, axisM02, axisNCell, axisRadius, axisParticle});
138+
mHistManager.add("hSparseClusterQA", "THnSparse for Cluster QA", HistType::kTHnSparseF, {axisEnergy, axisTime, axisM02, axisNCell, axisRadius, axisParticle, axisNContributor, axisCent});
139+
mHistManager.add("hSparseClusterContributors", "THnSparse with cluster contributors and energies", HistType::kTHnSparseF, {axisEnergy, axisParticle, axisNContributor, axisLeadingEnergy, axisLeadingGenMomentum, axisLeadingRatio, axisCent});
120140
mHistManager.add("clusterEtaPhi", "Eta and phi of cluster", HistType::kTH2F, {{140, -0.7, 0.7}, {360, 0, o2::constants::math::TwoPI}});
121141

122142
hfEvSel.addHistograms(mHistManager);
@@ -127,9 +147,8 @@ struct TaskEmcExtensiveMcQa {
127147
}
128148

129149
template <typename Coll>
130-
bool isCollSelected(const Coll& coll)
150+
bool isCollSelected(const Coll& coll, float& cent)
131151
{
132-
float cent{-1.f};
133152
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, o2::hf_centrality::CentralityEstimator::None, aod::BCsWithTimestamps>(coll, cent, ccdb, mHistManager);
134153
/// monitor the satisfied event selections
135154
hfEvSel.fillHistograms(coll, rejectionMask, cent);
@@ -143,12 +162,28 @@ struct TaskEmcExtensiveMcQa {
143162
template <typename T>
144163
int findPoIType(T const& mcparticle)
145164
{
146-
auto it = std::find(arrPoIPDG.begin(), arrPoIPDG.end(), std::abs(mcparticle.pdgCode()));
147-
if (it != arrPoIPDG.end()) {
148-
int index = std::distance(arrPoIPDG.begin(), it);
149-
return index;
150-
} else {
151-
return PoI::kHadron;
165+
auto pdgValue = std::abs(mcparticle.pdgCode());
166+
switch (pdgValue) {
167+
case kGamma: {
168+
return poi::kPhoton;
169+
}
170+
case kElectron: {
171+
if (mcparticle.isPhysicalPrimary()) {
172+
return poi::kElectronPrim;
173+
} else {
174+
return poi::kElectronSec;
175+
}
176+
}
177+
case kMuonMinus: {
178+
return poi::kMuon;
179+
}
180+
default: {
181+
auto it = std::find(arrPDGHadronNeutral.begin(), arrPDGHadronNeutral.end(), pdgValue);
182+
if (it != arrPDGHadronNeutral.end()) {
183+
return poi::kHadronNeutral;
184+
}
185+
return poi::kHadronCharge;
186+
}
152187
}
153188
}
154189

@@ -159,7 +194,8 @@ struct TaskEmcExtensiveMcQa {
159194
{
160195

161196
for (const auto& collision : collisions) {
162-
if (applyEvSels && !isCollSelected(collision)) {
197+
float cent = -1.f;
198+
if (applyEvSels && !isCollSelected(collision, cent)) {
163199
continue;
164200
}
165201

@@ -175,7 +211,11 @@ struct TaskEmcExtensiveMcQa {
175211
}
176212
auto mainMcParticle = cluster.mcParticle_as<McParticles>()[0];
177213
float radius = std::hypot(mainMcParticle.vx(), mainMcParticle.vy());
178-
mHistManager.fill(HIST("hSparseClusterQA"), cluster.energy(), cluster.time(), cluster.m02(), cluster.nCells(), radius, findPoIType(mainMcParticle));
214+
float momentum = mainMcParticle.p();
215+
float leadingEnergy = cluster.energy() * cluster.amplitudeA()[0];
216+
float leadingFraction = leadingEnergy / momentum;
217+
mHistManager.fill(HIST("hSparseClusterQA"), cluster.energy(), cluster.time(), cluster.m02(), cluster.nCells(), radius, findPoIType(mainMcParticle), cluster.mcParticle().size(), cent);
218+
mHistManager.fill(HIST("hSparseClusterContributors"), cluster.energy(), findPoIType(mainMcParticle), cluster.mcParticle().size(), leadingEnergy, momentum, leadingFraction, cent);
179219
}
180220
}
181221
}

0 commit comments

Comments
 (0)