Skip to content

Commit 0afe3a2

Browse files
committed
fix for o2 linter
1 parent 9201a6a commit 0afe3a2

1 file changed

Lines changed: 35 additions & 31 deletions

File tree

PWGCF/JCorran/Tasks/jEPFlowAnalysis.cxx

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ using namespace std;
4242
using MyCollisions = soa::Join<aod::Collisions, aod::EvSels, aod::Qvectors>;
4343
using MyTracks = aod::Tracks;
4444

45-
struct jEPFlowAnalysis {
45+
struct JEPFlowAnalysis {
4646

47-
HistogramRegistry EPFlowHistograms{"EPFlow", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
47+
HistogramRegistry epFlowHistograms{"EPFlow", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
4848
JEPFlowAnalysis epAnalysis;
4949
EventPlaneHelper helperEP;
5050
FlowJHistManager histManager;
@@ -74,22 +74,25 @@ struct jEPFlowAnalysis {
7474

7575
Filter trackFilter = (aod::track::pt > cfgTrackCuts.cfgPtMin) && (aod::track::pt < cfgTrackCuts.cfgPtMax) && (nabs(aod::track::eta) < cfgTrackCuts.cfgEtaMax);
7676

77-
int DetId;
78-
int RefAId;
79-
int RefBId;
77+
int detId;
78+
int refAId;
79+
int refBId;
8080
int harmInd;
8181

8282
int currentRunNumber = -999;
8383
int lastRunNumber = -999;
8484

85+
int initflow = 2;
8586
int nshift = 10;
8687
int nsystem = 3;
88+
int nqvec = 4;
89+
int nstep = 3;
8790

8891
std::vector<TProfile3D*> shiftprofile{};
8992
std::string fullCCDBShiftCorrPath;
9093

9194
template <typename T>
92-
int GetDetId(const T& name)
95+
int getDetId(const T& name)
9396
{
9497
if (name.value == "FT0C") {
9598
return 0;
@@ -112,11 +115,11 @@ struct jEPFlowAnalysis {
112115

113116
void init(InitContext const&)
114117
{
115-
DetId = GetDetId(cfgDetName);
116-
RefAId = GetDetId(cfgRefAName);
117-
RefBId = GetDetId(cfgRefBName);
118+
detId = getDetId(cfgDetName);
119+
refAId = getDetId(cfgRefAName);
120+
refBId = getDetId(cfgRefBName);
118121

119-
epAnalysis.SetHistRegistry(&EPFlowHistograms);
122+
epAnalysis.SetHistRegistry(&epFlowHistograms);
120123
epAnalysis.CreateHistograms();
121124
}
122125

@@ -126,15 +129,15 @@ struct jEPFlowAnalysis {
126129
return;
127130

128131
float cent = coll.cent();
129-
EPFlowHistograms.fill(HIST("FullCentrality"), cent);
130-
float EPs[3] = {0.};
132+
epFlowHistograms.fill(HIST("FullCentrality"), cent);
133+
float eps[3] = {0.};
131134

132135
if (cfgShiftCorr) {
133136
auto bc = coll.bc_as<aod::BCsWithTimestamps>();
134137
currentRunNumber = bc.runNumber();
135138
if (currentRunNumber != lastRunNumber) {
136139
shiftprofile.clear();
137-
for (int i = 2; i < 2 + cfgNmode; i++) {
140+
for (int i = initflow; i < initflow + cfgNmode; i++) {
138141
fullCCDBShiftCorrPath = cfgShiftPath;
139142
fullCCDBShiftCorrPath += "/v";
140143
fullCCDBShiftCorrPath += std::to_string(i);
@@ -145,11 +148,11 @@ struct jEPFlowAnalysis {
145148
}
146149
}
147150

148-
for (int i = 2; i < 2 + cfgNmode; i++) { // loop over different harmonic orders
149-
harmInd = cfgnTotalSystem * 4 * (i - 2) + 3; // harmonic index to access corresponding Q-vector as all Q-vectors are in same vector
150-
EPs[0] = helperEP.GetEventPlane(coll.qvecRe()[DetId + harmInd], coll.qvecIm()[DetId + harmInd], i);
151-
EPs[1] = helperEP.GetEventPlane(coll.qvecRe()[RefAId + harmInd], coll.qvecIm()[RefAId + harmInd], i);
152-
EPs[2] = helperEP.GetEventPlane(coll.qvecRe()[RefBId + harmInd], coll.qvecIm()[RefBId + harmInd], i);
151+
for (int i = initflow; i < initflow + cfgNmode; i++) { // loop over different harmonic orders
152+
harmInd = cfgnTotalSystem * nqvec * (i - initflow) + nstep; // harmonic index to access corresponding Q-vector as all Q-vectors are in same vector
153+
eps[0] = helperEP.GetEventPlane(coll.qvecRe()[detId + harmInd], coll.qvecIm()[detId + harmInd], i);
154+
eps[1] = helperEP.GetEventPlane(coll.qvecRe()[refAId + harmInd], coll.qvecIm()[refAId + harmInd], i);
155+
eps[2] = helperEP.GetEventPlane(coll.qvecRe()[refBId + harmInd], coll.qvecIm()[refBId + harmInd], i);
153156

154157
auto deltapsiDet = 0.0;
155158
auto deltapsiRefA = 0.0;
@@ -166,27 +169,28 @@ struct jEPFlowAnalysis {
166169
auto coeffshiftxRefB = shiftprofile.at(i - 2)->GetBinContent(shiftprofile.at(i - 2)->FindBin(cent, 4.5, ishift - 0.5));
167170
auto coeffshiftyRefB = shiftprofile.at(i - 2)->GetBinContent(shiftprofile.at(i - 2)->FindBin(cent, 5.5, ishift - 0.5)); // currently only FT0C/TPCpos/TPCneg
168171

169-
deltapsiDet += ((1 / (1.0 * ishift)) * (-coeffshiftxDet * std::cos(ishift * static_cast<float>(i) * EPs[0]) + coeffshiftyDet * std::sin(ishift * static_cast<float>(i) * EPs[0])));
170-
deltapsiRefA += ((1 / (1.0 * ishift)) * (-coeffshiftxRefA * std::cos(ishift * static_cast<float>(i) * EPs[1]) + coeffshiftyRefA * std::sin(ishift * static_cast<float>(i) * EPs[1])));
171-
deltapsiRefB += ((1 / (1.0 * ishift)) * (-coeffshiftxRefB * std::cos(ishift * static_cast<float>(i) * EPs[2]) + coeffshiftyRefB * std::sin(ishift * static_cast<float>(i) * EPs[2])));
172+
deltapsiDet += ((1 / (1.0 * ishift)) * (-coeffshiftxDet * std::cos(ishift * static_cast<float>(i) * eps[0]) + coeffshiftyDet * std::sin(ishift * static_cast<float>(i) * eps[0])));
173+
deltapsiRefA += ((1 / (1.0 * ishift)) * (-coeffshiftxRefA * std::cos(ishift * static_cast<float>(i) * eps[1]) + coeffshiftyRefA * std::sin(ishift * static_cast<float>(i) * eps[1])));
174+
deltapsiRefB += ((1 / (1.0 * ishift)) * (-coeffshiftxRefB * std::cos(ishift * static_cast<float>(i) * eps[2]) + coeffshiftyRefB * std::sin(ishift * static_cast<float>(i) * eps[2])));
172175
}
173176

174-
EPs[0] += deltapsiDet;
175-
EPs[1] += deltapsiRefA;
176-
EPs[2] += deltapsiRefB;
177+
eps[0] += deltapsiDet;
178+
eps[1] += deltapsiRefA;
179+
eps[2] += deltapsiRefB;
177180
}
178181

179182
if (cfgSPmethod)
180-
weight *= std::sqrt(std::pow(coll.qvecRe()[DetId + harmInd], 2) + std::pow(coll.qvecIm()[DetId + harmInd], 2));
183+
weight *= std::sqrt(std::pow(coll.qvecRe()[detId + harmInd], 2) + std::pow(coll.qvecIm()[detId + harmInd], 2));
181184

182-
float resNumA = helperEP.GetResolution(EPs[0], EPs[1], i);
183-
float resNumB = helperEP.GetResolution(EPs[0], EPs[2], i);
184-
float resDenom = helperEP.GetResolution(EPs[1], EPs[2], i);
185+
float resNumA = helperEP.GetResolution(eps[0], eps[1], i);
186+
float resNumB = helperEP.GetResolution(eps[0], eps[2], i);
187+
float resDenom = helperEP.GetResolution(eps[1], eps[2], i);
185188
epAnalysis.FillResolutionHistograms(cent, static_cast<float>(i), resNumA, resNumB, resDenom);
189+
186190
for (uint j = 0; j < nsystem; j++) { // loop over detectors used
187191
for (const auto& track : tracks) {
188-
float vn = std::cos((i) * (track.phi() - EPs[j]));
189-
float vn_sin = std::sin((i) * (track.phi() - EPs[j]));
192+
float vn = std::cos((i) * (track.phi() - eps[j]));
193+
float vn_sin = std::sin((i) * (track.phi() - eps[j]));
190194
epAnalysis.FillVnHistograms(i, cent, static_cast<float>(j + 1), track.pt(), vn * weight, vn_sin * weight);
191195
}
192196
}
@@ -197,5 +201,5 @@ struct jEPFlowAnalysis {
197201
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
198202
{
199203
return WorkflowSpec{
200-
adaptAnalysisTask<jEPFlowAnalysis>(cfgc)};
204+
adaptAnalysisTask<JEPFlowAnalysis>(cfgc)};
201205
}

0 commit comments

Comments
 (0)