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