Skip to content

Commit 803801d

Browse files
authored
Merge branch 'master' into DQRefactor
2 parents 5269ff8 + e5753b3 commit 803801d

108 files changed

Lines changed: 9733 additions & 3097 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.

‎PWGCF/EbyEFluctuations/Tasks/partNumFluc.cxx‎

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
#include <Framework/InitContext.h>
3939
#include <Framework/O2DatabasePDGPlugin.h>
4040
#include <Framework/OutputObjHeader.h>
41-
#include <Framework/StringHelpers.h>
4241
#include <Framework/runDataProcessing.h>
4342

4443
#include <TFormula.h>
@@ -73,17 +72,8 @@
7372
#include <utility>
7473
#include <vector>
7574

76-
#define C_CS(cs) /* NOLINT(cppcoreguidelines-macro-usage) */ \
77-
[]<std::size_t... indices>(const std::index_sequence<indices...>&) constexpr noexcept -> ConstStr<(cs)[indices]...> { \
78-
static_assert(std::is_array_v<std::remove_cvref_t<decltype(cs)>> && \
79-
std::same_as<std::remove_extent_t<std::remove_cvref_t<decltype(cs)>>, char>); \
80-
return ConstStr<(cs)[indices]...>{}; \
81-
}(std::make_index_sequence<sizeof(cs) - 1>{})
82-
#define C_SV(sv) /* NOLINT(cppcoreguidelines-macro-usage) */ \
83-
[]<std::size_t... indices>(const std::index_sequence<indices...>&) constexpr noexcept -> ConstStr<(sv)[indices]...> { \
84-
static_assert(std::same_as<std::remove_cvref_t<decltype(sv)>, std::string_view>); \
85-
return ConstStr<(sv)[indices]...>{}; \
86-
}(std::make_index_sequence<(sv).size()>{})
75+
#define C_CS(cs) HIST(cs) // NOLINT(cppcoreguidelines-macro-usage)
76+
#define C_SV(sv) HIST(sv) // NOLINT(cppcoreguidelines-macro-usage)
8777

8878
using namespace o2;
8979
using namespace o2::framework;

‎PWGCF/Femto/Core/collisionHistManager.h‎

Lines changed: 39 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,17 @@ enum ColHist {
6565
kColHistLast
6666
};
6767

68-
constexpr std::string_view AnalysisDir = "Collisions/Analysis/";
69-
constexpr std::string_view QaDir = "Collisions/QA/";
70-
constexpr std::string_view McDir = "Collisions/MC/";
68+
constexpr std::string_view AnalysisDir = "Analysis/";
69+
constexpr std::string_view QaDir = "QA/";
70+
constexpr std::string_view McDir = "MC/";
71+
72+
// prefixes: dedicated to the collision histograms, independent of whatever pair/triplet-type
73+
// prefix the enclosing builder uses for its other managers -- keeps every collision histogram
74+
// under one shared "Collision/" directory regardless of which pair/triplet type produced it.
75+
// Standalone QA tasks have no SE/ME split, so they use PrefixQa directly.
76+
constexpr char PrefixQa[] = "Collision/";
77+
constexpr char PrefixSe[] = "Collision/SE/";
78+
constexpr char PrefixMe[] = "Collision/ME/";
7179

