Skip to content

Commit b3c3b5c

Browse files
authored
Merge branch 'AliceO2Group:master' into master
2 parents ee831f7 + a2cc57c commit b3c3b5c

File tree

89 files changed

+7575
-3110
lines changed

Some content is hidden

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

89 files changed

+7575
-3110
lines changed

ALICE3/Core/DelphesO2TrackSmearer.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ lutEntry_t* TrackSmearer::getLUTEntry(const int pdg, const float nch, const floa
166166
{
167167
const int ipdg = getIndexPDG(pdg);
168168
if (!mLUTHeader[ipdg]) {
169-
LOG(error) << " --- getLUTEntry: LUT header not loaded for pdg=" << pdg << ". Returning nullptr.";
170169
return nullptr;
171170
}
171+
172172
auto inch = mLUTHeader[ipdg]->nchmap.find(nch);
173173
auto irad = mLUTHeader[ipdg]->radmap.find(radius);
174174
auto ieta = mLUTHeader[ipdg]->etamap.find(eta);
@@ -290,7 +290,6 @@ bool TrackSmearer::smearTrack(O2Track& o2track, lutEntry_t* lutEntry, float inte
290290

291291
bool TrackSmearer::smearTrack(O2Track& o2track, int pdg, float nch)
292292
{
293-
294293
auto pt = o2track.getPt();
295294
switch (pdg) {
296295
case o2::constants::physics::kHelium3:

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>();

Common/Core/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ o2physics_target_root_dictionary(EventFilteringUtils
5151

5252
o2physics_add_header_only_library(TPCDriftManager
5353
HEADERS TPCVDriftManager.h
54-
INTERFACE_LINK_LIBRARIES O2::DataFormatsTPC)
54+
INTERFACE_LINK_LIBRARIES)

Common/DataModel/EventSelection.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ DECLARE_SOA_INDEX_COLUMN_FULL(FoundFDD, foundFDD, int, FDDs, "_foundFDD"); //!
6565
DECLARE_SOA_INDEX_COLUMN_FULL(FoundZDC, foundZDC, int, Zdcs, "_foundZDC"); //! ZDC entry index in ZDCs table (-1 if doesn't exist)
6666
DECLARE_SOA_COLUMN(NumTracksInTimeRange, trackOccupancyInTimeRange, int); //! Occupancy in specified time interval by a number of tracks from nearby collisions // o2-linter: disable=name/o2-column
6767
DECLARE_SOA_COLUMN(SumAmpFT0CInTimeRange, ft0cOccupancyInTimeRange, float); //! Occupancy in specified time interval by a sum of FT0C amplitudes from nearby collisions // o2-linter: disable=name/o2-column
68+
DECLARE_SOA_COLUMN(OccupancyMedianTime, occupancyMedianTime, float); //! Median time for the occupancy in specified time interval (the delta-time wrt to the collision at which occupancy crosses 1/2 of its full value)
6869
} // namespace evsel
6970

7071
// bc-joinable event selection decisions
@@ -85,7 +86,8 @@ DECLARE_SOA_TABLE(EvSels, "AOD", "EVSEL", //!
8586
evsel::FoundFDDId,
8687
evsel::FoundZDCId,
8788
evsel::NumTracksInTimeRange,
88-
evsel::SumAmpFT0CInTimeRange);
89+
evsel::SumAmpFT0CInTimeRange,
90+
evsel::OccupancyMedianTime);
8991
using EvSel = EvSels::iterator;
9092
} // namespace o2::aod
9193

Common/TableProducer/eventSelection.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ struct EventSelectionTask {
694694
}
695695
}
696696

697-
evsel(alias, selection, rct, sel7, sel8, foundBC, foundFT0, foundFV0, foundFDD, foundZDC, 0, 0);
697+
evsel(alias, selection, rct, sel7, sel8, foundBC, foundFT0, foundFV0, foundFDD, foundZDC, 0, 0, 0);
698698
}
699699
PROCESS_SWITCH(EventSelectionTask, processRun2, "Process Run2 event selection", true);
700700

@@ -750,7 +750,7 @@ struct EventSelectionTask {
750750
int32_t foundFDD = bc.foundFDDId();
751751
int32_t foundZDC = bc.foundZDCId();
752752
uint32_t rct = 0;
753-
evsel(bc.alias_raw(), bc.selection_raw(), rct, kFALSE, kFALSE, foundBC, foundFT0, foundFV0, foundFDD, foundZDC, -1, -1);
753+
evsel(bc.alias_raw(), bc.selection_raw(), rct, kFALSE, kFALSE, foundBC, foundFT0, foundFV0, foundFDD, foundZDC, -1, -1, -1);
754754
}
755755
return;
756756
}
@@ -1166,7 +1166,7 @@ struct EventSelectionTask {
11661166
}
11671167

11681168
evsel(alias, selection, rct, sel7, sel8, foundBC, foundFT0, foundFV0, foundFDD, foundZDC,
1169-
vNumTracksITS567inFullTimeWin[colIndex], vSumAmpFT0CinFullTimeWin[colIndex]);
1169+
vNumTracksITS567inFullTimeWin[colIndex], vSumAmpFT0CinFullTimeWin[colIndex], 0);
11701170
}
11711171
}
11721172

0 commit comments

Comments
 (0)