]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/AliForwardMultiplicityBase.h
4a25f5ea4f421113996e300edbccab2b0a567df1
[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  * @mainpage ALICE PWGLF Forward Multiplcity Analysis 
34  * 
35  * This is the analysis code for analysis of the Forward data. 
36  * 
37  * @par Code overview 
38  * 
39  * See the <a href="modules.html">Modules</a> page 
40  * 
41  * @par Run.sh script 
42  * 
43  * @verbatim 
44  * Usage: Run.sh [OPTIONS]
45  * 
46  * Do Pass1 and Pass2 on ESD files in current directory.  
47  * 
48  * Options:
49  *      -h,--help               This help                  
50  *      -n,--events N           Number of events            (-1)
51  *      -1,--pass1              Run pass 1, only AOD        (0)
52  *      -2,--pass2              Run pass 2, only Hists      (0)
53  *      -3,--pass3              Draw results                (0)
54  *      -v,--vz-min CM          Minimum value of vz         (-10)
55  *      -V,--vz-max CM          Maximum value of vz         (10)
56  *      -t,--trigger TYPE       Select trigger TYPE         (INEL)
57  *      -b,--batch              Do batch processing         (0)
58  *      -P,--proof NWORKERS     Run in PROOF(Lite) mode     (0)
59  *      -M,--mc                 Run over MC data            (0)
60  *      -g,--gdb                Run in GDB mode             (0)
61  *      -E,--eloss              Run energy loss script      
62  *      -r,--rebin              Rebin factor                (1)
63  *      -C,--use-centrality     Run centrality task         (0)
64  *      -O,--show-older         Show older data             (0)
65  *      -J,--show-published     Show ALICE published data   (1)
66  *      -R,--show-ratios        Show ratios to other data   (1)
67  *      -Z,--show-asymmetry     Show asymmetry              (1)
68  *      -S,--scheme SCHEME      Normalisation scheme        (full)
69  *      -T,--title STRING       Title on plots              ()
70  * 
71  * TYPE is a comma or space separated list of 
72  *  
73  *   INEL             Inelastic triggers (V0A|V0C|SPD)
74  *   INEL>0      As above + N_ch > 0 in -0.5<eta<+0.5
75  *   NSD         Non-single diffractive ((VOA&VOC)|N_ch > 5 -1.9<eta<+1.9)
76  * 
77  * SCHEME is a comma or space separated list of 
78  * 
79  *   NONE          No event-level normalization except trivial one 
80  *   EVENTLEVEL    Event-level normalization 
81  *   ALTEVENTLEVEL Event-level normalization (alternative version)
82  *   BACKGROUND    Not implemented yet 
83  *   SHAPE         Shape correction 
84  *   FULL          Same as EVENTLEVEL,BACKGROUND,SHAPE
85  *   ALTFULL       Same as ALTEVENTLEVEL,BACKGROUND,SHAPE
86  * 
87  * If NWORKERS is 0, then the analysis will be run in local mode.
88  * @endverbatim
89  */
90 /** 
91  * @defgroup pwglf_forward PWGLF Forward analysis
92  *
93  * Code to do the multiplicity analysis in the forward psuedo-rapidity
94  * regions
95  *
96  */
97 /** 
98  * @defgroup pwglf_forward_tasks Tasks
99  *
100  * Code to do the multiplicity analysis in the forward psuedo-rapidity
101  * regions
102  *
103  * @ingroup pwglf_forward 
104  */
105 /** 
106  * @defgroup pwglf_forward_topical Topical
107  */
108 /** 
109  * @defgroup pwglf_forward_aod AOD
110  * @ingroup pwglf_forward_topical
111  */
112 /** 
113  * Base class for classes that calculate the multiplicity in the
114  * forward regions event-by-event
115  * 
116  * @par Inputs: 
117  *   - AliESDEvent 
118  *
119  * @par Outputs: 
120  *   - AliAODForwardMult 
121  * 
122  * @par Histograms 
123  *   
124  * @par Corrections used 
125  * 
126  * @ingroup pwglf_forward_tasks
127  * @ingroup pwglf_forward_aod
128  * 
129  */
130 class AliForwardMultiplicityBase : public AliAnalysisTaskSE
131 {
132 public:
133   /** 
134    * @{ 
135    * @name Interface methods 
136    */
137   /** 
138    * Initialize the task 
139    * 
140    */
141   virtual void Init() { fFirstEvent = true; }
142   /** 
143    * Create output objects 
144    * 
145    */
146   virtual void UserCreateOutputObjects() = 0;
147   /** 
148    * Process each event 
149    *
150    * @param option Not used
151    */  
152   virtual void UserExec(Option_t* option) = 0;
153   /** 
154    * End of job
155    * 
156    * @param option Not used 
157    */
158   virtual void Terminate(Option_t* option) = 0;
159   /** 
160    * @} 
161    */
162   /** 
163    * Print information 
164    * 
165    * @param option Not used
166    */
167   virtual void Print(Option_t* option="") const;
168   /** 
169    * Whether to enable low-flux code 
170    * 
171    * @param use IF true, enable low-flux code 
172    */
173   virtual void SetEnableLowFlux(Bool_t use=true) { fEnableLowFlux = use; }
174   /** 
175    * @{ 
176    * @name Access to sub-algorithms 
177    */
178   /**
179    * Get reference to the EventInspector algorithm 
180    * 
181    * @return Reference to AliFMDEventInspector object 
182    */
183   virtual AliFMDEventInspector& GetEventInspector() = 0;
184   /**
185    * Get reference to the SharingFilter algorithm 
186    * 
187    * @return Reference to AliFMDSharingFilter object 
188    */
189   virtual AliFMDSharingFilter& GetSharingFilter() = 0;
190   /**
191    * Get reference to the DensityCalculator algorithm 
192    * 
193    * @return Reference to AliFMDDensityCalculator object 
194    */
195   virtual AliFMDDensityCalculator& GetDensityCalculator() = 0;
196   /**
197    * Get reference to the Corrections algorithm 
198    * 
199    * @return Reference to AliFMDCorrector object 
200    */
201   virtual AliFMDCorrector& GetCorrections() = 0;
202   /**
203    * Get reference to the HistCollector algorithm 
204    * 
205    * @return Reference to AliFMDHistCollector object 
206    */
207   virtual AliFMDHistCollector& GetHistCollector() = 0;
208   /**
209    * Get reference to the EventInspector algorithm 
210    * 
211    * @return Reference to AliFMDEventInspector object 
212    */
213   virtual const AliFMDEventInspector& GetEventInspector() const = 0;
214   /**
215    * Get reference to the SharingFilter algorithm 
216    * 
217    * @return Reference to AliFMDSharingFilter object 
218    */
219   virtual const AliFMDSharingFilter& GetSharingFilter() const = 0;
220   /**
221    * Get reference to the DensityCalculator algorithm 
222    * 
223    * @return Reference to AliFMDDensityCalculator object 
224    */
225   virtual const AliFMDDensityCalculator& GetDensityCalculator() const = 0;
226   /**
227    * Get reference to the Corrections algorithm 
228    * 
229    * @return Reference to AliFMDCorrector object 
230    */
231   virtual const AliFMDCorrector& GetCorrections() const = 0;
232   /**
233    * Get reference to the HistCollector algorithm 
234    * 
235    * @return Reference to AliFMDHistCollector object 
236    */
237   virtual const AliFMDHistCollector& GetHistCollector() const = 0;
238    /**
239    * Get reference to the EventPlaneFinder algorithm 
240    * 
241    * @return Reference to AliFMDEventPlaneFinder object 
242    */
243   virtual AliFMDEventPlaneFinder& GetEventPlaneFinder() = 0;
244   /**
245    * Get reference to the EventPlaneFinder algorithm 
246    * 
247    * @return Reference to AliFMDEventPlaneFinder object 
248    */
249   virtual const AliFMDEventPlaneFinder& GetEventPlaneFinder() const = 0;
250
251   /** 
252    * @} 
253    */
254   virtual void SetDebug(Int_t dbg) = 0;
255 protected: 
256   /** 
257    * Constructor 
258    * 
259    * @param name Name of task 
260    */
261   AliForwardMultiplicityBase(const char* name); 
262   /** 
263    * Constructor
264    */
265   AliForwardMultiplicityBase() 
266   : AliAnalysisTaskSE(), 
267     fEnableLowFlux(true), 
268     fFirstEvent(true),
269     fCorrManager(0)
270   {}
271   /** 
272    * Copy constructor 
273    * 
274    * @param o Object to copy from 
275    */
276   AliForwardMultiplicityBase(const AliForwardMultiplicityBase& o)
277     : AliAnalysisTaskSE(o),
278       fEnableLowFlux(o.fEnableLowFlux), 
279       fFirstEvent(o.fFirstEvent),
280       fCorrManager(o.fCorrManager)
281   {}
282   /** 
283    * Assignment operator 
284    * 
285    * @param o Object to assign from 
286    * 
287    * @return Reference to this object 
288    */
289   AliForwardMultiplicityBase& operator=(const AliForwardMultiplicityBase& o);
290   /** 
291    * Check if all needed corrections are there and accounted for.  If not,
292    * do a Fatal exit 
293    * 
294    * @param what Which corrections is needed
295    * 
296    * @return true if all present, false otherwise
297    */  
298   Bool_t CheckCorrections(UInt_t what) const;
299   /**
300    * Read corrections
301    *
302    */
303   virtual Bool_t ReadCorrections(const TAxis*& pe, 
304                                  const TAxis*& pv,
305                                  Bool_t mc=false);
306   /**
307    * Get the ESD event. IF this is the first event, initialise
308    */
309   virtual AliESDEvent* GetESDEvent();
310   /** 
311    * Initialise the sub objects and stuff.  Called on first event
312    *
313    */
314   virtual void InitializeSubs() = 0;
315   /**
316    * Mark this event as one to store in the AOD 
317    * 
318    */
319   virtual void MarkEventForStore() const;
320   /** 
321    * Make Ring @f$ dN/d\eta @f$ histogram and a stack 
322    * 
323    * @param input      List with summed signals 
324    * @param output     Output list 
325    * @param inName     Input name 
326    * @param outName    Output name
327    * @param style      Style 
328    */
329   virtual void MakeRingdNdeta(const TList* input, 
330                               const char*  inName,
331                               TList*       output,
332                               const char*  outName,
333                               Int_t        style=20) const;
334   Bool_t fEnableLowFlux;// Whether to use low-flux specific code
335   Bool_t fFirstEvent;   // Whether the event is the first seen 
336 private:
337   /**
338    * A pointer to the corrections manager.  This is here to make the
339    * corrections manager persistent - that is, when we write the
340    * analysis train to a file (as done in PROOF) we should also write
341    * down the corrections mananger.   This pointer ensures that. 
342    * 
343    */
344   AliForwardCorrectionManager* fCorrManager; // Pointer to corrections manager
345
346   ClassDef(AliForwardMultiplicityBase,2) // Forward multiplicity class
347 };
348
349 #endif
350 // Local Variables:
351 //  mode: C++
352 // End:
353