2 // Calculate the flow in the forward regions using the Q cumulants method
4 #ifndef ALIFORWARDFLOWTASKQC_H
5 #define ALIFORWARDFLOWTASKQC_H
7 * @file AliForwardFlowTaskQC.h
8 * @author Alexander Hansen
9 * @date Tue Feb 14 2012
14 * @ingroup pwglf_forward_flow
16 #include "AliAnalysisTaskSE.h"
18 class AliAODForwardMult;
25 * @defgroup pwglf_forward_tasks_flow Flow tasks
26 * @ingroup pwglf_forward_tasks
29 * Calculate the flow in the forward regions using the Q cumulants method
35 * - AnalysisResults.root
37 * @ingroup pwglf_forward_tasks_flow
38 * @ingroup pwglf_forward_flow
42 class AliForwardFlowTaskQC : public AliAnalysisTaskSE
48 AliForwardFlowTaskQC();
52 * @param name Name of task
54 AliForwardFlowTaskQC(const char* name);
58 virtual ~AliForwardFlowTaskQC() {}
61 * @name Task interface methods
64 * Create output objects
66 virtual void UserCreateOutputObjects();
70 virtual void Init() {}
74 * @param option Not used
76 virtual void UserExec(Option_t *option);
80 * @param option Not used
82 virtual void Terminate(Option_t *option);
85 * Loops of vertex bins in list and runs analysis on those for current vertex
87 * @param list List of vertex bins
88 * @param h dN/detadphi histogram
89 * @param vtx Current vertex bin
91 * @return true on success
93 Bool_t FillVtxBinList(const TList& list, const TH2D& h, Int_t vtx) const;
95 * Loops over VertexBin list and calls terminate on each
97 * @param list VertexBin list
99 void EndVtxBinList(const TList& list) const;
101 * Returns the outputlist
105 TList* GetOutputList() { return fOutputList; }
107 * Check AODevent object for trigger, vertex and centrality
108 * returns true if event is OK
110 * @param aodfm AliAODForwardMultObject
114 Bool_t CheckEvent(const AliAODForwardMult* aodfm);
116 * Check trigger from AODForwardMult object
117 * returns true if offline trigger is present
119 * @param aodfm AliAODForwardMultObject
123 virtual Bool_t CheckTrigger(const AliAODForwardMult* aodfm) const;
125 * Check for centrality in AliAODForwardMult object,
126 * if present return true - also sets fCent value
128 * @param aodfm AliAODForwardMultObject
132 virtual Bool_t GetCentrality(const AliAODForwardMult* aodfm);
134 * Check for vertex in AliAODForwardMult
135 * returns true if in range of fVtxAXis, also sets fVtx value
137 * @param aodfm AliAODForwardMultObject
141 virtual Bool_t GetVertex(const AliAODForwardMult* aodfm);
143 * Set which harmonics to calculate. @f$ v_{1}@f$ to @f$ v_{4}@f$ is
144 * available and calculated as default
146 * @param v1 Do @f$ v_{1}$f$
147 * @param v2 Do @f$ v_{2}$f$
148 * @param v3 Do @f$ v_{3}$f$
149 * @param v4 Do @f$ v_{4}$f$
150 * @param v5 Do @f$ v_{5}$f$
151 * @param v6 Do @f$ v_{6}$f$
155 void SetDoHarmonics(Bool_t v1 = kTRUE, Bool_t v2 = kTRUE,
156 Bool_t v3 = kTRUE, Bool_t v4 = kTRUE,
157 Bool_t v5 = kTRUE, Bool_t v6 = kTRUE) {
158 fv[1] = v1; fv[2] = v2; fv[3] = v3; fv[4] = v4; fv[5] = v5; fv[6] = v6;}
160 * Set non-default vertex binning and range
162 * @param axis Use this vtx axis
166 void SetVertexAxis(TAxis* axis) { fVtxAxis = axis; }
168 * Nested class to handle cumulant calculations in vertex bins
170 class VertexBin : public TNamed
180 * @param vLow Min vertex z-coordinate
181 * @param vHigh Max vertex z-coordinate
182 * @param moment Flow moment
183 * @param type Data type (FMD/SPD/FMDTR/SPDTR/MC)
184 * @parma sym Data is symmetric in eta
186 VertexBin(Int_t vLow, Int_t vHigh,
187 UShort_t moment, TString type,
192 * @param o Object to copy from
196 VertexBin(const VertexBin& o);
198 * Assignment operator
204 VertexBin& operator=(const VertexBin&);
210 * Add vertex bin output to list
212 * @param list Histograms are added to this list
216 virtual void AddOutput(TList* list);
218 * Fill reference and differential flow histograms for analysis
220 * @param dNdetadphi 2D data histogram
222 * @return false if bad event (det. hotspot)
224 Bool_t FillHists(const TH2D& dNdetadphi);
226 * Do cumulants calculations for current event with
229 * @param cent Event centrality
233 void CumulantsAccumulate(Double_t cent);
235 * Finish cumulants calculations. Takes input and
236 * output lists in case Terminate is called separately
238 * @param inlist List with input histograms
239 * @param outlist List with output histograms
243 void CumulantsTerminate(TList* inlist, TList* outlist);
247 * Enumeration for ref/diff histograms
249 enum { kHmult = 1, kHQnRe, kHQnIm, kHQ2nRe, kHQ2nIm };
251 * Enumeration for cumulant histograms
280 const UShort_t fMoment; // flow moment
281 const Int_t fVzMin; // z-vertex min must be in whole [cm]
282 const Int_t fVzMax; // z-vertex max must be in whoe [cm]
283 TString fType; // data type
284 const Bool_t fSymEta; // Use forward-backward symmetry, if detector allows it
285 TH2D* fCumuRef; // histogram for reference flow
286 TH2D* fCumuDiff; // histogram for differential flow
287 TH3D* fCumuHist; // histogram for cumulants calculations
288 TH2D* fdNdedpAcc; // Diagnostics histogram to make acc. maps
289 UShort_t fDebug; // Debug flag
291 ClassDef(VertexBin, 1); // object for cumulants ananlysis in FMD
298 * @param o Object to copy from
300 AliForwardFlowTaskQC(const AliForwardFlowTaskQC& o);
302 * Assignment operator
304 * @return Reference to this object
306 AliForwardFlowTaskQC& operator=(const AliForwardFlowTaskQC&);
308 * Initiate vertex bin objects
310 virtual void InitVertexBins();
312 * Initiate diagnostics histograms
314 virtual void InitHists();
318 virtual Bool_t Analyze();
322 virtual void Finalize();
324 TAxis* fVtxAxis; // Axis to control vertex binning
325 TList fBinsFMD; // list with FMD VertexBin objects
326 TList fBinsSPD; // list with SPD VertexBin objects
327 TList* fSumList; // sum list
328 TList* fOutputList; // Output list
329 AliAODEvent* fAOD; // AOD event
330 Bool_t fv[7]; // Calculate v_{n} flag
331 Float_t fVtx; // Z vertex bin
332 Double_t fCent; // Centrality
333 TH1D* fHistCent; // Diagnostics hist for centrality
334 TH1D* fHistVertexSel; // Diagnostics hist for selected vertices
335 TH1D* fHistVertexAll; // Diagnostics hist for all vertices
337 ClassDef(AliForwardFlowTaskQC, 1); // Analysis task for FMD analysis