]>
Commit | Line | Data |
---|---|---|
d2bea14e | 1 | // |
2 | // Calculate the flow in the forward regions using the Q cumulants method | |
3 | // | |
4 | #ifndef ALIFORWARDFLOWTASKQC_H | |
5 | #define ALIFORWARDFLOWTASKQC_H | |
ffca499d | 6 | /** |
2b556440 | 7 | * @file AliForwardFlowTaskQC.h |
8 | * @author Alexander Hansen | |
ffca499d | 9 | * |
2b556440 | 10 | * @brief |
ffca499d | 11 | * |
12 | * | |
bd6f5206 | 13 | * @ingroup pwglf_forward_flow |
ffca499d | 14 | */ |
d2bea14e | 15 | #include "AliAnalysisTaskSE.h" |
4b5b52b7 | 16 | #include "TString.h" |
2b556440 | 17 | class AliAODForwardMult; |
18 | class TH1D; | |
d420e249 | 19 | class TH2F; |
2b556440 | 20 | class TH2D; |
21 | class TH3D; | |
4b5b52b7 | 22 | class TAxis; |
290052e7 | 23 | /** |
bd6f5206 | 24 | * @defgroup pwglf_forward_tasks_flow Flow tasks |
290052e7 | 25 | * |
26 | * Code to do with flow | |
27 | * | |
bd6f5206 | 28 | * @ingroup pwglf_forward_tasks |
ffca499d | 29 | */ |
d2bea14e | 30 | /** |
31 | * Calculate the flow in the forward regions using the Q cumulants method | |
32 | * | |
33 | * @par Inputs: | |
34 | * - AliAODEvent | |
35 | * | |
36 | * Outputs: | |
37 | * - AnalysisResults.root | |
38 | * | |
bd6f5206 | 39 | * @ingroup pwglf_forward_tasks_flow |
40 | * @ingroup pwglf_forward_flow | |
d2bea14e | 41 | * |
42 | */ | |
43 | class AliForwardFlowTaskQC : public AliAnalysisTaskSE | |
44 | { | |
45 | public: | |
46 | /** | |
47 | * Constructor | |
48 | */ | |
9d05ffeb | 49 | AliForwardFlowTaskQC(); |
d2bea14e | 50 | /** |
51 | * Constructor | |
52 | * | |
53 | * @param name Name of task | |
54 | */ | |
9d05ffeb | 55 | AliForwardFlowTaskQC(const char* name); |
d2bea14e | 56 | /** |
57 | * Destructor | |
58 | */ | |
ffca499d | 59 | virtual ~AliForwardFlowTaskQC() {} |
9d05ffeb | 60 | /** |
d2bea14e | 61 | * @{ |
ffca499d | 62 | * @name Task interface methods |
d2bea14e | 63 | */ |
64 | /** | |
65 | * Create output objects | |
d2bea14e | 66 | */ |
9453b19e | 67 | virtual void UserCreateOutputObjects(); |
d2bea14e | 68 | /** |
69 | * Initialize the task | |
d2bea14e | 70 | */ |
2b556440 | 71 | virtual void Init() {} |
d2bea14e | 72 | /** |
73 | * Process each event | |
74 | * | |
75 | * @param option Not used | |
76 | */ | |
9d05ffeb | 77 | virtual void UserExec(Option_t *option); |
d2bea14e | 78 | /** |
79 | * End of job | |
80 | * | |
81 | * @param option Not used | |
82 | */ | |
9d05ffeb | 83 | virtual void Terminate(Option_t *option); |
ffca499d | 84 | /* @} */ |
2b556440 | 85 | /** |
d2bea14e | 86 | * Returns the outputlist |
2b556440 | 87 | * |
88 | * @return TList* | |
4b5b52b7 | 89 | */ |
9d05ffeb | 90 | TList* GetOutputList() { return fOutputList; } |
4b5b52b7 | 91 | /** |
ffca499d | 92 | * Set which harmonics to calculate. @f$ v_{1}@f$ to @f$ v_{4}@f$ is |
93 | * available and calculated as default | |
2b556440 | 94 | * |
290052e7 | 95 | * @param v2 Do @f$ v_{2}@f$ |
96 | * @param v3 Do @f$ v_{3}@f$ | |
97 | * @param v4 Do @f$ v_{4}@f$ | |
98 | * @param v5 Do @f$ v_{5}@f$ | |
99 | * @param v6 Do @f$ v_{6}@f$ | |
2b556440 | 100 | * |
101 | * @return void | |
d2bea14e | 102 | */ |
d420e249 | 103 | void SetDoHarmonics(Bool_t v2 = kTRUE, |
d226802c | 104 | Bool_t v3 = kTRUE, Bool_t v4 = kTRUE, |
290052e7 | 105 | Bool_t v5 = kTRUE, Bool_t v6 = kTRUE) |
106 | { | |
107 | fv[2] = v2; fv[3] = v3; fv[4] = v4; fv[5] = v5; fv[6] = v6; | |
108 | } | |
109 | /** | |
4b5b52b7 | 110 | * Set non-default vertex binning and range |
111 | * | |
112 | * @param axis Use this vtx axis | |
4b5b52b7 | 113 | */ |
114 | void SetVertexAxis(TAxis* axis) { fVtxAxis = axis; } | |
290052e7 | 115 | /** |
d420e249 | 116 | * Set detector sigma cuts |
117 | * | |
118 | * @param fmdCut FMD sigma cut | |
119 | * @param spdCut SPD sigma cut | |
d420e249 | 120 | */ |
121 | void SetDetectorCuts(Double_t fmdCut, Double_t spdCut) { fFMDCut = fmdCut; fSPDCut = spdCut; } | |
290052e7 | 122 | /** |
123 | * Nested class to handle cumulant calculations in vertex bins | |
124 | */ | |
2b556440 | 125 | class VertexBin : public TNamed |
126 | { | |
290052e7 | 127 | public: |
2b556440 | 128 | /* |
129 | * Constructor | |
130 | */ | |
131 | VertexBin(); | |
4b5b52b7 | 132 | /** |
133 | * Constructor | |
134 | * | |
135 | * @param vLow Min vertex z-coordinate | |
136 | * @param vHigh Max vertex z-coordinate | |
137 | * @param moment Flow moment | |
138 | * @param type Data type (FMD/SPD/FMDTR/SPDTR/MC) | |
290052e7 | 139 | * @param sym Data is symmetric in eta |
140 | * @param cut Cut value | |
4b5b52b7 | 141 | */ |
142 | VertexBin(Int_t vLow, Int_t vHigh, | |
143 | UShort_t moment, TString type, | |
d420e249 | 144 | Bool_t sym = kTRUE, Double_t cut = -1); |
4b5b52b7 | 145 | /** |
146 | * Copy constructor | |
147 | * | |
148 | * @param o Object to copy from | |
149 | * | |
150 | * @return VertexBin | |
151 | */ | |
2b556440 | 152 | VertexBin(const VertexBin& o); |
4b5b52b7 | 153 | /** |
154 | * Assignment operator | |
155 | * | |
290052e7 | 156 | * @param v Object to assing from |
4b5b52b7 | 157 | * |
290052e7 | 158 | * @return reference to this |
4b5b52b7 | 159 | */ |
290052e7 | 160 | VertexBin& operator=(const VertexBin& v); |
4b5b52b7 | 161 | /** |
162 | * Destructor | |
163 | */ | |
2b556440 | 164 | ~VertexBin(){} |
4b5b52b7 | 165 | /** |
166 | * Add vertex bin output to list | |
167 | * | |
168 | * @param list Histograms are added to this list | |
169 | * | |
170 | * @return void | |
171 | */ | |
2b556440 | 172 | virtual void AddOutput(TList* list); |
4b5b52b7 | 173 | /** |
174 | * Fill reference and differential flow histograms for analysis | |
175 | * | |
176 | * @param dNdetadphi 2D data histogram | |
290052e7 | 177 | * @param fCent Centrality |
4b5b52b7 | 178 | * |
179 | * @return false if bad event (det. hotspot) | |
180 | */ | |
d420e249 | 181 | Bool_t FillHists(const TH2D& dNdetadphi, Double_t fCent); |
4b5b52b7 | 182 | /** |
183 | * Do cumulants calculations for current event with | |
184 | * centrality cent | |
185 | * | |
186 | * @param cent Event centrality | |
187 | * | |
188 | * @return void | |
189 | */ | |
2b556440 | 190 | void CumulantsAccumulate(Double_t cent); |
4b5b52b7 | 191 | /** |
192 | * Finish cumulants calculations. Takes input and | |
193 | * output lists in case Terminate is called separately | |
194 | * | |
195 | * @param inlist List with input histograms | |
196 | * @param outlist List with output histograms | |
197 | * | |
198 | * @return void | |
199 | */ | |
2b556440 | 200 | void CumulantsTerminate(TList* inlist, TList* outlist); |
201 | ||
290052e7 | 202 | protected: |
4b5b52b7 | 203 | /* |
204 | * Enumeration for ref/diff histograms | |
205 | */ | |
2b556440 | 206 | enum { kHmult = 1, kHQnRe, kHQnIm, kHQ2nRe, kHQ2nIm }; |
4b5b52b7 | 207 | /* |
2a276c75 | 208 | * Enumeration for cumulant histograms |
4b5b52b7 | 209 | */ |
2a276c75 | 210 | enum { kW2Two = 1, |
211 | kW2, | |
212 | kW4Four, | |
213 | kW4, | |
214 | kQnRe, | |
215 | kQnIm, | |
216 | kM, | |
217 | kCosphi1phi2, | |
218 | kSinphi1phi2, | |
219 | kCosphi1phi2phi3m, | |
220 | kSinphi1phi2phi3m, | |
221 | kMm1m2, | |
222 | kw2two, | |
223 | kw2, | |
224 | kw4four, | |
225 | kw4, | |
226 | kpnRe, | |
227 | kpnIm, | |
228 | kmp, | |
229 | kCospsi1phi2, | |
230 | kSinpsi1phi2, | |
231 | kCospsi1phi2phi3m, | |
232 | kSinpsi1phi2phi3m, | |
233 | kmpmq, | |
234 | kCospsi1phi2phi3p, | |
235 | kSinpsi1phi2phi3p }; | |
d420e249 | 236 | /** |
237 | * Set centrality axis | |
238 | * | |
239 | * @param axis Centrality axis | |
240 | * | |
241 | * @return void | |
242 | */ | |
243 | void SetupCentAxis(TAxis* axis); | |
2b556440 | 244 | |
d420e249 | 245 | const UShort_t fMoment; // flow moment |
246 | const Int_t fVzMin; // z-vertex min must be in whole [cm] | |
247 | const Int_t fVzMax; // z-vertex max must be in whoe [cm] | |
248 | TString fType; // data type | |
249 | const Bool_t fSymEta; // Use forward-backward symmetry, if detector allows it | |
250 | const Double_t fSigmaCut; // Detector specific cut for outlier events | |
251 | TH2D* fCumuRef; // histogram for reference flow | |
252 | TH2D* fCumuDiff; // histogram for differential flow | |
253 | TH3D* fCumuHist; // histogram for cumulants calculations | |
254 | TH2F* fdNdedpAcc; // Diagnostics histogram to make acc. maps | |
255 | TH2F* fOutliers; // Sigma <M> histogram | |
256 | UShort_t fDebug; // Debug flag | |
2b556440 | 257 | |
5934a3e3 | 258 | ClassDef(VertexBin, 2); // object for cumulants ananlysis in FMD |
2b556440 | 259 | }; |
260 | ||
d420e249 | 261 | static Bool_t fgDispVtx; // static flag for disp vtx |
262 | ||
ffca499d | 263 | protected: |
d2bea14e | 264 | /** |
ffca499d | 265 | * Copy constructor |
266 | * | |
267 | * @param o Object to copy from | |
d2bea14e | 268 | */ |
ffca499d | 269 | AliForwardFlowTaskQC(const AliForwardFlowTaskQC& o); |
270 | /** | |
271 | * Assignment operator | |
272 | * | |
273 | * @return Reference to this object | |
274 | */ | |
2b556440 | 275 | AliForwardFlowTaskQC& operator=(const AliForwardFlowTaskQC&); |
290052e7 | 276 | /** |
2b556440 | 277 | * Initiate vertex bin objects |
d2bea14e | 278 | */ |
2b556440 | 279 | virtual void InitVertexBins(); |
290052e7 | 280 | /** |
2b556440 | 281 | * Initiate diagnostics histograms |
282 | */ | |
283 | virtual void InitHists(); | |
290052e7 | 284 | /** |
2b556440 | 285 | * Analyze event |
290052e7 | 286 | * |
287 | * @return true on success | |
2b556440 | 288 | */ |
289 | virtual Bool_t Analyze(); | |
290052e7 | 290 | /** |
2b556440 | 291 | * Finalize analysis |
9d05ffeb | 292 | */ |
2b556440 | 293 | virtual void Finalize(); |
d420e249 | 294 | /** |
295 | * Loops of vertex bins in list and runs analysis on those for current vertex | |
296 | * | |
297 | * @param list List of vertex bins | |
298 | * @param h dN/detadphi histogram | |
299 | * @param vtx Current vertex bin | |
300 | * | |
301 | * @return true on success | |
302 | */ | |
303 | Bool_t FillVtxBinList(const TList& list, const TH2D& h, Int_t vtx) const; | |
304 | /** | |
305 | * Loops over VertexBin list and calls terminate on each | |
306 | * | |
307 | * @param list VertexBin list | |
308 | */ | |
309 | void EndVtxBinList(const TList& list) const; | |
310 | /** | |
311 | * Projects a list of TProfile2D's with flow | |
312 | * results to TH1's in centrality bins | |
313 | * | |
314 | * @param list List of flow results | |
315 | * | |
316 | * @return void | |
317 | */ | |
318 | void MakeCentralityHists(TList* list); | |
319 | /** | |
320 | * Check AODevent object for trigger, vertex and centrality | |
321 | * returns true if event is OK | |
322 | * | |
323 | * @param aodfm AliAODForwardMultObject | |
324 | * | |
325 | * @return Bool_t | |
326 | */ | |
327 | Bool_t CheckEvent(const AliAODForwardMult* aodfm); | |
328 | /** | |
329 | * Check trigger from AODForwardMult object | |
330 | * returns true if offline trigger is present | |
331 | * | |
332 | * @param aodfm AliAODForwardMultObject | |
333 | * | |
334 | * @return Bool_t | |
335 | */ | |
336 | virtual Bool_t CheckTrigger(const AliAODForwardMult* aodfm) const; | |
337 | /** | |
338 | * Check for centrality in AliAODForwardMult object, | |
339 | * if present return true - also sets fCent value | |
340 | * | |
341 | * @param aodfm AliAODForwardMultObject | |
342 | * | |
343 | * @return Bool_t | |
344 | */ | |
345 | virtual Bool_t GetCentrality(const AliAODForwardMult* aodfm); | |
346 | /** | |
347 | * Check for vertex in AliAODForwardMult | |
348 | * returns true if in range of fVtxAXis, also sets fVtx value | |
349 | * | |
350 | * @param aodfm AliAODForwardMultObject | |
351 | * | |
352 | * @return Bool_t | |
353 | */ | |
354 | virtual Bool_t GetVertex(const AliAODForwardMult* aodfm); | |
355 | /** | |
356 | * Print the setup of the task | |
357 | * | |
358 | * @return void | |
359 | */ | |
360 | virtual void PrintFlowSetup() const; | |
d2bea14e | 361 | |
d420e249 | 362 | TAxis* fVtxAxis; // Axis to control vertex binning |
363 | Double_t fFMDCut; // FMD sigma cut for outlier events | |
364 | Double_t fSPDCut; // SPD sigma cut for outlier events | |
365 | TList fBinsFMD; // list with FMD VertexBin objects | |
366 | TList fBinsSPD; // list with SPD VertexBin objects | |
367 | TList* fSumList; // sum list | |
368 | TList* fOutputList; // Output list | |
369 | AliAODEvent* fAOD; // AOD event | |
370 | Bool_t fv[7]; // Calculate v_{n} flag | |
371 | Float_t fVtx; // Z vertex bin | |
372 | Double_t fCent; // Centrality | |
373 | TH1D* fHistCent; // Diagnostics hist for centrality | |
374 | TH1D* fHistVertexSel; // Diagnostics hist for selected vertices | |
58f5fae2 | 375 | |
5934a3e3 | 376 | ClassDef(AliForwardFlowTaskQC, 2); // Analysis task for FMD analysis |
d2bea14e | 377 | }; |
d420e249 | 378 | |
d2bea14e | 379 | #endif |
380 | // Local Variables: | |
381 | // mode: C++ | |
382 | // End: |