Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 48 additions & 16 deletions PWGCF/Femto/Core/collisionHistManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ enum ColHist {
kCentVsMult,
kCentVsSphericity,
kMultVsSphericity,
// particle number correlation
kNpart1VsNpart2,
kNpart1VsNpart2VsNpart3,
// mc
kTrueCentVsCent,
kTrueMultVsMult,
Expand Down Expand Up @@ -79,16 +82,21 @@ constexpr std::array<histmanager::HistInfo<ColHist>, kColHistLast> HistTable = {
{kCentVsMult, o2::framework::kTH2F, "hCentVsMult", "Centrality vs Multiplicity; Centrality (%); Multiplicity"},
{kMultVsSphericity, o2::framework::kTH2F, "hMultVsSphericity", "Multiplicity vs Sphericity; Multiplicity; Sphericity"},
{kCentVsSphericity, o2::framework::kTH2F, "hCentVsSphericity", "Centrality vs Sphericity; Centrality (%); Sphericity"},
// particle number correlation
{kNpart1VsNpart2, o2::framework::kTH2F, "hNpart1VsNpart2", "# particle 1 vs # particle 2; # particle 1; # particle 2"},
{kNpart1VsNpart2VsNpart3, o2::framework::kTHnSparseF, "hNpart1VsNpart2VsNpart3", "# particle 1 vs # particle 2 vs particle 3; # particle 1; # particle 2; # particle 3"},
// mc
{kTrueCentVsCent, o2::framework::kTH2F, "hTrueCentVsCent", "True centrality vs centrality; Centrality_{True} (%); Centrality (%)"},
{kTrueMultVsMult, o2::framework::kTH2F, "hTrueMultVsMult", "True multiplicity vs multiplicity; Multiplicity_{True}; Multiplicity"},
}};

#define COL_HIST_ANALYSIS_MAP(conf) \
{kPosZ, {conf.vtxZ}}, \
{kMult, {conf.mult}}, \
{kCent, {conf.cent}}, \
{kMagField, {conf.magField}},
#define COL_HIST_ANALYSIS_MAP(conf) \
{kPosZ, {conf.vtxZ}}, \
{kMult, {conf.mult}}, \
{kCent, {conf.cent}}, \
{kMagField, {conf.magField}}, \
{kNpart1VsNpart2, {conf.particleCorrelation, conf.particleCorrelation}}, \
{kNpart1VsNpart2VsNpart3, {conf.particleCorrelation, conf.particleCorrelation, conf.particleCorrelation}},

#define COL_HIST_QA_MAP(confAnalysis, confQa) \
{kPosX, {confQa.vtxXY}}, \
Expand Down Expand Up @@ -148,6 +156,9 @@ struct ConfCollisionBinning : o2::framework::ConfigurableGroup {
o2::framework::ConfigurableAxis mult{"mult", {200, 0, 200}, "Multiplicity binning"};
o2::framework::ConfigurableAxis cent{"cent", {100, 0.0f, 100.0f}, "Centrality (multiplicity percentile) binning"};
o2::framework::ConfigurableAxis magField{"magField", {11, -5.5, 5.5}, "Magnetic field binning"};
o2::framework::Configurable<bool> plotParticlePairCorrelation{"plotParticlePairCorrelation", false, "Plot particle number correlation for pairs"};
o2::framework::Configurable<bool> plotParticleTripletCorrelation{"plotParticleTripletCorrelation", false, "Plot particle number correlation for triplets"};
o2::framework::ConfigurableAxis particleCorrelation{"particleCorrelation", {6, -0.5f, 5.5f}, "Binning for particle number correlation of pairs/triplets"};
};

