diff --git a/PWGUD/Tasks/flowCumulantsUpc.cxx b/PWGUD/Tasks/flowCumulantsUpc.cxx index 19f29620a21..01bf6d76a7c 100644 --- a/PWGUD/Tasks/flowCumulantsUpc.cxx +++ b/PWGUD/Tasks/flowCumulantsUpc.cxx @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -159,6 +160,7 @@ struct FlowCumulantsUpc { TRandom3* fRndmMc = new TRandom3(0); int lastRunNumber = -1; std::vector runNumbers; + std::map neventsIdBins; std::map> th3sPerRun; // map of TH3 histograms for all runs using UdTracks = soa::Join; @@ -320,6 +322,26 @@ struct FlowCumulantsUpc { } } } + + // One Y bin for every FlowContainer IDName already stored in oba. + const int nIdNames = oba->GetEntries(); + + const AxisSpec axisIdName{nIdNames, 0.5, static_cast(nIdNames) + 0.5, "ID name"}; + + registry.add("hNeventsVsNch", "Selected events;N_{ch};ID name", {HistType::kTH2D, {axisIndependent, axisIdName}}); + + auto hNeventsVsNch = registry.get(HIST("hNeventsVsNch")); + + for (int i = 0; i < nIdNames; ++i) { + auto* observable = dynamic_cast(oba->At(i)); + if (!observable) { + continue; + } + const std::string idName = observable->GetName(); + const int yBin = i + 1; + neventsIdBins[idName] = yBin; + hNeventsVsNch->GetYaxis()->SetBinLabel(yBin, idName.c_str()); + } fFC->SetName("FlowContainer"); fFC->SetXAxis(fPtAxis); fFC->Initialize(oba, axisIndependent, cfgNbootstrap); @@ -520,6 +542,16 @@ struct FlowCumulantsUpc { fGFW->CreateRegions(); } + void fillNeventsVsNch(const std::string& idName, double independent) + { + const auto it = neventsIdBins.find(idName); + if (it == neventsIdBins.end()) { + return; + } + + registry.fill(HIST("hNeventsVsNch"), independent, static_cast(it->second)); + } + void createOutputObjectsForRun(int runNumber) { const AxisSpec axisPhi{60, 0.0, constants::math::TwoPI, "#varphi"}; @@ -538,6 +570,7 @@ struct FlowCumulantsUpc { val = fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx; if (std::fabs(val) < 1) { fFC->FillProfile(corrconf.Head.c_str(), cent, val, dnx, rndm); + fillNeventsVsNch(corrconf.Head, cent); } return; }