Skip to content

Commit da17d49

Browse files
committed
Please consider the following formatting changes
1 parent 760c078 commit da17d49

File tree

1 file changed

+55
-56
lines changed

1 file changed

+55
-56
lines changed

PWGCF/Flow/TableProducer/zdcQVectors.cxx

Lines changed: 55 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ struct ZdcQVectors {
129129
O2_DEFINE_CONFIGURABLE(cfgEnergyCal, std::string, "Users/c/ckoster/ZDC/LHC23_zzh_pass4/Energy", "ccdb path for energy calibration histos")
130130
O2_DEFINE_CONFIGURABLE(cfgMeanv, std::string, "Users/c/ckoster/ZDC/LHC23_zzh_pass4/vmean", "ccdb path for mean v histos")
131131
O2_DEFINE_CONFIGURABLE(cfgMinEntriesSparseBin, int, 100, "Minimal number of entries allowed in 4D recentering histogram to use for recentering.")
132-
O2_DEFINE_CONFIGURABLE(cfgRec, std::string, "Users/c/ckoster/ZDC/LHC23_PbPb_pass4/", "ccdb path for recentering histos");
132+
O2_DEFINE_CONFIGURABLE(cfgRec, std::string, "Users/c/ckoster/ZDC/LHC23_PbPb_pass4/", "ccdb path for recentering histos");
133133
O2_DEFINE_CONFIGURABLE(cfgFillCommonRegistry, bool, true, "Fill common registry with histograms");
134134

135135
// Additional event selections
@@ -148,7 +148,6 @@ struct ZdcQVectors {
148148
using UsedCollisions = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs, aod::CentFT0CVariant1s, aod::CentFT0Ms, aod::CentFV0As, aod::CentNGlobals>;
149149
using BCsRun3 = soa::Join<aod::BCs, aod::Timestamps, aod::BcSels, aod::Run3MatchedToBCSparse>;
150150

151-
152151
enum SelectionCriteria {
153152
evSel_Zvtx,
154153
evSel_sel8,
@@ -163,7 +162,7 @@ struct ZdcQVectors {
163162
nEventSelections
164163
};
165164

166-
enum CalibModes {
165+
enum CalibModes {
167166
kEnergyCal,
168167
kMeanv,
169168
kRec
@@ -177,7 +176,7 @@ struct ZdcQVectors {
177176
// keep track of calibration histos for each given step and iteration
178177
struct Calib {
179178
std::vector<TList*> calibList = std::vector<TList*>(3, nullptr); // [0] Enerfy cal, [1] vmean, [2] recentering
180-
std::vector<bool> calibfilesLoaded = std::vector<bool>(3, false);
179+
std::vector<bool> calibfilesLoaded = std::vector<bool>(3, false);
181180
int atStep = 0;
182181
int atIteration = 0;
183182
} cal;
@@ -199,7 +198,7 @@ struct ZdcQVectors {
199198
std::vector<const char*> sides = {"A", "C"};
200199
std::vector<const char*> capCOORDS = {"X", "Y"};
201200

202-
if(cfgFillCommonRegistry){
201+
if (cfgFillCommonRegistry) {
203202
registry.add<TH2>(Form("QA/before/hSPplaneA"), "hSPplaneA", kTH2D, {{100, -4, 4}, axisCent10});
204203
registry.add<TH2>(Form("QA/before/hSPplaneC"), "hSPplaneC", kTH2D, {{100, -4, 4}, axisCent10});
205204
registry.add<TH2>(Form("QA/before/hSPplaneFull"), "hSPplaneFull", kTH2D, {{100, -4, 4}, axisCent10});
@@ -234,26 +233,26 @@ struct ZdcQVectors {
234233
} // end of capCOORDS
235234
} // end of sides
236235

237-
registry.add<TH1>("QA/centrality_before", "centrality_before", kTH1D, {{200, 0, 100}});
238-
registry.add<TH1>("QA/centrality_after", "centrality_after", kTH1D, {{200, 0, 100}});
236+
registry.add<TH1>("QA/centrality_before", "centrality_before", kTH1D, {{200, 0, 100}});
237+
registry.add<TH1>("QA/centrality_after", "centrality_after", kTH1D, {{200, 0, 100}});
239238

240-
registry.add<TProfile>("QA/ZNA_Energy", "ZNA_Energy", kTProfile, {{8, 0, 8}});
241-
registry.add<TProfile>("QA/ZNC_Energy", "ZNC_Energy", kTProfile, {{8, 0, 8}});
239+
registry.add<TProfile>("QA/ZNA_Energy", "ZNA_Energy", kTProfile, {{8, 0, 8}});
240+
registry.add<TProfile>("QA/ZNC_Energy", "ZNC_Energy", kTProfile, {{8, 0, 8}});
242241

243-
registry.add<TProfile>("QA/before/ZNA_pm1", "ZNA_pm1", kTProfile, {{1, 0, 1.}});
244-
registry.add<TProfile>("QA/before/ZNA_pm2", "ZNA_pm2", kTProfile, {{1, 0, 1.}});
245-
registry.add<TProfile>("QA/before/ZNA_pm3", "ZNA_pm3", kTProfile, {{1, 0, 1.}});
246-
registry.add<TProfile>("QA/before/ZNA_pm4", "ZNA_pm4", kTProfile, {{1, 0, 1.}});
242+
registry.add<TProfile>("QA/before/ZNA_pm1", "ZNA_pm1", kTProfile, {{1, 0, 1.}});
243+
registry.add<TProfile>("QA/before/ZNA_pm2", "ZNA_pm2", kTProfile, {{1, 0, 1.}});
244+
registry.add<TProfile>("QA/before/ZNA_pm3", "ZNA_pm3", kTProfile, {{1, 0, 1.}});
245+
registry.add<TProfile>("QA/before/ZNA_pm4", "ZNA_pm4", kTProfile, {{1, 0, 1.}});
247246

248-
registry.add<TProfile>("QA/before/ZNC_pm1", "ZNC_pm1", kTProfile, {{1, 0, 1.}});
249-
registry.add<TProfile>("QA/before/ZNC_pm2", "ZNC_pm2", kTProfile, {{1, 0, 1.}});
250-
registry.add<TProfile>("QA/before/ZNC_pm3", "ZNC_pm3", kTProfile, {{1, 0, 1.}});
251-
registry.add<TProfile>("QA/before/ZNC_pm4", "ZNC_pm4", kTProfile, {{1, 0, 1.}});
247+
registry.add<TProfile>("QA/before/ZNC_pm1", "ZNC_pm1", kTProfile, {{1, 0, 1.}});
248+
registry.add<TProfile>("QA/before/ZNC_pm2", "ZNC_pm2", kTProfile, {{1, 0, 1.}});
249+
registry.add<TProfile>("QA/before/ZNC_pm3", "ZNC_pm3", kTProfile, {{1, 0, 1.}});
250+
registry.add<TProfile>("QA/before/ZNC_pm4", "ZNC_pm4", kTProfile, {{1, 0, 1.}});
252251

253-
registry.addClone("QA/before/", "QA/after/");
252+
registry.addClone("QA/before/", "QA/after/");
254253
}
255254

256-
// Tower mean energies vs. centrality used for tower gain equalisation
255+
// Tower mean energies vs. centrality used for tower gain equalisation
257256
for (int tower = 0; tower < 10; tower++) {
258257
namesEcal[tower] = TString::Format("hZN%s_mean_t%i_cent", sides[(tower < 5) ? 0 : 1], tower % 5);
259258
registry.add<TProfile2D>(Form("Energy/%s", namesEcal[tower].Data()), Form("%s", namesEcal[tower].Data()), kTProfile2D, {{1, 0, 1}, axisCent});
@@ -262,7 +261,7 @@ struct ZdcQVectors {
262261
// recentered q-vectors (to check what steps are finished in the end)
263262
registry.add<TProfile>("vmean/hvertex_vx", "hvertex_vx", kTProfile, {{1, 0., 1.}});
264263
registry.add<TProfile>("vmean/hvertex_vy", "hvertex_vy", kTProfile, {{1, 0., 1.}});
265-
registry.add<TProfile>("vmean/hvertex_vz", "hvertex_vz", kTProfile, {{1, 0., 1.}});
264+
registry.add<TProfile>("vmean/hvertex_vz", "hvertex_vz", kTProfile, {{1, 0., 1.}});
266265

267266
registry.add("hEventCount", "Number of Event; Cut; #Events Passed Cut", {HistType::kTH1D, {{nEventSelections, 0, nEventSelections}}});
268267
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_Zvtx + 1, "Z vertex cut event");
@@ -345,7 +344,6 @@ struct ZdcQVectors {
345344
return 1;
346345
}
347346

348-
349347
template <FillType ft>
350348
inline void fillCommonRegistry(double qxa, double qya, double qxc, double qyc, std::vector<double> v, double centrality)
351349
{
@@ -405,23 +403,22 @@ struct ZdcQVectors {
405403
registry.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/hSPplaneFull"), psiFull, centrality, 1);
406404
}
407405

408-
template <CalibModes cm>
409-
void loadCalibrations(uint64_t timestamp, std::string ccdb_dir)
406+
template <CalibModes cm>
407+
void loadCalibrations(uint64_t timestamp, std::string ccdb_dir)
410408
{
411409
// iteration = 0 (Energy calibration) -> step 0 only
412410
// iteration 1,2,3,4,5 = recentering -> 5 steps per iteration (1x 4D + 4x 1D)
413411

414412
if (cal.calibfilesLoaded[cm])
415413
return;
416414

417-
if (ccdb_dir.empty() == false){
418-
cal.calibList[cm] = ccdb->getForTimeStamp<TList>(ccdb_dir, timestamp);
419-
cal.calibfilesLoaded[cm] = true;
415+
if (ccdb_dir.empty() == false) {
416+
cal.calibList[cm] = ccdb->getForTimeStamp<TList>(ccdb_dir, timestamp);
417+
cal.calibfilesLoaded[cm] = true;
420418
LOGF(info, "Loaded calibration histos from %s", ccdb_dir.c_str());
421419
} else {
422420
LOGF(info, "No ccdb path given for calibration histos. Do not recenter.");
423421
}
424-
425422
}
426423

427424
template <typename T, CalibModes cm>
@@ -430,16 +427,16 @@ void loadCalibrations(uint64_t timestamp, std::string ccdb_dir)
430427
T* hist = nullptr;
431428
double calibConstant{0};
432429

433-
if(cm == kEnergyCal){
430+
if (cm == kEnergyCal) {
434431
TList* list = cal.calibList[cm];
435432
hist = reinterpret_cast<T*>(list->FindObject(Form("%s", objName)));
436-
} else if(cm == kMeanv){
433+
} else if (cm == kMeanv) {
437434
TList* list = cal.calibList[cm];
438435
hist = reinterpret_cast<T*>(list->FindObject(Form("%s", objName)));
439-
} else if(cm == kRec){
440-
TList* list = reinterpret_cast<TList*>(cal.calibList[cm]->FindObject(Form("it%i_step%i", iteration, step)));
441-
hist = reinterpret_cast<T*>(list->FindObject(Form("%s", objName)));
442-
}
436+
} else if (cm == kRec) {
437+
TList* list = reinterpret_cast<TList*>(cal.calibList[cm]->FindObject(Form("it%i_step%i", iteration, step)));
438+
hist = reinterpret_cast<T*>(list->FindObject(Form("%s", objName)));
439+
}
443440

444441
if (!hist) {
445442
LOGF(fatal, "%s not available.. Abort..", objName);
@@ -544,7 +541,7 @@ void loadCalibrations(uint64_t timestamp, std::string ccdb_dir)
544541

545542
// load new calibrations for new runs only
546543
if (runnumber != lastRunNumber) {
547-
cal.calibfilesLoaded[2] = false;
544+
cal.calibfilesLoaded[2] = false;
548545
cal.calibList[2] = nullptr;
549546
lastRunNumber = runnumber;
550547
}
@@ -647,23 +644,23 @@ void loadCalibrations(uint64_t timestamp, std::string ccdb_dir)
647644
registry.fill(HIST("QA/ZNC_Energy"), bincenter, eZN[i + 4]);
648645
registry.fill(HIST("QA/ZNC_Energy"), bincenter + 4, e[i + 4]);
649646

650-
registry.get<TProfile>(HIST("QA/before/ZNA_pm1"))->Fill(Form("%d", runnumber), eZN[0]);
651-
registry.get<TProfile>(HIST("QA/before/ZNA_pm2"))->Fill(Form("%d", runnumber), eZN[1]);
652-
registry.get<TProfile>(HIST("QA/before/ZNA_pm3"))->Fill(Form("%d", runnumber), eZN[2]);
653-
registry.get<TProfile>(HIST("QA/before/ZNA_pm4"))->Fill(Form("%d", runnumber), eZN[3]);
654-
registry.get<TProfile>(HIST("QA/before/ZNC_pm1"))->Fill(Form("%d", runnumber), eZN[4]);
655-
registry.get<TProfile>(HIST("QA/before/ZNC_pm2"))->Fill(Form("%d", runnumber), eZN[5]);
656-
registry.get<TProfile>(HIST("QA/before/ZNC_pm3"))->Fill(Form("%d", runnumber), eZN[6]);
657-
registry.get<TProfile>(HIST("QA/before/ZNC_pm4"))->Fill(Form("%d", runnumber), eZN[7]);
658-
659-
registry.get<TProfile>(HIST("QA/after/ZNA_pm1"))->Fill(Form("%d", runnumber), e[0]);
660-
registry.get<TProfile>(HIST("QA/after/ZNA_pm2"))->Fill(Form("%d", runnumber), e[1]);
661-
registry.get<TProfile>(HIST("QA/after/ZNA_pm3"))->Fill(Form("%d", runnumber), e[2]);
662-
registry.get<TProfile>(HIST("QA/after/ZNA_pm4"))->Fill(Form("%d", runnumber), e[3]);
663-
registry.get<TProfile>(HIST("QA/after/ZNC_pm1"))->Fill(Form("%d", runnumber), e[4]);
664-
registry.get<TProfile>(HIST("QA/after/ZNC_pm2"))->Fill(Form("%d", runnumber), e[5]);
665-
registry.get<TProfile>(HIST("QA/after/ZNC_pm3"))->Fill(Form("%d", runnumber), e[6]);
666-
registry.get<TProfile>(HIST("QA/after/ZNC_pm4"))->Fill(Form("%d", runnumber), e[7]);
647+
registry.get<TProfile>(HIST("QA/before/ZNA_pm1"))->Fill(Form("%d", runnumber), eZN[0]);
648+
registry.get<TProfile>(HIST("QA/before/ZNA_pm2"))->Fill(Form("%d", runnumber), eZN[1]);
649+
registry.get<TProfile>(HIST("QA/before/ZNA_pm3"))->Fill(Form("%d", runnumber), eZN[2]);
650+
registry.get<TProfile>(HIST("QA/before/ZNA_pm4"))->Fill(Form("%d", runnumber), eZN[3]);
651+
registry.get<TProfile>(HIST("QA/before/ZNC_pm1"))->Fill(Form("%d", runnumber), eZN[4]);
652+
registry.get<TProfile>(HIST("QA/before/ZNC_pm2"))->Fill(Form("%d", runnumber), eZN[5]);
653+
registry.get<TProfile>(HIST("QA/before/ZNC_pm3"))->Fill(Form("%d", runnumber), eZN[6]);
654+
registry.get<TProfile>(HIST("QA/before/ZNC_pm4"))->Fill(Form("%d", runnumber), eZN[7]);
655+
656+
registry.get<TProfile>(HIST("QA/after/ZNA_pm1"))->Fill(Form("%d", runnumber), e[0]);
657+
registry.get<TProfile>(HIST("QA/after/ZNA_pm2"))->Fill(Form("%d", runnumber), e[1]);
658+
registry.get<TProfile>(HIST("QA/after/ZNA_pm3"))->Fill(Form("%d", runnumber), e[2]);
659+
registry.get<TProfile>(HIST("QA/after/ZNA_pm4"))->Fill(Form("%d", runnumber), e[3]);
660+
registry.get<TProfile>(HIST("QA/after/ZNC_pm1"))->Fill(Form("%d", runnumber), e[4]);
661+
registry.get<TProfile>(HIST("QA/after/ZNC_pm2"))->Fill(Form("%d", runnumber), e[5]);
662+
registry.get<TProfile>(HIST("QA/after/ZNC_pm3"))->Fill(Form("%d", runnumber), e[6]);
663+
registry.get<TProfile>(HIST("QA/after/ZNC_pm4"))->Fill(Form("%d", runnumber), e[7]);
667664
}
668665

669666
// Now calculate Q-vector
@@ -689,23 +686,24 @@ void loadCalibrations(uint64_t timestamp, std::string ccdb_dir)
689686
v[1] = v[1] - getCorrection<TProfile, kMeanv>(vnames[1].Data());
690687
} else {
691688
LOGF(warning, " --> No mean V found.. -> THis wil lead to wrong axis for vx, vy (will be created in vmean/)");
692-
return;
689+
return;
693690
}
694691

695692
loadCalibrations<kRec>(foundBC.timestamp(), cfgRec.value);
696693

697-
698694
std::vector<double> qRec(q);
699695

700696
if (cal.atIteration == 0) {
701697
if (isSelected)
702-
if(cfgFillCommonRegistry) fillCommonRegistry<kBefore>(q[0], q[1], q[2], q[3], v, centrality);
698+
if (cfgFillCommonRegistry)
699+
fillCommonRegistry<kBefore>(q[0], q[1], q[2], q[3], v, centrality);
703700

704701
spTableZDC(runnumber, centrality, v[0], v[1], v[2], q[0], q[1], q[2], q[3], isSelected, 0, 0);
705702
counter++;
706703
return;
707704
} else if (cal.atIteration == 5 && cal.atStep == 4) {
708-
if(cfgFillCommonRegistry) fillCommonRegistry<kBefore>(q[0], q[1], q[2], q[3], v, centrality);
705+
if (cfgFillCommonRegistry)
706+
fillCommonRegistry<kBefore>(q[0], q[1], q[2], q[3], v, centrality);
709707

710708
// vector of 4
711709
std::vector<double> corrQxA;
@@ -739,7 +737,8 @@ void loadCalibrations(uint64_t timestamp, std::string ccdb_dir)
739737
}
740738

741739
if (isSelected) {
742-
if(cfgFillCommonRegistry) fillCommonRegistry<kAfter>(qRec[0], qRec[1], qRec[2], qRec[3], v, centrality);
740+
if (cfgFillCommonRegistry)
741+
fillCommonRegistry<kAfter>(qRec[0], qRec[1], qRec[2], qRec[3], v, centrality);
743742
registry.fill(HIST("QA/centrality_after"), centrality);
744743
}
745744

0 commit comments

Comments
 (0)