diff --git a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx index b921074a4f8..35931370294 100644 --- a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx @@ -244,22 +244,22 @@ struct FlowGfwV02 { std::array tofNsigmaCut; std::array itsNsigmaCut; std::array tpcNsigmaCut; - TH1D* hPtMid[4] = {nullptr, nullptr, nullptr, nullptr}; + std::array, 4> hPtMid{}; }; PIDState pidStates; // Event selection cuts - Alex - TF1* fMultPVCutLow = nullptr; - TF1* fMultPVCutHigh = nullptr; - TF1* fMultCutLow = nullptr; - TF1* fMultCutHigh = nullptr; - TF1* fMultPVGlobalCutHigh = nullptr; - TF1* fMultGlobalV0ACutLow = nullptr; - TF1* fMultGlobalV0ACutHigh = nullptr; - TF1* fMultGlobalT0ACutLow = nullptr; - TF1* fMultGlobalT0ACutHigh = nullptr; - - TF1* fPtDepDCAxy = nullptr; + std::unique_ptr fMultPVCutLow; + std::unique_ptr fMultPVCutHigh; + std::unique_ptr fMultCutLow; + std::unique_ptr fMultCutHigh; + std::unique_ptr fMultPVGlobalCutHigh; + std::unique_ptr fMultGlobalV0ACutLow; + std::unique_ptr fMultGlobalV0ACutHigh; + std::unique_ptr fMultGlobalT0ACutLow; + std::unique_ptr fMultGlobalT0ACutHigh; + + std::unique_ptr fPtDepDCAxy; using GFWTracks = soa::Filtered>; @@ -361,10 +361,10 @@ struct FlowGfwV02 { o2::analysis::gfw::multGlobalPVCorrCutPars = cfgMultCorrCuts.cfgMultGlobalPVCutPars; // Initialise pt spectra histograms for different particles - pidStates.hPtMid[PidCharged] = new TH1D("hPtMid_charged", "hPtMid_charged", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); - pidStates.hPtMid[PidPions] = new TH1D("hPtMid_pions", "hPtMid_pions", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); - pidStates.hPtMid[PidKaons] = new TH1D("hPtMid_kaons", "hPtMid_kaons", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); - pidStates.hPtMid[PidProtons] = new TH1D("hPtMid_protons", "hPtMid_protons", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); + pidStates.hPtMid[PidCharged] = std::make_unique("hPtMid_charged", "hPtMid_charged", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); + pidStates.hPtMid[PidPions] = std::make_unique("hPtMid_pions", "hPtMid_pions", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); + pidStates.hPtMid[PidKaons] = std::make_unique("hPtMid_kaons", "hPtMid_kaons", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); + pidStates.hPtMid[PidProtons] = std::make_unique("hPtMid_protons", "hPtMid_protons", o2::analysis::gfw::ptbinning.size() - 1, &o2::analysis::gfw::ptbinning[0]); pidStates.hPtMid[PidCharged]->SetDirectory(nullptr); pidStates.hPtMid[PidPions]->SetDirectory(nullptr); pidStates.hPtMid[PidKaons]->SetDirectory(nullptr); @@ -466,6 +466,7 @@ struct FlowGfwV02 { LOGF(error, "Configuration contains vectors of different size - check the GFWCorrConfig configurable"); fGFW->CreateRegions(); TObjArray* oba = new TObjArray(); + oba->SetOwner(kTRUE); addConfigObjectsToObjArray(oba, corrconfigs); LOGF(info, "Number of correlators: %d", oba->GetEntries()); fFC->SetName("FlowContainer"); @@ -501,19 +502,19 @@ struct FlowGfwV02 { } if (cfgUseAdditionalEventCut) { - fMultPVCutLow = new TF1("fMultPVCutLow", cfgMultCorrCuts.cfgMultCorrLowCutFunction->c_str(), 0, 100); + fMultPVCutLow = std::make_unique("fMultPVCutLow", cfgMultCorrCuts.cfgMultCorrLowCutFunction->c_str(), 0, 100); fMultPVCutLow->SetParameters(&(o2::analysis::gfw::multPVCorrCutPars[0])); - fMultPVCutHigh = new TF1("fMultPVCutHigh", cfgMultCorrCuts.cfgMultCorrHighCutFunction->c_str(), 0, 100); + fMultPVCutHigh = std::make_unique("fMultPVCutHigh", cfgMultCorrCuts.cfgMultCorrHighCutFunction->c_str(), 0, 100); fMultPVCutHigh->SetParameters(&(o2::analysis::gfw::multPVCorrCutPars[0])); - fMultCutLow = new TF1("fMultCutLow", cfgMultCorrCuts.cfgMultCorrLowCutFunction->c_str(), 0, 100); + fMultCutLow = std::make_unique("fMultCutLow", cfgMultCorrCuts.cfgMultCorrLowCutFunction->c_str(), 0, 100); fMultCutLow->SetParameters(&(o2::analysis::gfw::multGlobalCorrCutPars[0])); - fMultCutHigh = new TF1("fMultCutHigh", cfgMultCorrCuts.cfgMultCorrHighCutFunction->c_str(), 0, 100); + fMultCutHigh = std::make_unique("fMultCutHigh", cfgMultCorrCuts.cfgMultCorrHighCutFunction->c_str(), 0, 100); fMultCutHigh->SetParameters(&(o2::analysis::gfw::multGlobalCorrCutPars[0])); - fMultPVGlobalCutHigh = new TF1("fMultPVGlobalCutHigh", cfgMultCorrCuts.cfgMultGlobalPVCorrCutFunction->c_str(), 0, nchbinning.back()); + fMultPVGlobalCutHigh = std::make_unique("fMultPVGlobalCutHigh", cfgMultCorrCuts.cfgMultGlobalPVCorrCutFunction->c_str(), 0, nchbinning.back()); fMultPVGlobalCutHigh->SetParameters(&(o2::analysis::gfw::multGlobalPVCorrCutPars[0])); } // Set DCAxy cut - fPtDepDCAxy = new TF1("ptDepDCAxy", Form("[0]*%s", cfgTrackCuts.cfgDCAxy->c_str()), 0.001, 100); + fPtDepDCAxy = std::make_unique("ptDepDCAxy", Form("[0]*%s", cfgTrackCuts.cfgDCAxy->c_str()), 0.001, 100); fPtDepDCAxy->SetParameter(0, cfgTrackCuts.cfgDCAxyNSigma); }