7280
constexpr std::array<histmanager::HistInfo<ColHist>, kColHistLast> HistTable = {
7381
{
@@ -192,6 +200,7 @@ struct ConfCollisionQaBinning : o2::framework::ConfigurableGroup {
192200
o2::framework::ConfigurableAxis occupancy{"occupancy", {500, 0.f, 5000.f}, "Occupancy Binning"};
193201
};
194202

203+
template <auto& prefix>
195204
class CollisionHistManager
196205
{
197206
public:
@@ -270,7 +279,7 @@ class CollisionHistManager
270279
private:
271280
void initAnalysis(std::map<ColHist, std::vector<o2::framework::AxisSpec>> const& Specs)
272281
{
273-
std::string analysisDir = std::string(AnalysisDir);
282+
std::string analysisDir = std::string(prefix) + std::string(AnalysisDir);
274283
mHistogramRegistry->add(analysisDir + getHistNameV2(kPosZ, HistTable), getHistDesc(kPosZ, HistTable), getHistType(kPosZ, HistTable), {Specs.at(kPosZ)});
275284
mHistogramRegistry->add(analysisDir + getHistNameV2(kMult, HistTable), getHistDesc(kMult, HistTable), getHistType(kMult, HistTable), {Specs.at(kMult)});
276285
mHistogramRegistry->add(analysisDir + getHistNameV2(kCent, HistTable), getHistDesc(kCent, HistTable), getHistType(kCent, HistTable), {Specs.at(kCent)});
@@ -284,7 +293,7 @@ class CollisionHistManager
284293

285294
void initQa(std::map<ColHist, std::vector<o2::framework::AxisSpec>> const& Specs)
286295
{
287-
std::string qaDir = std::string(QaDir);
296+
std::string qaDir = std::string(prefix) + std::string(QaDir);
288297
mHistogramRegistry->add(qaDir + getHistNameV2(kPosX, HistTable), getHistDesc(kPosX, HistTable), getHistType(kPosX, HistTable), {Specs.at(kPosX)});
289298
mHistogramRegistry->add(qaDir + getHistNameV2(kPosY, HistTable), getHistDesc(kPosY, HistTable), getHistType(kPosY, HistTable), {Specs.at(kPosY)});
290299
mHistogramRegistry->add(qaDir + getHistNameV2(kPos, HistTable), getHistDesc(kPos, HistTable), getHistType(kPos, HistTable), {Specs.at(kPos)});
@@ -303,7 +312,7 @@ class CollisionHistManager
303312
// reco-vs-truth correlation histograms (kReco and kMc both set)
304313
void initMc(std::map<ColHist, std::vector<o2::framework::AxisSpec>> const& Specs)
305314
{
306-
std::string mcDir = std::string(McDir);
315+
std::string mcDir = std::string(prefix) + std::string(McDir);
307316
mHistogramRegistry->add(mcDir + getHistNameV2(kTruePosZVsPosZ, HistTable), getHistDesc(kTruePosZVsPosZ, HistTable), getHistType(kTruePosZVsPosZ, HistTable), {Specs.at(kTruePosZVsPosZ)});
308317
mHistogramRegistry->add(mcDir + getHistNameV2(kTrueCentVsCent, HistTable), getHistDesc(kTrueCentVsCent, HistTable), getHistType(kTrueCentVsCent, HistTable), {Specs.at(kTrueCentVsCent)});
309318
mHistogramRegistry->add(mcDir + getHistNameV2(kTrueMultVsMult, HistTable), getHistDesc(kTrueMultVsMult, HistTable), getHistType(kTrueMultVsMult, HistTable), {Specs.at(kTrueMultVsMult)});
@@ -312,7 +321,7 @@ class CollisionHistManager
312321
// pure mc-truth collision: 1D only, no reco collision exists (kMc without kReco)
313322
void initMcTruth(std::map<ColHist, std::vector<o2::framework::AxisSpec>> const& Specs)
314323
{
315-
std::string mcDir = std::string(McDir);
324+
std::string mcDir = std::string(prefix) + std::string(McDir);
316325
mHistogramRegistry->add(mcDir + getHistNameV2(kTruePosZ, HistTable), getHistDesc(kTruePosZ, HistTable), getHistType(kTruePosZ, HistTable), {Specs.at(kTruePosZ)});
317326
mHistogramRegistry->add(mcDir + getHistNameV2(kTrueCent, HistTable), getHistDesc(kTrueCent, HistTable), getHistType(kTrueCent, HistTable), {Specs.at(kTrueCent)});
318327
mHistogramRegistry->add(mcDir + getHistNameV2(kTrueMult, HistTable), getHistDesc(kTrueMult, HistTable), getHistType(kTrueMult, HistTable), {Specs.at(kTrueMult)});
@@ -321,34 +330,34 @@ class CollisionHistManager
321330
template <typename T>
322331
void fillAnalysis(T const& col)
323332
{
324-
mHistogramRegistry->fill(HIST(AnalysisDir) + HIST(getHistName(kPosZ, HistTable)), col.posZ());
325-
mHistogramRegistry->fill(HIST(AnalysisDir) + HIST(getHistName(kMult, HistTable)), col.mult());
326-
mHistogramRegistry->fill(HIST(AnalysisDir) + HIST(getHistName(kCent, HistTable)), col.cent());
327-
mHistogramRegistry->fill(HIST(AnalysisDir) + HIST(getHistName(kMagField, HistTable)), col.magField());
333+
mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kPosZ, HistTable)), col.posZ());
334+
mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kMult, HistTable)), col.mult());
335+
mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kCent, HistTable)), col.cent());
336+
mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kMagField, HistTable)), col.magField());
328337

