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
13 * @ingroup pwglf_forward_flow
15 #include "AliAnalysisTaskSE.h"
17 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 * Returns the outputlist
89 TList* GetOutputList() { return fOutputList; }
91 * Set which harmonics to calculate. @f$ v_{1}@f$ to @f$ v_{4}@f$ is
92 * available and calculated as default
94 * @param v2 Do @f$ v_{2}$f$
95 * @param v3 Do @f$ v_{3}$f$
96 * @param v4 Do @f$ v_{4}$f$
97 * @param v5 Do @f$ v_{5}$f$
98 * @param v6 Do @f$ v_{6}$f$
102 void SetDoHarmonics(Bool_t v2 = kTRUE,
103 Bool_t v3 = kTRUE, Bool_t v4 = kTRUE,
104 Bool_t v5 = kTRUE, Bool_t v6 = kTRUE) {
105 fv[2] = v2; fv[3] = v3; fv[4] = v4; fv[5] = v5; fv[6] = v6;}
107 * Set non-default vertex binning and range
109 * @param axis Use this vtx axis
113 void SetVertexAxis(TAxis* axis) { fVtxAxis = axis; }
115 * Set detector sigma cuts
117 * @param fmdCut FMD sigma cut
118 * @param spdCut SPD sigma cut
122 void SetDetectorCuts(Double_t fmdCut, Double_t spdCut) { fFMDCut = fmdCut; fSPDCut = spdCut; }
124 * Nested class to handle cumulant calculations in vertex bins
126 class VertexBin : public TNamed
136 * @param vLow Min vertex z-coordinate
137 * @param vHigh Max vertex z-coordinate
138 * @param moment Flow moment
139 * @param type Data type (FMD/SPD/FMDTR/SPDTR/MC)
140 * @parma sym Data is symmetric in eta
142 VertexBin(Int_t vLow, Int_t vHigh,
143 UShort_t moment, TString type,
144 Bool_t sym = kTRUE, Double_t cut = -1);
148 * @param o Object to copy from
152 VertexBin(const VertexBin& o);
154 * Assignment operator
160 VertexBin& operator=(const VertexBin&);
166 * Add vertex bin output to list
168 * @param list Histograms are added to this list
172 virtual void AddOutput(TList* list);
174 * Fill reference and differential flow histograms for analysis
176 * @param dNdetadphi 2D data histogram
178 * @return false if bad event (det. hotspot)
180 Bool_t FillHists(const TH2D& dNdetadphi, Double_t fCent);
182 * Do cumulants calculations for current event with
185 * @param cent Event centrality
189 void CumulantsAccumulate(Double_t cent);
191 * Finish cumulants calculations. Takes input and
192 * output lists in case Terminate is called separately
194 * @param inlist List with input histograms
195 * @param outlist List with output histograms
199 void CumulantsTerminate(TList* inlist, TList* outlist);
203 * Enumeration for ref/diff histograms
205 enum { kHmult = 1, kHQnRe, kHQnIm, kHQ2nRe, kHQ2nIm };
207 * Enumeration for cumulant histograms
236 * Set centrality axis
238 * @param axis Centrality axis
242 void SetupCentAxis(TAxis* axis);
244 const UShort_t fMoment; // flow moment
245 const Int_t fVzMin; // z-vertex min must be in whole [cm]
246 const Int_t fVzMax; // z-vertex max must be in whoe [cm]
247 TString fType; // data type
248 const Bool_t fSymEta; // Use forward-backward symmetry, if detector allows it
249 const Double_t fSigmaCut; // Detector specific cut for outlier events
250 TH2D* fCumuRef; // histogram for reference flow
251 TH2D* fCumuDiff; // histogram for differential flow
252 TH3D* fCumuHist; // histogram for cumulants calculations
253 TH2F* fdNdedpAcc; // Diagnostics histogram to make acc. maps
254 TH2F* fOutliers; // Sigma <M> histogram
255 UShort_t fDebug; // Debug flag
257 ClassDef(VertexBin, 1); // object for cumulants ananlysis in FMD
260 static Bool_t fgDispVtx; // static flag for disp vtx
266 * @param o Object to copy from
268 AliForwardFlowTaskQC(const AliForwardFlowTaskQC& o);
270 * Assignment operator
272 * @return Reference to this object
274 AliForwardFlowTaskQC& operator=(const AliForwardFlowTaskQC&);
276 * Initiate vertex bin objects
278 virtual void InitVertexBins();
280 * Initiate diagnostics histograms
282 virtual void InitHists();
286 virtual Bool_t Analyze();
290 virtual void Finalize();
292 * Loops of vertex bins in list and runs analysis on those for current vertex
294 * @param list List of vertex bins
295 * @param h dN/detadphi histogram
296 * @param vtx Current vertex bin
298 * @return true on success
300 Bool_t FillVtxBinList(const TList& list, const TH2D& h, Int_t vtx) const;
302 * Loops over VertexBin list and calls terminate on each
304 * @param list VertexBin list
306 void EndVtxBinList(const TList& list) const;
308 * Projects a list of TProfile2D's with flow
309 * results to TH1's in centrality bins
311 * @param list List of flow results
315 void MakeCentralityHists(TList* list);
317 * Check AODevent object for trigger, vertex and centrality
318 * returns true if event is OK
320 * @param aodfm AliAODForwardMultObject
324 Bool_t CheckEvent(const AliAODForwardMult* aodfm);
326 * Check trigger from AODForwardMult object
327 * returns true if offline trigger is present
329 * @param aodfm AliAODForwardMultObject
333 virtual Bool_t CheckTrigger(const AliAODForwardMult* aodfm) const;
335 * Check for centrality in AliAODForwardMult object,
336 * if present return true - also sets fCent value
338 * @param aodfm AliAODForwardMultObject
342 virtual Bool_t GetCentrality(const AliAODForwardMult* aodfm);
344 * Check for vertex in AliAODForwardMult
345 * returns true if in range of fVtxAXis, also sets fVtx value
347 * @param aodfm AliAODForwardMultObject
351 virtual Bool_t GetVertex(const AliAODForwardMult* aodfm);
353 * Print the setup of the task
357 virtual void PrintFlowSetup() const;
359 TAxis* fVtxAxis; // Axis to control vertex binning
360 Double_t fFMDCut; // FMD sigma cut for outlier events
361 Double_t fSPDCut; // SPD sigma cut for outlier events
362 TList fBinsFMD; // list with FMD VertexBin objects
363 TList fBinsSPD; // list with SPD VertexBin objects
364 TList* fSumList; // sum list
365 TList* fOutputList; // Output list
366 AliAODEvent* fAOD; // AOD event
367 Bool_t fv[7]; // Calculate v_{n} flag
368 Float_t fVtx; // Z vertex bin
369 Double_t fCent; // Centrality
370 TH1D* fHistCent; // Diagnostics hist for centrality
371 TH1D* fHistVertexSel; // Diagnostics hist for selected vertices
373 ClassDef(AliForwardFlowTaskQC, 1); // Analysis task for FMD analysis