Skip to content

Commit 0563fcb

Browse files
authored
Merge branch 'AliceO2Group:master' into master
2 parents 98b1c0b + a11e182 commit 0563fcb

396 files changed

Lines changed: 8329 additions & 6791 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ALICE3/Tasks/alice3TrackingPerformance.cxx

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
///
1414
/// \brief This task produces the tracking performance
1515
///
16-
/// \author Nicolò Jacazio, Universita del Piemonte Orientale (IT)
16+
/// \author Nicolò Jacazio, Università del Piemonte Orientale (IT)
1717
/// \since May 27, 2025
1818
///
1919

@@ -46,7 +46,9 @@ std::map<int, std::shared_ptr<TH1>> particlePtDistribution;
4646
std::map<int, std::shared_ptr<TH1>> particleEtaDistribution;
4747
std::map<int, std::shared_ptr<TH1>> ptDistribution;
4848
std::map<int, std::shared_ptr<TH2>> ptResolutionVsPt;
49+
std::map<int, std::shared_ptr<TProfile2D>> ptResolutionVsEta;
4950
std::map<int, std::shared_ptr<TH2>> invPtResolutionVsPt;
51+
std::map<int, std::shared_ptr<TProfile2D>> invPtResolutionVsEta;
5052
std::map<int, std::shared_ptr<TH2>> dcaXyResolutionVsPt;
5153
std::map<int, std::shared_ptr<TH2>> dcaZResolutionVsPt;
5254

