Skip to content

Commit f6a5d98

Browse files
authored
Merge pull request #82 from alibuild/alibot-cleanup-13701
[PWGCF] Please consider the following formatting changes to #13701
2 parents 1ca1413 + 58121bf commit f6a5d98

File tree

3 files changed

+64
-66
lines changed

3 files changed

+64
-66
lines changed

PWGCF/DataModel/SPTableZDC.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@
1414
#ifndef PWGCF_DATAMODEL_SPTABLEZDC_H_
1515
#define PWGCF_DATAMODEL_SPTABLEZDC_H_
1616

17-
#include <cmath>
18-
#include <vector>
19-
20-
#include "Common/DataModel/PIDResponse.h"
2117
#include "Common/Core/RecoDecay.h"
18+
#include "Common/DataModel/PIDResponse.h"
2219
#include "Common/DataModel/TrackSelectionTables.h"
20+
2321
#include "Framework/AnalysisDataModel.h"
2422

23+
#include <cmath>
24+
#include <vector>
25+
2526
namespace o2::aod
2627
{
2728
namespace sptablezdc

PWGCF/Flow/TableProducer/zdcQVectors.cxx

Lines changed: 54 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ std::vector<double> meanEZN(10); // mean energies from calibration histos (commo
9090
std::vector<double> e(8, 0.); // calibrated energies (a1, a2, a3, a4, c1, c2, c3, c4))
9191

9292
// Define variables needed to do the recentring steps.
93-
float centrality = 0;
93+
float centrality = 0;
9494
int runnumber = 0;
9595
int lastRunNumber = 0;
9696
std::vector<float> v(3, 0); // vx, vy, vz
@@ -115,12 +115,11 @@ struct ZdcQVectors {
115115
RCTFlagsChecker rctChecker;
116116

117117
struct : ConfigurableGroup {
118-
// Additional event selections
118+
// Additional event selections
119119
O2_DEFINE_CONFIGURABLE(cfgMaxOccupancy, int, 10000, "Maximum occupancy of selected events");
120120
O2_DEFINE_CONFIGURABLE(cfgCentMin, float, 0, "Minimum cenrality for selected events");
121121
O2_DEFINE_CONFIGURABLE(cfgCentMax, float, 90, "Maximum cenrality for selected events");
122-
} EvSel;
123-
122+
} EvSel;
124123

125124
ConfigurableAxis axisCent{"axisCent", {90, 0, 90}, "Centrality axis in 1% bins"};
126125
ConfigurableAxis axisCent10{"axisCent10", {9, 0, 90}, "Centrality axis in 10% bins"};
@@ -221,7 +220,7 @@ struct ZdcQVectors {
221220
AxisSpec axisPsiA = {100, -M_PI, M_PI, "#Psi_{1} ZNA"};
222221
AxisSpec axisPsiC = {100, -M_PI, M_PI, "#Psi_{1} ZNC"};
223222

224-
// This is the only histogram that is AL~WA~YS filled.
223+
// This is the only histogram that is AL~WA~YS filled.
225224
registry.add("hEventCount", "Number of Event; Cut; #Events Passed Cut", {HistType::kTH1D, {{nEventSelections, 0, nEventSelections}}});
226225
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_FilteredEvent + 1, "Filtered events");
227226
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_BCHasZDC + 1, "BCHasZDC");
@@ -242,8 +241,8 @@ struct ZdcQVectors {
242241
int totalTowers = 10;
243242
int totalTowersPerSide = 5;
244243
for (int tower = 0; tower < totalTowers; tower++) {
245-
namesEcal[tower] = TString::Format("hZN%s_mean_t%i_cent", sides[(tower < totalTowersPerSide) ? 0 : 1], tower % 5);
246-
}
244+
namesEcal[tower] = TString::Format("hZN%s_mean_t%i_cent", sides[(tower < totalTowersPerSide) ? 0 : 1], tower % 5);
245+
}
247246

