Skip to content
Merged
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
33 changes: 33 additions & 0 deletions PWGUD/Tasks/flowCumulantsUpc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <Math/GenVector/PxPyPzE4D.h>
#include <TF1.h>
#include <TH1.h>
#include <TH2.h>
#include <TH3.h>
#include <TNamed.h>
#include <TObjArray.h>
Expand Down Expand Up @@ -159,6 +160,7 @@ struct FlowCumulantsUpc {
TRandom3* fRndmMc = new TRandom3(0);
int lastRunNumber = -1;
std::vector<int> runNumbers;
std::map<std::string, int> neventsIdBins;
std::map<int, std::shared_ptr<TH3>> th3sPerRun; // map of TH3 histograms for all runs

using UdTracks = soa::Join<aod::UDTracks, aod::UDTracksExtra, aod::UDTracksPID>;
Expand Down Expand Up @@ -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<double>(nIdNames) + 0.5, "ID name"};

registry.add("hNeventsVsNch", "Selected events;N_{ch};ID name", {HistType::kTH2D, {axisIndependent, axisIdName}});

auto hNeventsVsNch = registry.get<TH2>(HIST("hNeventsVsNch"));

for (int i = 0; i < nIdNames; ++i) {
auto* observable = dynamic_cast<TNamed*>(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);
Expand Down Expand Up @@ -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<double>(it->second));
}

void createOutputObjectsForRun(int runNumber)
{
const AxisSpec axisPhi{60, 0.0, constants::math::TwoPI, "#varphi"};
Expand All @@ -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;
}
Expand Down
Loading