Skip to content
Open
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
39 changes: 39 additions & 0 deletions PWGCF/GenericFramework/Core/FlowPtContainer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,45 @@ void FlowPtContainer::fillPtProfiles(const double& centmult, const double& rn)
}
return;
}
bool FlowPtContainer::addPtProfile(const char* name, int observableOrder)
{
if (!fCorrList || !name || !name[0] || observableOrder < 1 || observableOrder > mpar) {
LOGF(error, "Cannot add pT profile %s for order %d", name ? name : "(null)", observableOrder);
return false;
}
const std::string profileName{name};
if (fCorrList->FindObject(profileName.c_str())) {
LOGF(error, "pT profile %s already exists", profileName.c_str());
return false;
}
auto* original = dynamic_cast<BootstrapProfile*>(fCorrList->At(observableOrder - 1));
const auto* axis = original->GetXaxis();
BootstrapProfile* profile = nullptr;
if (axis->GetXbins()->GetSize()) {
profile = new BootstrapProfile(profileName.c_str(), profileName.c_str(), axis->GetNbins(), axis->GetXbins()->GetArray());
} else {
profile = new BootstrapProfile(profileName.c_str(), profileName.c_str(), axis->GetNbins(), axis->GetXmin(), axis->GetXmax());
}
if (original->fListOfEntries) {
profile->InitializeSubsamples(original->fListOfEntries->GetEntries());
}
fCorrList->Add(profile);
return true;
}
bool FlowPtContainer::fillPtProfile(const char* name, int observableOrder, double mult, double eventWeight, double rn)
{
if (!fCorrList || !name || observableOrder < 1 || observableOrder > mpar ||
static_cast<size_t>(observableOrder) >= corrDen.size() || corrDen[observableOrder] == 0. || eventWeight == 0.) {
return false;
}
auto* profile = dynamic_cast<BootstrapProfile*>(fCorrList->FindObject(name));
if (!profile) {
LOGF(error, "pT profile %s has not been booked", name);
return false;
}
profile->FillProfile(mult, corrNum[observableOrder] / corrDen[observableOrder], eventWeight, rn);
return true;
}
void FlowPtContainer::fillSubeventPtProfiles(const double& centmult, const double& rn)
{
int histCounter = 0;
Expand Down
4 changes: 4 additions & 0 deletions PWGCF/GenericFramework/Core/FlowPtContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ class FlowPtContainer : public TNamed
void calculateSubeventCorrelations();
void calculateCMTerms();
void fillPtProfiles(const double& lMult, const double& rn);
// Book and fill a separate pT observable with a weight calculated by the task.
// The task can supply a separate event weight for the same observable.
bool addPtProfile(const char* name, int observableOrder);
bool fillPtProfile(const char* name, int observableOrder, double mult, double eventWeight, double rn);
void fillSubeventPtProfiles(const double& lMult, const double& rn);
void fillVnPtCorrProfiles(const double& lMult, const double& flowval, const double& flowtuples, const double& rn, uint8_t mask);
void fillVnDeltaPtProfiles(const double& centmult, const double& flowval, const double& flowtuples, const double& rn, uint8_t mask);
Expand Down
Loading
Loading