Skip to content

Commit acb2d41

Browse files
committed
Please consider the following formatting changes
1 parent d1c5d1c commit acb2d41

1 file changed

Lines changed: 42 additions & 35 deletions

File tree

‎PWGMM/UE/Tasks/flattenicity.cxx‎

Lines changed: 42 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,24 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111

12-
#include <cmath>
13-
#include <vector>
14-
15-
#include "Framework/runDataProcessing.h"
16-
#include "Framework/AnalysisTask.h"
17-
#include "Framework/AnalysisDataModel.h"
18-
#include "Framework/ASoAHelpers.h"
19-
#include "Framework/HistogramRegistry.h"
20-
#include "Framework/Configurable.h"
21-
#include "Framework/InitContext.h"
22-
#include "Framework/O2DatabasePDGPlugin.h"
23-
24-
#include "ReconstructionDataFormats/Track.h"
25-
#include "Common/DataModel/Multiplicity.h"
26-
#include "Common/DataModel/EventSelection.h"
27-
#include "Common/DataModel/TrackSelectionTables.h"
2812
#include "Common/Core/TrackSelection.h"
2913
#include "Common/Core/TrackSelectionDefaults.h"
14+
#include "Common/DataModel/EventSelection.h"
15+
#include "Common/DataModel/Multiplicity.h"
16+
#include "Common/DataModel/TrackSelectionTables.h"
17+
18+
#include <Framework/ASoAHelpers.h>
19+
#include <Framework/AnalysisDataModel.h>
20+
#include <Framework/AnalysisTask.h>
21+
#include <Framework/Configurable.h>
22+
#include <Framework/HistogramRegistry.h>
23+
#include <Framework/InitContext.h>
24+
#include <Framework/O2DatabasePDGPlugin.h>
25+
#include <Framework/runDataProcessing.h>
26+
#include <ReconstructionDataFormats/Track.h>
27+
28+
#include <cmath>
29+
#include <vector>
3030

3131
using namespace o2;
3232
using namespace o2::framework;
@@ -72,10 +72,10 @@ struct flattenicityTask {
7272
// Define histograms
7373
AxisSpec flatBins = {40, 0.0, 1.0, "#rho"};
7474
AxisSpec nchBins = {100, -0.5, 99.5, "N_{ch}"};
75-
76-
registry.add("hFlattenicityTruth", "Truth flattenicity; 1-#rho; Events",
75+
76+
registry.add("hFlattenicityTruth", "Truth flattenicity; 1-#rho; Events",
7777
HistType::kTH1D, {flatBins});
78-
registry.add("hFlattenicityReco", "Reco flattenicity; 1-#rho; Events",
78+
registry.add("hFlattenicityReco", "Reco flattenicity; 1-#rho; Events",
7979
HistType::kTH1D, {flatBins});
8080
registry.add("hFlattenicityCorrelation", "Truth vs Reco; 1-#rho_{truth}; 1-#rho_{reco}",
8181
HistType::kTH2D, {flatBins, flatBins});
@@ -104,55 +104,62 @@ struct flattenicityTask {
104104
// --- Flattenicity calculation ---
105105
float calculateFlattenicity(const std::vector<float>& counts)
106106
{
107-
if (counts.size() != N_CELL) return -1;
108-
107+
if (counts.size() != N_CELL)
108+
return -1;
109+
109110
float total = 0;
110-
for (auto c : counts) total += c;
111-
if (total <= 0) return -1;
112-
111+
for (auto c : counts)
112+
total += c;
113+
if (total <= 0)
114+
return -1;
115+
113116
float mean = total / N_CELL;
114-
if (mean <= 0) return -1;
115-
117+
if (mean <= 0)
118+
return -1;
119+
116120
float sumSq = 0;
117121
for (auto c : counts) {
118122
sumSq += (c - mean) * (c - mean);
119123
}
120-
124+
121125
float rho = std::sqrt(sumSq / (N_CELL * N_CELL)) / mean;
122126
return 1.0f - rho;
123127
}
124128

125129
// --- Process Data ---
126-
void processData(aod::Collision const& collision,
130+
void processData(aod::Collision const& collision,
127131
soa::Filtered<aod::Tracks> const& tracks,
128132
aod::FT0s const& ft0s)
129133
{
130134
// Event selection (Paola/Jesus)
131-
if (!collision.sel8()) return;
132-
if (std::abs(collision.posZ()) >= 10.0f) return;
133-
135+
if (!collision.sel8())
136+
return;
137+
if (std::abs(collision.posZ()) >= 10.0f)
138+
return;
139+
134140
// Track loop for Nch
135141
int nch = 0;
136142
for (auto& track : tracks) {
137-
if (!mySelectionPrim.IsSelected(track)) continue;
143+
if (!mySelectionPrim.IsSelected(track))
144+
continue;
138145
nch++;
139146
}
140147
registry.fill(HIST("hNch"), nch);
141-
148+
142149
// FT0 flattenicity
143150
auto ft0 = collision.ft0();
144151
if (ft0.hasAmplitudeA() && ft0.hasAmplitudeC()) {
145152
auto ampA = ft0.amplitudeA();
146153
auto ampC = ft0.amplitudeC();
147-
154+
148155
std::vector<float> counts(N_CELL, 0.0f);
149156
for (int i = 0; i < ampA.size() && i < N_CH_A; ++i) {
150157
counts[i] = ampA[i];
151158
}
152159
for (int i = 0; i < ampC.size() && i < N_CH_C; ++i) {
153160
counts[N_CH_A + i] = ampC[i];
154161
}
155-
162+
156163
float flat = calculateFlattenicity(counts);
157164
if (flat >= 0) {
158165
registry.fill(HIST("hFlattenicityReco"), flat);

0 commit comments

Comments
 (0)