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"
18 class AliAODForwardMult;
25 * @defgroup pwglf_forward_tasks_flow Flow tasks
27 * Code to do with flow
29 * @ingroup pwglf_forward_tasks
32 * Calculate the flow in the forward regions using the Q cumulants method
38 * - AnalysisResults.root
40 * @ingroup pwglf_forward_tasks_flow
41 * @ingroup pwglf_forward_flow
44 class AliForwardFlowTaskQC : public AliAnalysisTaskSE
50 AliForwardFlowTaskQC();
54 * @param name Name of task
56 AliForwardFlowTaskQC(const char* name);
60 virtual ~AliForwardFlowTaskQC() {}
63 * @name Task interface methods
66 * Create output objects
68 virtual void UserCreateOutputObjects();
72 virtual void Init() {}
76 * @param option Not used
78 virtual void UserExec(Option_t *option);
82 * @param option Not used
84 virtual void Terminate(Option_t *option);
87 * Returns the outputlist
91 TList* GetOutputList() { return fOutputList; }
93 * Set which flow moments to calculate.
95 * @param n Do @f$ v_{n}@f$
99 void AddFlowMoment(Short_t n);
101 * Set non-default vertex binning and range
103 * @param axis Use this vtx axis
105 void SetVertexAxis(TAxis* axis) { fVtxAxis = axis; }
107 * Set detector sigma cuts
109 * @param fmdCut FMD sigma cut
110 * @param spdCut SPD sigma cut
112 void SetDetectorCuts(Double_t fmdCut, Double_t spdCut) { fFMDCut = fmdCut; fSPDCut = spdCut; }
114 * Set flow flags, @f$\eta@f$-gap, sym. around @f$\eta=0@f$ or
115 * sat. vtx. interactions
117 * @param flags EFlowFlags
119 void SetFlowFlags(UShort_t flags) { fFlowFlags = flags; }
121 * Enum for flow flags
129 * Set @f$|\eta|@f$ value to make cut for @f$\eta@f$ gap at
131 * @param eg gap value
133 void SetEtaGapValue(Double_t eg) { fEtaGap = eg; }
136 * Enum for reference flow (eta-gap) mode
143 // ----------------- Being nested class ---------------------
145 * Nested class to handle cumulant calculations in vertex bins
147 class VertexBin : public TNamed
157 * @param vLow Min vertex z-coordinate
158 * @param vHigh Max vertex z-coordinate
159 * @param moment Flow moment
160 * @param type Data type (FMD/SPD/FMDTR/SPDTR/MC)
162 * @param cut Cut value
163 * @param etaGap @f$\eta@f$ gap
165 VertexBin(Int_t vLow, Int_t vHigh,
166 UShort_t moment, TString type,
167 UShort_t flags = kSymEta,
168 Double_t cut = -1, Double_t etaGap = 2.);
172 * @param o Object to copy from
176 VertexBin(const VertexBin& o);
178 * Assignment operator
180 * @param v Object to assing from
182 * @return reference to this
184 VertexBin& operator=(const VertexBin& v);
190 * Add vertex bin output to list
192 * @param list Histograms are added to this list
196 virtual void AddOutput(TList* list);
198 * Fill reference and differential flow histograms for analysis
200 * @param dNdetadphi 2D data histogram
201 * @param cent Centrality
202 * @param mode fill ref/diff or both
204 * @return false if bad event (det. hotspot)
206 Bool_t FillHists(const TH2D& dNdetadphi, Double_t cent, EFillFlow mode = kFillBoth);
208 * Do cumulants calculations for current event with
211 * @param cent Event centrality
212 * @param skipFourP Skip ?
216 void CumulantsAccumulate(Double_t cent, Bool_t skipFourP = kFALSE);
218 * Finish cumulants calculations. Takes input and
219 * output lists in case Terminate is called separately
221 * @param inlist List with input histograms
222 * @param outlist List with output histograms
226 void CumulantsTerminate(TList* inlist, TList* outlist);
230 * Enumeration for ref/diff histograms
232 enum { kHmultA = 1, kHmultB, kHQnReA, kHQnImA, kHQnReB, kHQnImB, kHQ2nRe, kHQ2nIm };
234 * Enumeration for cumulant histograms
266 * Set centrality axis
268 * @param axis Centrality axis
272 void SetupCentAxis(TAxis* axis);
274 const UShort_t fMoment; // flow moment
275 const Int_t fVzMin; // z-vertex min must be in whole [cm]
276 const Int_t fVzMax; // z-vertex max must be in whoe [cm]
277 TString fType; // data type
278 const UShort_t fFlags; // Flow flags, e.g., eta-gap sat. vtx
279 const Double_t fSigmaCut; // Detector specific cut for outlier events
280 const Double_t fEtaGap; // Eta gap value
281 TH2D* fCumuRef; // histogram for reference flow
282 TH2D* fCumuDiff; // histogram for differential flow
283 TH3D* fCumuHist; // histogram for cumulants calculations
284 TH2F* fdNdedpAcc; // Diagnostics histogram to make acc. maps
285 TH2F* fOutliers; // Sigma <M> histogram
286 UShort_t fDebug; // Debug flag
288 ClassDef(VertexBin, 3); // object for cumulants ananlysis in FMD
290 // ---------- End of nested class -------------
294 * @param o Object to copy from
296 AliForwardFlowTaskQC(const AliForwardFlowTaskQC& o);
298 * Assignment operator
300 * @return Reference to this object
302 AliForwardFlowTaskQC& operator=(const AliForwardFlowTaskQC&);
304 * Initiate vertex bin objects
306 virtual void InitVertexBins();
308 * Initiate diagnostics histograms
310 virtual void InitHists();
314 * @return true on success
316 virtual Bool_t Analyze();
320 virtual void Finalize();
322 * Loops of vertex bins in list and runs analysis on those for current vertex
324 * @param list List of vertex bins
325 * @param h dN/detadphi histogram
326 * @param vtx Current vertex bin
328 * @return true on success
330 Bool_t FillVtxBinList(const TList& list, const TH2D& h, Int_t vtx) const;
332 * Loops of vertex bins in list and runs analysis on those for current vertex
334 * @param list List of vertex bins
335 * @param href dN/detadphi histogram for ref flow
336 * @param hdiff dN/detadphi histogram for diff flow
337 * @param vtx Current vertex bin
339 * @return true on success
341 Bool_t FillVtxBinListEtaGap(const TList& list, const TH2D& href, const TH2D& hdiff, Int_t vtx) const;
344 * Loops over VertexBin list and calls terminate on each
346 * @param list VertexBin list
348 void EndVtxBinList(const TList& list) const;
350 * Projects a list of TProfile2D's with flow
351 * results to TH1's in centrality bins
353 * @param list List of flow results
357 void MakeCentralityHists(TList* list);
359 * Check AODevent object for trigger, vertex and centrality
360 * returns true if event is OK
362 * @param aodfm AliAODForwardMultObject
366 Bool_t CheckEvent(const AliAODForwardMult* aodfm);
368 * Check trigger from AODForwardMult object
369 * returns true if offline trigger is present
371 * @param aodfm AliAODForwardMultObject
375 virtual Bool_t CheckTrigger(const AliAODForwardMult* aodfm) const;
377 * Check for centrality in AliAODForwardMult object,
378 * if present return true - also sets fCent value
380 * @param aodfm AliAODForwardMultObject
384 virtual Bool_t GetCentrality(const AliAODForwardMult* aodfm);
386 * Check for vertex in AliAODForwardMult
387 * returns true if in range of fVtxAXis, also sets fVtx value
389 * @param aodfm AliAODForwardMultObject
393 virtual Bool_t GetVertex(const AliAODForwardMult* aodfm);
395 * Make diagnostics hitogram
399 void MakeQualityHist(const Char_t* name) const;
401 * Print the setup of the task
405 virtual void PrintFlowSetup() const;
407 TAxis* fVtxAxis; // Axis to control vertex binning
408 Double_t fFMDCut; // FMD sigma cut for outlier events
409 Double_t fSPDCut; // SPD sigma cut for outlier events
410 UShort_t fFlowFlags; // Flow flags, e.g., eta-gap, sat. vtx.
411 Double_t fEtaGap; // Eta gap value
412 TList fBinsFMD; // list with FMD VertexBin objects
413 TList fBinsSPD; // list with SPD VertexBin objects
414 TList* fSumList; // sum list
415 TList* fOutputList; // Output list
416 AliAODEvent* fAOD; // AOD event
417 TArrayI fV; // Calculate v_{n} flag
418 Float_t fVtx; // Z vertex bin
419 Double_t fCent; // Centrality
420 TH1D* fHistCent; // Diagnostics hist for centrality
421 TH1D* fHistVertexSel; // Diagnostics hist for selected vertices
423 ClassDef(AliForwardFlowTaskQC, 3); // Analysis task for FMD analysis