Skip to content

Commit 14dc656

Browse files
authored
Merge branch 'AliceO2Group:master' into Add-preselection-and-centrality-to-STTree-creatore
2 parents 2788efd + 753f62e commit 14dc656

File tree

6 files changed

+875
-784
lines changed

6 files changed

+875
-784
lines changed

ALICE3/TableProducer/OTF/onTheFlyTrackerPid.cxx

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -136,38 +136,37 @@ class ToTLUT
136136

137137
bool load(int pdg, const std::string& filename)
138138
{
139-
if (!filename.empty() && strncmp(filename.c_str(), "ccdb:", 5) == 0) {
140-
std::string basePath = std::string(filename).substr(5);
141-
std::string path = basePath + "/PDG_" + std::to_string(pdg);
142-
const std::string outPath = "/tmp/ToTLUTs/";
143-
144-
std::string localFilename = Form("%s/lut_tot_%d.root", outPath.c_str(), pdg);
139+
if (filename.empty()) {
140+
LOG(warning) << "Provided filename is empty for PDG " << pdg;
141+
return false;
142+
}
143+
if (strncmp(filename.c_str(), "ccdb:", 5) == 0) { // Check if filename starts with "ccdb:"
144+
const std::string basePath = std::string(filename).substr(5);
145+
const std::string outPath = "/tmp/ToTLUTs/" + basePath;
146+
const std::string localFilename = outPath + "/snapshot.root";
145147
std::ifstream checkFile(localFilename);
146-
if (!checkFile.is_open()) {
148+
if (!checkFile.is_open()) { // File is not found, need to download it from CCDB
147149
if (!mCcdbManager) {
148150
LOG(fatal) << "CCDB manager not set. Please set it before loading LUT from CCDB.";
149151
}
150152
std::map<std::string, std::string> metadata;
151-
mCcdbManager->getCCDBAccessor().retrieveBlob(path, outPath, metadata, 1);
152-
153-
std::string foundFile = Form("%s/%s/snapshot.root", outPath.c_str(), path.c_str());
154-
std::ifstream testFile(foundFile);
153+
mCcdbManager->getCCDBAccessor().retrieveBlob(basePath, outPath, metadata, 1);
154+
std::ifstream testFile(localFilename);
155155
if (!testFile.is_open()) {
156-
LOG(error) << "Could not find downloaded CCDB file for PDG " << pdg;
156+
LOG(fatal) << "Could not find downloaded CCDB file for PDG " << pdg;
157157
return false;
158158
}
159159
testFile.close();
160-
161-
return load(pdg, foundFile);
162-
} else {
160+
return load(pdg, localFilename);
161+
} else { // File is found, proceed to load it
163162
checkFile.close();
164163
return load(pdg, localFilename);
165164
}
166165
}
167-
166+
// In case the file is already available locally
168167
TFile* f = TFile::Open(filename.c_str());
169168
if (!f || f->IsZombie()) {
170-
LOG(error) << "Failed to open LUT file: " << filename;
169+
LOG(fatal) << "Failed to open LUT file: " << filename;
171170
return false;
172171
}
173172

@@ -397,15 +396,15 @@ struct OnTheFlyTrackerPid {
397396

398397
HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject};
399398

400-
Configurable<std::string> lutTotEl{"lutTotEl", "ccdb:Users/h/hfribert/ToT_LUTs", "ToT LUT for electrons"};
401-
Configurable<std::string> lutTotMu{"lutTotMu", "ccdb:Users/h/hfribert/ToT_LUTs", "ToT LUT for muons"};
402-
Configurable<std::string> lutTotPi{"lutTotPi", "ccdb:Users/h/hfribert/ToT_LUTs", "ToT LUT for pions"};
403-
Configurable<std::string> lutTotKa{"lutTotKa", "ccdb:Users/h/hfribert/ToT_LUTs", "ToT LUT for kaons"};
404-
Configurable<std::string> lutTotPr{"lutTotPr", "ccdb:Users/h/hfribert/ToT_LUTs", "ToT LUT for protons"};
405-
Configurable<std::string> lutTotDe{"lutTotDe", "ccdb:Users/h/hfribert/ToT_LUTs", "ToT LUT for deuteron"};
406-
Configurable<std::string> lutTotTr{"lutTotTr", "ccdb:Users/h/hfribert/ToT_LUTs", "ToT LUT for triton"};
407-
Configurable<std::string> lutTotHe{"lutTotHe", "ccdb:Users/h/hfribert/ToT_LUTs", "ToT LUT for helium-3"};
408-
Configurable<std::string> lutTotAl{"lutTotAl", "ccdb:Users/h/hfribert/ToT_LUTs", "ToT LUT for alphas"};
399+
Configurable<std::string> lutTotEl{"lutTotEl", "ccdb:Users/h/hfribert/ToT_LUTs/PDG_11/", "ToT LUT for electrons"};
400+
Configurable<std::string> lutTotMu{"lutTotMu", "ccdb:Users/h/hfribert/ToT_LUTs/PDG_13/", "ToT LUT for muons"};
401+
Configurable<std::string> lutTotPi{"lutTotPi", "ccdb:Users/h/hfribert/ToT_LUTs/PDG_211/", "ToT LUT for pions"};
402+
Configurable<std::string> lutTotKa{"lutTotKa", "ccdb:Users/h/hfribert/ToT_LUTs/PDG_321/", "ToT LUT for kaons"};
403+
Configurable<std::string> lutTotPr{"lutTotPr", "ccdb:Users/h/hfribert/ToT_LUTs/PDG_2212/", "ToT LUT for protons"};
404+
Configurable<std::string> lutTotDe{"lutTotDe", "ccdb:Users/h/hfribert/ToT_LUTs/PDG_1000010020/", "ToT LUT for deuteron"};
405+
Configurable<std::string> lutTotTr{"lutTotTr", "ccdb:Users/h/hfribert/ToT_LUTs/PDG_1000010030/", "ToT LUT for triton"};
406+
Configurable<std::string> lutTotHe{"lutTotHe", "ccdb:Users/h/hfribert/ToT_LUTs/PDG_1000020030/", "ToT LUT for helium-3"};
407+
Configurable<std::string> lutTotAl{"lutTotAl", "ccdb:Users/h/hfribert/ToT_LUTs/PDG_1000020040/", "ToT LUT for alphas"};
409408

410409
Configurable<float> dBz{"dBz", 20, "magnetic field (kilogauss) for track propagation"};
411410
Configurable<int> maxBarrelLayers{"maxBarrelLayers", 11, "Maximum number of barrel layers"};

ALICE3/Tasks/alice3-qa-singleparticle.cxx

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
/// \brief Task to monitor the single particle QA, at the particle and track level, showing the tracked and the origin of particles
1616
///
1717

18-
// O2 includes
19-
#include "Framework/AnalysisTask.h"
20-
#include "Framework/runDataProcessing.h"
21-
#include "Framework/HistogramRegistry.h"
22-
#include "Framework/O2DatabasePDGPlugin.h"
23-
#include "TDatabasePDG.h"
24-
#include "TMCProcess.h"
18+
#include <Framework/AnalysisTask.h>
19+
#include <Framework/HistogramRegistry.h>
20+
#include <Framework/O2DatabasePDGPlugin.h>
21+
#include <Framework/runDataProcessing.h>
22+
23+
#include <TDatabasePDG.h>
24+
#include <TMCProcess.h>
2525

2626
using namespace o2;
2727
using namespace o2::framework;
@@ -97,11 +97,9 @@ struct Alice3SingleParticle {
9797
const AxisSpec axisProdz{prodBinsZ, prodMinZ, prodMaxZ, "Prod. Vertex Z (cm)"};
9898
const AxisSpec axisProdRadius{prodBins, 0., 2. * prodMax, "Prod. Vertex Radius (cm)"};
9999

100-
if (!doprocessParticleOnly) {
101-
histos.add("event/VtxX", "Vertex X", kTH1D, {axisVx});
102-
histos.add("event/VtxY", "Vertex Y", kTH1D, {axisVy});
103-
histos.add("event/VtxZ", "Vertex Z", kTH1D, {axisVz});
104-
}
100+
histos.add("event/VtxX", "Vertex X", kTH1D, {axisVx});
101+
histos.add("event/VtxY", "Vertex Y", kTH1D, {axisVy});
102+
histos.add("event/VtxZ", "Vertex Z", kTH1D, {axisVz});
105103

106104
histos.add("particle/PDGs", "Particle PDGs", kTH2D, {axisPDGs, axisCharge});
107105
histos.add("particle/PDGsPrimaries", "Particle PDGs of Primaries", kTH2D, {axisPDGs, axisCharge});
@@ -145,6 +143,7 @@ struct Alice3SingleParticle {
145143
histos.add("particle/Py", "Particle Py " + tit, kTH1D, {axisPy});
146144
histos.add("particle/Pz", "Particle Pz " + tit, kTH1D, {axisPz});
147145

146+
histos.add("particle/daughters/Number", "Number of Daughters " + tit, kTH1D, {{20, -0.5, 19.5}});
148147
histos.add("particle/daughters/PDGs", "Daughters PDGs " + tit, kTH2D, {axisPDGs, axisCharge});
149148
histos.add("particle/daughters/PDGsPrimaries", "Daughters PDGs Primaries of " + tit, kTH2D, {axisPDGs, axisCharge});
150149
histos.add("particle/daughters/PDGsSecondaries", "Daughters PDGs Secondaries of " + tit, kTH2D, {axisPDGs, axisCharge});
@@ -158,6 +157,7 @@ struct Alice3SingleParticle {
158157
histos.add("particle/daughters/prodRadiusVsPt", "Daughters Prod. Vertex Radius " + tit, kTH2D, {axisPt, axisProdRadius});
159158
histos.add("particle/daughters/prodRadius3DVsPt", "Daughters Prod. Vertex Radius XYZ " + tit, kTH2D, {axisPt, axisProdRadius});
160159

160+
histos.add("particle/mothers/Number", "Number of Mothers " + tit, kTH1D, {{20, -0.5, 19.5}});
161161
histos.add("particle/mothers/PDGs", "Mothers PDGs " + tit, kTH2D, {axisPDGs, axisCharge});
162162
histos.add("particle/mothers/PDGsPrimaries", "Mothers PDGs Primaries of " + tit, kTH2D, {axisPDGs, axisCharge});
163163
histos.add("particle/mothers/PDGsSecondaries", "Mothers PDGs Secondaries of " + tit, kTH2D, {axisPDGs, axisCharge});
@@ -167,6 +167,8 @@ struct Alice3SingleParticle {
167167
histos.add("particle/mothers/prodRadiusVsPt", "Mothers Prod. Vertex Radius " + tit, kTH2D, {axisPt, axisProdRadius});
168168
histos.add("particle/mothers/prodRadius3DVsPt", "Mothers Prod. Vertex Radius XYZ " + tit, kTH2D, {axisPt, axisProdRadius});
169169

170+
// Go up one generation
171+
histos.add("particle/mothers/mothers/Number", "Number of Mothers mothers " + tit, kTH1D, {{20, -0.5, 19.5}});
170172
histos.add("particle/mothers/mothers/PDGs", "Mothers mothers PDGs " + tit, kTH2D, {axisPDGs, axisCharge});
171173
histos.add("particle/mothers/mothers/PDGsPrimaries", "Mothers mothers PDGs Primaries of " + tit, kTH2D, {axisPDGs, axisCharge});
172174
histos.add("particle/mothers/mothers/PDGsSecondaries", "Mothers mothers PDGs Secondaries of " + tit, kTH2D, {axisPDGs, axisCharge});
@@ -272,6 +274,7 @@ struct Alice3SingleParticle {
272274
histos.fill(HIST("particle/prodVz"), mcParticle.vz());
273275
if (mcParticle.has_daughters()) {
274276
auto daughters = mcParticle.daughters_as<aod::McParticles>();
277+
histos.fill(HIST("particle/daughters/Number"), daughters.size());
275278
for (const auto& daughter : daughters) {
276279
const auto& pdgStringDau = getPdgCodeString(daughter);
277280
const auto& pdgChargeDau = getCharge(daughter);
@@ -293,6 +296,8 @@ struct Alice3SingleParticle {
293296
histos.fill(HIST("particle/daughters/prodRadiusVsPt"), mcParticle.pt(), std::sqrt(daughter.vx() * daughter.vx() + daughter.vy() * daughter.vy()));
294297
histos.fill(HIST("particle/daughters/prodRadius3DVsPt"), mcParticle.pt(), std::sqrt(daughter.vx() * daughter.vx() + daughter.vy() * daughter.vy() + daughter.vz() * daughter.vz()));
295298
}
299+
} else {
300+
histos.fill(HIST("particle/daughters/Number"), 0.f);
296301
}
297302
if (mcParticle.has_mothers()) {
298303
const auto& mothers = mcParticle.mothers_as<aod::McParticles>();
@@ -415,8 +420,14 @@ struct Alice3SingleParticle {
415420
}
416421
PROCESS_SWITCH(Alice3SingleParticle, processStandard, "Process IU tracks", true);
417422

418-
void processParticleOnly(const aod::McParticles& mcParticles)
423+
void processParticleOnly(const o2::aod::McCollisions& colls,
424+
const aod::McParticles& mcParticles)
419425
{
426+
for (const auto& col : colls) {
427+
histos.fill(HIST("event/VtxX"), col.posX());
428+
histos.fill(HIST("event/VtxY"), col.posY());
429+
histos.fill(HIST("event/VtxZ"), col.posZ());
430+
}
420431
for (const auto& mcParticle : mcParticles) {
421432
const auto& pdgString = getPdgCodeString(mcParticle);
422433
const auto& pdgCharge = getCharge(mcParticle);
@@ -467,6 +478,7 @@ struct Alice3SingleParticle {
467478
histos.fill(HIST("particle/prodVz"), mcParticle.vz());
468479
if (mcParticle.has_daughters()) {
469480
auto daughters = mcParticle.daughters_as<aod::McParticles>();
481+
histos.fill(HIST("particle/daughters/Number"), daughters.size());
470482
for (const auto& daughter : daughters) {
471483
const auto& pdgStringDau = getPdgCodeString(daughter);
472484
const auto& pdgChargeDau = getCharge(daughter);
@@ -484,6 +496,8 @@ struct Alice3SingleParticle {
484496
histos.fill(HIST("particle/daughters/prodRadiusVsPt"), mcParticle.pt(), std::sqrt(mcParticle.vx() * mcParticle.vx() + mcParticle.vy() * mcParticle.vy()));
485497
histos.fill(HIST("particle/daughters/prodRadius3DVsPt"), mcParticle.pt(), std::sqrt(mcParticle.vx() * mcParticle.vx() + mcParticle.vy() * mcParticle.vy() + mcParticle.vz() * mcParticle.vz()));
486498
}
499+
} else {
500+
histos.fill(HIST("particle/daughters/Number"), 0.f);
487501
}
488502
if (mcParticle.has_mothers()) {
489503
auto mothers = mcParticle.mothers_as<aod::McParticles>();
@@ -586,6 +600,7 @@ struct Alice3SingleParticle {
586600
histos.fill(HIST("particle/prodVz"), mcParticle.vz());
587601
if (mcParticle.has_daughters()) {
588602
auto daughters = mcParticle.daughters_as<aod::McParticles>();
603+
histos.fill(HIST("particle/daughters/Number"), daughters.size());
589604
for (const auto& daughter : daughters) {
590605
const auto& pdgStringDau = getPdgCodeString(daughter);
591606
const auto& pdgChargeDau = getCharge(daughter);
@@ -603,6 +618,8 @@ struct Alice3SingleParticle {
603618
histos.fill(HIST("particle/daughters/prodRadiusVsPt"), mcParticle.pt(), std::sqrt(mcParticle.vx() * mcParticle.vx() + mcParticle.vy() * mcParticle.vy()));
604619
histos.fill(HIST("particle/daughters/prodRadius3DVsPt"), mcParticle.pt(), std::sqrt(mcParticle.vx() * mcParticle.vx() + mcParticle.vy() * mcParticle.vy() + mcParticle.vz() * mcParticle.vz()));
605620
}
621+
} else {
622+
histos.fill(HIST("particle/daughters/Number"), 0.f);
606623
}
607624
if (mcParticle.has_mothers()) {
608625
auto mothers = mcParticle.mothers_as<aod::McParticles>();

PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ std::array<float, 3> kDCAzResolutionParams[static_cast<int>(Species::kAllSpecies
129129
{0.0021, 1.1122, 0.0021} // Pr
130130
};
131131

132+
std::array<float, 2> kHePidTrkParams = {0.1593, -0.0445};
133+
132134
} // namespace
133135

134136
struct He3HadCandidate {
@@ -472,6 +474,15 @@ struct he3HadronFemto {
472474
return true;
473475
}
474476

477+
template <typename Ttrack>
478+
float correctPtHe3TrackedAsTriton(const Ttrack& candidate)
479+
{
480+
if (candidate.pt() < 2.5 && candidate.pidForTracking() == o2::track::PID::Triton)
481+
return candidate.pt() * 2. * (1. - kHePidTrkParams[0] - kHePidTrkParams[1] * candidate.pt() * 2.);
482+
483+
return candidate.pt() * 2.;
484+
}
485+
475486
float computeNsigmaDCA(const float pt, const float dca, const int iSpecies, const char* dcaType = "xy")
476487
{
477488

@@ -1337,7 +1348,9 @@ struct he3HadronFemto {
13371348
if (!selectTrack(track, Species::kHe3) || !selectDcaNsigmaCut(track, Species::kHe3))
13381349
continue;
13391350

1340-
mQaRegistry.fill(HIST("He3/hHe3Pt"), track.pt() * 2.f);
1351+
const float ptHe3Corrected = correctPtHe3TrackedAsTriton(track);
1352+
1353+
mQaRegistry.fill(HIST("He3/hHe3Pt"), ptHe3Corrected);
13411354
mQaRegistry.fill(HIST("He3/hDCAxyHe3"), track.dcaXY());
13421355
mQaRegistry.fill(HIST("He3/hDCAzHe3"), track.dcaZ());
13431356

@@ -1348,7 +1361,7 @@ struct he3HadronFemto {
13481361
}
13491362

13501363
const float nSigmaHe3 = computeNSigmaHe3(track);
1351-
mQaRegistry.fill(HIST("He3/h2NsigmaHe3TPC_preselection"), track.sign() * 2 * track.pt(), nSigmaHe3);
1364+
mQaRegistry.fill(HIST("He3/h2NsigmaHe3TPC_preselection"), track.sign() * ptHe3Corrected, nSigmaHe3);
13521365
}
13531366
}
13541367
PROCESS_SWITCH(he3HadronFemto, processPurity, "Process for purity studies", false);

PWGLF/Tasks/Nuspex/antinucleiInJets.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ struct AntinucleiInJets {
121121
Configurable<double> maxNormalizedJetArea{"maxNormalizedJetArea", 1.0, "area cut"};
122122
Configurable<double> deltaEtaEdge{"deltaEtaEdge", 0.05, "eta gap from the edge"};
123123
Configurable<int> nSyst{"nSyst", 50, "number of systematic variations"};
124+
Configurable<int> nSubsamples{"nSubsamples", 50, "number of subsamples"};
124125

125126
// Track quality, kinematic, and PID selection parameters
126127
Configurable<bool> requirePvContributor{"requirePvContributor", false, "require that the track is a PV contributor"};
@@ -472,7 +473,7 @@ struct AntinucleiInJets {
472473
const AxisSpec nBarD2Axis{100, 0.0, 100.0, "N_{#bar{d}}^{i} #times N_{#bar{d}}^{j}"};
473474
const AxisSpec nBarP2Axis{100, 0.0, 100.0, "N_{#bar{p}}^{i} #times N_{#bar{p}}^{j}"};
474475
const AxisSpec nBarDnBarPAxis{100, 0.0, 100.0, "N_{#bar{d}}^{i} #times N_{#bar{p}}^{j}"};
475-
const AxisSpec subsampleAxis{20, 0, 20, "Subsample Index"};
476+
const AxisSpec subsampleAxis{nSubsamples, 0, static_cast<double>(nSubsamples), "Subsample Index"};
476477

477478
// Event counter
478479
registryCorr.add("eventCounter", "number of events", HistType::kTH1F, {{20, 0, 20, "counter"}});
@@ -2684,7 +2685,7 @@ struct AntinucleiInJets {
26842685
registryCorr.fill(HIST("eventCounter"), 7.5);
26852686

26862687
// Assign event to a random subsample (0-19)
2687-
double sampleId = mRand.Integer(20) + 0.5;
2688+
double sampleId = mRand.Integer(nSubsamples) + 0.5;
26882689

26892690
// Multiplicity percentile
26902691
const float multiplicity = collision.centFT0M();

0 commit comments

Comments
 (0)