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