Skip to content

Commit d484530

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 d484530

File tree

1 file changed

+56
-17
lines changed

1 file changed

+56
-17
lines changed

PWGJE/Tasks/taskEmcExtensiveMcQa.cxx

Lines changed: 56 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,31 @@
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};
6777

6878
SliceCache cache;
6979
Preslice<SelectedClusters> psClusterPerCollision = o2::aod::emcalcluster::collisionId;
@@ -88,10 +98,13 @@ struct TaskEmcExtensiveMcQa {
8898
ConfigurableAxis nClustersBinning{"nClustersBinning", {201, -0.5, 200.5}, "binning for the number of clusters"};
8999

90100
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"};
101+
ConfigurableAxis clusterTimeBinning{"clusterTimeBinning", {100, -50, 50}, "binning for the cluster time in ns"};
92102
ConfigurableAxis clusterM02{"clusterM02", {100, 0., 2.0}, "binning for the cluster M02"};
93103
ConfigurableAxis clusterNCellBinning{"clusterNCellBinning", {100, 0.5, 100.5}, "binning for the number of cells per cluster"};
94104
ConfigurableAxis clusterOriginRadius{"clusterOriginRadius", {225, 0., 450}, "binning for the radial original point of the main contributor of a cluster"};
105+
ConfigurableAxis clusterNContributor{"clusterNContributor", {20, 0.5, 20.5}, "binning for the number of contributor of a cluster"};
106+
ConfigurableAxis clusterEnergyRatio{"clusterEnergyRatio", {100, 0., 10.}, "binning for ratio of the deposited energy of the leading particle to its generated momentum cluster"};
107+
ConfigurableAxis collisionCent{"collisionCent", {10, 0., 100.}, "binning for the event centrality"};
95108

96109
std::vector<float> mCellTime;
97110

@@ -103,20 +116,26 @@ struct TaskEmcExtensiveMcQa {
103116

104117
// create common axes
105118
const AxisSpec numberClustersAxis{nClustersBinning, "#it{N}_{cl}/ #it{N}_{event}"};
106-
const AxisSpec axisParticle = {PoI::kNPoI, -0.5f, +PoI::kNPoI - 0.5f, ""};
119+
const AxisSpec axisParticle = {poi::kNPoI, -0.5f, +poi::kNPoI - 0.5f, ""};
107120
const AxisSpec axisEnergy{clusterEnergy, "#it{E}_{cl} (GeV)"};
108121
const AxisSpec axisTime{clusterTimeBinning, "#it{t}_{cl} (ns)"};
109122
const AxisSpec axisM02{clusterM02, "#it{M}_{02}"};
110123
const AxisSpec axisNCell{clusterNCellBinning, "#it{N}_{cells}"};
111124
const AxisSpec axisRadius{clusterOriginRadius, "#it{R}_{origin} (cm)"};
125+
const AxisSpec axisNContributor{clusterNContributor, "#it{N}_{particles}"};
126+
const AxisSpec axisCent{collisionCent, "cent (%)"};
127+
const AxisSpec axisLeadingEnergy{clusterEnergy, "#it{E}_{lead} (GeV)"};
128+
const AxisSpec axisLeadingGenMomentum{clusterEnergy, "#it{p}_{lead, gen} (GeV/#it{c})"};
129+
const AxisSpec axisLeadingRatio{clusterEnergy, "#it{E}_{lead}/#it{p}_{lead, gen} (#it{c})"};
112130

113131
// create histograms
114132

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

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

122141
hfEvSel.addHistograms(mHistManager);
@@ -127,9 +146,8 @@ struct TaskEmcExtensiveMcQa {
127146
}
128147

129148
template <typename Coll>
130-
bool isCollSelected(const Coll& coll)
149+
bool isCollSelected(const Coll& coll, float& cent)
131150
{
132-
float cent{-1.f};
133151
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, o2::hf_centrality::CentralityEstimator::None, aod::BCsWithTimestamps>(coll, cent, ccdb, mHistManager);
134152
/// monitor the satisfied event selections
135153
hfEvSel.fillHistograms(coll, rejectionMask, cent);
@@ -143,12 +161,28 @@ struct TaskEmcExtensiveMcQa {
143161
template <typename T>
144162
int findPoIType(T const& mcparticle)
145163
{
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;
164+
auto pdgValue = std::abs(mcparticle.pdgCode());
165+
switch (pdgValue) {
166+
case kGamma: {
167+
return poi::kPhoton;
168+
}
169+
case kElectron: {
170+
if (mcparticle.isPhysicalPrimary()) {
171+
return poi::kElectronPrim;
172+
} else {
173+
return poi::kElectronSec;
174+
}
175+
}
176+
case kMuonMinus: {
177+
return poi::kMuon;
178+
}
179+
default: {
180+
auto it = std::find(arrPDGHadronNeutral.begin(), arrPDGHadronNeutral.end(), pdgValue);
181+
if (it != arrPDGHadronNeutral.end()) {
182+
return poi::kHadronNeutral;
183+
}
184+
return poi::kHadronCharge;
185+
}
152186
}
153187
}
154188

@@ -159,7 +193,8 @@ struct TaskEmcExtensiveMcQa {
159193
{
160194

161195
for (const auto& collision : collisions) {
162-
if (applyEvSels && !isCollSelected(collision)) {
196+
float cent = -1.f;
197+
if (applyEvSels && !isCollSelected(collision, cent)) {
163198
continue;
164199
}
165200

@@ -175,7 +210,11 @@ struct TaskEmcExtensiveMcQa {
175210
}
176211
auto mainMcParticle = cluster.mcParticle_as<McParticles>()[0];
177212
float radius = std::hypot(mainMcParticle.vx(), mainMcParticle.vy());
178-
mHistManager.fill(HIST("hSparseClusterQA"), cluster.energy(), cluster.time(), cluster.m02(), cluster.nCells(), radius, findPoIType(mainMcParticle));
213+
float momentum = mainMcParticle.p();
214+
float leadingEnergy = cluster.energy() * cluster.amplitudeA()[0];
215+
float leadingFraction = leadingEnergy / momentum;
216+
mHistManager.fill(HIST("hSparseClusterQA"), cluster.energy(), cluster.time(), cluster.m02(), cluster.nCells(), radius, findPoIType(mainMcParticle), cluster.mcParticle().size(), cent);
217+
mHistManager.fill(HIST("hSparseClusterContributors"), cluster.energy(), findPoIType(mainMcParticle), cluster.mcParticle().size(), leadingEnergy, momentum, leadingFraction, cent);
179218
}
180219
}
181220
}

0 commit comments

Comments
 (0)