Skip to content

Commit 8adbe32

Browse files
committed
o2 linter
1 parent df7fa22 commit 8adbe32

1 file changed

Lines changed: 31 additions & 27 deletions

File tree

PWGCF/JCorran/Tasks/jEPFlowAnalysis.cxx

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
// In applying this license CERN does not waive the privileges and immunities
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
11+
1112
/// \author Maxim Virta (maxim.virta@cern.ch)
13+
/// \brief flow measurement with q-vectors
14+
/// \file jEPFlowAnalysis.cxx
1215
/// \since Jul 2024
1316

1417
#include "FlowJHistManager.h"
@@ -39,7 +42,7 @@ using MyTracks = aod::Tracks;
3942

4043
struct jEPFlowAnalysis {
4144

42-
HistogramRegistry EPFlowHistograms{"EPFlow", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
45+
HistogramRegistry epFlowHistograms{"EPFlow", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
4346
EventPlaneHelper helperEP;
4447
FlowJHistManager histManager;
4548
bool debug = kFALSE;
@@ -82,7 +85,7 @@ struct jEPFlowAnalysis {
8285
std::string fullCCDBShiftCorrPath;
8386

8487
template <typename T>
85-
int GetdetId(const T& name)
88+
int getdetId(const T& name)
8689
{
8790
if (name.value == "FT0C") {
8891
return 0;
@@ -105,9 +108,9 @@ struct jEPFlowAnalysis {
105108

106109
void init(InitContext const&)
107110
{
108-
detId = GetdetId(cfgDetName);
109-
refAId = GetdetId(cfgRefAName);
110-
refBId = GetdetId(cfgRefBName);
111+
detId = getdetId(cfgDetName);
112+
refAId = getdetId(cfgRefAName);
113+
refBId = getdetId(cfgRefBName);
111114

112115
AxisSpec axisMod{cfgnMode, 2., cfgnMode + 2.};
113116
AxisSpec axisEvtPl{360, -constants::math::PI * 1.1, constants::math::PI * 1.1};
@@ -116,16 +119,16 @@ struct jEPFlowAnalysis {
116119
AxisSpec axisPt{cfgAxisPt, "pT"};
117120
AxisSpec axisCos{cfgAxisCos, "cos"};
118121

119-
EPFlowHistograms.add("EpDet", "", {HistType::kTH3F, {axisMod, axisCent, axisEvtPl}});
120-
EPFlowHistograms.add("EpRefA", "", {HistType::kTH3F, {axisMod, axisCent, axisEvtPl}});
121-
EPFlowHistograms.add("EpRefB", "", {HistType::kTH3F, {axisMod, axisCent, axisEvtPl}});
122+
epFlowHistograms.add("EpDet", "", {HistType::kTH3F, {axisMod, axisCent, axisEvtPl}});
123+
epFlowHistograms.add("EpRefA", "", {HistType::kTH3F, {axisMod, axisCent, axisEvtPl}});
124+
epFlowHistograms.add("EpRefB", "", {HistType::kTH3F, {axisMod, axisCent, axisEvtPl}});
122125

123-
EPFlowHistograms.add("EpResDetRefA", "", {HistType::kTH3F, {axisMod, axisCent, axisEvtPl}});
124-
EPFlowHistograms.add("EpResDetRefB", "", {HistType::kTH3F, {axisMod, axisCent, axisEvtPl}});
125-
EPFlowHistograms.add("EpResRefARefB", "", {HistType::kTH3F, {axisMod, axisCent, axisEvtPl}});
126+
epFlowHistograms.add("EpResDetRefA", "", {HistType::kTH3F, {axisMod, axisCent, axisEvtPl}});
127+
epFlowHistograms.add("EpResDetRefB", "", {HistType::kTH3F, {axisMod, axisCent, axisEvtPl}});
128+
epFlowHistograms.add("EpResRefARefB", "", {HistType::kTH3F, {axisMod, axisCent, axisEvtPl}});
126129

127-
EPFlowHistograms.add("vncos", "", {HistType::kTHnSparseF, {axisMod, axisCent, axisPt, axisCos}});
128-
EPFlowHistograms.add("vnsin", "", {HistType::kTHnSparseF, {axisMod, axisCent, axisPt, axisCos}});
130+
epFlowHistograms.add("vncos", "", {HistType::kTHnSparseF, {axisMod, axisCent, axisPt, axisCos}});
131+
epFlowHistograms.add("vnsin", "", {HistType::kTHnSparseF, {axisMod, axisCent, axisPt, axisCos}});
129132
}
130133

131134
void process(MyCollisions::iterator const& coll, soa::Filtered<MyTracks> const& tracks, aod::BCsWithTimestamps const&)
@@ -134,18 +137,18 @@ struct jEPFlowAnalysis {
134137
return;
135138

136139
float cent = coll.cent();
137-
EPFlowHistograms.fill(HIST("FullCentrality"), cent);
140+
epFlowHistograms.fill(HIST("FullCentrality"), cent);
138141
float eps[3] = {0.};
139142

140143
if (cfgShiftCorr) {
141144
auto bc = coll.bc_as<aod::BCsWithTimestamps>();
142145
currentRunNumber = bc.runNumber();
143146
if (currentRunNumber != lastRunNumber) {
144147
shiftprofile.clear();
145-
for (int i = 2; i < 5; i++) {
148+
for (int i = 0; i < cfgnMode; i++) {
146149
fullCCDBShiftCorrPath = cfgShiftPath;
147150
fullCCDBShiftCorrPath += "/v";
148-
fullCCDBShiftCorrPath += std::to_string(i);
151+
fullCCDBShiftCorrPath += std::to_string(i + 2);
149152
auto objshift = ccdb->getForTimeStamp<TProfile3D>(fullCCDBShiftCorrPath, bc.timestamp());
150153
shiftprofile.push_back(objshift);
151154
}
@@ -166,7 +169,8 @@ struct jEPFlowAnalysis {
166169
float weight = 1.0;
167170

168171
if (cfgShiftCorr) {
169-
for (int ishift = 1; ishift <= 10; ishift++) {
172+
constexpr int kShiftBins = 10;
173+
for (int ishift = 1; ishift <= kShiftBins; ishift++) {
170174
auto coeffshiftxDet = shiftprofile.at(i)->GetBinContent(shiftprofile.at(i)->FindBin(cent, 0.5, ishift - 0.5));
171175
auto coeffshiftyDet = shiftprofile.at(i)->GetBinContent(shiftprofile.at(i)->FindBin(cent, 1.5, ishift - 0.5));
172176
auto coeffshiftxRefA = shiftprofile.at(i)->GetBinContent(shiftprofile.at(i)->FindBin(cent, 2.5, ishift - 0.5));
@@ -191,21 +195,21 @@ struct jEPFlowAnalysis {
191195
float resNumB = helperEP.GetResolution(eps[0], eps[2], i + 2);
192196
float resDenom = helperEP.GetResolution(eps[1], eps[2], i + 2);
193197

194-
EPFlowHistograms.fill(HIST("EpDet"), i + 2, cent, eps[0]);
195-
EPFlowHistograms.fill(HIST("EpRefA"), i + 2, cent, eps[1]);
196-
EPFlowHistograms.fill(HIST("EpRefB"), i + 2, cent, eps[2]);
198+
epFlowHistograms.fill(HIST("EpDet"), i + 2, cent, eps[0]);
199+
epFlowHistograms.fill(HIST("EpRefA"), i + 2, cent, eps[1]);
200+
epFlowHistograms.fill(HIST("EpRefB"), i + 2, cent, eps[2]);
197201

198-
EPFlowHistograms.fill(HIST("EpResDetRefA"), i + 2, cent, resNumA);
199-
EPFlowHistograms.fill(HIST("EpResDetRefB"), i + 2, cent, resNumB);
200-
EPFlowHistograms.fill(HIST("EpResRefARefB"), i + 2, cent, resDenom);
202+
epFlowHistograms.fill(HIST("EpResDetRefA"), i + 2, cent, resNumA);
203+
epFlowHistograms.fill(HIST("EpResDetRefB"), i + 2, cent, resNumB);
204+
epFlowHistograms.fill(HIST("EpResRefARefB"), i + 2, cent, resDenom);
201205

202206
for (int j = 0; j < cfgnMode; j++) { // loop over detectors used
203-
for (auto& track : tracks) {
207+
for (const auto& track : tracks) {
204208
float vn = std::cos((i + 2) * (track.phi() - eps[j]));
205-
float vn_sin = std::sin((i + 2) * (track.phi() - eps[j]));
209+
float vnSin = std::sin((i + 2) * (track.phi() - eps[j]));
206210

207-
EPFlowHistograms.fill(HIST("vncos"), i + 2, cent, track.pt(), vn * weight);
208-
EPFlowHistograms.fill(HIST("vnsin"), i + 2, cent, track.pt(), vn_sin * weight);
211+
epFlowHistograms.fill(HIST("vncos"), i + 2, cent, track.pt(), vn * weight);
212+
epFlowHistograms.fill(HIST("vnsin"), i + 2, cent, track.pt(), vnSin * weight);
209213
}
210214
}
211215
}

0 commit comments

Comments
 (0)