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
43 changes: 23 additions & 20 deletions PWGCF/GenericFramework/Core/FlowContainer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,10 @@ TProfile* FlowContainer::GetCorrXXVsMulti(const char* order, int l_pti)
}
delete rethist;
}
if (!retSubset) {
LOGF(error, "Correlation profile is null");
return nullptr;
}
if (fMultiRebin > 0) {
TString temp_name(retSubset->GetName());
TProfile* tempprof = dynamic_cast<TProfile*>(retSubset->Clone("tempProfile"));
Expand Down Expand Up @@ -525,9 +529,9 @@ TH1D* FlowContainer::GetCN2VsX(int n, bool onPt, double arg1, double arg2)
corrN2 = GetHistCorrXXVsMulti(Form("%i2", n), static_cast<int>(arg1));
corrN2->SetName(Form("Corr_%s", corrN2->GetName()));
TH1D* rethist = GetCN2(corrN2);
TString* nam = new TString(corrN2->GetName());
const TString nam(corrN2->GetName());
delete corrN2;
rethist->SetName(nam->Data());
rethist->SetName(nam.Data());
if (onPt) {
int bins = fProf->GetXaxis()->FindBin(arg1);
int bins2 = fProf->GetXaxis()->FindBin(arg2);
Expand All @@ -543,10 +547,10 @@ TH1D* FlowContainer::GetCN2VsX(int n, bool onPt, double arg1, double arg2)
TH1D* FlowContainer::GetVN2VsX(int n, bool onPt, double arg1, double arg2)
{
TH1D* corrh = GetCN2VsX(n, onPt, arg1, arg2);
TString* nam = new TString(corrh->GetName());
const TString nam(corrh->GetName());
TH1D* rethist = GetVN2(corrh);
delete corrh;
rethist->SetName(nam->Data());
rethist->SetName(nam.Data());
if (onPt) {
int bins = fProf->GetXaxis()->FindBin(arg1);
int bins2 = fProf->GetXaxis()->FindBin(arg2);
Expand All @@ -556,7 +560,6 @@ TH1D* FlowContainer::GetVN2VsX(int n, bool onPt, double arg1, double arg2)
} else {
rethist->SetTitle(Form(";#it{N}_{tr};v_{%i}{2}", n));
}
delete nam;
return rethist;
}

Expand Down Expand Up @@ -706,10 +709,10 @@ TH1D* FlowContainer::GetCN4VsX(int n, bool onPt, double arg1, double arg2)
corrN4->SetName(Form("Corr_%s", corrN4->GetName()));
}
TH1D* rethist = GetCN4(corrN4, corrN2);
TString* nam = new TString(corrN4->GetName());
const TString nam(corrN4->GetName());
delete corrN2;
delete corrN4;
rethist->SetName(nam->Data());
rethist->SetName(nam.Data());
if (onPt) {
int bins = fProf->GetXaxis()->FindBin(arg1);
int bins2 = fProf->GetXaxis()->FindBin(arg2);
Expand Down Expand Up @@ -780,9 +783,9 @@ TH1D* FlowContainer::GetVN4VsX(int n, bool onPt, double arg1, double arg2)
{
TH1D* temph = GetCN4VsX(n, onPt, arg1, arg2);
TH1D* rethist = GetVN4(temph);
TString* nam = new TString(temph->GetName());
const TString nam(temph->GetName());
delete temph;
rethist->SetName(nam->Data());
rethist->SetName(nam.Data());
if (onPt) {
int bins = fProf->GetXaxis()->FindBin(arg1);
int bins2 = fProf->GetXaxis()->FindBin(arg2);
Expand Down Expand Up @@ -812,9 +815,9 @@ TH1D* FlowContainer::GetCN6VsX(int n, bool onPt, double arg1, double arg2)
TH1D* rethist = GetCN6(corrN6, corrN4, corrN2);
delete corrN2;
delete corrN4;
TString* nam = new TString(corrN6->GetName());
const TString nam(corrN6->GetName());
delete corrN6;
rethist->SetName(nam->Data());
rethist->SetName(nam.Data());
if (onPt) {
int bins = fProf->GetXaxis()->FindBin(arg1);
int bins2 = fProf->GetXaxis()->FindBin(arg2);
Expand All @@ -830,9 +833,9 @@ TH1D* FlowContainer::GetVN6VsX(int n, bool onPt, double arg1, double arg2)
{
TH1D* temph = GetCN6VsX(n, onPt, arg1, arg2);
TH1D* rethist = GetVN6(temph);
TString* nam = new TString(temph->GetName());
const TString nam(temph->GetName());
delete temph;
rethist->SetName(nam->Data());
rethist->SetName(nam.Data());
if (onPt) {
int bins = fProf->GetXaxis()->FindBin(arg1);
int bins2 = fProf->GetXaxis()->FindBin(arg2);
Expand Down Expand Up @@ -866,9 +869,9 @@ TH1D* FlowContainer::GetCN8VsX(int n, bool onPt, double arg1, double arg2)
delete corrN2;
delete corrN4;
delete corrN6;
TString* nam = new TString(corrN8->GetName());
const TString nam(corrN8->GetName());
delete corrN8;
rethist->SetName(nam->Data());
rethist->SetName(nam.Data());
if (onPt) {
int bins = fProf->GetXaxis()->FindBin(arg1);
int bins2 = fProf->GetXaxis()->FindBin(arg2);
Expand All @@ -884,9 +887,9 @@ TH1D* FlowContainer::GetVN8VsX(int n, bool onPt, double arg1, double arg2)
{
TH1D* temph = GetCN8VsX(n, onPt, arg1, arg2);
TH1D* rethist = GetVN8(temph);
TString* nam = new TString(temph->GetName());
const TString nam(temph->GetName());
delete temph;
rethist->SetName(nam->Data());
rethist->SetName(nam.Data());
if (onPt) {
int bins = fProf->GetXaxis()->FindBin(arg1);
int bins2 = fProf->GetXaxis()->FindBin(arg2);
Expand Down Expand Up @@ -928,7 +931,7 @@ TProfile* FlowContainer::GetRefFlowProfile(const char* order, double m1, double
if (nStopBin < nStartBin)
nStopBin = fProf->GetXaxis()->GetNbins();
int nBins = nStopBin - nStartBin + 1;
double* l_bins = new double[nBins + 1];
std::vector<double> l_bins(nBins + 1);
for (int i = 0; i <= nBins; i++)
l_bins[i] = i;
TProfile* retpf = 0;
Expand All @@ -939,7 +942,7 @@ TProfile* FlowContainer::GetRefFlowProfile(const char* order, double m1, double
while (fIDName.Tokenize(l_name, l_pos)) {
l_name.Append(order);
int ybin = fProf->GetYaxis()->FindBin(l_name.Data());
TProfile* tempprof = rhSubset->GetSubset(kTRUE, "tempprof", ybin, ybin, nBins, l_bins);
TProfile* tempprof = rhSubset->GetSubset(kTRUE, "tempprof", ybin, ybin, nBins, l_bins.data());
if (!retpf)
retpf = dynamic_cast<TProfile*>(tempprof->Clone("RefFlowProf"));
else
Expand Down Expand Up @@ -1237,5 +1240,5 @@ double* FlowContainer::GetMultiRebin(int& nbins)
double* retBins = new double[fMultiRebin + 1];
for (int i = 0; i <= nbins; i++)
retBins[i] = fMultiRebinEdges[i];
return fMultiRebinEdges;
return retBins;
}
Loading
Loading