Skip to content

Commit 78cba9a

Browse files
committed
linter fixes
1 parent 84fa585 commit 78cba9a

3 files changed

Lines changed: 26 additions & 23 deletions

File tree

PWGCF/GenericFramework/Core/FlowPtContainer.cxx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,12 @@ FlowPtContainer::FlowPtContainer(const char* name, const char* title) : TNamed(n
132132
arr(),
133133
warr(),
134134
subevents() {}
135-
void FlowPtContainer::initialise(const o2::framework::AxisSpec axis, const int& m, const GFWCorrConfigs& configs, const int& nsub)
135+
void FlowPtContainer::initialise(const o2::framework::AxisSpec axis, const int& maxOrder, const GFWCorrConfigs& configs, const int& nsub)
136136
{
137137
arr.resize(3 * 3 * 3 * 3);
138138
warr.resize(3 * 3 * 3 * 3);
139139
if (!mpar)
140-
mpar = m;
140+
mpar = maxOrder;
141141
std::vector<double> multiBins = axis.binEdges;
142142
int nMultiBins = axis.nBins.value_or(0);
143143
if (nMultiBins <= 0)
@@ -230,12 +230,12 @@ void FlowPtContainer::initialise(const o2::framework::AxisSpec axis, const int&
230230
LOGF(info, "Container %s initialized with m = %i\n and %i subsamples", this->GetName(), mpar, nsub);
231231
return;
232232
};
233-
void FlowPtContainer::initialise(int nbinsx, double* xbins, const int& m, const GFWCorrConfigs& configs, const int& nsub)
233+
void FlowPtContainer::initialise(int nbinsx, double* xbins, const int& maxOrder, const GFWCorrConfigs& configs, const int& nsub)
234234
{
235235
arr.resize(3 * 3 * 5 * 5);
236236
warr.resize(3 * 3 * 5 * 5);
237237
if (!mpar)
238-
mpar = m;
238+
mpar = maxOrder;
239239
if (fCMTermList)
240240
delete fCMTermList;
241241
fCMTermList = new TList();
@@ -318,12 +318,12 @@ void FlowPtContainer::initialise(int nbinsx, double* xbins, const int& m, const
318318
}
319319
LOGF(info, "Container %s initialized with m = %i\n", this->GetName(), mpar);
320320
};
321-
void FlowPtContainer::initialise(int nbinsx, double xlow, double xhigh, const int& m, const GFWCorrConfigs& configs, const int& nsub)
321+
void FlowPtContainer::initialise(int nbinsx, double xlow, double xhigh, const int& maxOrder, const GFWCorrConfigs& configs, const int& nsub)
322322
{
323323
arr.resize(3 * 3 * 5 * 5);
324324
warr.resize(3 * 3 * 5 * 5);
325325
if (!mpar)
326-
mpar = m;
326+
mpar = maxOrder;
327327
if (fCMTermList)
328328
delete fCMTermList;
329329
fCMTermList = new TList();
@@ -406,15 +406,15 @@ void FlowPtContainer::initialise(int nbinsx, double xlow, double xhigh, const in
406406
}
407407
LOGF(info, "Container %s initialized with m = %i\n", this->GetName(), mpar);
408408
};
409-
void FlowPtContainer::initialiseSubevent(const o2::framework::AxisSpec axis, const int& m, const int& nsubev, const int& nsub)
409+
void FlowPtContainer::initialiseSubevent(const o2::framework::AxisSpec axis, const int& maxOrder, const int& nsubev, const int& nsub)
410410
{
411411
if (nsubev < 1) {
412412
LOGF(fatal, "Need at least one subevent");
413413
return;
414414
}
415415
nSubevents = nsubev;
416416
if (!mpar)
417-
mpar = m;
417+
mpar = maxOrder;
418418
std::vector<double> multiBins = axis.binEdges;
419419
int nMultiBins = axis.nBins.value_or(0);
420420
if (nMultiBins <= 0)
@@ -431,7 +431,7 @@ void FlowPtContainer::initialiseSubevent(const o2::framework::AxisSpec axis, con
431431

432432
// Get all possible subevent combinations given m particles and nsubev subevents - also considering not using all m particles, e.g. all lower orders
433433
std::vector<int> current;
434-
getSubevents(m, nsubev + 1, current, subevents);
434+
getSubevents(mpar, nsubev + 1, current, subevents);
435435
// remove unused "extra" subevent
436436
for (auto& subevent : subevents) // o2-linter: disable=const-ref-in-for-loop (modified through pop_back())
437437
subevent.pop_back();
@@ -486,15 +486,15 @@ void FlowPtContainer::initialiseSubevent(const o2::framework::AxisSpec axis, con
486486
}
487487
LOGF(info, "Container %s initialized Subevents and %i subsamples", this->GetName(), nsub);
488488
}
489-
void FlowPtContainer::initialiseSubevent(int nbinsx, double* xbins, const int& m, const int& nsubev, const int& nsub)
489+
void FlowPtContainer::initialiseSubevent(int nbinsx, double* xbins, const int& maxOrder, const int& nsubev, const int& nsub)
490490
{
491491
if (nsubev < 1) {
492492
LOGF(fatal, "Need at least one subevent");
493493
return;
494494
}
495495
nSubevents = nsubev;
496496
if (!mpar)
497-
mpar = m;
497+
mpar = maxOrder;
498498

499499
if (fSubList)
500500
delete fSubList;
@@ -503,7 +503,7 @@ void FlowPtContainer::initialiseSubevent(int nbinsx, double* xbins, const int& m
503503

504504
// Get all possible subevent combinations given m particles and nsubev subevents - also considering not using all m particles, e.g. all lower orders
505505
std::vector<int> current;
506-
getSubevents(m, nsubev + 1, current, subevents);
506+
getSubevents(mpar, nsubev + 1, current, subevents);
507507
// remove unused "extra" subevent
508508
for (auto& subevent : subevents) // o2-linter: disable=const-ref-in-for-loop (modified through pop_back())
509509
subevent.pop_back();
@@ -558,15 +558,15 @@ void FlowPtContainer::initialiseSubevent(int nbinsx, double* xbins, const int& m
558558
}
559559
LOGF(info, "Container %s initialized Subevents and %i subsamples", this->GetName(), nsub);
560560
}
561-
void FlowPtContainer::initialiseSubevent(int nbinsx, double xlow, double xhigh, const int& m, const int& nsubev, const int& nsub)
561+
void FlowPtContainer::initialiseSubevent(int nbinsx, double xlow, double xhigh, const int& maxOrder, const int& nsubev, const int& nsub)
562562
{
563563
if (nsubev < 1) {
564564
LOGF(fatal, "Need at least one subevent");
565565
return;
566566
}
567567
nSubevents = nsubev;
568568
if (!mpar)
569-
mpar = m;
569+
mpar = maxOrder;
570570
if (fSubList)
571571
delete fSubList;
572572
fSubList = new TList();
@@ -1929,19 +1929,19 @@ TH1* FlowPtContainer::raiseHistToPower(TH1* inh, double p)
19291929
}
19301930
return reth;
19311931
}
1932-
void FlowPtContainer::getSubevents(int k, int n, std::vector<int>& current, std::vector<std::vector<int>>& subevents)
1932+
void FlowPtContainer::getSubevents(int k, int n, std::vector<int>& current, std::vector<std::vector<int>>& outputSubevents)
19331933
{
19341934
if (n == 1) {
19351935
// Last box gets all remaining objects
19361936
current.push_back(k);
1937-
subevents.push_back(current);
1937+
outputSubevents.push_back(current);
19381938
current.pop_back();
19391939
return;
19401940
}
19411941

19421942
for (int i = 0; i <= k; ++i) {
19431943
current.push_back(i);
1944-
getSubevents(k - i, n - 1, current, subevents);
1944+
getSubevents(k - i, n - 1, current, outputSubevents);
19451945
current.pop_back();
19461946
}
19471947
}

PWGCF/GenericFramework/Core/FlowPtContainer.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ class FlowPtContainer : public TNamed
4949
explicit FlowPtContainer(const char* name);
5050
~FlowPtContainer();
5151
FlowPtContainer(const char* name, const char* title);
52-
void initialise(const o2::framework::AxisSpec axis, const int& m, const o2::analysis::genericframework::GFWCorrConfigs& configs, const int& nsub = 10);
53-
void initialise(int nbinsx, double* xbins, const int& m, const o2::analysis::genericframework::GFWCorrConfigs& configs, const int& nsub = 10);
54-
void initialise(int nbinsx, double xlow, double xhigh, const int& m, const o2::analysis::genericframework::GFWCorrConfigs& configs, const int& nsub = 10);
52+
void initialise(const o2::framework::AxisSpec axis, const int& maxOrder, const o2::analysis::genericframework::GFWCorrConfigs& configs, const int& nsub = 10);
53+
void initialise(int nbinsx, double* xbins, const int& maxOrder, const o2::analysis::genericframework::GFWCorrConfigs& configs, const int& nsub = 10);
54+
void initialise(int nbinsx, double xlow, double xhigh, const int& maxOrder, const o2::analysis::genericframework::GFWCorrConfigs& configs, const int& nsub = 10);
5555
// initial pt-pt correlations with two subevents
56-
void initialiseSubevent(const o2::framework::AxisSpec axis, const int& m, const int& nsubev = 2, const int& nsub = 10);
57-
void initialiseSubevent(int nbinsx, double* xbins, const int& m, const int& nsubev = 2, const int& nsub = 10);
58-
void initialiseSubevent(int nbinsx, double xlow, double xhigh, const int& m, const int& nsubev = 2, const int& nsub = 10);
56+
void initialiseSubevent(const o2::framework::AxisSpec axis, const int& maxOrder, const int& nsubev = 2, const int& nsub = 10);
57+
void initialiseSubevent(int nbinsx, double* xbins, const int& maxOrder, const int& nsubev = 2, const int& nsub = 10);
58+
void initialiseSubevent(int nbinsx, double xlow, double xhigh, const int& maxOrder, const int& nsubev = 2, const int& nsub = 10);
5959
void fill(const double& w, const double& pt);
6060
void fillSub(const double& w, const double& pt, int subIndex);
6161
void fillSub1(const double& w, const double& pt) { fillSub(w, pt, 0); }

PWGCF/GenericFramework/Core/GFWConfig.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ int CheckSameSize(const std::vector<T>& first, const std::vector<Args>&... rest)
5353
class GFWBinningCuts
5454
{
5555
public:
56+
// cppcheck-suppress noExplicitConstructor
5657
GFWBinningCuts(int vtxzbins_ = 40, int etabins_ = 16, int phibins_ = 72, int nchbins_ = 300, float nchmin_ = 0, float nchmax_ = 3000,
5758
float ptpoimin_ = 0.2, float ptpoimax_ = 10., float ptrefmin_ = 0.2, float ptrefmax_ = 3.,
5859
std::vector<double> ptbinning_ = {0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55,
@@ -144,6 +145,7 @@ class GFWBinningCuts
144145
class GFWRegions
145146
{
146147
public:
148+
// cppcheck-suppress noExplicitConstructor
147149
GFWRegions(std::vector<std::string> names_ = {"refN", "refP", "refFull"}, std::vector<float> etaminvals_ = {-0.8, 0.4, -0.8},
148150
std::vector<float> etamaxvals_ = {-0.4, 0.8, 0.8},
149151
std::vector<int> pTDifs_ = {0, 0, 0},
@@ -189,6 +191,7 @@ class GFWRegions
189191
class GFWCorrConfigs
190192
{
191193
public:
194+
// cppcheck-suppress noExplicitConstructor
192195
GFWCorrConfigs(std::vector<std::string> corrs_ = {"refP {2} refN {-2}", "refP {3} refN {-3}", "refP {4} refN {-4}", "refFull {2 -2}",
193196
"refFull {2 2 -2 -2}"},
194197
std::vector<std::string> heads_ = {"ChGap22", "ChGap32", "ChGap42", "ChFull22", "ChFull24"},

0 commit comments

Comments
 (0)