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
18 changes: 14 additions & 4 deletions PWGCF/GenericFramework/Core/FlowContainer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

#include "FlowContainer.h"

#include <cstdio>
#include <vector>

ClassImp(FlowContainer);

FlowContainer::FlowContainer() : TNamed("", ""),
Expand Down Expand Up @@ -51,15 +54,15 @@
if (nMultiBins <= 0)
nMultiBins = multiBins.size() - 1;
if (nMultiBins <= 0) {
printf("Multiplicity axis does not exist");

Check failure on line 57 in PWGCF/GenericFramework/Core/FlowContainer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
return;
}
if (!inputList) {
printf("Input list not specified\n");

Check failure on line 61 in PWGCF/GenericFramework/Core/FlowContainer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
return;
}
if (inputList->GetEntries() < 1) {
printf("Input list empty!\n");

Check failure on line 65 in PWGCF/GenericFramework/Core/FlowContainer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
return;
}
fProf = new TProfile2D(Form("%s_CorrProfile", this->GetName()), "CorrProfile", nMultiBins, &multiBins[0], inputList->GetEntries(), 0.5, inputList->GetEntries() + 0.5);
Expand All @@ -79,11 +82,11 @@
void FlowContainer::Initialize(TObjArray* inputList, int nMultiBins, double MultiMin, double MultiMax, int nRandom)
{
if (!inputList) {
printf("Input list not specified\n");

Check failure on line 85 in PWGCF/GenericFramework/Core/FlowContainer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
return;
}
if (inputList->GetEntries() < 1) {
printf("Input list empty!\n");

Check failure on line 89 in PWGCF/GenericFramework/Core/FlowContainer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
return;
}
fProf = new TProfile2D(Form("%s_CorrProfile", this->GetName()), "CorrProfile", nMultiBins, MultiMin, MultiMax, inputList->GetEntries(), 0.5, inputList->GetEntries() + 0.5);
Expand Down Expand Up @@ -116,7 +119,7 @@
fXAxis = dynamic_cast<TAxis*>(inax->Clone("pTAxis"));
bool success = CreateBinsFromAxis(fXAxis);
if (!success)
printf("Something went wrong setting the x axis!\n");

Check failure on line 122 in PWGCF/GenericFramework/Core/FlowContainer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
}
void FlowContainer::SetXAxis()
{
Expand All @@ -139,7 +142,7 @@
return -1;
int yin = fProf->GetYaxis()->FindBin(hname);
if (!yin) {
printf("Could not find bin %s\n", hname);

Check failure on line 145 in PWGCF/GenericFramework/Core/FlowContainer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
return -1;
}
fProf->Fill(multi, yin, corr, w);
Expand All @@ -154,11 +157,11 @@
int nBinsX = fProf->GetNbinsX();
int nBinsY = fProf->GetNbinsY();
if ((inpf->GetNbinsX() != nBinsX) || (inpf->GetNbinsY() != nBinsY)) {
printf("Number of bins in two profiles do not match, not doing anything\n");

Check failure on line 160 in PWGCF/GenericFramework/Core/FlowContainer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
return;
}
if (!inpf->GetBinSumw2()->fArray) {
printf("Input profile has no BinSumw2()! Returning\n");

Check failure on line 164 in PWGCF/GenericFramework/Core/FlowContainer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
return;
}
if (!fProf->GetBinSumw2()->fArray)
Expand All @@ -170,7 +173,7 @@
double* farrProf = fProf->fArray;
for (int ix = 1; ix <= nBinsX; ix++) {
double xval = fProf->GetXaxis()->GetBinCenter(ix);
printf("Processing x-bin %i\n", ix);

Check failure on line 176 in PWGCF/GenericFramework/Core/FlowContainer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
for (int iy = 1; iy <= nBinsY; iy++) {
double yval = fProf->GetYaxis()->GetBinCenter(iy);
int binno = fProf->FindBin(xval, yval);
Expand Down Expand Up @@ -462,9 +465,11 @@
TProfile* tpf = GetCorrXXVsPt(order, lminmulti, lmaxmulti);
TH1D* rethist = ProfToHist(tpf);
TProfile* refflow = GetRefFlowProfile(order, lminmulti, lmaxmulti);
refflow->RebinX(refflow->GetNbinsX());
rethist->SetBinContent(0, refflow->GetBinContent(1));
rethist->SetBinError(0, refflow->GetBinError(1));
if (refflow) {
refflow->RebinX(refflow->GetNbinsX());
rethist->SetBinContent(0, refflow->GetBinContent(1));
rethist->SetBinError(0, refflow->GetBinError(1));
}
delete refflow;
delete tpf;
return rethist;
Expand Down Expand Up @@ -916,7 +921,12 @@
delete tempprof;
}
delete rhSubset;
retpf->RebinX(nBins);
if (!retpf) {
LOGF(error, "Reference flow profile is null");
return nullptr;
} else {
retpf->RebinX(nBins);
}
return retpf;
};

Expand Down
Loading