@@ -57,26 +59,30 @@ struct Alice3TrackingPerformance {
5759

5860
void init(o2::framework::InitContext&)
5961
{
60-
const AxisSpec axisPt{100, 0, 10, "p_{T} (GeV/c)"};
62+
const AxisSpec axisPt{500, 0, 100, "#it{p}_{T} (GeV/#it{c})"};
6163
const AxisSpec axisEta{100, etaRange.value.first, etaRange.value.second, "#eta"};
62-
const AxisSpec axisPtDelta{100, -1, 1, "p_{T}^{gen} - p_{T}^{reco} (GeV/c)"};
63-
const AxisSpec axisInvPtDelta{100, -1, 1, "1./p_{T}^{gen} - 1./p_{T}^{reco} (GeV/c)^{-1}"};
64+
const AxisSpec axisPtDelta{100, -1, 1, "(#it{p}_{T}^{reco} - #it{p}_{T}^{gen}) / #it{p}_{T}^{gen}"};
65+
const AxisSpec axisInvPtDelta{100, -1, 1, "1./#it{p}_{T}^{gen} - 1./#it{p}_{T}^{reco} (GeV/#it{c})^{-1}"};
6466
const AxisSpec axisDcaXy{100, -1, 1, "DCA_{xy} (cm)"};
6567
const AxisSpec axisDcaZ{100, -1, 1, "DCA_{z} (cm)"};
6668
particlePdgCodes = histos.add<TH1>("particlePdgCodes", "", kTH1D, {AxisSpec{100, -0.5, 99.5, "PDG Code"}});
6769
for (const int& pdg : pdgCodes.value) {
68-
std::string tag = Form("_%d", pdg);
70+
std::string prefix = Form("%i", pdg);
6971
if (pdg < 0) {
70-
tag = Form("_m%d", -pdg);
72+
prefix = Form("m%i", -pdg);
7173
}
72-
particlePtDistribution[pdg] = histos.add<TH1>("particlePtDistribution" + tag, "", kTH1D, {axisPt});
73-
particleEtaDistribution[pdg] = histos.add<TH1>("particleEtaDistribution" + tag, "", kTH1D, {axisEta});
74+
const std::string tag = "_" + prefix;
75+
prefix += "/";
76+
particlePtDistribution[pdg] = histos.add<TH1>(prefix + "particlePtDistribution" + tag, "", kTH1D, {axisPt});
77+
particleEtaDistribution[pdg] = histos.add<TH1>(prefix + "particleEtaDistribution" + tag, "", kTH1D, {axisEta});
7478

75-
ptDistribution[pdg] = histos.add<TH1>("ptDistribution" + tag, "", kTH1D, {axisPt});
76-
ptResolutionVsPt[pdg] = histos.add<TH2>("ptResolutionVsPt" + tag, "", kTH2D, {axisPt, axisPtDelta});
77-
invPtResolutionVsPt[pdg] = histos.add<TH2>("invPtResolutionVsPt" + tag, "", kTH2D, {axisPt, axisInvPtDelta});
78-
dcaXyResolutionVsPt[pdg] = histos.add<TH2>("dcaXyResolutionVsPt" + tag, "", kTH2D, {axisPt, axisDcaXy});
79-
dcaZResolutionVsPt[pdg] = histos.add<TH2>("dcaZResolutionVsPt" + tag, "", kTH2D, {axisPt, axisDcaZ});
79+
ptDistribution[pdg] = histos.add<TH1>(prefix + "ptDistribution" + tag, "", kTH1D, {axisPt});
80+
ptResolutionVsPt[pdg] = histos.add<TH2>(prefix + "ptResolutionVsPt" + tag, "", kTH2D, {axisPt, axisPtDelta});
81+
ptResolutionVsEta[pdg] = histos.add<TProfile2D>(prefix + "ptResolutionVsEta" + tag, "", kTProfile2D, {axisPt, axisEta});
82+
invPtResolutionVsPt[pdg] = histos.add<TH2>(prefix + "invPtResolutionVsPt" + tag, "", kTH2D, {axisPt, axisInvPtDelta});
83+
invPtResolutionVsEta[pdg] = histos.add<TProfile2D>(prefix + "invPtResolutionVsEta" + tag, "", kTProfile2D, {axisPt, axisEta});
84+
dcaXyResolutionVsPt[pdg] = histos.add<TH2>(prefix + "dcaXyResolutionVsPt" + tag, "", kTH2D, {axisPt, axisDcaXy});
85+
dcaZResolutionVsPt[pdg] = histos.add<TH2>(prefix + "dcaZResolutionVsPt" + tag, "", kTH2D, {axisPt, axisDcaZ});
8086
}
8187
}
8288

@@ -110,26 +116,32 @@ struct Alice3TrackingPerformance {
110116
particleEtaDistribution[mcParticle.pdgCode()]->Fill(mcParticle.eta());
111117
}
112118
for (const auto& track : tracks) {
113-
ptDistribution[0]->Fill(track.pt());
114119
if (!track.has_mcParticle()) {
115120
continue;
116121
}
117122
const auto& mcParticle = track.mcParticle();
118-
ptResolutionVsPt[0]->Fill(mcParticle.pt(), mcParticle.pt() - track.pt());
119-
invPtResolutionVsPt[0]->Fill(mcParticle.pt(), 1.f / mcParticle.pt() - 1.f / track.pt());
120-
dcaXyResolutionVsPt[0]->Fill(mcParticle.pt(), track.dcaXY());
121-
dcaZResolutionVsPt[0]->Fill(mcParticle.pt(), track.dcaZ());
123+
const float ptResolution = (track.pt() - mcParticle.pt()) / mcParticle.pt();
124+
const float invptResolution = 1.f / track.pt() - 1.f / mcParticle.pt();
125+
126+
auto fillResolutionHistograms = [&](const int p) {
127+
ptDistribution[p]->Fill(track.pt());
128+
ptResolutionVsPt[p]->Fill(mcParticle.pt(), ptResolution);
129+
ptResolutionVsEta[p]->Fill(mcParticle.pt(), mcParticle.eta(), ptResolution);
130+
invPtResolutionVsPt[p]->Fill(mcParticle.pt(), invptResolution);
131+
invPtResolutionVsEta[p]->Fill(mcParticle.pt(), mcParticle.eta(), invptResolution);
132+
dcaXyResolutionVsPt[p]->Fill(mcParticle.pt(), track.dcaXY());
133+
dcaZResolutionVsPt[p]->Fill(mcParticle.pt(), track.dcaZ());
134+
};
135+
136+
fillResolutionHistograms(0);
137+
122138
if (!isParticleSelected(mcParticle)) {
123139
continue;
124140
}
125141
if (ptResolutionVsPt.find(mcParticle.pdgCode()) == ptResolutionVsPt.end()) {
126142
continue;
127143
}
128-
ptDistribution[mcParticle.pdgCode()]->Fill(mcParticle.pt());
129-
ptResolutionVsPt[mcParticle.pdgCode()]->Fill(mcParticle.pt(), mcParticle.pt() - track.pt());
130-
invPtResolutionVsPt[mcParticle.pdgCode()]->Fill(mcParticle.pt(), 1.f / mcParticle.pt() - 1.f / track.pt());
131-
dcaXyResolutionVsPt[mcParticle.pdgCode()]->Fill(mcParticle.pt(), track.dcaXY());
132-
dcaZResolutionVsPt[mcParticle.pdgCode()]->Fill(mcParticle.pt(), track.dcaZ());
144+
fillResolutionHistograms(mcParticle.pdgCode());
133145
}
134146
}
135147
};