248247
for (const auto& side : sides) {
249248
for (const auto& coord : capCOORDS) {
@@ -254,9 +253,8 @@ struct ZdcQVectors {
254253
names[4].push_back(TString::Format("hQ%s%s_mean_vz_run", coord, side));
255254
} // end of capCOORDS
256255
}
257-
258256

259-
if(!cfgFillNothing){
257+
if (!cfgFillNothing) {
260258
if (cfgFillHistRegistry) {
261259
registry.add<TH2>(Form("QA/before/hSPplaneA"), "hSPplaneA", kTH2D, {axisPsiA, axisCent10});
262260
registry.add<TH2>(Form("QA/before/hSPplaneC"), "hSPplaneC", kTH2D, {axisPsiC, axisCent10});
@@ -350,18 +348,16 @@ struct ZdcQVectors {
350348
}
351349

352350
// recentered q-vectors (to check what steps are finished in the end)
353-
351+
354352
registry.add<TProfile>("vmean/hvertex_vx", "hvertex_vx", kTProfile, {{1, 0., 1.}});
355353
registry.add<TProfile>("vmean/hvertex_vy", "hvertex_vy", kTProfile, {{1, 0., 1.}});
356354
registry.add<TProfile>("vmean/hvertex_vz", "hvertex_vz", kTProfile, {{1, 0., 1.}});
357-
358355

359356
registry.add<TProfile3D>("shift/ShiftZDCC", "ShiftZDCC", kTProfile3D, {{100, 0, 100}, {2, 0, 2}, {10, 0, 10}});
360357
registry.add<TProfile3D>("shift/ShiftZDCA", "ShiftZDCA", kTProfile3D, {{100, 0, 100}, {2, 0, 2}, {10, 0, 10}});
361358

362-
363-
if(cfgFillCutAnalysis) {
364-
// Tower mean energies vs. centrality used for tower gain equalisation
359+
if (cfgFillCutAnalysis) {
360+
// Tower mean energies vs. centrality used for tower gain equalisation
365361
int totalTowers = 10;
366362
int totalTowersPerSide = 5;
367363
for (int tower = 0; tower < totalTowers; tower++) {
@@ -376,60 +372,64 @@ struct ZdcQVectors {
376372
}
377373

378374
template <typename TCollision, typename TZdc>
379-
inline void fillCutAnalysis(TCollision collision, TZdc zdcBC, int evSel)
375+
inline void fillCutAnalysis(TCollision collision, TZdc zdcBC, int evSel)
380376
{
381377
registry.fill(HIST("hEventCount"), evSel);
382378
// FT0C is the default centrality estimator
383379
auto cent = collision.centFT0C();
384380
cents.push_back(collision.centFT0C());
385381

386-
if (cfgFT0Cvariant1){
387-
if(cfgUseSecondCent) cent = collision.centFT0CVariant1();
382+
if (cfgFT0Cvariant1) {
383+
if (cfgUseSecondCent)
384+
cent = collision.centFT0CVariant1();
388385
cents.push_back(collision.centFT0CVariant1());
389386
}
390-
if (cfgFT0M){
391-
if(cfgUseSecondCent) cent = collision.centFT0M();
387+
if (cfgFT0M) {
388+
if (cfgUseSecondCent)
389+
cent = collision.centFT0M();
392390
cents.push_back(collision.centFT0M());
393391
}
394-
if (cfgFV0A){
395-
if(cfgUseSecondCent) cent = collision.centFV0A();
392+
if (cfgFV0A) {
393+
if (cfgUseSecondCent)
394+
cent = collision.centFV0A();
396395
cents.push_back(collision.centFV0A());
397396
}
398-
if (cfgNGlobal){
399-
if(cfgUseSecondCent) cent = collision.centNGlobal();
397+
if (cfgNGlobal) {
398+
if (cfgUseSecondCent)
399+
cent = collision.centNGlobal();
400400
cents.push_back(collision.centNGlobal());
401401
}
402-
centrality = cent;
403-
404-
if(!cfgFillCutAnalysis || cfgFillNothing) return;
405-
// Here we fill the Energy and mean vx, vy vz histograms with an extra dimension for all the event selections used.
406-
registry.get<TProfile2D>(HIST("CutAnalysis/hvertex_vx"))->Fill(Form("%d", runnumber), evSel, collision.posX());
407-
registry.get<TProfile2D>(HIST("CutAnalysis/hvertex_vy"))->Fill(Form("%d", runnumber), evSel, collision.posY());
408-
registry.get<TProfile2D>(HIST("CutAnalysis/hvertex_vz"))->Fill(Form("%d", runnumber), evSel, collision.posZ());
409-
410-
registry.get<TProfile2D>(HIST("CutAnalysis/hZNA_mean_t0_cent"))->Fill(cent, evSel, zdcBC.energyCommonZNA(), 1);
411-
registry.get<TProfile2D>(HIST("CutAnalysis/hZNA_mean_t1_cent"))->Fill(cent, evSel, zdcBC.energySectorZNA()[0], 1);
412-
registry.get<TProfile2D>(HIST("CutAnalysis/hZNA_mean_t2_cent"))->Fill(cent, evSel, zdcBC.energySectorZNA()[1], 1);
413-
registry.get<TProfile2D>(HIST("CutAnalysis/hZNA_mean_t3_cent"))->Fill(cent, evSel, zdcBC.energySectorZNA()[2], 1);
414-
registry.get<TProfile2D>(HIST("CutAnalysis/hZNA_mean_t4_cent"))->Fill(cent, evSel, zdcBC.energySectorZNA()[3], 1);
415-
registry.get<TProfile2D>(HIST("CutAnalysis/hZNC_mean_t0_cent"))->Fill(cent, evSel, zdcBC.energyCommonZNC(), 1);
416-
registry.get<TProfile2D>(HIST("CutAnalysis/hZNC_mean_t1_cent"))->Fill(cent, evSel, zdcBC.energySectorZNC()[0], 1);
417-
registry.get<TProfile2D>(HIST("CutAnalysis/hZNC_mean_t2_cent"))->Fill(cent, evSel, zdcBC.energySectorZNC()[1], 1);
418-
registry.get<TProfile2D>(HIST("CutAnalysis/hZNC_mean_t3_cent"))->Fill(cent, evSel, zdcBC.energySectorZNC()[2], 1);
419-
registry.get<TProfile2D>(HIST("CutAnalysis/hZNC_mean_t4_cent"))->Fill(cent, evSel, zdcBC.energySectorZNC()[3], 1);
420-
}
402+
centrality = cent;
421403

404+
if (!cfgFillCutAnalysis || cfgFillNothing)
405+
return;
406+
// Here we fill the Energy and mean vx, vy vz histograms with an extra dimension for all the event selections used.
407+
registry.get<TProfile2D>(HIST("CutAnalysis/hvertex_vx"))->Fill(Form("%d", runnumber), evSel, collision.posX());
408+
registry.get<TProfile2D>(HIST("CutAnalysis/hvertex_vy"))->Fill(Form("%d", runnumber), evSel, collision.posY());
409+
registry.get<TProfile2D>(HIST("CutAnalysis/hvertex_vz"))->Fill(Form("%d", runnumber), evSel, collision.posZ());
410+
411+
registry.get<TProfile2D>(HIST("CutAnalysis/hZNA_mean_t0_cent"))->Fill(cent, evSel, zdcBC.energyCommonZNA(), 1);
412+
registry.get<TProfile2D>(HIST("CutAnalysis/hZNA_mean_t1_cent"))->Fill(cent, evSel, zdcBC.energySectorZNA()[0], 1);
413+
registry.get<TProfile2D>(HIST("CutAnalysis/hZNA_mean_t2_cent"))->Fill(cent, evSel, zdcBC.energySectorZNA()[1], 1);
414+
registry.get<TProfile2D>(HIST("CutAnalysis/hZNA_mean_t3_cent"))->Fill(cent, evSel, zdcBC.energySectorZNA()[2], 1);
415+
registry.get<TProfile2D>(HIST("CutAnalysis/hZNA_mean_t4_cent"))->Fill(cent, evSel, zdcBC.energySectorZNA()[3], 1);
416+
registry.get<TProfile2D>(HIST("CutAnalysis/hZNC_mean_t0_cent"))->Fill(cent, evSel, zdcBC.energyCommonZNC(), 1);
417+
registry.get<TProfile2D>(HIST("CutAnalysis/hZNC_mean_t1_cent"))->Fill(cent, evSel, zdcBC.energySectorZNC()[0], 1);
418+
registry.get<TProfile2D>(HIST("CutAnalysis/hZNC_mean_t2_cent"))->Fill(cent, evSel, zdcBC.energySectorZNC()[1], 1);
419+
registry.get<TProfile2D>(HIST("CutAnalysis/hZNC_mean_t3_cent"))->Fill(cent, evSel, zdcBC.energySectorZNC()[2], 1);
420+
registry.get<TProfile2D>(HIST("CutAnalysis/hZNC_mean_t4_cent"))->Fill(cent, evSel, zdcBC.energySectorZNC()[3], 1);
421+
}
422422

423423
template <typename TCollision, typename TBunchCrossing>
424424
uint16_t eventSelected(TCollision collision, TBunchCrossing bunchCrossing)
425425
{
426426
uint16_t selectionBits = 0;
427427
bool selected;
428428

429-
// Define selection criteria
429+
// Define selection criteria
430430
// If event is selected (passed the cut), set the corresponding bit in the selectionBits variable
431431
// bit 0 is for filterd events, so it will stay 0
432-
// uint16_t is 16 bits, so we have room for 15 selection criteria here
432+
// uint16_t is 16 bits, so we have room for 15 selection criteria here
433433

434434
selected = std::fabs(collision.posZ()) < cfgVtxZ;
435435
if (selected) {
@@ -492,8 +492,8 @@ struct ZdcQVectors {
492492
fillCutAnalysis(collision, bunchCrossing, evSel_kIsGoodITSLayer0123);
493493
}
494494

495-
selected = rctChecker(collision);
496-
if (selected){
495+
selected = rctChecker(collision);
496+
if (selected) {
497497
selectionBits |= (uint16_t)(0x1u << evSel_RCTFlagsZDC);
498498
fillCutAnalysis(collision, bunchCrossing, evSel_RCTFlagsZDC);
499499
}
@@ -506,7 +506,8 @@ struct ZdcQVectors {
506506
{
507507
// loop for filling multiple histograms with different naming patterns
508508
// Always fill the uncentered "raw" Q-vector histos!
509-
if(cfgFillNothing) return;
509+
if (cfgFillNothing)
510+
return;
510511
static constexpr std::string_view Time[] = {"before", "after"};
511512

512513
registry.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/hZNA_Qx_vs_Qy"), qxa, qya);
@@ -741,8 +742,6 @@ struct ZdcQVectors {
741742
}
742743
registry.fill(HIST("hEventCount"), evSel_isSelectedZDC);
743744

744-
745-
746745
uint16_t eventSelectionFlags = eventSelected(collision, foundBC.zdc());
747746

748747
// ALWAYS use these event selections
@@ -772,7 +771,6 @@ struct ZdcQVectors {
772771
cal.shiftprofileA = nullptr;
773772
}
774773

775-
776774
// load the calibration histos for iteration 0 step 0 (Energy Calibration)
777775
loadCalibrations<kEnergyCal>(foundBC.timestamp(), cfgEnergyCal.value);
778776

@@ -784,7 +782,7 @@ struct ZdcQVectors {
784782
// load the calibrations for the mean v
785783
loadCalibrations<kMeanv>(foundBC.timestamp(), cfgMeanv.value);
786784

787-
if(!cfgFillNothing){
785+
if (!cfgFillNothing) {
788786
registry.get<TProfile>(HIST("vmean/hvertex_vx"))->Fill(Form("%d", runnumber), v[0]);
789787
registry.get<TProfile>(HIST("vmean/hvertex_vy"))->Fill(Form("%d", runnumber), v[1]);
790788
registry.get<TProfile>(HIST("vmean/hvertex_vz"))->Fill(Form("%d", runnumber), v[2]);
@@ -833,7 +831,7 @@ struct ZdcQVectors {
833831
calibtower++;
834832
}
835833

836-
if(cfgFillHistRegistry && !cfgFillNothing) {
834+
if (cfgFillHistRegistry && !cfgFillNothing) {
837835
for (int i = 0; i < nTowersPerSide; i++) {
838836
float bincenter = i + .5;
839837
registry.fill(HIST("QA/ZNA_Energy"), bincenter, eZN[i]);
@@ -896,7 +894,7 @@ struct ZdcQVectors {
896894
registry.fill(HIST("QA/") + HIST("after") + HIST("/ZNC_pm3_vs_Centrality"), centrality, e[6] / sumZNCafter);
897895
registry.fill(HIST("QA/") + HIST("after") + HIST("/ZNC_pm4_vs_Centrality"), centrality, e[7] / sumZNCafter);
898896
}
899-
}
897+
}
900898

901899
// Now calculate Q-vector
902900
for (int tower = 0; tower < nTowers; tower++) {
@@ -939,7 +937,7 @@ struct ZdcQVectors {
939937

940938
std::vector<double> qRec(q);
941939

942-
if(cfgFillHistRegistry && !cfgFillNothing) {
940+
if (cfgFillHistRegistry && !cfgFillNothing) {
943941
registry.get<TProfile>(HIST("QA/before/ZNA_Qx"))->Fill(Form("%d", runnumber), q[0]);
944942
registry.get<TProfile>(HIST("QA/before/ZNA_Qy"))->Fill(Form("%d", runnumber), q[1]);
945943
registry.get<TProfile>(HIST("QA/before/ZNC_Qx"))->Fill(Form("%d", runnumber), q[2]);
@@ -996,7 +994,7 @@ struct ZdcQVectors {
996994
qRec[2] -= corrQxC[cor];
997995
qRec[3] -= corrQyC[cor];
998996

999-
if(cfgFillHistRegistry && !cfgFillNothing) {
997+
if (cfgFillHistRegistry && !cfgFillNothing) {
1000998
registry.get<TH2>(HIST("QA/QXA_vs_iteration"))->Fill(cor, qRec[0]);
1001999
registry.get<TH2>(HIST("QA/QYA_vs_iteration"))->Fill(cor, qRec[1]);
10021000
registry.get<TH2>(HIST("QA/QXC_vs_iteration"))->Fill(cor, qRec[2]);
@@ -1040,7 +1038,7 @@ struct ZdcQVectors {
10401038
}
10411039

10421040
for (int ishift = 1; ishift <= nshift; ishift++) {
1043-
if(!cfgFillNothing){
1041+
if (!cfgFillNothing) {
10441042
registry.fill(HIST("shift/ShiftZDCC"), centrality, 0.5, ishift - 0.5, std::sin(ishift * 1.0 * psiZDCC));
10451043
registry.fill(HIST("shift/ShiftZDCC"), centrality, 1.5, ishift - 0.5, std::cos(ishift * 1.0 * psiZDCC));
10461044
registry.fill(HIST("shift/ShiftZDCA"), centrality, 0.5, ishift - 0.5, std::sin(ishift * 1.0 * psiZDCA));

PWGCF/Flow/Tasks/flowSP.cxx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ struct FlowSP {
7070
} rctFlags;
7171

7272
// struct : ConfigurableGroup { // <-- change all to evsels.Selection
73-
// event selection configurable group
73+
// event selection configurable group
7474
O2_DEFINE_CONFIGURABLE(cfgEvSelsUseAdditionalEventCut, bool, true, "Bool to enable Additional Event Cut");
7575
O2_DEFINE_CONFIGURABLE(cfgEvSelsMaxOccupancy, int, 10000, "Maximum occupancy of selected events");
7676
O2_DEFINE_CONFIGURABLE(cfgEvSelsNoSameBunchPileupCut, bool, true, "kNoSameBunchPileupCut");
@@ -774,9 +774,9 @@ struct FlowSP {
774774
float eff = 1.;
775775
int sizeEff = cfg.mEfficiency.size();
776776
if (sizeEff > pID) {
777-
if(cfguseNUE2D) {
778-
int binx = cfg.mEfficiency2D[pID]->GetXaxis()->FindBin(eta);
779-
int biny = cfg.mEfficiency2D[pID]->GetYaxis()->FindBin(pt);
777+
if (cfguseNUE2D) {
778+
int binx = cfg.mEfficiency2D[pID]->GetXaxis()->FindBin(eta);
779+
int biny = cfg.mEfficiency2D[pID]->GetYaxis()->FindBin(pt);
780780
eff = cfg.mEfficiency2D[pID]->GetBinContent(binx, biny);
781781
} else {
782782
eff = cfg.mEfficiency[pID]->GetBinContent(cfg.mEfficiency[pID]->FindBin(pt));
@@ -1191,12 +1191,11 @@ struct FlowSP {
11911191

11921192
if (!eventSelected(collision, tracks.size()))
11931193
return;
1194-
1194+
11951195
if (!collision.isSelected()) // selected by ZDCQVectors task (checks signal in ZDC) --> only possible in data not MC
11961196
return;
11971197
histos.fill(HIST("hEventCount"), evSel_isSelectedZDC);
11981198

1199-
12001199
spm.qxA = collision.qxA();
12011200
spm.qyA = collision.qyA();
12021201
spm.qxC = collision.qxC();

0 commit comments

Comments
 (0)