]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/AliForwardQATask.h
Fixed references from PWG2 -> PWGLF - very efficiently done using ETags.
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AliForwardQATask.h
1 // 
2 // Calculate the qa in the forward regions event-by-event 
3 // 
4 #ifndef ALIFORWARDQATASK_H
5 #define ALIFORWARDQATASK_H
6 /**
7  * @file   AliForwardQATask.h
8  * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
9  * @date   Wed Mar 23 14:06:42 2011
10  * 
11  * @brief  
12  * 
13  * 
14  * @ingroup pwglf_forward_aod
15  */
16 #include <AliAnalysisTaskSE.h>
17 #include "AliFMDEventInspector.h"
18 #include "AliFMDSharingFilter.h"
19 #include "AliFMDDensityCalculator.h"
20 #include "AliFMDEnergyFitter.h"
21 #include <AliESDFMD.h>
22 class AliForwardCorrectionManager;
23 class AliESDEvent;
24 class TH2D;
25 class TList;
26 class TAxis;
27
28 /** 
29  * Calculate the QA in the forward regions
30  * 
31  * @par Inputs: 
32  *   - AliESDEvent 
33  *
34  * @par Outputs: 
35  *   - Histograms 
36  * 
37  * @par Histograms 
38  *   
39  * @par Corrections used 
40  * 
41  * @ingroup pwglf_forward_tasks
42  * 
43  */
44 class AliForwardQATask : public AliAnalysisTaskSE
45 {
46 public:
47   /** 
48    * Constructor 
49    * 
50    * @param name Name of task 
51    */
52   AliForwardQATask(const char* name);
53   /** 
54    * Constructor
55    */
56   AliForwardQATask();
57   /** 
58    * Copy constructor 
59    * 
60    * @param o Object to copy from 
61    */
62   AliForwardQATask(const AliForwardQATask& o);
63   /** 
64    * Assignment operator 
65    * 
66    * @param o Object to assign from 
67    * 
68    * @return Reference to this object 
69    */
70   AliForwardQATask& operator=(const AliForwardQATask& o);
71   /** 
72    * @{ 
73    * @name Interface methods 
74    */
75   /** 
76    * Create output objects 
77    * 
78    */
79   virtual void UserCreateOutputObjects();
80   /** 
81    * Process each event 
82    *
83    * @param option Not used
84    */  
85   virtual void UserExec(Option_t* option);
86   /** 
87    * End of job
88    * 
89    * @param option Not used 
90    */
91   virtual void Terminate(Option_t* option);
92   /** 
93    * @} 
94    */
95   /** 
96    * @{ 
97    * @name Access to sub-algorithms 
98    */
99   /**
100    * Get reference to the EventInspector algorithm 
101    * 
102    * @return Reference to AliFMDEventInspector object 
103    */
104   AliFMDEventInspector& GetEventInspector() { return fEventInspector; }
105   /**
106    * Get reference to the EnergyFitter algorithm 
107    * 
108    * @return Reference to AliFMDEnergyFitter object 
109    */
110   AliFMDEnergyFitter& GetEnergyFitter() { return fEnergyFitter; }
111   /**
112    * Get reference to the SharingFilter algorithm 
113    * 
114    * @return Reference to AliFMDSharingFilter object 
115    */
116   AliFMDSharingFilter& GetSharingFilter() { return fSharingFilter; }
117   /**
118    * Get reference to the DensityCalculator algorithm 
119    * 
120    * @return Reference to AliFMDDensityCalculator object 
121    */
122   AliFMDDensityCalculator& GetDensityCalculator() { return fDensityCalculator; }
123   /**
124    * Get reference to the EventInspector algorithm 
125    * 
126    * @return Reference to AliFMDEventInspector object 
127    */
128   const AliFMDEventInspector& GetEventInspector() const { return fEventInspector; }
129   /**
130    * Get reference to the EnergyFitter algorithm 
131    * 
132    * @return Reference to AliFMDEnergyFitter object 
133    */
134   const AliFMDEnergyFitter& GetEnergyFitter() const { return fEnergyFitter; }
135   /**
136    * Get reference to the SharingFilter algorithm 
137    * 
138    * @return Reference to AliFMDSharingFilter object 
139    */
140   const AliFMDSharingFilter& GetSharingFilter() const { return fSharingFilter; }
141   /**
142    * Get reference to the DensityCalculator algorithm 
143    * 
144    * @return Reference to AliFMDDensityCalculator object 
145    */
146   const AliFMDDensityCalculator& GetDensityCalculator() const { return fDensityCalculator; }
147   /** 
148    * @} 
149    */
150   /** 
151    * Set debug level 
152    * 
153    * @param dbg Debug level
154    */
155   void SetDebug(Int_t dbg);
156   void Print(Option_t* option="") const;
157 protected: 
158   /** 
159    * Check if all needed corrections are there and accounted for.  If not,
160    * do a Fatal exit 
161    * 
162    * @param what Which corrections is needed
163    * 
164    * @return true if all present, false otherwise
165    */  
166   Bool_t CheckCorrections(UInt_t what) const;
167   /**
168    * Read corrections
169    *
170    */
171   virtual Bool_t ReadCorrections(const TAxis*& pe, 
172                                  const TAxis*& pv,
173                                  Bool_t mc=false);
174   /**
175    * Get the ESD event. IF this is the first event, initialise.  If
176    * initialisation failes, return a null pointer. 
177    */
178   virtual AliESDEvent* GetESDEvent();
179   /** 
180    * Initialise the sub objects and stuff.  Called on first event 
181    * @return false on error. 
182    */
183   virtual Bool_t  InitializeSubs();
184
185   Bool_t fEnableLowFlux;// Whether to use low-flux specific code
186   Bool_t fFirstEvent;   // Whether the event is the first seen 
187   /**
188    * A pointer to the corrections manager.  This is here to make the
189    * corrections manager persistent - that is, when we write the
190    * analysis train to a file (as done in PROOF) we should also write
191    * down the corrections mananger.   This pointer ensures that. 
192    */
193   AliForwardCorrectionManager* fCorrManager; // Pointer to corrections manager
194
195   AliESDFMD              fESDFMD;       // Sharing corrected ESD object
196   AliForwardUtil::Histos fHistos;       // Cache histograms 
197
198   AliFMDEventInspector    fEventInspector;    // Algorithm
199   AliFMDEnergyFitter      fEnergyFitter;      // Algorithm
200   AliFMDSharingFilter     fSharingFilter;     // Algorithm
201   AliFMDDensityCalculator fDensityCalculator; // Algorithm
202
203   TList* fList; // Output list 
204   Int_t fDebug; // Debug flag
205
206   ClassDef(AliForwardQATask,1) // Forward QA class
207 };
208
209 #endif
210 // Local Variables:
211 //  mode: C++
212 // End:
213