struct ConfCollisionQaBinning : o2::framework::ConfigurableGroup {
Expand All @@ -165,10 +176,14 @@ class CollisionHistManager
CollisionHistManager() = default;
~CollisionHistManager() = default;

template <modes::Mode mode>
void init(o2::framework::HistogramRegistry* registry, std::map<ColHist, std::vector<o2::framework::AxisSpec>> const& Specs)
template <modes::Mode mode, typename T>
void init(o2::framework::HistogramRegistry* registry,
std::map<ColHist, std::vector<o2::framework::AxisSpec>> const& Specs,
T const& ConfCollisionBinning)
{
mHistogramRegistry = registry;
mPlotPairCorrelation = ConfCollisionBinning.plotParticlePairCorrelation.value;
mPlotTripletCorrelation = ConfCollisionBinning.plotParticleTripletCorrelation.value;
if constexpr (isFlagSet(mode, modes::Mode::kAnalysis)) {
initAnalysis(Specs);
}
Expand All @@ -186,29 +201,32 @@ class CollisionHistManager
mPlot2d = ConfBinningQa.plot2d.value;
}

template <modes::Mode mode, typename T>
void init(o2::framework::HistogramRegistry* registry, std::map<ColHist, std::vector<o2::framework::AxisSpec>> const& Specs, T const& ConfBinningQa)
template <modes::Mode mode, typename T1, typename T2>
void init(o2::framework::HistogramRegistry* registry,
std::map<ColHist, std::vector<o2::framework::AxisSpec>> const& Specs,
T1 const& ConfCollisionBinning,
T2 const& ConfBinningQa)
{
enableOptionalHistograms(ConfBinningQa);
this->template init<mode>(registry, Specs);
init<mode>(registry, Specs, ConfCollisionBinning);
}

template <modes::Mode mode, typename T>
void fill(T const& col)
void fill(T const& col, int64_t nSlice1, int64_t nSlice2, int64_t nSlice3)
{
if constexpr (isFlagSet(mode, modes::Mode::kAnalysis)) {
fillAnalysis(col);
fillAnalysis(col, nSlice1, nSlice2, nSlice3);
}
if constexpr (isFlagSet(mode, modes::Mode::kQa)) {
fillQa(col);
}
}

template <modes::Mode mode, typename T1, typename T2>
void fill(T1 const& col, T2 const& mcCols)
void fill(T1 const& col, T2 const& mcCols, int64_t nSlice1, int64_t nSlice2, int64_t nSlice3)
{
if constexpr (isFlagSet(mode, modes::Mode::kAnalysis)) {
fillAnalysis(col);
fillAnalysis(col, nSlice1, nSlice2, nSlice3);
}
if constexpr (isFlagSet(mode, modes::Mode::kQa)) {
fillQa(col);
Expand All @@ -226,6 +244,12 @@ class CollisionHistManager
mHistogramRegistry->add(analysisDir + getHistNameV2(kMult, HistTable), getHistDesc(kMult, HistTable), getHistType(kMult, HistTable), {Specs.at(kMult)});
mHistogramRegistry->add(analysisDir + getHistNameV2(kCent, HistTable), getHistDesc(kCent, HistTable), getHistType(kCent, HistTable), {Specs.at(kCent)});
mHistogramRegistry->add(analysisDir + getHistNameV2(kMagField, HistTable), getHistDesc(kMagField, HistTable), getHistType(kMagField, HistTable), {Specs.at(kMagField)});
if (mPlotPairCorrelation) {
mHistogramRegistry->add(analysisDir + getHistNameV2(kNpart1VsNpart2, HistTable), getHistDesc(kNpart1VsNpart2, HistTable), getHistType(kNpart1VsNpart2, HistTable), {Specs.at(kNpart1VsNpart2)});
}
if (mPlotTripletCorrelation) {
mHistogramRegistry->add(analysisDir + getHistNameV2(kNpart1VsNpart2VsNpart3, HistTable), getHistDesc(kNpart1VsNpart2VsNpart3, HistTable), getHistType(kNpart1VsNpart2VsNpart3, HistTable), {Specs.at(kNpart1VsNpart2VsNpart3)});
}
}

void initQa(std::map<ColHist, std::vector<o2::framework::AxisSpec>> const& Specs)
Expand Down Expand Up @@ -253,12 +277,18 @@ class CollisionHistManager
}

template <typename T>
void fillAnalysis(T const& col)
void fillAnalysis(T const& col, size_t nSlice1, size_t nSlice2, size_t nSlice3)
{
mHistogramRegistry->fill(HIST(AnalysisDir) + HIST(getHistName(kPosZ, HistTable)), col.posZ());
mHistogramRegistry->fill(HIST(AnalysisDir) + HIST(getHistName(kMult, HistTable)), col.mult());
mHistogramRegistry->fill(HIST(AnalysisDir) + HIST(getHistName(kCent, HistTable)), col.cent());
mHistogramRegistry->fill(HIST(AnalysisDir) + HIST(getHistName(kMagField, HistTable)), col.magField());
if (mPlotPairCorrelation) {
mHistogramRegistry->fill(HIST(AnalysisDir) + HIST(getHistName(kNpart1VsNpart2, HistTable)), nSlice1, nSlice2);
}
if (mPlotTripletCorrelation) {
mHistogramRegistry->fill(HIST(AnalysisDir) + HIST(getHistName(kNpart1VsNpart2VsNpart3, HistTable)), nSlice1, nSlice2, nSlice3);
}
}

template <typename T>
Expand Down Expand Up @@ -290,7 +320,9 @@ class CollisionHistManager
}

o2::framework::HistogramRegistry* mHistogramRegistry = nullptr;
bool mPlot2d = true;
bool mPlot2d = false;
bool mPlotPairCorrelation = false;
bool mPlotTripletCorrelation = false;
}; // namespace femtounitedcolhistmanager
}; // namespace colhistmanager
}; // namespace o2::analysis::femto
Expand Down
Loading
Loading