]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/AliCentralMCCorrectionsTask.h
This commit has two major parts:
[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 class AliCentralCorrSecondaryMap;
20 class AliCentralCorrAcceptance;
21 class AliESDEvent;
22 class TH2D;
23 class TH1D;
24 class TH1I;
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    * Set the maximum @f$|\eta|@f$ to accept. 
151    * 
152    * @param maxEta maximum @f$|\eta|@f$
153    */
154   void SetEtaCut(Double_t maxEta=1.9) { fEtaCut = maxEta; }
155   /** 
156    * If a particular phi bin has less then this fraction of the
157    * largest signal in the corresponding @f$\eta@f$ slice, then it is
158    * not used.
159    * 
160    * @param least Lower bound on fraction of largest signal in this
161    * @f$\eta@f$ slice
162    */
163   void SetAcceptanceCut(Double_t least=0.8) { fCorrCut = least; }
164   /** 
165    * Get a reference to the track density calculator 
166    * 
167    * @return Reference to the track density calculator 
168    */
169   AliSPDMCTrackDensity& GetTrackDensity() { return fTrackDensity; }
170   /** 
171    * Get a reference to the track density calculator 
172    * 
173    * @return Reference to the track density calculator 
174    */
175   const AliSPDMCTrackDensity& GetTrackDensity() const { return fTrackDensity; }
176   /** 
177    * Get a reference to the event inspector
178    * 
179    * @return Reference to the event inspector 
180    */
181   AliFMDMCEventInspector& GetEventInspector() { return fInspector; }
182   /** 
183    * Get a reference to the event inspector
184    * 
185    * @return Reference to the event inspector 
186    */
187   const AliFMDMCEventInspector& GetEventInspector() const { return fInspector;}
188 protected: 
189   /**
190    * A vertex bin 
191    * 
192    */
193   struct VtxBin : public TNamed
194   {
195     /** 
196      * Constructor 
197      */
198     VtxBin();
199     /** 
200      * Constructor
201      *  
202      * @param low       Lower @f$v_z@f$ bound
203      * @param high      Upper @f$v_z@f$ bound
204      * @param etaAxis   @f$\eta@f$ axis to use 
205      * @param nPhi      Number of phi bins 
206      */
207     VtxBin(Double_t low, Double_t high, const TAxis& etaAxis, UShort_t nPhi);
208     /** 
209      * Copy constructor 
210      * 
211      * @param o Object to copy from 
212      */
213     VtxBin(const VtxBin& o);
214     /** 
215      * Assignment operator 
216      * 
217      * @param o Object to assign from 
218      * 
219      * @return Reference to this object
220      */
221     VtxBin& operator=(const VtxBin& o);
222     /** 
223      * Get bin name
224      * 
225      * @param low       Lower @f$v_z@f$ bound
226      * @param high      Upper @f$v_z@f$ bound
227      * 
228      * @return Bin name 
229      */
230     static const char* BinName(Double_t low, Double_t high);
231     /** 
232      * Declare output in passed list 
233      * 
234      * @param list List to put output in 
235      */
236     void CreateOutputObjects(TList* list);
237     /** 
238      * End of job process 
239      * 
240      * @param o         List to add output to 
241      * @param i         Input list
242      * @param iVz       Vertex bin 
243      * @param effective Make an effective correction 
244      * @param etaCut    Maximum @f$|\eta|@f$ to use 
245      * @param accCut    Cut on acceptance 
246      * @param acorr     Acceptance correction 
247      * @param map       Corrections map 
248      */
249     void Terminate(const TList* i, 
250                    TList* o,
251                    UShort_t iVz, 
252                    Bool_t effective,
253                    Double_t etaCut, 
254                    Double_t accCut,
255                    AliCentralCorrSecondaryMap* map,
256                    AliCentralCorrAcceptance* acorr);
257     
258     TH2D* fHits;     // Cache of MC-truth hits
259     TH2D* fClusters; // Cache of reconstructed hits
260     TH2D* fPrimary;  // Cache or primary 
261     TH1D* fCounts;   // Event count 
262
263     ClassDef(VtxBin,3); // Vertex bin 
264   };
265   /** 
266    * Define our vertex bins 
267    * 
268    * @param list List to read or add binst from/to
269    */
270   void DefineBins(TList* list);
271
272   AliFMDMCEventInspector fInspector; // Event inspector 
273   AliSPDMCTrackDensity   fTrackDensity; // Get the track density 
274
275   TObjArray* fVtxBins;       // Vertex bins 
276   Bool_t     fFirstEvent;    // First event flag 
277   TH1I*      fHEvents;       // All Events
278   TH1I*      fHEventsTr;     // Histogram of events w/trigger
279   TH1I*      fHEventsTrVtx;  // Events w/trigger and vertex 
280   TAxis      fVtxAxis;       // Vertex axis 
281   TAxis      fEtaAxis;       // Eta axis 
282   TList*     fList;          // Output list 
283   UShort_t   fNPhiBins;      // Nunber of phi bins
284   Bool_t     fEffectiveCorr; // Whether to make effective corrections
285   Double_t   fEtaCut;        // Maximum Eta
286   Double_t   fCorrCut;       // Correction cut
287   ClassDef(AliCentralMCCorrectionsTask,3) // Central corrections class
288 };
289
290 #endif
291 // Local Variables:
292 //  mode: C++
293 // End:
294