]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/AliForwardMultiplicityBase.h
59b4a3c3bdb3a36c38a077b78dab73febc66aa4b
[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 <AliAnalysisTaskSE.h>
18 class AliFMDEventInspector;
19 class AliFMDEnergyFitter;
20 class AliFMDSharingFilter;
21 class AliFMDDensityCalculator;
22 class AliFMDCorrector;
23 class AliFMDHistCollector;
24 class AliForwardCorrectionManager;
25 class AliFMDEventPlaneFinder;
26 class AliESDEvent;
27 class TH2D;
28 class TList;
29 class TTree;
30 class TAxis;
31
32 /** 
33  * @defgroup pwglf_forward PWGLF Forward analysis
34  *
35  * Code to do the multiplicity analysis in the forward psuedo-rapidity
36  * regions
37  *
38  */
39 /** 
40  * @defgroup pwglf_forward_tasks Tasks
41  *
42  * Code to do the multiplicity analysis in the forward psuedo-rapidity
43  * regions
44  *
45  * @ingroup pwglf_forward 
46  */
47 /** 
48  * @defgroup pwglf_forward_topical Topical
49  *
50  * The code divided according to topic
51  */
52 /** 
53  * @defgroup pwglf_forward_aod AOD
54  * 
55  * Code to do with AOD production 
56  *
57  * @ingroup pwglf_forward_topical
58  */
59 /** 
60  * Base class for classes that calculate the multiplicity in the
61  * forward regions event-by-event
62  * 
63  * @par Inputs: 
64  *   - AliESDEvent 
65  *
66  * @par Outputs: 
67  *   - AliAODForwardMult 
68  * 
69  * @par Histograms 
70  *   
71  * @par Corrections used 
72  * 
73  * @ingroup pwglf_forward_tasks
74  * @ingroup pwglf_forward_aod
75  * 
76  */
77 class AliForwardMultiplicityBase : public AliAnalysisTaskSE
78 {
79 public:
80   /** 
81    * @{ 
82    * @name Interface methods 
83    */
84   /** 
85    * Initialize the task 
86    * 
87    */
88   virtual void Init() { fFirstEvent = true; }
89   /** 
90    * Create output objects 
91    * 
92    */
93   virtual void UserCreateOutputObjects() = 0;
94   /** 
95    * Process each event 
96    *
97    * @param option Not used
98    */  
99   virtual void UserExec(Option_t* option) = 0;
100   /** 
101    * End of job
102    * 
103    * @param option Not used 
104    */
105   virtual void Terminate(Option_t* option) = 0;
106   /** 
107    * @} 
108    */
109   /** 
110    * Configure this task via a macro 
111    * 
112    * @param macro Macro to configure va 
113    * 
114    * @return true on success, false otherwise
115    */
116   virtual Bool_t Configure(const char* macro="ForwardAODConfig.C");
117   /** 
118    * Print information 
119    * 
120    * @param option Not used
121    */
122   virtual void Print(Option_t* option="") const;
123   /** 
124    * Whether to enable low-flux code 
125    * 
126    * @param use IF true, enable low-flux code 
127    */
128   virtual void SetEnableLowFlux(Bool_t use=true) { fEnableLowFlux = use; }
129   /** 
130    * @{ 
131    * @name Access to sub-algorithms 
132    */
133   /**
134    * Get reference to the EventInspector algorithm 
135    * 
136    * @return Reference to AliFMDEventInspector object 
137    */
138   virtual AliFMDEventInspector& GetEventInspector() = 0;
139   /**
140    * Get reference to the SharingFilter algorithm 
141    * 
142    * @return Reference to AliFMDSharingFilter object 
143    */
144   virtual AliFMDSharingFilter& GetSharingFilter() = 0;
145   /**
146    * Get reference to the DensityCalculator algorithm 
147    * 
148    * @return Reference to AliFMDDensityCalculator object 
149    */
150   virtual AliFMDDensityCalculator& GetDensityCalculator() = 0;
151   /**
152    * Get reference to the Corrections algorithm 
153    * 
154    * @return Reference to AliFMDCorrector object 
155    */
156   virtual AliFMDCorrector& GetCorrections() = 0;
157   /**
158    * Get reference to the HistCollector algorithm 
159    * 
160    * @return Reference to AliFMDHistCollector object 
161    */
162   virtual AliFMDHistCollector& GetHistCollector() = 0;
163   /**
164    * Get reference to the EventInspector algorithm 
165    * 
166    * @return Reference to AliFMDEventInspector object 
167    */
168   virtual const AliFMDEventInspector& GetEventInspector() const = 0;
169   /**
170    * Get reference to the SharingFilter algorithm 
171    * 
172    * @return Reference to AliFMDSharingFilter object 
173    */
174   virtual const AliFMDSharingFilter& GetSharingFilter() const = 0;
175   /**
176    * Get reference to the DensityCalculator algorithm 
177    * 
178    * @return Reference to AliFMDDensityCalculator object 
179    */
180   virtual const AliFMDDensityCalculator& GetDensityCalculator() const = 0;
181   /**
182    * Get reference to the Corrections algorithm 
183    * 
184    * @return Reference to AliFMDCorrector object 
185    */
186   virtual const AliFMDCorrector& GetCorrections() const = 0;
187   /**
188    * Get reference to the HistCollector algorithm 
189    * 
190    * @return Reference to AliFMDHistCollector object 
191    */
192   virtual const AliFMDHistCollector& GetHistCollector() const = 0;
193    /**
194    * Get reference to the EventPlaneFinder algorithm 
195    * 
196    * @return Reference to AliFMDEventPlaneFinder object 
197    */
198   virtual AliFMDEventPlaneFinder& GetEventPlaneFinder() = 0;
199   /**
200    * Get reference to the EventPlaneFinder algorithm 
201    * 
202    * @return Reference to AliFMDEventPlaneFinder object 
203    */
204   virtual const AliFMDEventPlaneFinder& GetEventPlaneFinder() const = 0;
205   /* @} */
206
207   /** 
208    * Set the debug level 
209    * 
210    * @param dbg 
211    */
212   virtual void SetDebug(Int_t dbg) = 0;
213   /** 
214    * Overload super class method for setting debug level to call our
215    * SetDebug member function.
216    * 
217    * @param dbg Debug level (0: no output, 1: essentials, 3: a whole lot)
218    */
219   virtual void SetDebugLevel(Int_t dbg) 
220   { 
221     AliAnalysisTaskSE::SetDebugLevel(dbg); 
222     SetDebug(dbg);
223   }
224 protected: 
225   /** 
226    * Constructor 
227    * 
228    * @param name Name of task 
229    */
230   AliForwardMultiplicityBase(const char* name); 
231   /** 
232    * Constructor
233    */
234   AliForwardMultiplicityBase() 
235   : AliAnalysisTaskSE(), 
236     fEnableLowFlux(true), 
237     fFirstEvent(true),
238     fCorrManager(0)
239   {}
240   /** 
241    * Copy constructor 
242    * 
243    * @param o Object to copy from 
244    */
245   AliForwardMultiplicityBase(const AliForwardMultiplicityBase& o)
246     : AliAnalysisTaskSE(o),
247       fEnableLowFlux(o.fEnableLowFlux), 
248       fFirstEvent(o.fFirstEvent),
249       fCorrManager(o.fCorrManager)
250   {}
251   /** 
252    * Assignment operator 
253    * 
254    * @param o Object to assign from 
255    * 
256    * @return Reference to this object 
257    */
258   AliForwardMultiplicityBase& operator=(const AliForwardMultiplicityBase& o);
259   /** 
260    * Check if all needed corrections are there and accounted for.  If not,
261    * do a Fatal exit 
262    * 
263    * @param what Which corrections is needed
264    * 
265    * @return true if all present, false otherwise
266    */  
267   Bool_t CheckCorrections(UInt_t what) const;
268   /** 
269    * Read corrections
270    * 
271    * 
272    * @param pe  On return, the eta axis
273    * @param pv  On return ,the vertex axis 
274    * @param mc  True assume MC input
275    * 
276    * @return true ons succcss
277    */
278   virtual Bool_t ReadCorrections(const TAxis*& pe, 
279                                  const TAxis*& pv,
280                                  Bool_t mc=false);
281   /**
282    * Get the ESD event. IF this is the first event, initialise
283    *
284    * @return Pointer to ESD event structore 
285    */
286   virtual AliESDEvent* GetESDEvent();
287   /** 
288    * Initialise the sub objects and stuff.  Called on first event
289    *
290    * @return false on errors 
291    */
292   virtual Bool_t InitializeSubs() = 0;
293   /**
294    * Mark this event as one to store in the AOD 
295    * 
296    */
297   virtual void MarkEventForStore() const;
298   /** 
299    * Make Ring @f$ dN/d\eta @f$ histogram and a stack 
300    * 
301    * @param input      List with summed signals 
302    * @param output     Output list 
303    * @param inName     Input name 
304    * @param outName    Output name
305    * @param style      Style 
306    */
307   virtual void MakeRingdNdeta(const TList* input, 
308                               const char*  inName,
309                               TList*       output,
310                               const char*  outName,
311                               Int_t        style=20) const;
312   Bool_t fEnableLowFlux;// Whether to use low-flux specific code
313   Bool_t fFirstEvent;   // Whether the event is the first seen 
314 private:
315   /**
316    * A pointer to the corrections manager.  This is here to make the
317    * corrections manager persistent - that is, when we write the
318    * analysis train to a file (as done in PROOF) we should also write
319    * down the corrections mananger.   This pointer ensures that. 
320    * 
321    */
322   AliForwardCorrectionManager* fCorrManager; // Pointer to corrections manager
323
324   ClassDef(AliForwardMultiplicityBase,2) // Forward multiplicity class
325 };
326
327 #endif
328
329 // Local Variables:
330 //  mode: C++
331 // End:
332