329338
if (mPlotEventShape) {
330339
if constexpr (utils::HasEventShape<T>) {
331-
mHistogramRegistry->fill(HIST(AnalysisDir) + HIST(getHistName(kQvector, HistTable)), col.qvec());
332-
mHistogramRegistry->fill(HIST(AnalysisDir) + HIST(getHistName(kEventPlaneAngle, HistTable)), col.eventPlaneAngle());
340+
mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kQvector, HistTable)), col.qvec());
341+
mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kEventPlaneAngle, HistTable)), col.eventPlaneAngle());
333342
}
334343
}
335344
}
336345

337346
template <typename T>
338347
void fillQa(T const& col)
339348
{
340-
mHistogramRegistry->fill(HIST(QaDir) + HIST(getHistName(kPosX, HistTable)), col.posX());
341-
mHistogramRegistry->fill(HIST(QaDir) + HIST(getHistName(kPosY, HistTable)), col.posY());
342-
mHistogramRegistry->fill(HIST(QaDir) + HIST(getHistName(kPos, HistTable)), std::hypot(col.posX(), col.posY(), col.posZ()));
343-
mHistogramRegistry->fill(HIST(QaDir) + HIST(getHistName(kSphericity, HistTable)), col.sphericity());
344-
mHistogramRegistry->fill(HIST(QaDir) + HIST(getHistName(kOccupancy, HistTable)), col.trackOccupancyInTimeRange());
349+
mHistogramRegistry->fill(HIST(prefix) + HIST(QaDir) + HIST(getHistName(kPosX, HistTable)), col.posX());
350+
mHistogramRegistry->fill(HIST(prefix) + HIST(QaDir) + HIST(getHistName(kPosY, HistTable)), col.posY());
351+
mHistogramRegistry->fill(HIST(prefix) + HIST(QaDir) + HIST(getHistName(kPos, HistTable)), std::hypot(col.posX(), col.posY(), col.posZ()));
352+
mHistogramRegistry->fill(HIST(prefix) + HIST(QaDir) + HIST(getHistName(kSphericity, HistTable)), col.sphericity());
353+
mHistogramRegistry->fill(HIST(prefix) + HIST(QaDir) + HIST(getHistName(kOccupancy, HistTable)), col.trackOccupancyInTimeRange());
345354
if (mPlot2d) {
346-
mHistogramRegistry->fill(HIST(QaDir) + HIST(getHistName(kPoszVsMult, HistTable)), col.posZ(), col.mult());
347-
mHistogramRegistry->fill(HIST(QaDir) + HIST(getHistName(kPoszVsCent, HistTable)), col.posZ(), col.cent());
348-
mHistogramRegistry->fill(HIST(QaDir) + HIST(getHistName(kCentVsMult, HistTable)), col.cent(), col.mult());
349-
mHistogramRegistry->fill(HIST(QaDir) + HIST(getHistName(kMultVsSphericity, HistTable)), col.mult(), col.sphericity());
350-
mHistogramRegistry->fill(HIST(QaDir) + HIST(getHistName(kCentVsSphericity, HistTable)), col.cent(), col.sphericity());
351-
mHistogramRegistry->fill(HIST(QaDir) + HIST(getHistName(kFT0AvsFT0C, HistTable)), col.centFT0A(), col.centFT0C());
355+
mHistogramRegistry->fill(HIST(prefix) + HIST(QaDir) + HIST(getHistName(kPoszVsMult, HistTable)), col.posZ(), col.mult());
356+
mHistogramRegistry->fill(HIST(prefix) + HIST(QaDir) + HIST(getHistName(kPoszVsCent, HistTable)), col.posZ(), col.cent());
357+
mHistogramRegistry->fill(HIST(prefix) + HIST(QaDir) + HIST(getHistName(kCentVsMult, HistTable)), col.cent(), col.mult());
358+
mHistogramRegistry->fill(HIST(prefix) + HIST(QaDir) + HIST(getHistName(kMultVsSphericity, HistTable)), col.mult(), col.sphericity());
359+
mHistogramRegistry->fill(HIST(prefix) + HIST(QaDir) + HIST(getHistName(kCentVsSphericity, HistTable)), col.cent(), col.sphericity());
360+
mHistogramRegistry->fill(HIST(prefix) + HIST(QaDir) + HIST(getHistName(kFT0AvsFT0C, HistTable)), col.centFT0A(), col.centFT0C());
352361
}
353362
}
354363

