Skip to content

Commit 1d490bf

Browse files
cnkosteralibuild
andauthored
[PWGCF] Change new to unique_ptr + add shift to final common registry (#16718)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent c6c2693 commit 1d490bf

2 files changed

Lines changed: 25 additions & 24 deletions

File tree

PWGCF/Flow/TableProducer/zdcQVectors.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,7 @@ struct ZdcQVectors {
11381138
double qYcShift = std::hypot(qRec[2], qRec[3]) * std::sin(psiZDCCshift);
11391139

11401140
if (isSelected && cfgFillHistRegistry && !cfgFillNothing) {
1141-
fillCommonRegistry<kAfter>(qRec[0], qRec[1], qRec[2], qRec[3], v, centrality, rsTimestamp);
1141+
fillCommonRegistry<kAfter>(qXaShift, qYaShift, qXcShift, qYcShift, v, centrality, rsTimestamp);
11421142
registry.fill(HIST("QA/centrality_after"), centrality);
11431143
registry.get<TProfile>(HIST("QA/after/ZNA_Qx"))->Fill(Form("%d", runnumber), qXaShift);
11441144
registry.get<TProfile>(HIST("QA/after/ZNA_Qy"))->Fill(Form("%d", runnumber), qYaShift);

PWGCF/Flow/Tasks/flowSP.cxx

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
#include <cstdint>
5959
#include <cstdlib>
6060
#include <map>
61+
#include <memory>
6162
#include <string>
6263
#include <string_view>
6364
#include <unordered_map>
@@ -258,19 +259,19 @@ struct FlowSP {
258259
double meanPxC = 0;
259260
} spm;
260261

261-
struct ptMaps {
262-
TProfile* meanPTMap = new TProfile("meanPTMap", "meanPTMap", 8, -0.8, 0.8);
263-
TProfile* meanPTMapPos = new TProfile("meanPTMapPos", "meanPTMapPos", 8, -0.8, 0.8);
264-
TProfile* meanPTMapNeg = new TProfile("meanPTMapNeg", "meanPTMapNeg", 8, -0.8, 0.8);
262+
struct PtMaps {
263+
std::unique_ptr<TProfile> meanPTMap = std::make_unique<TProfile>("meanPTMap", "meanPTMap", 8, -0.8, 0.8);
264+
std::unique_ptr<TProfile> meanPTMapPos = std::make_unique<TProfile>("meanPTMapPos", "meanPTMapPos", 8, -0.8, 0.8);
265+
std::unique_ptr<TProfile> meanPTMapNeg = std::make_unique<TProfile>("meanPTMapNeg", "meanPTMapNeg", 8, -0.8, 0.8);
265266

266-
TProfile* relPxA = new TProfile("relPxA", "relPxA", 8, -0.8, 0.8);
267-
TProfile* relPxC = new TProfile("relPxC", "relPxC", 8, -0.8, 0.8);
267+
std::unique_ptr<TProfile> relPxA = std::make_unique<TProfile>("relPxA", "relPxA", 8, -0.8, 0.8);
268+
std::unique_ptr<TProfile> relPxC = std::make_unique<TProfile>("relPxC", "relPxC", 8, -0.8, 0.8);
268269

269-
TProfile* relPxANeg = new TProfile("relPxANeg", "relPxANeg", 8, -0.8, 0.8);
270-
TProfile* relPxAPos = new TProfile("relPxAPos", "relPxAPos", 8, -0.8, 0.8);
270+
std::unique_ptr<TProfile> relPxANeg = std::make_unique<TProfile>("relPxANeg", "relPxANeg", 8, -0.8, 0.8);
271+
std::unique_ptr<TProfile> relPxAPos = std::make_unique<TProfile>("relPxAPos", "relPxAPos", 8, -0.8, 0.8);
271272

272-
TProfile* relPxCNeg = new TProfile("relPxCNeg", "relPxCNeg", 8, -0.8, 0.8);
273-
TProfile* relPxCPos = new TProfile("relPxCPos", "relPxCPos", 8, -0.8, 0.8);
273+
std::unique_ptr<TProfile> relPxCNeg = std::make_unique<TProfile>("relPxCNeg", "relPxCNeg", 8, -0.8, 0.8);
274+
std::unique_ptr<TProfile> relPxCPos = std::make_unique<TProfile>("relPxCPos", "relPxCPos", 8, -0.8, 0.8);
274275
} ptmaps;
275276

276277
OutputObj<GFWWeights> fWeights{GFWWeights("weights")};
@@ -281,13 +282,13 @@ struct FlowSP {
281282
HistogramRegistry histos{"QAhistos", {}, OutputObjHandlingPolicy::AnalysisObject, false, true};
282283

283284
// Event selection cuts
284-
TF1* fPhiCutLow = nullptr;
285-
TF1* fPhiCutHigh = nullptr;
286-
TF1* fMultPVCutLow = nullptr;
287-
TF1* fMultPVCutHigh = nullptr;
288-
TF1* fMultCutLow = nullptr;
289-
TF1* fMultCutHigh = nullptr;
290-
TF1* fMultMultPVCut = nullptr;
285+
std::unique_ptr<TF1> fPhiCutLow = nullptr;
286+
std::unique_ptr<TF1> fPhiCutHigh = nullptr;
287+
std::unique_ptr<TF1> fMultPVCutLow = nullptr;
288+
std::unique_ptr<TF1> fMultPVCutHigh = nullptr;
289+
std::unique_ptr<TF1> fMultCutLow = nullptr;
290+
std::unique_ptr<TF1> fMultCutHigh = nullptr;
291+
std::unique_ptr<TF1> fMultMultPVCut = nullptr;
291292

292293
enum SelectionCriteria {
293294
evSel_FilteredEvent,
@@ -694,10 +695,10 @@ struct FlowSP {
694695
}
695696

696697
if (cfg.cEvSelsUseAdditionalEventCut) {
697-
fMultPVCutLow = new TF1("fMultPVCutLow", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x", 0, 100);
698-
fMultPVCutHigh = new TF1("fMultPVCutHigh", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x", 0, 100);
699-
fMultCutLow = new TF1("fMultCutLow", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x", 0, 100);
700-
fMultCutHigh = new TF1("fMultCutHigh", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x", 0, 100);
698+
fMultPVCutLow = std::make_unique<TF1>("fMultPVCutLow", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x", 0, 100);
699+
fMultPVCutHigh = std::make_unique<TF1>("fMultPVCutHigh", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x", 0, 100);
700+
fMultCutLow = std::make_unique<TF1>("fMultCutLow", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x", 0, 100);
701+
fMultCutHigh = std::make_unique<TF1>("fMultCutHigh", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x", 0, 100);
701702

702703
std::vector<double> paramsMultPVCut;
703704
std::vector<double> paramsMultCut;
@@ -756,8 +757,8 @@ struct FlowSP {
756757
}
757758

758759
if (cfg.cTrackSelsUseAdditionalTrackCut) {
759-
fPhiCutLow = new TF1("fPhiCutLow", "0.06/x+pi/18.0-0.06", 0, 100);
760-
fPhiCutHigh = new TF1("fPhiCutHigh", "0.1/x+pi/18.0+0.06", 0, 100);
760+
fPhiCutLow = std::make_unique<TF1>("fPhiCutLow", "0.06/x+pi/18.0-0.06", 0, 100);
761+
fPhiCutHigh = std::make_unique<TF1>("fPhiCutHigh", "0.1/x+pi/18.0+0.06", 0, 100);
761762
}
762763
} // end of init
763764

0 commit comments

Comments
 (0)