PWGCF/DataModel/CorrelationsDerived.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,10 @@ namespace cf2prongmcpart
195195
DECLARE_SOA_INDEX_COLUMN_FULL(CFParticleDaugh0, cfParticleDaugh0, int, CFMcParticles, "_0"); //! Index to prong 1 CFMcParticle
196196
DECLARE_SOA_INDEX_COLUMN_FULL(CFParticleDaugh1, cfParticleDaugh1, int, CFMcParticles, "_1"); //! Index to prong 2 CFMcParticle
197197
DECLARE_SOA_COLUMN(Decay, decay, uint8_t); //! Particle decay and flags
198-
DECLARE_SOA_DYNAMIC_COLUMN(McDecay, mcDecay, [](uint8_t decay) -> uint8_t { return decay & 0x7f; }); //! MC particle decay
198+
DECLARE_SOA_DYNAMIC_COLUMN(McDecay, mcDecay, [](uint8_t decay) -> uint8_t { return decay & 0x3f; }); //! MC particle decay
199199
enum ParticleDecayFlags {
200-
Prompt = 0x80
200+
Prompt = 0x40,
201+
NonPrompt = 0x80
201202
};
202203
} // namespace cf2prongmcpart
203204
DECLARE_SOA_TABLE(CF2ProngMcParts, "AOD", "CF2PRONGMCPART", //! Table for the daughter particles of a 2-prong particle, to be joined with CFMcParticles

PWGCF/Femto/Core/closePairRejection.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,8 @@ class CloseTrackRejection
367367
{
368368
double arg = 0.3 * (0.1 * magfield) * (0.01 * radius) / (2. * signedPt);
369369
if (std::fabs(arg) <= 1.) {
370-
double phistar = phi - std::asin(arg);
371-
return static_cast<float>(RecoDecay::constrainAngle(phistar));
370+
double angle = phi - std::asin(arg);
371+
return static_cast<float>(RecoDecay::constrainAngle(angle));
372372
}
373373
return std::nullopt;
374374
}
@@ -558,7 +558,7 @@ class ClosePairRejectionTrackCascade
558558
bool
559559
isClosePair() const
560560
{
561-
return mCtrBachelor.isClosePair() || mCtrBachelor.isClosePair();
561+
return mCtrBachelor.isClosePair();
562562
}
563563

564564
void fill(float kstar)

PWGCF/Femto/Core/collisionHistManager.h

Lines changed: 11 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ enum ColHist {
5353
kCentVsMult,
5454
kCentVsSphericity,
5555
kMultVsSphericity,
56-
// particle number correlation
57-
kNpart1VsNpart2,
58-
kNpart1VsNpart2VsNpart3,
5956
// mc
6057
kTrueCentVsCent,
6158
kTrueMultVsMult,
@@ -84,21 +81,16 @@ constexpr std::array<histmanager::HistInfo<ColHist>, kColHistLast> HistTable = {
8481
{kCentVsMult, o2::framework::kTH2F, "hCentVsMult", "Centrality vs Multiplicity; Centrality (%); Multiplicity"},
8582
{kMultVsSphericity, o2::framework::kTH2F, "hMultVsSphericity", "Multiplicity vs Sphericity; Multiplicity; Sphericity"},
8683
{kCentVsSphericity, o2::framework::kTH2F, "hCentVsSphericity", "Centrality vs Sphericity; Centrality (%); Sphericity"},
87-
// particle number correlation
88-
{kNpart1VsNpart2, o2::framework::kTH2F, "hNpart1VsNpart2", "# particle 1 vs # particle 2; # particle 1; # particle 2"},
89-
{kNpart1VsNpart2VsNpart3, o2::framework::kTHnSparseF, "hNpart1VsNpart2VsNpart3", "# particle 1 vs # particle 2 vs particle 3; # particle 1; # particle 2; # particle 3"},
9084
// mc
9185
{kTrueCentVsCent, o2::framework::kTH2F, "hTrueCentVsCent", "True centrality vs centrality; Centrality_{True} (%); Centrality (%)"},
9286
{kTrueMultVsMult, o2::framework::kTH2F, "hTrueMultVsMult", "True multiplicity vs multiplicity; Multiplicity_{True}; Multiplicity"},
9387
}};
9488

95-
#define COL_HIST_ANALYSIS_MAP(conf) \
96-
{kPosZ, {conf.vtxZ}}, \
97-
{kMult, {conf.mult}}, \
98-
{kCent, {conf.cent}}, \
99-
{kMagField, {conf.magField}}, \
100-
{kNpart1VsNpart2, {conf.particleCorrelation, conf.particleCorrelation}}, \
101-
{kNpart1VsNpart2VsNpart3, {conf.particleCorrelation, conf.particleCorrelation, conf.particleCorrelation}},
89+
#define COL_HIST_ANALYSIS_MAP(conf) \
90+
{kPosZ, {conf.vtxZ}}, \
91+
{kMult, {conf.mult}}, \
92+
{kCent, {conf.cent}}, \
93+
{kMagField, {conf.magField}},
10294

10395
#define COL_HIST_QA_MAP(confAnalysis, confQa) \
10496
{kPosX, {confQa.vtxXY}}, \
@@ -158,9 +150,6 @@ struct ConfCollisionBinning : o2::framework::ConfigurableGroup {
158150
o2::framework::ConfigurableAxis mult{"mult", {200, 0, 200}, "Multiplicity binning"};
159151
o2::framework::ConfigurableAxis cent{"cent", {100, 0.0f, 100.0f}, "Centrality (multiplicity percentile) binning"};
160152
o2::framework::ConfigurableAxis magField{"magField", {11, -5.5, 5.5}, "Magnetic field binning"};
161-
o2::framework::Configurable<bool> plotParticlePairCorrelation{"plotParticlePairCorrelation", false, "Plot particle number correlation for pairs"};
162-
o2::framework::Configurable<bool> plotParticleTripletCorrelation{"plotParticleTripletCorrelation", false, "Plot particle number correlation for triplets"};
163-
o2::framework::ConfigurableAxis particleCorrelation{"particleCorrelation", {6, -0.5f, 5.5f}, "Binning for particle number correlation of pairs/triplets"};
164153
};
165154

166155
struct ConfCollisionQaBinning : o2::framework::ConfigurableGroup {
@@ -181,11 +170,9 @@ class CollisionHistManager
181170
template <modes::Mode mode, typename T>
182171
void init(o2::framework::HistogramRegistry* registry,
183172
std::map<ColHist, std::vector<o2::framework::AxisSpec>> const& Specs,
184-
T const& ConfCollisionBinning)
173+
T const& /*ConfCollisionBinning*/)
185174
{
186175
mHistogramRegistry = registry;
187-
mPlotPairCorrelation = ConfCollisionBinning.plotParticlePairCorrelation.value;
188-
mPlotTripletCorrelation = ConfCollisionBinning.plotParticleTripletCorrelation.value;
189176
if constexpr (isFlagSet(mode, modes::Mode::kAnalysis)) {
190177
initAnalysis(Specs);
191178
}
@@ -214,21 +201,21 @@ class CollisionHistManager
214201
}
215202

216203
template <modes::Mode mode, typename T>
217-
void fill(T const& col, int64_t nSlice1, int64_t nSlice2, int64_t nSlice3)
204+
void fill(T const& col)
218205
{
219206
if constexpr (isFlagSet(mode, modes::Mode::kAnalysis)) {
220-
fillAnalysis(col, nSlice1, nSlice2, nSlice3);
207+
fillAnalysis(col);
221208
}
222209
if constexpr (isFlagSet(mode, modes::Mode::kQa)) {
223210
fillQa(col);
224211
}
225212
}
226213

227214
template <modes::Mode mode, typename T1, typename T2>
228-
void fill(T1 const& col, T2 const& mcCols, int64_t nSlice1, int64_t nSlice2, int64_t nSlice3)
215+
void fill(T1 const& col, T2 const& mcCols)
229216
{
230217
if constexpr (isFlagSet(mode, modes::Mode::kAnalysis)) {
231-
fillAnalysis(col, nSlice1, nSlice2, nSlice3);
218+
fillAnalysis(col);
232219
}
233220
if constexpr (isFlagSet(mode, modes::Mode::kQa)) {
234221
fillQa(col);
@@ -246,12 +233,6 @@ class CollisionHistManager
246233
mHistogramRegistry->add(analysisDir + getHistNameV2(kMult, HistTable), getHistDesc(kMult, HistTable), getHistType(kMult, HistTable), {Specs.at(kMult)});
247234
mHistogramRegistry->add(analysisDir + getHistNameV2(kCent, HistTable), getHistDesc(kCent, HistTable), getHistType(kCent, HistTable), {Specs.at(kCent)});
248235
mHistogramRegistry->add(analysisDir + getHistNameV2(kMagField, HistTable), getHistDesc(kMagField, HistTable), getHistType(kMagField, HistTable), {Specs.at(kMagField)});
249-
if (mPlotPairCorrelation) {
250-
mHistogramRegistry->add(analysisDir + getHistNameV2(kNpart1VsNpart2, HistTable), getHistDesc(kNpart1VsNpart2, HistTable), getHistType(kNpart1VsNpart2, HistTable), {Specs.at(kNpart1VsNpart2)});
251-
}
252-
if (mPlotTripletCorrelation) {
253-
mHistogramRegistry->add(analysisDir + getHistNameV2(kNpart1VsNpart2VsNpart3, HistTable), getHistDesc(kNpart1VsNpart2VsNpart3, HistTable), getHistType(kNpart1VsNpart2VsNpart3, HistTable), {Specs.at(kNpart1VsNpart2VsNpart3)});
254-
}
255236
}
256237

257238
void initQa(std::map<ColHist, std::vector<o2::framework::AxisSpec>> const& Specs)
@@ -279,18 +260,12 @@ class CollisionHistManager
279260
}
280261

281262
template <typename T>
282-
void fillAnalysis(T const& col, size_t nSlice1, size_t nSlice2, size_t nSlice3)
263+
void fillAnalysis(T const& col)
283264
{
284265
mHistogramRegistry->fill(HIST(AnalysisDir) + HIST(getHistName(kPosZ, HistTable)), col.posZ());
285266
mHistogramRegistry->fill(HIST(AnalysisDir) + HIST(getHistName(kMult, HistTable)), col.mult());
286267
mHistogramRegistry->fill(HIST(AnalysisDir) + HIST(getHistName(kCent, HistTable)), col.cent());
287268
mHistogramRegistry->fill(HIST(AnalysisDir) + HIST(getHistName(kMagField, HistTable)), col.magField());
288-
if (mPlotPairCorrelation) {
289-
mHistogramRegistry->fill(HIST(AnalysisDir) + HIST(getHistName(kNpart1VsNpart2, HistTable)), nSlice1, nSlice2);
290-
}
291-
if (mPlotTripletCorrelation) {
292-
mHistogramRegistry->fill(HIST(AnalysisDir) + HIST(getHistName(kNpart1VsNpart2VsNpart3, HistTable)), nSlice1, nSlice2, nSlice3);
293-
}
294269
}
295270

296271
template <typename T>
@@ -323,8 +298,6 @@ class CollisionHistManager
323298

324299
o2::framework::HistogramRegistry* mHistogramRegistry = nullptr;
325300
bool mPlot2d = false;
326-
bool mPlotPairCorrelation = false;
327-
bool mPlotTripletCorrelation = false;
328301
}; // namespace femtounitedcolhistmanager
329302
}; // namespace colhistmanager
330303
}; // namespace o2::analysis::femto

PWGCF/Femto/Core/mcBuilder.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,9 @@ class McBuilder
134134
// Not yet created → create it
135135
auto mcCol = col.template mcCollision_as<T3>();
136136
this->fillMcCollision<system>(mcCol, mcProducts);
137-
it = mCollisionMap.find(originalIndex);
138137
}
139138
// Add label
140-
mcProducts.producedCollisionLabels(it->second);
139+
mcProducts.producedCollisionLabels(mCollisionMap.at(originalIndex)); // mc collsions has been added so we can now safely retrieve the index
141140
} else {
142141
// If no MC collision associated, fill empty label
143142
mcProducts.producedCollisionLabels(-1);

PWGCF/Femto/Core/modes.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,15 @@ enum class Mode : uint32_t {
4848
kAnalysis = BIT(0),
4949
kQa = BIT(1),
5050
kMc = BIT(2),
51+
kSe = BIT(3),
52+
kMe = BIT(4),
5153
kAnalysis_Qa = kAnalysis | kQa,
5254
kAnalysis_Mc = kAnalysis | kMc,
5355
kAnalysis_Qa_Mc = kAnalysis | kQa | kMc,
56+
kSe_Analysis = kAnalysis | kSe,
57+
kMe_Analysis = kAnalysis | kMe,
58+
kSe_Analysis_Mc = kAnalysis | kSe | kMc,
59+
kMe_Analysis_Mc = kAnalysis | kMe | kMc,
5460
};
5561

5662
enum class System : uint32_t {

0 commit comments

Comments
 (0)