]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/AliCentralMCCorrectionsTask.h
Merge branch 'feature-movesplit'
[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 "AliBaseMCCorrectionsTask.h"
17 #include "AliSPDMCTrackDensity.h"
18 class AliCentralCorrSecondaryMap;
19 class AliCentralCorrAcceptance;
20
21
22 /** 
23  * Calculate the corrections in the central regions
24  * 
25  * @par Inputs: 
26  *   - AliESDEvent 
27  *
28  * @par Outputs: 
29  *   - AliAODCentralMult 
30  * 
31  * @par Histograms 
32  *   
33  * @par Corrections used 
34  * 
35  * @ingroup pwglf_central_tasks
36  * @ingroup pwglf_central_mc
37  * @ingroup pwglf_central_aod
38  * 
39  */
40 class AliCentralMCCorrectionsTask : public AliBaseMCCorrectionsTask
41 {
42 public:
43   /** 
44    * Constructor 
45    * 
46    * @param name Name of task 
47    */
48   AliCentralMCCorrectionsTask(const char* name);
49   /** 
50    * Constructor
51    */
52   AliCentralMCCorrectionsTask();
53   /** 
54    * @{ 
55    * @name Interface methods 
56    */
57   /** 
58    * Print this object 
59    * 
60    * @param option   Not used
61    */
62   void Print(Option_t* option="") const;
63
64   /** 
65    * Set the number of phi bins to use 
66    * 
67    * @param nBins 
68    */
69   void SetNPhiBins(UShort_t nBins) { fNPhiBins = nBins; }
70   /** 
71    * Whether to make effective corrections
72    * 
73    * @param e if true, make effective correction
74    */
75   void SetEffectiveCorrection(Bool_t e) { fEffectiveCorr = e; }
76   /** 
77    * Set the maximum @f$|\eta|@f$ to accept. 
78    * 
79    * @param maxEta maximum @f$|\eta|@f$
80    */
81   void SetEtaCut(Double_t maxEta=1.9) { fEtaCut = maxEta; }
82   /** 
83    * If a particular phi bin has less then this fraction of the
84    * largest signal in the corresponding @f$\eta@f$ slice, then it is
85    * not used.
86    * 
87    * @param least Lower bound on fraction of largest signal in this
88    * @f$\eta@f$ slice
89    */
90   void SetAcceptanceCut(Double_t least=0.8) { fCorrCut = least; }
91   /** 
92    * Get a reference to the track density calculator 
93    * 
94    * @return Reference to the track density calculator 
95    */
96   AliSPDMCTrackDensity& GetTrackDensity() { return fTrackDensity; }
97   /** 
98    * Get a reference to the track density calculator 
99    * 
100    * @return Reference to the track density calculator 
101    */
102   const AliSPDMCTrackDensity& GetTrackDensity() const { return fTrackDensity; }
103 protected: 
104   /** 
105    * Copy constructor 
106    * 
107    * @param o Object to copy from 
108    */
109   AliCentralMCCorrectionsTask(const AliCentralMCCorrectionsTask& o);
110   /** 
111    * Assignment operator 
112    * 
113    * @param o Object to assign from 
114    * 
115    * @return Reference to this object 
116    */
117   AliCentralMCCorrectionsTask& operator=(const AliCentralMCCorrectionsTask& o);
118   /**
119    * A vertex bin 
120    * 
121    */
122   struct VtxBin : public AliBaseMCCorrectionsTask::VtxBin
123   {
124     /** 
125      * Constructor 
126      */
127     VtxBin();
128     /** 
129      * Constructor
130      *  
131      * @param low       Lower @f$v_z@f$ bound
132      * @param high      Upper @f$v_z@f$ bound
133      * @param etaAxis   @f$\eta@f$ axis to use 
134      * @param nPhi      Number of phi bins 
135      */
136     VtxBin(Double_t low, Double_t high, const TAxis& etaAxis, UShort_t nPhi);
137     /** 
138      * Copy constructor 
139      * 
140      * @param o Object to copy from 
141      */
142     VtxBin(const VtxBin& o){;}
143     /** 
144      * Assignment operator 
145      * 
146      * @param o Object to assign from 
147      * 
148      * @return Reference to this object
149      */
150     VtxBin& operator=(const VtxBin& o){return *this;}
151     /** 
152      * Declare output in passed list 
153      * 
154      * @param list List to put output in 
155      */
156     TList* CreateOutputObjects(TList* list);
157     /** 
158      * End of job process 
159      * 
160      * @param o         List to add output to 
161      * @param i         Input list
162      * @param iVz       Vertex bin 
163      * @param effective Make an effective correction 
164      * @param etaCut    Maximum @f$|\eta|@f$ to use 
165      * @param accCut    Cut on acceptance 
166      * @param acorr     Acceptance correction 
167      * @param map       Corrections map 
168      */
169     void Terminate(const TList* i, 
170                    TList* o,
171                    UShort_t iVz, 
172                    Bool_t effective,
173                    Double_t etaCut, 
174                    Double_t accCut,
175                    AliCentralCorrSecondaryMap* map,
176                    AliCentralCorrAcceptance* acorr);
177     
178     TH2D* fHits;     // Cache of MC-truth hits
179     TH2D* fClusters; // Cache of reconstructed hits
180
181     ClassDef(VtxBin,3); // Vertex bin 
182   };
183   /** 
184    * Define our vertex bins 
185    * 
186    * @param list List to read or add binst from/to
187    */
188   void DefineBins(TList* list);
189   /** 
190    * Create a vertex bin 
191    * 
192    * @param low     Low cut on @f$IP_{z}@f$ 
193    * @param high    High cut on @f$IP_{z}@f$ 
194    * 
195    * @return Newly created vertex bin
196    */
197   AliBaseMCCorrectionsTask::VtxBin* CreateVtxBin(Double_t low, Double_t high);
198   /** 
199    * Process an ESD event
200    * 
201    * @param esd   ESD event 
202    * @param mc    MC event
203    * @param bin   Vertex bin 
204    * @param vz    @f$IP_{z}@f$ 
205    * 
206    * @return true on success
207    */
208   Bool_t ProcessESD(const AliESDEvent& esd, const AliMCEvent& mc, 
209                     AliBaseMCCorrectionsTask::VtxBin& bin,
210                     Double_t vz);
211   /** 
212    * Create corrections objects and store them in passed list
213    * 
214    * @param results Output list 
215    */
216   virtual void CreateCorrections(TList* results);
217   /** 
218    * Do the final processing of a vertex bin 
219    * 
220    * @param bin       Vertex bin
221    * @param iVz       Vertex bin number 
222    * 
223    * @return true on successd
224    */
225   virtual Bool_t FinalizeVtxBin(AliBaseMCCorrectionsTask::VtxBin*      bin, 
226                                 UShort_t     iVz);
227
228
229   AliSPDMCTrackDensity        fTrackDensity; // Get the track density 
230   AliCentralCorrSecondaryMap* fSecCorr;
231   AliCentralCorrAcceptance*   fAccCorr;
232
233   UShort_t   fNPhiBins;      // Nunber of phi bins
234   Bool_t     fEffectiveCorr; // Whether to make effective corrections
235   Double_t   fEtaCut;        // Maximum Eta
236   Double_t   fCorrCut;       // Correction cut
237   ClassDef(AliCentralMCCorrectionsTask,3) // Central corrections class
238 };
239
240 #endif
241 // Local Variables:
242 //  mode: C++
243 // End:
244