]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/AliForwardMCCorrectionsTask.h
flat friend update
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AliForwardMCCorrectionsTask.h
1 // 
2 // Calculate the corrections in the forward regions
3 // 
4 #ifndef ALIFORWARDMCCORRECTIONS_H
5 #define ALIFORWARDMCCORRECTIONS_H
6 /**
7  * @file   AliForwardMCCorrectionsTask.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_forward_aod
15  */
16 #include "AliBaseMCCorrectionsTask.h"
17 #include <AliESDFMD.h>
18 #include "AliFMDMCTrackDensity.h"
19 #include "AliForwardUtil.h"
20 #include <TH1I.h>
21 class AliESDEvent;
22 class AliFMDCorrSecondaryMap;
23 class TList;
24
25
26 /** 
27  * Calculate the simulation-based corrections in the forward regions
28  * 
29  * @image html alice-int-2012-040-secondary_origin.png "Fraction of secondaries"
30  *
31  * @par Inputs: 
32  *   - AliESDEvent (for steering only)
33  *   - AliTrackReference
34  *   - Kinematics 
35  *   - Geometry 
36  *
37  * @par Outputs: 
38  *   - AliFMDCorrSecondaryMap
39  * 
40  * @par Histograms 
41  *   
42  * @par Corrections used 
43  *   - None
44  * 
45  * @ingroup pwglf_forward_tasks
46  * @ingroup pwglf_forward_mc
47  * @ingroup pwglf_forward_aod
48  * 
49  */
50 class AliForwardMCCorrectionsTask : public AliBaseMCCorrectionsTask
51 {
52 public:
53   /** 
54    * Constructor 
55    * 
56    * @param name Name of task 
57    */
58   AliForwardMCCorrectionsTask(const char* name);
59   /** 
60    * Constructor
61    */
62   AliForwardMCCorrectionsTask();
63   /** 
64    * @{ 
65    * @name Interface methods 
66    */
67   /** 
68    * Called before the event processing 
69    * 
70    * @return true on success
71    */
72   virtual Bool_t PreEvent();
73   /** 
74    * @} 
75    */
76   /** 
77    * Print this object 
78    * 
79    * @param option   Not used
80    */
81   void Print(Option_t* option="") const;
82   /** 
83    * Get a reference to the track density calculator 
84    * 
85    * @return Reference to the track density calculator 
86    */
87   AliBaseMCTrackDensity& GetTrackDensity() { return fTrackDensity; }
88   /** 
89    * Get a reference to the track density calculator 
90    * 
91    * @return Reference to the track density calculator 
92    */
93   const AliBaseMCTrackDensity& GetTrackDensity() const { return fTrackDensity; }
94 protected: 
95   /** 
96    * Copy constructor 
97    * 
98    * @param o Object to copy from 
99    */
100   AliForwardMCCorrectionsTask(const AliForwardMCCorrectionsTask& o);
101   /** 
102    * Assignment operator 
103    * 
104    * @param o Object to assign from 
105    * 
106    * @return Reference to this object 
107    */
108   AliForwardMCCorrectionsTask& operator=(const AliForwardMCCorrectionsTask& o);
109   /**
110    * A vertex bin 
111    * 
112    */
113   struct VtxBin : public AliBaseMCCorrectionsTask::VtxBin
114   {
115     /** 
116      * Constructor 
117      */
118     VtxBin();
119     /** 
120      * Constructor
121      *  
122      * @param low       Lower @f$v_z@f$ bound
123      * @param high      Upper @f$v_z@f$ bound
124      * @param etaAxis   @f$\eta@f$ axis to use 
125      */
126     VtxBin(Double_t low, Double_t high, const TAxis& etaAxis);
127     /** 
128      * Copy constructor 
129      * 
130      * @param o Object to copy from 
131      */
132     VtxBin(const VtxBin& o);
133     /** 
134      * Assignment operator 
135      * 
136      * @param o Object to assign from 
137      * 
138      * @return Reference to this object
139      */
140     VtxBin& operator=(const VtxBin& o);
141     /** 
142      * Declare output in passed list 
143      * 
144      * @param list List to put output in 
145      */
146     TList* CreateOutputObjects(TList* list);
147     /** 
148      * Calculate the background correction
149      * 
150      * @param hits      Summed hits (track-refs)
151      * @param primary   Summed primaries 
152      * 
153      * @return Background correction
154      */
155     TH2D* MakeBg(const TH2D* hits, const TH2D* primary) const;
156     /** 
157      * End of job process 
158      * 
159      * @param o   List to add output to 
160      * @param i   Input 
161      * @param iVz Vertex bin
162      * @param map Corrections map 
163      */
164     void Terminate(const TList*            i, 
165                 TList*                  o,
166                 UShort_t                iVz, 
167                 AliFMDCorrSecondaryMap* map);
168
169     AliForwardUtil::Histos fHists;    // Cache of per-ring histograms
170     ClassDef(VtxBin,2); // Vertex bin 
171   };
172   /** 
173    * Create a vertex bin 
174    * 
175    * @param low     Low cut on @f$IP_{z}@f$ 
176    * @param high    High cut on @f$IP_{z}@f$ 
177    * 
178    * @return Newly created vertex bin
179    */
180   AliBaseMCCorrectionsTask::VtxBin* CreateVtxBin(Double_t low, Double_t high);
181   /** 
182    * Process an ESD event
183    * 
184    * @param esd   ESD event 
185    * @param mc    MC event
186    * @param bin   Vertex bin 
187    * @param vz    @f$IP_{z}@f$ 
188    * 
189    * @return true on success
190    */
191   Bool_t ProcessESD(const AliESDEvent& esd, const AliMCEvent& mc, 
192                     AliBaseMCCorrectionsTask::VtxBin& bin,
193                     Double_t vz);
194   /** 
195    * Create corrections objects and store them in passed list
196    * 
197    * @param results Output list 
198    */
199   virtual void CreateCorrections(TList* results);
200   /** 
201    * Do the final processing of a vertex bin 
202    * 
203    * @param bin       Vertex bin
204    * @param iVz       Vertex bin number 
205    * 
206    * @return true on successd
207    */
208   virtual Bool_t FinalizeVtxBin(AliBaseMCCorrectionsTask::VtxBin* bin, 
209                                 UShort_t     iVz);
210
211
212   AliFMDMCTrackDensity    fTrackDensity; // Get the track density 
213   AliESDFMD               fESDFMD;       // Cache object
214   AliFMDCorrSecondaryMap* fSecCorr;
215   ClassDef(AliForwardMCCorrectionsTask,4) // Forward corrections class
216 };
217
218 #endif
219 // Local Variables:
220 //  mode: C++
221 // End:
222