]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/AliForwardMultiplicityBase.h
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AliForwardMultiplicityBase.h
1 // 
2 // Base class for classes that calculate the multiplicity in the
3 // forward regions event-by-event
4 // 
5 #ifndef ALIFORWARDMULTIPLICITYBASE_H
6 #define ALIFORWARDMULTIPLICITYBASE_H
7 /**
8  * @file   AliForwardMultiplicityBase.h
9  * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
10  * @date   Wed Mar 23 14:06:29 2011
11  * 
12  * @brief  
13  * 
14  * 
15  * @ingroup pwglf_forward_aod
16  */
17 #include "AliBaseESDTask.h"
18 #include "AliForwardUtil.h"
19 #include "AliAODForwardMult.h"
20 #include "AliAODForwardEP.h"
21 // class AliFMDEnergyFitter;
22 class AliFMDSharingFilter;
23 class AliFMDDensityCalculator;
24 class AliFMDCorrector;
25 class AliFMDHistCollector;
26 class AliFMDEventPlaneFinder;
27 class AliAODHandler;
28 class AliESDEvent;
29 class TH2D;
30 class TList;
31 class TTree;
32 class TAxis;
33 class TProfile;
34
35 /** 
36  * @defgroup pwglf_forward PWGLF Forward analysis
37  *
38  * Code to do the multiplicity analysis in the forward psuedo-rapidity
39  * regions
40  *
41  */
42 /** 
43  * @defgroup pwglf_forward_tasks Tasks
44  *
45  * Code to do the multiplicity analysis in the forward psuedo-rapidity
46  * regions
47  *
48  * @ingroup pwglf_forward 
49  */
50 /** 
51  * @defgroup pwglf_forward_topical Topical
52  *
53  * The code divided according to topic
54  */
55 /** 
56  * @defgroup pwglf_forward_aod AOD
57  * 
58  * Code to do with AOD production 
59  *
60  * @ingroup pwglf_forward_topical
61  */
62 /** 
63  * Base class for classes that calculate the multiplicity in the
64  * forward regions event-by-event
65  * 
66  * @par Inputs: 
67  *   - AliESDEvent 
68  *
69  * @par Outputs: 
70  *   - AliAODForwardMult 
71  * 
72  * @par Histograms 
73  *   
74  * @par Corrections used 
75  * 
76  * @ingroup pwglf_forward_tasks
77  * @ingroup pwglf_forward_aod
78  * 
79  */
80 class AliForwardMultiplicityBase : public AliBaseESDTask
81 {
82 public:
83   enum { 
84     kTimingEventInspector    = 1,
85     kTimingSharingFilter     = 2, 
86     kTimingDensityCalculator = 3, 
87     kTimingCorrections       = 4, 
88     kTimingHistCollector     = 5, 
89     kTimingEventPlaneFinder  = 6, 
90     kTimingTotal             = 7
91   };
92   /** 
93    * @{ 
94    * @name Interface methods 
95    */
96   /** 
97    * Create output objects 
98    *
99    * @return true on success
100    */
101   virtual Bool_t Book();
102   /** 
103    * Initialise the sub objects and stuff.  Called on first event
104    *
105    * @param vertex Vertex axis to use 
106    * @param eta    Eta axis to use 
107    *
108    * @return false on errors 
109    */
110   virtual Bool_t PreData(const TAxis& vertex, const TAxis& eta);
111   /** 
112    * End of job
113    * 
114    * @return true on success
115    */
116   virtual Bool_t Finalize();
117   /** 
118    * @} 
119    */
120   /** 
121    * Print information 
122    * 
123    * @param option Not used
124    */
125   virtual void Print(Option_t* option="") const;
126   /** 
127    * Set whether to make a timing histogram 
128    * 
129    * @param enable 
130    */
131   virtual void SetDoTiming(Bool_t enable=true) { fDoTiming = enable; }
132   /** 
133    * Whether to enable low-flux code 
134    * 
135    * @param use IF true, enable low-flux code 
136    */
137   virtual void SetEnableLowFlux(Bool_t use=true) { fEnableLowFlux = use; }
138   /** 
139    * @{ 
140    * @name Access to sub-algorithms 
141    */
142   /**
143    * Get reference to the SharingFilter algorithm 
144    * 
145    * @return Reference to AliFMDSharingFilter object 
146    */
147   virtual AliFMDSharingFilter& GetSharingFilter() = 0;
148   /**
149    * Get reference to the DensityCalculator algorithm 
150    * 
151    * @return Reference to AliFMDDensityCalculator object 
152    */
153   virtual AliFMDDensityCalculator& GetDensityCalculator() = 0;
154   /**
155    * Get reference to the Corrections algorithm 
156    * 
157    * @return Reference to AliFMDCorrector object 
158    */
159   virtual AliFMDCorrector& GetCorrections() = 0;
160   /**
161    * Get reference to the HistCollector algorithm 
162    * 
163    * @return Reference to AliFMDHistCollector object 
164    */
165   virtual AliFMDHistCollector& GetHistCollector() = 0;
166   /**
167    * Get reference to the SharingFilter algorithm 
168    * 
169    * @return Reference to AliFMDSharingFilter object 
170    */
171   virtual const AliFMDSharingFilter& GetSharingFilter() const = 0;
172   /**
173    * Get reference to the DensityCalculator algorithm 
174    * 
175    * @return Reference to AliFMDDensityCalculator object 
176    */
177   virtual const AliFMDDensityCalculator& GetDensityCalculator() const = 0;
178   /**
179    * Get reference to the Corrections algorithm 
180    * 
181    * @return Reference to AliFMDCorrector object 
182    */
183   virtual const AliFMDCorrector& GetCorrections() const = 0;
184   /**
185    * Get reference to the HistCollector algorithm 
186    * 
187    * @return Reference to AliFMDHistCollector object 
188    */
189   virtual const AliFMDHistCollector& GetHistCollector() const = 0;
190    /**
191    * Get reference to the EventPlaneFinder algorithm 
192    * 
193    * @return Reference to AliFMDEventPlaneFinder object 
194    */
195   virtual AliFMDEventPlaneFinder& GetEventPlaneFinder() = 0;
196   /**
197    * Get reference to the EventPlaneFinder algorithm 
198    * 
199    * @return Reference to AliFMDEventPlaneFinder object 
200    */
201   virtual const AliFMDEventPlaneFinder& GetEventPlaneFinder() const = 0;
202   /* @} */
203
204   /** 
205    * Set the debug level 
206    * 
207    * @param dbg 
208    */
209   virtual void SetDebug(Int_t dbg);
210   /** 
211    * Set whether to make separate branches for each ring.  If enabled
212    * there will be 5 additional branches on the AOD tree - each
213    * holding a TH2D object of the charged particle multiplicity in
214    * @f$(\eta,\varphi)@f$ bins for that event.
215    * 
216    * @param use If true, make separate branches for each ring. 
217    */
218   void SetStorePerRing(Bool_t use) { fStorePerRing = use; }
219 protected: 
220   /** 
221    * Constructor 
222    * 
223    * @param name Name of task 
224    */
225   AliForwardMultiplicityBase(const char* name); 
226   /** 
227    * Constructor
228    */
229   AliForwardMultiplicityBase() 
230     : AliBaseESDTask(), 
231       fEnableLowFlux(true), 
232       fStorePerRing(false),
233       fHData(0),
234       fHistos(),
235       fAODFMD(),
236       fAODEP(),
237       fRingSums(),
238       fDoTiming(false), 
239       fHTiming(0)
240   {}
241   /** 
242    * Copy constructor 
243    * 
244    * @param o Object to copy from 
245    */
246   AliForwardMultiplicityBase(const AliForwardMultiplicityBase& o);
247   /** 
248    * Assignment operator 
249    * 
250    * @param o Object to assign from 
251    * 
252    * @return Reference to this object 
253    */
254   AliForwardMultiplicityBase& operator=(const AliForwardMultiplicityBase& o);
255   /** 
256    * Initialize members based on eta and vertex axis - only available
257    * after first event - called from SetupForData.
258    * 
259    * @param pe @f$\eta@f$ axis
260    * @param pv Interaction point Z-coordinate axis 
261    */
262   virtual void InitMembers(const TAxis& pe, const TAxis& pv);
263   /**
264    * Create output branches - called from UserCreateOutputObjects
265    */
266   virtual void CreateBranches(AliAODHandler* ah);
267   /** 
268    * Do estimates of @f$dN/d\eta@f$  - called at Terminate
269    * 
270    * @param input  Input list
271    * @param output Output list
272    */
273   virtual void EstimatedNdeta(const TList* input, TList* output) const;
274   /** 
275    * Calculate a simple dN/deta from all accepted events 
276    * 
277    * @param input  Input list
278    * @param output Output list
279    * @param nTr    On return, number of triggers
280    * @param nTrVtx On return, number of trigger+vertex events
281    * @param nAcc   On return, number of accepted events
282    * 
283    * @return true on success 
284    */
285   virtual Bool_t MakeSimpledNdeta(const TList* input, 
286                                   TList*       output,
287                                   Double_t&    nTr, 
288                                   Double_t&    nTrVtx, 
289                                   Double_t&    nAcc);
290   /** 
291    * Make Ring @f$ dN/d\eta @f$ histogram and a stack 
292    * 
293    * @param input      List with summed signals 
294    * @param output     Output list 
295    * @param inName     Input name 
296    * @param outName    Output name
297    * @param style      Style 
298    */
299   virtual void MakeRingdNdeta(const TList* input, 
300                               const char*  inName,
301                               TList*       output,
302                               const char*  outName,
303                               Int_t        style=20) const;
304   TAxis* DefaultEtaAxis() const { return new TAxis(200,-4,6); }
305   TAxis* DefaultVertexAxis() const { return new TAxis(10,-10,10); }
306   Bool_t                 fEnableLowFlux;// Whether to use low-flux specific code
307   Bool_t                 fStorePerRing; // Store each ring on separate branch
308   TH2D*                  fHData;        // Summed 1/Nd^2N_{ch}/dphideta
309   AliForwardUtil::Histos fHistos;       // Cache histograms 
310   AliAODForwardMult      fAODFMD;       // Output object
311   AliAODForwardEP        fAODEP;        // Output object
312   AliForwardUtil::Histos fRingSums;     // Cache histograms 
313   Bool_t                 fDoTiming;     // Whether to do timing or not
314   TProfile*              fHTiming;
315
316   ClassDef(AliForwardMultiplicityBase,5) // Forward multiplicity class
317 };
318
319 #endif
320
321 // Local Variables:
322 //  mode: C++
323 // End:
324