Skip to content

Commit daf12d1

Browse files
calmonbehlingMaria Calmon Behling
andauthored
[PWGLF] updated CCDB files, ratio to pions, more QA plots (#17642)
Co-authored-by: Maria Calmon Behling <mariacalmonbehling@pcikf104.ikf.uni-frankfurt.de>
1 parent f13efbf commit daf12d1

2 files changed

Lines changed: 93 additions & 14 deletions

File tree

PWGLF/TableProducer/Nuspex/particleCompositionCorrection.cxx

Lines changed: 56 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ struct ParticleCompositionCorrection {
7070
Configurable<float> ptMaxCut{"ptMaxCut", 10.f, "pt max cut"};
7171
Configurable<bool> enableQAHistos{"enableQAHistos", true, "enable qa histograms showing the effect of the PCC"};
7272

73-
Configurable<std::string> ccdbBasePath{"ccdbBasePath", "/Users/m/makruger/", "ccdb directory contianing the particle fraction networks"};
73+
Configurable<std::string> ccdbBasePath{"ccdbBasePath", "/Users/m/mcalmonb/", "ccdb directory contianing the particle fraction networks"};
7474
Configurable<std::string> modelPathData{"modelPathData", "PCC/data/pp", "Path to the .onnx file containing the particle fractions in data"};
7575
Configurable<std::string> modelPathMC{"modelPathMC", "PCC/pythia/pp", "Path to the .onnx file containing the particle fractions in MC"};
7676

@@ -97,14 +97,16 @@ void ParticleCompositionCorrection::init(InitContext const&)
9797
return;
9898
}
9999
if (!ccdbBasePath.value.empty()) {
100-
ccdbApi.init("http://ccdb-test.cern.ch:8080");
100+
// ccdbApi.init("http://ccdb-test.cern.ch:8080");
101+
ccdbApi.init("http://alice-ccdb.cern.ch");
101102
static const int64_t dummyTimeStamp = 2;
102-
if (!ccdbApi.retrieveBlob(ccdbBasePath.value + modelPathData.value, modelPathData.value, {}, dummyTimeStamp, false, "ParticleFractions_Data.onnx") || !ccdbApi.retrieveBlob(ccdbBasePath.value + modelPathMC.value, modelPathMC.value, {}, dummyTimeStamp, false, "ParticleFractions_MC.onnx")) {
103+
if (!ccdbApi.retrieveBlob(ccdbBasePath.value + modelPathData.value, modelPathData.value, {}, dummyTimeStamp, false, "ParticleFractions_data.onnx") || !ccdbApi.retrieveBlob(ccdbBasePath.value + modelPathMC.value, modelPathMC.value, {}, dummyTimeStamp, false, "ParticleFractions_pythia.onnx")) {
103104
LOGP(fatal, "Could not download particle fraction networks!");
104105
}
105106
}
106-
particleFractionsData.initModel(modelPathData.value + "/ParticleFractions_Data.onnx", true);
107-
particleFractionsMC.initModel(modelPathMC.value + "/ParticleFractions_MC.onnx", true);
107+
108+
particleFractionsData.initModel(modelPathData.value + "/ParticleFractions_data.onnx", true);
109+
particleFractionsMC.initModel(modelPathMC.value + "/ParticleFractions_pythia.onnx", true);
108110

109111
if (enableQAHistos) {
110112
std::vector<double> ptBinEdges = {0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75,
@@ -113,19 +115,37 @@ void ParticleCompositionCorrection::init(InitContext const&)
113115
6.0, 6.5, 7.0, 8.0, 9.0, 10.0};
114116
const AxisSpec ptAxis{ptBinEdges, "#it{p}_{T} (GeV/#it{c})", "pt"};
115117

116-
histos.add("frac/data/pion", "", kTProfile, {ptAxis});
118+
const int maxMult = 100;
119+
const int nBinsMult = maxMult + 1;
120+
const AxisSpec multAxis = {nBinsMult, -0.5, nBinsMult - 0.5, "#it{N}_{ch}", "mult"};
121+
122+
histos.add("multDist_INELg0", "", kTH1D, {multAxis});
123+
histos.add("multDist_fid", "", kTH1D, {multAxis});
124+
histos.add("multDist_fidVsINELg0", "", kTH2D, {multAxis, multAxis});
125+
117126
histos.add("frac/data/kaon", "", kTProfile, {ptAxis});
118127
histos.add("frac/data/proton", "", kTProfile, {ptAxis});
119128
histos.add("frac/data/sigma", "", kTProfile, {ptAxis});
129+
130+
histos.add("frac/data/kaon_mult", "", kTProfile2D, {multAxis, ptAxis});
131+
histos.add("frac/data/proton_mult", "", kTProfile2D, {multAxis, ptAxis});
132+
histos.add("frac/data/sigma_mult", "", kTProfile2D, {multAxis, ptAxis});
133+
120134
histos.addClone("frac/data/", "frac/mc/");
121135

122-
histos.add("weight/pion", "", kTProfile, {ptAxis});
123136
histos.add("weight/kaon", "", kTProfile, {ptAxis});
124137
histos.add("weight/proton", "", kTProfile, {ptAxis});
125138
histos.add("weight/sigma", "", kTProfile, {ptAxis});
126139

140+
histos.add("weight/kaon_mult", "", kTProfile2D, {multAxis, ptAxis});
141+
histos.add("weight/proton_mult", "", kTProfile2D, {multAxis, ptAxis});
142+
histos.add("weight/sigma_mult", "", kTProfile2D, {multAxis, ptAxis});
143+
127144
histos.add("weight/secDec", "", kTProfile, {ptAxis});
128145
histos.add("weight/secMat", "", kTProfile, {ptAxis});
146+
147+
histos.add("weight/secDec_mult", "", kTProfile2D, {multAxis, ptAxis});
148+
histos.add("weight/secMat_mult", "", kTProfile2D, {multAxis, ptAxis});
129149
}
130150
}
131151

@@ -143,6 +163,11 @@ std::tuple<float, float, float> ParticleCompositionCorrection::getWeights(aod::M
143163
}
144164
auto absPDGCode = std::abs(particle.pdgCode());
145165
// translate abs PDG code to PID variable of neural networks (0: pion, 1: kaon, 2: proton, 3: sigma)
166+
167+
if (absPDGCode == PDG_t::kPiPlus || absPDGCode == PDG_t::kPi0) {
168+
return noWeights;
169+
}
170+
146171
static const std::map<int, float> mapPID = {
147172
{PDG_t::kPiPlus, 0.f},
148173
{PDG_t::kPi0, 0.f},
@@ -175,25 +200,29 @@ std::tuple<float, float, float> ParticleCompositionCorrection::getWeights(aod::M
175200
storedWeights[particle.index()] = weights;
176201
}
177202
if (enableQAHistos && particle.isPhysicalPrimary() && std::abs(particle.eta()) < 0.8) { // o2-linter: disable=magic-number (usual range of charged-partilce measurements)
178-
if (iterMapPID->first == PDG_t::kPiPlus) {
179-
histos.fill(HIST("frac/data/pion"), pt, fracData);
180-
histos.fill(HIST("frac/mc/pion"), pt, fracMC);
181-
histos.fill(HIST("weight/pion"), pt, weight);
182-
}
183203
if (iterMapPID->first == PDG_t::kKPlus) {
184204
histos.fill(HIST("frac/data/kaon"), pt, fracData);
185205
histos.fill(HIST("frac/mc/kaon"), pt, fracMC);
206+
histos.fill(HIST("frac/data/kaon_mult"), dNdEta, pt, fracData);
207+
histos.fill(HIST("frac/mc/kaon_mult"), dNdEta, pt, fracMC);
186208
histos.fill(HIST("weight/kaon"), pt, weight);
209+
histos.fill(HIST("weight/kaon_mult"), dNdEta, pt, weight);
187210
}
188211
if (iterMapPID->first == PDG_t::kProton) {
189212
histos.fill(HIST("frac/data/proton"), pt, fracData);
190213
histos.fill(HIST("frac/mc/proton"), pt, fracMC);
214+
histos.fill(HIST("frac/data/proton_mult"), dNdEta, pt, fracData);
215+
histos.fill(HIST("frac/mc/proton_mult"), dNdEta, pt, fracMC);
191216
histos.fill(HIST("weight/proton"), pt, weight);
217+
histos.fill(HIST("weight/proton_mult"), dNdEta, pt, weight);
192218
}
193219
if (iterMapPID->first == PDG_t::kSigmaPlus || iterMapPID->first == PDG_t::kSigmaMinus) {
194220
histos.fill(HIST("frac/data/sigma"), pt, fracData);
195221
histos.fill(HIST("frac/mc/sigma"), pt, fracMC);
222+
histos.fill(HIST("frac/data/sigma_mult"), dNdEta, pt, fracData);
223+
histos.fill(HIST("frac/mc/sigma_mult"), dNdEta, pt, fracMC);
196224
histos.fill(HIST("weight/sigma"), pt, weight);
225+
histos.fill(HIST("weight/sigma_mult"), dNdEta, pt, weight);
197226
}
198227
}
199228
return weights;
@@ -218,8 +247,10 @@ std::tuple<float, float, float> ParticleCompositionCorrection::getWeights(aod::M
218247
if (pdgParticle && pdgParticle->Charge() != 0.) {
219248
if (particle.getProcess() == TMCProcess::kPDecay) {
220249
histos.fill(HIST("weight/secDec"), particle.pt(), weight);
250+
histos.fill(HIST("weight/secDec_mult"), dNdEta, particle.pt(), weight);
221251
} else if (particle.getProcess() == TMCProcess::kPHInhelastic || particle.getProcess() == TMCProcess::kPHadronic || particle.getProcess() == TMCProcess::kPHElastic) {
222252
histos.fill(HIST("weight/secMat"), particle.pt(), weight);
253+
histos.fill(HIST("weight/secMat_mult"), dNdEta, particle.pt(), weight);
223254
}
224255
}
225256
}
@@ -232,6 +263,8 @@ void ParticleCompositionCorrection::process(aod::McCollisions::iterator const&,
232263
{
233264
// determine dNdEta of the collision
234265
float dNdEta = 0.f;
266+
float dNdEtafid = 0.f;
267+
235268
for (const auto& particle : particles) {
236269
if (!particle.isPhysicalPrimary()) {
237270
continue;
@@ -240,10 +273,19 @@ void ParticleCompositionCorrection::process(aod::McCollisions::iterator const&,
240273
if (!pdgParticle || pdgParticle->Charge() == 0.) {
241274
continue;
242275
}
243-
if (std::abs(particle.eta()) >= 0.5) { // o2-linter: disable=magic-number (particle density at mid-rapidity)
276+
if (std::abs(particle.eta()) >= etaCut) {
244277
continue;
245278
}
246-
++dNdEta;
279+
if (std::abs(particle.eta()) < 0.5) { // o2-linter: disable=magic-number (particle density at mid-rapidity)
280+
++dNdEta;
281+
}
282+
++dNdEtafid;
283+
}
284+
285+
if (dNdEtafid > 0.f) {
286+
histos.fill(HIST("multDist_INELg0"), dNdEta);
287+
histos.fill(HIST("multDist_fid"), dNdEtafid);
288+
histos.fill(HIST("multDist_fidVsINELg0"), dNdEta, dNdEtafid);
247289
}
248290

249291
std::map<int32_t, std::tuple<float, float, float>> storedWeights;

PWGLF/Tasks/Nuspex/pccQa.cxx

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <Framework/AnalysisDataModel.h>
2323
#include <Framework/AnalysisHelpers.h>
2424
#include <Framework/AnalysisTask.h>
25+
#include <Framework/ConfigParamSpec.h>
2526
#include <Framework/Configurable.h>
2627
#include <Framework/HistogramRegistry.h>
2728
#include <Framework/HistogramSpec.h>
@@ -43,6 +44,8 @@ struct PccQa {
4344

4445
static constexpr float MaxVtxZ = 10.f;
4546

47+
Configurable<uint32_t> maxMult{"maxMult", 100, "max multiplicity"};
48+
4649
void init(InitContext const&);
4750

4851
template <bool IS_MC, typename C, typename T>
@@ -69,23 +72,45 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
6972

7073
void PccQa::init(InitContext const&)
7174
{
75+
7276
histos.add("eventCounter", "", kTH1D, {{1, 0.5, 1.5}});
7377
const AxisSpec dcaAxis = {1000, -1., 1., "#it{DCA}_{xy}", "dca"};
7478
std::vector<double> ptBinEdges = {0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.5, 3.0};
7579
const AxisSpec ptAxis{ptBinEdges, "#it{p}_{T} (GeV/#it{c})", "pt"};
7680

81+
const int nBinsMult = 30;
82+
const AxisSpec nchAxis = {nBinsMult, 0., static_cast<double>(maxMult), "#it{N}_{ch}", "nch"};
83+
7784
histos.add("DCAxyVsPt", "", kTH2D, {ptAxis, dcaAxis});
85+
histos.add("DCAxyVsPtVsMult", "", kTH3D, {nchAxis, ptAxis, dcaAxis});
7886

7987
if (doprocessMC) {
8088
histos.add("DCAxyVsPt_weighted", "", kTH2D, {ptAxis, dcaAxis});
89+
histos.add("DCAxyVsPtVsMult_weighted", "", kTH3D, {nchAxis, ptAxis, dcaAxis});
90+
8191
histos.add("prim/DCAxyVsPt", "", kTH2D, {ptAxis, dcaAxis});
92+
histos.add("prim/DCAxyVsPtVsMult", "", kTH3D, {nchAxis, ptAxis, dcaAxis});
93+
94+
histos.add("prim/DCAxyVsPtVsMult_weighted", "", kTH3D, {nchAxis, ptAxis, dcaAxis});
8295
histos.add("prim/DCAxyVsPt_weighted", "", kTH2D, {ptAxis, dcaAxis});
96+
8397
histos.add("sec/DCAxyVsPt", "", kTH2D, {ptAxis, dcaAxis});
98+
histos.add("sec/DCAxyVsPtVsMult", "", kTH3D, {nchAxis, ptAxis, dcaAxis});
99+
84100
histos.add("sec/DCAxyVsPt_weighted", "", kTH2D, {ptAxis, dcaAxis});
101+
histos.add("sec/DCAxyVsPtVsMult_weighted", "", kTH3D, {nchAxis, ptAxis, dcaAxis});
102+
85103
histos.add("sec/dec/DCAxyVsPt", "", kTH2D, {ptAxis, dcaAxis});
104+
histos.add("sec/dec/DCAxyVsPtVsMult", "", kTH3D, {nchAxis, ptAxis, dcaAxis});
105+
86106
histos.add("sec/dec/DCAxyVsPt_weighted", "", kTH2D, {ptAxis, dcaAxis});
107+
histos.add("sec/dec/DCAxyVsPtVsMult_weighted", "", kTH3D, {nchAxis, ptAxis, dcaAxis});
108+
87109
histos.add("sec/mat/DCAxyVsPt", "", kTH2D, {ptAxis, dcaAxis});
110+
histos.add("sec/mat/DCAxyVsPtVsMult", "", kTH3D, {nchAxis, ptAxis, dcaAxis});
111+
88112
histos.add("sec/mat/DCAxyVsPt_weighted", "", kTH2D, {ptAxis, dcaAxis});
113+
histos.add("sec/mat/DCAxyVsPtVsMult_weighted", "", kTH3D, {nchAxis, ptAxis, dcaAxis});
89114
}
90115
}
91116

@@ -95,6 +120,7 @@ void PccQa::processData(CollisionTableData::iterator const& collision, TrackTabl
95120
}
96121
void PccQa::processMC(CollisionTableMCTrue::iterator const&, TrackTableMC const& tracks, CollisionTableMC const& collisions, ParticleTableMC const&)
97122
{
123+
98124
for (const auto& collision : collisions) {
99125
auto curTracks = tracks.sliceBy(perCollision, collision.globalIndex());
100126
processMeas<true>(collision, curTracks);
@@ -105,6 +131,7 @@ void PccQa::processMC(CollisionTableMCTrue::iterator const&, TrackTableMC const&
105131
template <bool IS_MC, typename C, typename T>
106132
void PccQa::processMeas(const C& collision, const T& tracks)
107133
{
134+
108135
if ((std::abs(collision.posZ()) > MaxVtxZ) || !collision.sel8()) {
109136
return;
110137
}
@@ -115,6 +142,7 @@ void PccQa::processMeas(const C& collision, const T& tracks)
115142
continue;
116143
}
117144
histos.fill(HIST("DCAxyVsPt"), track.pt(), track.dcaXY());
145+
histos.fill(HIST("DCAxyVsPtVsMult"), tracks.size(), track.pt(), track.dcaXY());
118146

119147
if constexpr (IS_MC) {
120148
if (!track.has_mcParticle()) {
@@ -123,19 +151,28 @@ void PccQa::processMeas(const C& collision, const T& tracks)
123151
const auto& particle = track.template mcParticle_as<ParticleTableMC>();
124152

125153
histos.fill(HIST("DCAxyVsPt_weighted"), track.pt(), track.dcaXY(), particle.pccWeight());
154+
histos.fill(HIST("DCAxyVsPtVsMult_weighted"), tracks.size(), track.pt(), track.dcaXY(), particle.pccWeight());
126155

127156
if (particle.isPhysicalPrimary()) {
128157
histos.fill(HIST("prim/DCAxyVsPt"), track.pt(), track.dcaXY());
129158
histos.fill(HIST("prim/DCAxyVsPt_weighted"), track.pt(), track.dcaXY(), particle.pccWeight());
159+
histos.fill(HIST("prim/DCAxyVsPtVsMult"), tracks.size(), track.pt(), track.dcaXY());
160+
histos.fill(HIST("prim/DCAxyVsPtVsMult_weighted"), tracks.size(), track.pt(), track.dcaXY(), particle.pccWeight());
130161
} else {
131162
histos.fill(HIST("sec/DCAxyVsPt"), track.pt(), track.dcaXY());
132163
histos.fill(HIST("sec/DCAxyVsPt_weighted"), track.pt(), track.dcaXY(), particle.pccWeight());
164+
histos.fill(HIST("sec/DCAxyVsPtVsMult"), tracks.size(), track.pt(), track.dcaXY());
165+
histos.fill(HIST("sec/DCAxyVsPtVsMult_weighted"), tracks.size(), track.pt(), track.dcaXY(), particle.pccWeight());
133166
if (particle.getProcess() == TMCProcess::kPDecay) {
134167
histos.fill(HIST("sec/dec/DCAxyVsPt"), track.pt(), track.dcaXY());
135168
histos.fill(HIST("sec/dec/DCAxyVsPt_weighted"), track.pt(), track.dcaXY(), particle.pccWeight());
169+
histos.fill(HIST("sec/dec/DCAxyVsPtVsMult"), tracks.size(), track.pt(), track.dcaXY());
170+
histos.fill(HIST("sec/dec/DCAxyVsPtVsMult_weighted"), tracks.size(), track.pt(), track.dcaXY(), particle.pccWeight());
136171
} else if (particle.getProcess() == TMCProcess::kPHInhelastic || particle.getProcess() == TMCProcess::kPHadronic || particle.getProcess() == TMCProcess::kPHElastic) {
137172
histos.fill(HIST("sec/mat/DCAxyVsPt"), track.pt(), track.dcaXY());
138173
histos.fill(HIST("sec/mat/DCAxyVsPt_weighted"), track.pt(), track.dcaXY(), particle.pccWeight());
174+
histos.fill(HIST("sec/mat/DCAxyVsPtVsMult"), tracks.size(), track.pt(), track.dcaXY());
175+
histos.fill(HIST("sec/mat/DCAxyVsPtVsMult_weighted"), tracks.size(), track.pt(), track.dcaXY(), particle.pccWeight());
139176
}
140177
}
141178
}

0 commit comments

Comments
 (0)