]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/AliCentralMCCorrectionsTask.h
Transition PWG2/FORWARD -> PWGLF
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AliCentralMCCorrectionsTask.h
1 // 
2 // Calculate the corrections in the central regions
3 // 
4 #ifndef ALICENTRALMCCORRECTIONS_H
5 #define ALICENTRALMCCORRECTIONS_H
6 /**
7  * @file   AliCentralMCCorrectionsTask.h
8  * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
9  * @date   Wed Mar 23 14:05:51 2011
10  * 
11  * @brief  
12  * 
13  * 
14  * @ingroup pwg2_central_aod
15  */
16 #include <AliAnalysisTaskSE.h>
17 #include "AliFMDMCEventInspector.h"
18 #include "AliSPDMCTrackDensity.h"
19 #include <TH1I.h>
20 class AliCentralCorrSecondaryMap;
21 class AliESDEvent;
22 class TH2D;
23 class TH1D;
24 class TList;
25
26
27 /** 
28  * Calculate the corrections in the central regions
29  * 
30  * @par Inputs: 
31  *   - AliESDEvent 
32  *
33  * @par Outputs: 
34  *   - AliAODCentralMult 
35  * 
36  * @par Histograms 
37  *   
38  * @par Corrections used 
39  * 
40  * @ingroup pwg2_central_tasks
41  * @ingroup pwg2_central_mc
42  * @ingroup pwg2_central_aod
43  * 
44  */
45 class AliCentralMCCorrectionsTask : public AliAnalysisTaskSE
46 {
47 public:
48   /** 
49    * Constructor 
50    * 
51    * @param name Name of task 
52    */
53   AliCentralMCCorrectionsTask(const char* name);
54   /** 
55    * Constructor
56    */
57   AliCentralMCCorrectionsTask();
58   /** 
59    * Copy constructor 
60    * 
61    * @param o Object to copy from 
62    */
63   AliCentralMCCorrectionsTask(const AliCentralMCCorrectionsTask& o);
64   /** 
65    * Assignment operator 
66    * 
67    * @param o Object to assign from 
68    * 
69    * @return Reference to this object 
70    */
71   AliCentralMCCorrectionsTask& operator=(const AliCentralMCCorrectionsTask& o);
72   /** 
73    * @{ 
74    * @name Interface methods 
75    */
76   /** 
77    * Initialize the task 
78    * 
79    */
80   virtual void Init();
81   /** 
82    * Create output objects 
83    * 
84    */
85   virtual void UserCreateOutputObjects();
86   /** 
87    * Process each event 
88    *
89    * @param option Not used
90    */  
91   virtual void UserExec(Option_t* option);
92   /** 
93    * End of job
94    * 
95    * @param option Not used 
96    */
97   virtual void Terminate(Option_t* option);
98   /** 
99    * @} 
100    */
101   /** 
102    * Print this object 
103    * 
104    * @param option   Not used
105    */
106   void Print(Option_t* option="") const;
107
108   /** 
109    * Set the vertex axis to use
110    * 
111    * @param nBins Number of bins
112    * @param vzMin Least @f$z@f$ coordinate of interation point
113    * @param vzMax Largest @f$z@f$ coordinate of interation point
114    */
115   void SetVertexAxis(Int_t nBins, Double_t vzMin, Double_t vzMax=-1000000);
116   /** 
117    * Set the vertex axis to use
118    * 
119    * @param axis Axis
120    */
121   void SetVertexAxis(const TAxis& axis);
122   /** 
123    * Set the eta axis to use
124    * 
125    * @param nBins Number of bins
126    * @param etaMin Least @f$\eta@f$ 
127    * @param etaMax Largest @f$\eta@f$ 
128    */
129   void SetEtaAxis(Int_t nBins, Double_t etaMin, Double_t etaMax=-1000000);
130   /** 
131    * Set the eta axis to use
132    * 
133    * @param axis Axis
134    */
135   void SetEtaAxis(const TAxis& axis);
136   /** 
137    * Set the number of phi bins to use 
138    * 
139    * @param nBins 
140    */
141   void SetNPhiBins(UShort_t nBins) { fNPhiBins = nBins; }
142   /** 
143    * Get a reference to the track density calculator 
144    * 
145    * @return Reference to the track density calculator 
146    */
147   AliSPDMCTrackDensity& GetTrackDensity() { return fTrackDensity; }
148   /** 
149    * Get a reference to the track density calculator 
150    * 
151    * @return Reference to the track density calculator 
152    */
153   const AliSPDMCTrackDensity& GetTrackDensity() const { return fTrackDensity; }
154   /** 
155    * Get a reference to the event inspector
156    * 
157    * @return Reference to the event inspector 
158    */
159   AliFMDMCEventInspector& GetEventInspector() { return fInspector; }
160   /** 
161    * Get a reference to the event inspector
162    * 
163    * @return Reference to the event inspector 
164    */
165   const AliFMDMCEventInspector& GetEventInspector() const { return fInspector;}
166 protected: 
167   /**
168    * A vertex bin 
169    * 
170    */
171   struct VtxBin : public TNamed
172   {
173     /** 
174      * Constructor 
175      */
176     VtxBin();
177     /** 
178      * Constructor
179      *  
180      * @param low       Lower @f$v_z@f$ bound
181      * @param high      Upper @f$v_z@f$ bound
182      * @param etaAxis   @f$\eta@f$ axis to use 
183      * @param nPhi      Number of phi bins 
184      */
185     VtxBin(Double_t low, Double_t high, const TAxis& etaAxis, UShort_t nPhi);
186     /** 
187      * Copy constructor 
188      * 
189      * @param o Object to copy from 
190      */
191     VtxBin(const VtxBin& o);
192     /** 
193      * Assignment operator 
194      * 
195      * @param o Object to assign from 
196      * 
197      * @return Reference to this object
198      */
199     VtxBin& operator=(const VtxBin& o);
200     /** 
201      * Get bin name
202      * 
203      * @param low       Lower @f$v_z@f$ bound
204      * @param high      Upper @f$v_z@f$ bound
205      * 
206      * @return Bin name 
207      */
208     static const char* BinName(Double_t low, Double_t high);
209     /** 
210      * Declare output in passed list 
211      * 
212      * @param list List to put output in 
213      */
214     void DefineOutput(TList* list);
215     /** 
216      * End of job process 
217      * 
218      * @param o   List to add output to 
219      * @param i   Input list
220      * @param iVz Vertex bin 
221      * @param map Correctons map 
222      */
223     void Finish(const TList* i, 
224                 TList* o,
225                 UShort_t iVz, 
226                 AliCentralCorrSecondaryMap* map);
227
228     TH2D* fHits;    // Cache of per-ring histograms
229     TH2D* fPrimary;  // Cache or primary 
230     TH1D* fCounts;   // Event count 
231
232     ClassDef(VtxBin,1); // Vertex bin 
233   };
234   /** 
235    * Define our vertex bins 
236    * 
237    * @param list List to read or add binst from/to
238    */
239   void DefineBins(TList* list);
240
241   AliFMDMCEventInspector fInspector; // Event inspector 
242   AliSPDMCTrackDensity   fTrackDensity; // Get the track density 
243
244   TObjArray* fVtxBins;      // Vertex bins 
245   Bool_t     fFirstEvent;   // First event flag 
246   TH1I*      fHEvents;      // All Events
247   TH1I*      fHEventsTr;    // Histogram of events w/trigger
248   TH1I*      fHEventsTrVtx; // Events w/trigger and vertex 
249   TAxis      fVtxAxis;      // Vertex axis 
250   TAxis      fEtaAxis;      // Eta axis 
251   TList*     fList;         // Output list 
252   UShort_t   fNPhiBins;     // Nunber of phi bins
253   ClassDef(AliCentralMCCorrectionsTask,1) // Central corrections class
254 };
255
256 #endif
257 // Local Variables:
258 //  mode: C++
259 // End:
260