Skip to content

Commit 0d7e4c5

Browse files
authored
Merge pull request #84 from alibuild/alibot-cleanup-13803
[PWGCF,Tutorial] Please consider the following formatting changes to #13803
2 parents ffb30be + ee8ce71 commit 0d7e4c5

File tree

1 file changed

+28
-33
lines changed

1 file changed

+28
-33
lines changed

Tutorials/PWGCF/EventPlane/src/SpectatorPlaneTutorial.cxx

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
/// \since 11/2025
1515
/// \brief This is a tutorial task to show how to use the ZDC q-vectors and the spectator plane resolution.
1616

17-
1817
#include "PWGCF/DataModel/SPTableZDC.h"
1918

2019
#include "Common/Core/EventPlaneHelper.h"
@@ -94,7 +93,6 @@ struct SpectatorPlaneTutorial {
9493
int64_t now = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
9594
ccdb->setCreatedNotAfter(now);
9695

97-
9896
AxisSpec axisPhi = {60, 0, M_PI * 2, "#varphi"};
9997
AxisSpec axisEta = {64, -1.6, 1.6, "#eta"};
10098
AxisSpec axisEtaVn = {8, -.8, .8, "#eta"};
@@ -122,15 +120,15 @@ struct SpectatorPlaneTutorial {
122120
registry.add("hSPplaneAvsC", "Spectator Plane Angle A vs C; #Events; #Psi_{A}; #Psi_{C}", {HistType::kTH2D, {axisPhiPlane, axisPhiPlane}});
123121
registry.add("hSPplaneFull", "Spectator Plane Angle Full; #Events; #Psi_{Full}", {HistType::kTH1D, {axisPhiPlane}});
124122

125-
// Note: we will fill these with data from the CCDB, just to take a look!
123+
// Note: we will fill these with data from the CCDB, just to take a look!
126124
registry.add("CalibHistos/hQQx", "QQx; #Events; QQx", {HistType::kTProfile, {axisCent}});
127125
registry.add("CalibHistos/hQQy", "QQy; #Events; QQy", {HistType::kTProfile, {axisCent}});
128126
registry.add("CalibHistos/hQQ", "QQ; #Events; QQx + QQy", {HistType::kTProfile, {axisCent}});
129127
// Add here the histograms for the cross-terms of the Q-vectors from the ZDC
130128

131129
registry.add("CalibHistos/hEvPlaneRes", "Event Plane Resolution; #Events; Event Plane Resolution", {HistType::kTProfile, {axisCent}});
132130

133-
// Flow Histograms
131+
// Flow Histograms
134132
registry.add("flow/v1A", "", {HistType::kTProfile, {axisPt}});
135133
registry.add("flow/v1C", "", {HistType::kTProfile, {axisPt}});
136134

@@ -140,7 +138,6 @@ struct SpectatorPlaneTutorial {
140138
registry.add("flow/vnAyCxUy_MH", "", {HistType::kTProfile, {axisCent}});
141139
}
142140

143-
144141
void process(ZDCCollisions::iterator const& collision, aod::BCsWithTimestamps const&, UsedTracks const& tracks)
145142
{
146143

@@ -150,7 +147,7 @@ struct SpectatorPlaneTutorial {
150147
registry.fill(HIST("hCentrality"), centrality);
151148

152149
if (centrality > 80 || centrality < 0)
153-
return;
150+
return;
154151

155152
if (collision.isSelected() == false)
156153
return;
@@ -165,7 +162,7 @@ struct SpectatorPlaneTutorial {
165162
double psiA = 1.0 * std::atan2(qyA, qxA);
166163
registry.fill(HIST("hSPplaneA"), psiA);
167164

168-
// Add the PsiA vs PsiC as a TH2D
165+
// Add the PsiA vs PsiC as a TH2D
169166

170167
double psiC = 1.0 * std::atan2(qyC, qxC);
171168
double psiFull = 1.0 * std::atan2(qyA + qyC, qxA + qxC);
@@ -178,11 +175,11 @@ struct SpectatorPlaneTutorial {
178175

179176
double QQx = 1;
180177
double QQy = 1;
181-
double QQ = 1;
178+
double QQ = 1;
182179
double evPlaneRes = 1;
183180

184181
// Get QQ-correlations from CCDB
185-
if(cfgCCDBdir_QQ.value.empty() == false) {
182+
if (cfgCCDBdir_QQ.value.empty() == false) {
186183
TList* list = ccdb->getForTimeStamp<TList>(cfgCCDBdir_QQ.value, bc.timestamp());
187184
TProfile* qAqCX = reinterpret_cast<TProfile*>(list->FindObject("qAqCX"));
188185
TProfile* qAqCY = reinterpret_cast<TProfile*>(list->FindObject("qAqCY"));
@@ -195,42 +192,40 @@ struct SpectatorPlaneTutorial {
195192
registry.fill(HIST("CalibHistos/hQQy"), centrality, QQy);
196193
registry.fill(HIST("CalibHistos/hQQ"), centrality, QQ);
197194
}
198-
// Get event plane resolution from CCDB
199-
if(cfgCCDBdir_SP.value.empty() == false) {
195+
// Get event plane resolution from CCDB
196+
if (cfgCCDBdir_SP.value.empty() == false) {
200197
evPlaneRes = ccdb->getForTimeStamp<TProfile>(cfgCCDBdir_SP.value, bc.timestamp())->GetBinContent(centrality);
201198
registry.fill(HIST("CalibHistos/hEvPlaneRes"), centrality, evPlaneRes);
202199
}
203200

204-
for (const auto& track : tracks) {
201+
for (const auto& track : tracks) {
205202

206-
// constrain angle to 0 -> [0,0+2pi]
207-
auto phi = RecoDecay::constrainAngle(track.phi(), 0);
203+
// constrain angle to 0 -> [0,0+2pi]
204+
auto phi = RecoDecay::constrainAngle(track.phi(), 0);
208205

209-
double ux = std::cos(phi);
210-
double uy = std::sin(phi);
206+
double ux = std::cos(phi);
207+
double uy = std::sin(phi);
211208

212-
double uxMH = std::cos(2 * phi);
213-
double uyMH = std::sin(2 * phi);
209+
double uxMH = std::cos(2 * phi);
210+
double uyMH = std::sin(2 * phi);
214211

215-
double v1A = (uy * qyA + ux * qxA) / std::sqrt(std::fabs(QQ));
216-
double v1C = (uy * qyC + ux * qxC) / std::sqrt(std::fabs(QQ));
212+
double v1A = (uy * qyA + ux * qxA) / std::sqrt(std::fabs(QQ));
213+
double v1C = (uy * qyC + ux * qxC) / std::sqrt(std::fabs(QQ));
217214

218-
double v2AxCxUx_MH = (uxMH * qxA * qxC) / QQx;
219-
double v2AyCyUx_MH = (uxMH * qyA * qyC) / QQy;
220-
double v2AxCyUy_MH = (uyMH * qxA * qyC) / QQx;
221-
double v2AyCxUy_MH = (uyMH * qyA * qxC) / QQy;
215+
double v2AxCxUx_MH = (uxMH * qxA * qxC) / QQx;
216+
double v2AyCyUx_MH = (uxMH * qyA * qyC) / QQy;
217+
double v2AxCyUy_MH = (uyMH * qxA * qyC) / QQx;
218+
double v2AyCxUy_MH = (uyMH * qyA * qxC) / QQy;
222219

223-
registry.fill(HIST("flow/v1A"), track.eta(), v1A);
224-
registry.fill(HIST("flow/v1C"), track.eta(), v1C);
225-
226-
registry.fill(HIST("flow/v2AxCxUx_MH"), centrality, v2AxCxUx_MH);
227-
registry.fill(HIST("flow/v2AyCyUx_MH"), centrality, v2AyCyUx_MH);
228-
registry.fill(HIST("flow/v2AxCyUy_MH"), centrality, v2AxCyUy_MH);
229-
registry.fill(HIST("flow/v2AyCxUy_MH"), centrality, v2AyCxUy_MH);
220+
registry.fill(HIST("flow/v1A"), track.eta(), v1A);
221+
registry.fill(HIST("flow/v1C"), track.eta(), v1C);
230222

223+
registry.fill(HIST("flow/v2AxCxUx_MH"), centrality, v2AxCxUx_MH);
224+
registry.fill(HIST("flow/v2AyCyUx_MH"), centrality, v2AyCyUx_MH);
225+
registry.fill(HIST("flow/v2AxCyUy_MH"), centrality, v2AxCyUy_MH);
226+
registry.fill(HIST("flow/v2AyCxUy_MH"), centrality, v2AyCxUy_MH);
227+
}
231228
}
232-
}
233-
234229
};
235230

236231
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

0 commit comments

Comments
 (0)