@@ -244,22 +244,22 @@ struct FlowGfwV02 {
244244 std::array<float , 6 > tofNsigmaCut;
245245 std::array<float , 6 > itsNsigmaCut;
246246 std::array<float , 6 > tpcNsigmaCut;
247- TH1D* hPtMid[ 4 ] = { nullptr , nullptr , nullptr , nullptr };
247+ std::array<std::unique_ptr< TH1D>, 4 > hPtMid{ };
248248 };
249249 PIDState pidStates;
250250
251251 // Event selection cuts - Alex
252- TF1* fMultPVCutLow = nullptr ;
253- TF1* fMultPVCutHigh = nullptr ;
254- TF1* fMultCutLow = nullptr ;
255- TF1* fMultCutHigh = nullptr ;
256- TF1* fMultPVGlobalCutHigh = nullptr ;
257- TF1* fMultGlobalV0ACutLow = nullptr ;
258- TF1* fMultGlobalV0ACutHigh = nullptr ;
259- TF1* fMultGlobalT0ACutLow = nullptr ;
260- TF1* fMultGlobalT0ACutHigh = nullptr ;
261-
262- TF1* fPtDepDCAxy = nullptr ;
252+ std::unique_ptr< TF1> fMultPVCutLow ;
253+ std::unique_ptr< TF1> fMultPVCutHigh ;
254+ std::unique_ptr< TF1> fMultCutLow ;
255+ std::unique_ptr< TF1> fMultCutHigh ;
256+ std::unique_ptr< TF1> fMultPVGlobalCutHigh ;
257+ std::unique_ptr< TF1> fMultGlobalV0ACutLow ;
258+ std::unique_ptr< TF1> fMultGlobalV0ACutHigh ;
259+ std::unique_ptr< TF1> fMultGlobalT0ACutLow ;
260+ std::unique_ptr< TF1> fMultGlobalT0ACutHigh ;
261+
262+ std::unique_ptr< TF1> fPtDepDCAxy ;
263263
264264 using GFWTracks = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::TrackSelection, aod::TracksDCA, aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr, aod::pidTOFbeta, aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr>>;
265265
@@ -361,10 +361,10 @@ struct FlowGfwV02 {
361361 o2::analysis::gfw::multGlobalPVCorrCutPars = cfgMultCorrCuts.cfgMultGlobalPVCutPars ;
362362
363363 // Initialise pt spectra histograms for different particles
364- pidStates.hPtMid [PidCharged] = new TH1D (" hPtMid_charged" , " hPtMid_charged" , o2::analysis::gfw::ptbinning.size () - 1 , &o2::analysis::gfw::ptbinning[0 ]);
365- pidStates.hPtMid [PidPions] = new TH1D (" hPtMid_pions" , " hPtMid_pions" , o2::analysis::gfw::ptbinning.size () - 1 , &o2::analysis::gfw::ptbinning[0 ]);
366- pidStates.hPtMid [PidKaons] = new TH1D (" hPtMid_kaons" , " hPtMid_kaons" , o2::analysis::gfw::ptbinning.size () - 1 , &o2::analysis::gfw::ptbinning[0 ]);
367- pidStates.hPtMid [PidProtons] = new TH1D (" hPtMid_protons" , " hPtMid_protons" , o2::analysis::gfw::ptbinning.size () - 1 , &o2::analysis::gfw::ptbinning[0 ]);
364+ pidStates.hPtMid [PidCharged] = std::make_unique< TH1D> (" hPtMid_charged" , " hPtMid_charged" , o2::analysis::gfw::ptbinning.size () - 1 , &o2::analysis::gfw::ptbinning[0 ]);
365+ pidStates.hPtMid [PidPions] = std::make_unique< TH1D> (" hPtMid_pions" , " hPtMid_pions" , o2::analysis::gfw::ptbinning.size () - 1 , &o2::analysis::gfw::ptbinning[0 ]);
366+ pidStates.hPtMid [PidKaons] = std::make_unique< TH1D> (" hPtMid_kaons" , " hPtMid_kaons" , o2::analysis::gfw::ptbinning.size () - 1 , &o2::analysis::gfw::ptbinning[0 ]);
367+ pidStates.hPtMid [PidProtons] = std::make_unique< TH1D> (" hPtMid_protons" , " hPtMid_protons" , o2::analysis::gfw::ptbinning.size () - 1 , &o2::analysis::gfw::ptbinning[0 ]);
368368 pidStates.hPtMid [PidCharged]->SetDirectory (nullptr );
369369 pidStates.hPtMid [PidPions]->SetDirectory (nullptr );
370370 pidStates.hPtMid [PidKaons]->SetDirectory (nullptr );
@@ -466,6 +466,7 @@ struct FlowGfwV02 {
466466 LOGF (error, " Configuration contains vectors of different size - check the GFWCorrConfig configurable" );
467467 fGFW ->CreateRegions ();
468468 TObjArray* oba = new TObjArray ();
469+ oba->SetOwner (kTRUE );
469470 addConfigObjectsToObjArray (oba, corrconfigs);
470471 LOGF (info, " Number of correlators: %d" , oba->GetEntries ());
471472 fFC ->SetName (" FlowContainer" );
@@ -501,19 +502,19 @@ struct FlowGfwV02 {
501502 }
502503
503504 if (cfgUseAdditionalEventCut) {
504- fMultPVCutLow = new TF1 (" fMultPVCutLow" , cfgMultCorrCuts.cfgMultCorrLowCutFunction ->c_str (), 0 , 100 );
505+ fMultPVCutLow = std::make_unique< TF1> (" fMultPVCutLow" , cfgMultCorrCuts.cfgMultCorrLowCutFunction ->c_str (), 0 , 100 );
505506 fMultPVCutLow ->SetParameters (&(o2::analysis::gfw::multPVCorrCutPars[0 ]));
506- fMultPVCutHigh = new TF1 (" fMultPVCutHigh" , cfgMultCorrCuts.cfgMultCorrHighCutFunction ->c_str (), 0 , 100 );
507+ fMultPVCutHigh = std::make_unique< TF1> (" fMultPVCutHigh" , cfgMultCorrCuts.cfgMultCorrHighCutFunction ->c_str (), 0 , 100 );
507508 fMultPVCutHigh ->SetParameters (&(o2::analysis::gfw::multPVCorrCutPars[0 ]));
508- fMultCutLow = new TF1 (" fMultCutLow" , cfgMultCorrCuts.cfgMultCorrLowCutFunction ->c_str (), 0 , 100 );
509+ fMultCutLow = std::make_unique< TF1> (" fMultCutLow" , cfgMultCorrCuts.cfgMultCorrLowCutFunction ->c_str (), 0 , 100 );
509510 fMultCutLow ->SetParameters (&(o2::analysis::gfw::multGlobalCorrCutPars[0 ]));
510- fMultCutHigh = new TF1 (" fMultCutHigh" , cfgMultCorrCuts.cfgMultCorrHighCutFunction ->c_str (), 0 , 100 );
511+ fMultCutHigh = std::make_unique< TF1> (" fMultCutHigh" , cfgMultCorrCuts.cfgMultCorrHighCutFunction ->c_str (), 0 , 100 );
511512 fMultCutHigh ->SetParameters (&(o2::analysis::gfw::multGlobalCorrCutPars[0 ]));
512- fMultPVGlobalCutHigh = new TF1 (" fMultPVGlobalCutHigh" , cfgMultCorrCuts.cfgMultGlobalPVCorrCutFunction ->c_str (), 0 , nchbinning.back ());
513+ fMultPVGlobalCutHigh = std::make_unique< TF1> (" fMultPVGlobalCutHigh" , cfgMultCorrCuts.cfgMultGlobalPVCorrCutFunction ->c_str (), 0 , nchbinning.back ());
513514 fMultPVGlobalCutHigh ->SetParameters (&(o2::analysis::gfw::multGlobalPVCorrCutPars[0 ]));
514515 }
515516 // Set DCAxy cut
516- fPtDepDCAxy = new TF1 (" ptDepDCAxy" , Form (" [0]*%s" , cfgTrackCuts.cfgDCAxy ->c_str ()), 0.001 , 100 );
517+ fPtDepDCAxy = std::make_unique< TF1> (" ptDepDCAxy" , Form (" [0]*%s" , cfgTrackCuts.cfgDCAxy ->c_str ()), 0.001 , 100 );
517518 fPtDepDCAxy ->SetParameter (0 , cfgTrackCuts.cfgDCAxyNSigma );
518519 }
519520
0 commit comments