@@ -360,18 +369,18 @@ class CollisionHistManager
360369
return;
361370
}
362371
auto mcCol = col.template fMcCol_as<T2>();
363-
mHistogramRegistry->fill(HIST(McDir) + HIST(getHistName(kTruePosZVsPosZ, HistTable)), mcCol.posZ(), col.posZ());
364-
mHistogramRegistry->fill(HIST(McDir) + HIST(getHistName(kTrueCentVsCent, HistTable)), mcCol.cent(), col.cent());
365-
mHistogramRegistry->fill(HIST(McDir) + HIST(getHistName(kTrueMultVsMult, HistTable)), mcCol.mult(), col.mult());
372+
mHistogramRegistry->fill(HIST(prefix) + HIST(McDir) + HIST(getHistName(kTruePosZVsPosZ, HistTable)), mcCol.posZ(), col.posZ());
373+
mHistogramRegistry->fill(HIST(prefix) + HIST(McDir) + HIST(getHistName(kTrueCentVsCent, HistTable)), mcCol.cent(), col.cent());
374+
mHistogramRegistry->fill(HIST(prefix) + HIST(McDir) + HIST(getHistName(kTrueMultVsMult, HistTable)), mcCol.mult(), col.mult());
366375
}
367376

368377
// pure mc-truth collision: 'col' here IS the truth collision, no reco object exists
369378
template <typename T>
370379
void fillMc(T const& col)
371380
{
372-
mHistogramRegistry->fill(HIST(McDir) + HIST(getHistName(kTruePosZ, HistTable)), col.posZ());
373-
mHistogramRegistry->fill(HIST(McDir) + HIST(getHistName(kTrueCent, HistTable)), col.cent());
374-
mHistogramRegistry->fill(HIST(McDir) + HIST(getHistName(kTrueMult, HistTable)), col.mult());
381+
mHistogramRegistry->fill(HIST(prefix) + HIST(McDir) + HIST(getHistName(kTruePosZ, HistTable)), col.posZ());
382+
mHistogramRegistry->fill(HIST(prefix) + HIST(McDir) + HIST(getHistName(kTrueCent, HistTable)), col.cent());
383+
mHistogramRegistry->fill(HIST(prefix) + HIST(McDir) + HIST(getHistName(kTrueMult, HistTable)), col.mult());
375384
}
376385

377386
o2::framework::HistogramRegistry* mHistogramRegistry = nullptr;

0 commit comments

Comments
 (0)