]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/AliForwardFlowTaskQC.h
09d652c0a07c37e3a3f7c676f4429c4f17d50e9d
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AliForwardFlowTaskQC.h
1 //
2 // Calculate the flow in the forward regions using the Q cumulants method
3 //
4 #ifndef ALIFORWARDFLOWTASKQC_H
5 #define ALIFORWARDFLOWTASKQC_H
6 /**
7  * @file AliForwardFlowTaskQC.h
8  * @author Alexander Hansen
9  * @date   Tue Feb 14 2012
10  * 
11  * @brief
12  * 
13  * 
14  * @ingroup pwglf_forward_flow
15  */
16 #include "AliAnalysisTaskSE.h"
17 class AliAODForwardMult;
18 class TH1D;
19 class TH2D;
20 class TH3D;
21
22  /**
23  * @defgroup pwglf_forward_tasks_flow Flow tasks 
24  * @ingroup pwglf_forward_tasks
25  */
26 /**
27  * Calculate the flow in the forward regions using the Q cumulants method
28  *
29  * @par Inputs:
30  *   - AliAODEvent
31  *
32  * Outputs:
33  *   - AnalysisResults.root
34  *
35  * @ingroup pwglf_forward_tasks_flow
36  * @ingroup pwglf_forward_flow
37  *
38  *
39  */
40 class AliForwardFlowTaskQC : public AliAnalysisTaskSE
41 {
42 public:
43   /** 
44    * Constructor 
45    */
46   AliForwardFlowTaskQC();
47   /** 
48    * Constructor
49    * 
50    * @param name Name of task 
51    */
52   AliForwardFlowTaskQC(const char* name);
53   /**
54    * Destructor
55    */
56   virtual ~AliForwardFlowTaskQC() {}
57   /** 
58    * @{ 
59    * @name Task interface methods 
60    */
61   /** 
62    * Create output objects 
63    */
64   virtual void UserCreateOutputObjects();
65   /**
66    * Initialize the task
67    */
68   virtual void Init() {} 
69   /** 
70    * Process each event 
71    *
72    * @param option Not used
73    */  
74   virtual void UserExec(Option_t *option);
75   /** 
76    * End of job
77    * 
78    * @param option Not used 
79    */
80   virtual void Terminate(Option_t *option);
81   /* @} */
82   /**
83    * Returns the outputlist
84    * 
85    * @return TList* 
86   */
87   TList* GetOutputList() { return fOutputList; }
88  /**
89   * Check AODForwardMult object for trigger, vertex and centrality
90   * returns true if event is OK
91   * 
92   * @param const aodfm
93   * 
94   * @return Bool_t 
95   */
96   Bool_t AODCheck(const AliAODForwardMult* aodfm);
97    /*
98    * Set which harmonics to calculate. @f$ v_{1}@f$ to @f$ v_{4}@f$ is
99    * available and calculated as default
100    * 
101    * @param  v1 Do @f$ v_{1}$f$
102    * @param  v2 Do @f$ v_{2}$f$
103    * @param  v3 Do @f$ v_{3}$f$
104    * @param  v4 Do @f$ v_{4}$f$
105    * @param  v5 Do @f$ v_{5}$f$
106    * @param  v6 Do @f$ v_{6}$f$
107    * 
108    * @return void 
109    */
110   void SetDoHarmonics(Bool_t v1 = kTRUE, Bool_t v2 = kTRUE, 
111                       Bool_t v3 = kTRUE, Bool_t v4 = kTRUE,
112                       Bool_t v5 = kTRUE, Bool_t v6 = kTRUE) { 
113     fv[1] = v1; fv[2] = v2; fv[3] = v3; fv[4] = v4; fv[5] = v5; fv[6] = v6;}
114  /**
115   * Nested class to handle cumulant calculations in vertex bins
116   */
117   class VertexBin : public TNamed
118   {
119     public:
120     /*
121      * Constructor
122      */
123     VertexBin();
124    /**
125     * Constructor
126     * 
127     * @param vLow Min vertex z-coordinate
128     * @param vHigh Max vertex z-coordinate
129     * @param moment Flow moment
130     * @param type Data type (FMD/SPD/FMDTR/SPDTR/MC)
131     */
132     VertexBin(const Int_t vLow, const Int_t vHigh, 
133               const Int_t moment, const Char_t* type);
134    /**
135     * Copy constructor 
136     * 
137     * @param o Object to copy from
138     * 
139     * @return VertexBin
140     */
141     VertexBin(const VertexBin& o);
142    /**
143     * Assignment operator 
144     * 
145     * @param VertexBin&
146     * 
147     * @return VertexBin& 
148     */
149     VertexBin& operator=(const VertexBin&);
150    /**
151     * Destructor 
152     */
153     ~VertexBin(){}
154    /**
155     * Add vertex bin output to list
156     * 
157     * @param list Histograms are added to this list
158     * 
159     * @return void 
160     */
161     virtual void AddOutput(TList* list);
162    /**
163     * Check if vertex vZ is in range for this bin
164     * 
165     * @param vZ z-coordinate of vertex to check
166     * 
167     * @return Bool_t 
168     */
169     Bool_t CheckVertex(Double_t vZ);
170   /**
171     * Fill reference and differential flow histograms for analysis
172     *
173     * @param dNdetadphi 2D data histogram
174     *
175     * @return false if bad event (det. hotspot)
176     */
177     Bool_t FillHists(TH2D dNdetadphi);
178    /**
179     * Do cumulants calculations for current event with 
180     * centrality cent
181     * 
182     * @param cent Event centrality
183     * 
184     * @return void 
185     */
186     void CumulantsAccumulate(Double_t cent);
187    /**
188     * Finish cumulants calculations. Takes input and
189     * output lists in case Terminate is called separately
190     * 
191     * @param inlist List with input histograms
192     * @param outlist List with output histograms
193     * 
194     * @return void 
195     */
196     void CumulantsTerminate(TList* inlist, TList* outlist);
197
198     protected:
199    /*
200     * Enumeration for ref/diff histograms
201     */
202     enum { kHmult = 1, kHQnRe, kHQnIm, kHQ2nRe, kHQ2nIm };
203    /*
204     * Enumeration for cumulant histogram
205     */
206     enum { kW2Two = 1, kW2, kW4Four, kW4, kQnRe, kQnIm, kM,
207        kCosphi1phi2, kSinphi1phi2, kCosphi1phi2phi3m, kSinphi1phi2phi3m, kMm1m2, 
208        kw2two, kw2, kw4four, kw4, kpnRe, kpnIm, kmp, 
209        kCospsi1phi2, kSinpsi1phi2, kCospsi1phi2phi3m, kSinpsi1phi2phi3m,
210        kmpmq, kCospsi1phi2phi3p, kSinpsi1phi2phi3p };
211
212     const Int_t   fMoment;        // flow moment 
213     const Int_t   fVzMin;         // z-vertex min
214     const Int_t   fVzMax;         // z-vertex max
215     const Char_t* fType;          // data type
216     TH2D*         fCumuRef;       // histogram for reference flow
217     TH2D*         fCumuDiff;      // histogram for differential flow
218     TH3D*         fCumuHist;      // histogram for cumulants calculations
219     TH3D*         fHistTwoCorr;   // Diagnostics histogram for <2>
220     TH3D*         fHistW2;        // Diagnostics histogram for w_<2>
221     TH3D*         fHistFourCorr;  // Diagnostics histogram for <4>
222     TH3D*         fHistW4;        // Diagnostics histogram for w_<4>
223     TH2D*         fdNdedpAcc;     // Diagnostics histogram to make acc. maps
224
225     ClassDef(VertexBin, 1); // object for cumulants ananlysis in FMD
226   };
227
228 protected:
229   /** 
230    * Copy constructor 
231    * 
232    * @param o Object to copy from 
233    */
234   AliForwardFlowTaskQC(const AliForwardFlowTaskQC& o);
235   /** 
236    * Assignment operator 
237    * 
238    * @return Reference to this object 
239    */
240   AliForwardFlowTaskQC& operator=(const AliForwardFlowTaskQC&);
241   /*
242    * Initiate vertex bin objects
243    */
244   virtual void InitVertexBins();
245   /*
246    * Initiate diagnostics histograms
247    */
248   virtual void InitHists();
249   /*
250    * Analyze event
251    */
252   virtual Bool_t Analyze();
253   /*
254    * Finalize analysis
255    */
256   virtual void Finalize();
257
258   TList          fBinsFMD;        //  list with FMD VertexBin objects 
259   TList          fBinsSPD;        //  list with SPD VertexBin objects
260   TList*         fSumList;        //  sum list
261   TList*         fOutputList;     //  Output list
262   AliAODEvent*   fAOD;            //  AOD event
263   Bool_t         fv[7];           //  Calculate v_{n} flag
264   Float_t        fZvertex;        //  Z vertex bin
265   Double_t       fCent;           //  Centrality
266   TH1D*          fHistCent;       //  Diagnostics hist for centrality
267   TH1D*          fHistVertexSel;  //  Diagnostics hist for selected vertices
268   TH1D*          fHistVertexAll;  //  Diagnostics hist for all vertices
269
270   ClassDef(AliForwardFlowTaskQC, 1); // Analysis task for FMD analysis
271 };
272  
273 #endif
274 // Local Variables:
275 //   mode: C++ 
276 // End: