]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/AliForwardCorrectionManager.h
Why the h*ll do we make a remote commit when pulling?
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AliForwardCorrectionManager.h
1 //
2 // Manager (singleton) of corrections 
3 // 
4 #ifndef ALIFORWARDCORRECTIONMANAGER_H
5 #define ALIFORWARDCORRECTIONMANAGER_H
6 /**
7  * @file   AliForwardCorrectionManager.h
8  * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
9  * @date   Wed Mar 23 14:04:27 2011
10  * 
11  * @brief  
12  * 
13  * 
14  * @ingroup pwglf_forward_aod
15  */
16 #include "AliCorrectionManagerBase.h"
17 #include <TString.h>
18 class TBrowser;
19 class AliFMDCorrELossFit;
20 class AliFMDCorrDoubleHit;
21 class AliFMDCorrVertexBias;
22 class AliFMDCorrMergingEfficiency;
23 class AliFMDCorrAcceptance;
24 class AliFMDCorrSecondaryMap;
25 class TAxis;
26
27 /**
28  * Manager (singleton) of corrections 
29  *
30  * Note, that this class has a custom streamer.  That is to ensure
31  * that the singleton pointer is correctly set on reading in an object
32  * of this type.
33  * 
34  * @ingroup pwglf_forward_corr 
35  * @ingroup pwglf_forward_aod
36  */
37 class AliForwardCorrectionManager : public AliCorrectionManagerBase
38 {
39 private:
40   /**
41    * Enumeration of things that can be read in 
42    */
43   enum EId { 
44     kIdSecondaryMap            = 0, 
45     kIdELossFits,
46     kIdVertexBias,
47     kIdMergingEfficiency,
48     kIdDoubleHit,
49     kIdAcceptance
50   };
51 public:
52   /**
53    * Enumeration of things that can be read in 
54    */
55   enum ECorrection { 
56     kSecondaryMap              = 0x01, 
57     kELossFits                 = 0x02, 
58     kVertexBias                = 0x04, 
59     kMergingEfficiency         = 0x08,
60     kDoubleHit                 = 0x10,
61     kAcceptance                = 0x20,
62     kDefault                   = (kSecondaryMap|kELossFits|kAcceptance),
63     kAll                       = (kSecondaryMap| 
64                                   kELossFits|
65                                   kVertexBias|
66                                   kMergingEfficiency|
67                                   kDoubleHit|
68                                   kAcceptance)
69   };
70   /** 
71    * Default constructor.  This is public for the sake of the ROOT I/O
72    * system, but should never be used outside of that system - that
73    * is, do not use this constructor
74    */
75   AliForwardCorrectionManager();
76   /** 
77    * Access to the singleton object 
78    * 
79    * @return Reference to the singleton object 
80    */
81   static AliForwardCorrectionManager& Instance();
82
83   /** 
84    * Append the content of the file @a addition to the @a destination
85    * file for this manager.  This used TFileMerger::PartialMerge 
86    * 
87    * @param destination Filename of destination storage (in OADB_PATH)
88    * @param addition    Filename of addition. 
89    * 
90    * @return true on success 
91    */
92   virtual Bool_t Append(const TString& addition,
93                         const TString& destination="") const;
94
95   /** 
96    * @return name of object 
97    */
98   const Char_t* GetName() const { return "forwardCorrections"; }
99   /** 
100    * Set path to corrections 
101    * 
102    * @param d Path
103    */
104   void SetSecondaryMapPath(const char* d) 
105   {
106     SetCorrectionFile(kIdSecondaryMap, d);
107   }
108   /** 
109    * Set path to corrections 
110    * 
111    * @param d Path
112    */
113   void SetDoubleHitPath(const char* d)    
114   {
115     SetCorrectionFile(kIdDoubleHit, d);
116   }
117   /** 
118    * Set path to corrections 
119    * 
120    * @param d Path
121    */
122   void SetELossFitsPath(const char* d)    
123   {
124     SetCorrectionFile(kIdELossFits, d);
125   }
126   /** 
127    * Set path to corrections 
128    * 
129    * @param d Path
130    */
131   void SetVertexBiasPath(const char* d)   
132   {
133     SetCorrectionFile(kIdVertexBias, d);
134   }
135   /** 
136    * Set path to corrections 
137    * 
138    * @param d Path
139    */
140   void SetMergingEffPath(const char* d)   
141   {
142     SetCorrectionFile(kIdMergingEfficiency, d);
143   }
144   /** 
145    * Set path to corrections 
146    * 
147    * @param d Path
148    */
149   void SetAcceptancePath(const char* d)   
150   {
151     SetCorrectionFile(kIdAcceptance, d);
152   }
153   /** 
154    * Read in corrections based on the parameters given 
155    * 
156    * @param runNumber       Run number
157    * @param collisionSystem Collision system
158    * @param cmsNN           Center of mass energy per nuclean pair [GeV]
159    * @param field           Magnetic field setting [kG]
160    * @param mc              Monte-carlo switch
161    * @param what            What to read in. 
162    * @param force           Force (re-)reading of specified things
163    * @param satelliteCollisions For satellite collisions
164    * 
165    * @return 
166    */
167   Bool_t Init(ULong_t  runNumber,
168               UShort_t collisionSystem, 
169               UShort_t cmsNN, 
170               Short_t  field, 
171               Bool_t   mc=false,
172               Bool_t   satelliteCollisions=false,
173               UInt_t   what=kDefault,
174               Bool_t   force=false);
175   /** 
176    * Read in correction based on passed parameters
177    * 
178    * @param runNumber       Run number
179    * @param collisionSystem Collision system string 
180    * @param cmsNN           Center of mass energy per nucleon pair [GeV]
181    * @param field           Magnetic field [kG]
182    * @param mc              Monte-carlo switch
183    * @param what            What to read in 
184    * @param force           Force (re-)reading of specified things
185    * @param satelliteCollisions For satellite collisions
186    * 
187    * @return true on success
188    */
189   Bool_t Init(ULong_t     runNumber, 
190               const char* collisionSystem, 
191               Float_t     cmsNN, 
192               Float_t     field, 
193               Bool_t      mc=false,
194               Bool_t      satelliteCollisions=false,
195               UInt_t      what=kDefault,
196               Bool_t      force=false);
197   /** 
198    * Parse string with fields in it, and return the corresponding bit mask
199    * 
200    * @param what The string 
201    * 
202    * @return The corresponding bit mask
203    */
204   static UInt_t ParseFields(const TString& what);
205   /** 
206    * Get the eta axis 
207    * 
208    * @return Eta axis or null
209    */
210   const TAxis* GetEtaAxis() const;
211   /** 
212    * Get the vertex axis 
213    * 
214    * @return The vertex axis or null
215    */
216   const TAxis* GetVertexAxis() const;
217   /** 
218    * Get the energy loss fit correction object. 
219    * 
220    * @return Get the energy loss fits corrections object or null pointer
221    */
222   const AliFMDCorrELossFit* GetELossFit() const;
223   /** 
224    * Alias for GetELossFit
225    * 
226    * @return Get the energy loss fits corrections object or null pointer
227    */
228   const AliFMDCorrELossFit* GetELossFits() const { return GetELossFit(); }
229   /** 
230    * Get the secondary correction map
231    * 
232    * @return Get the secondary correction map object or null
233    */
234   const AliFMDCorrSecondaryMap* GetSecondaryMap() const;
235   /** 
236    * Get the double hit correction object
237    * 
238    * @return Get the double hit correction object or null 
239    */
240   const AliFMDCorrDoubleHit* GetDoubleHit() const;
241   /** 
242    * Get the vertex bias correction object
243    * 
244    * @return Get the vertex bias correction object or null 
245    */
246   const AliFMDCorrVertexBias* GetVertexBias() const;
247   /** 
248    * Get the merging efficiency 
249    * 
250    * 
251    * @return Get the vertex efficiency correction 
252    */
253   const AliFMDCorrMergingEfficiency* GetMergingEfficiency() const;
254   /** 
255    * Get the acceptance correction due to dead channels 
256    * 
257    * 
258    * @return Acceptance correction due to dead channels 
259    */
260   const AliFMDCorrAcceptance* GetAcceptance() const;
261 private:
262   /** 
263    * Non-default constructor - initializes corrections - used by
264    * singleton access member function Instance
265    * 
266    * @param notUsed Ignored
267    */
268   AliForwardCorrectionManager(Bool_t notUsed);
269   
270   /** Static singleton instance */
271   static AliForwardCorrectionManager* fgInstance; // Skeleton
272
273   /** 
274    * @{ 
275    * @name Object name 
276    */
277   static const Char_t* fgkSecondaryMapSkel;  // Name of correction object 
278   static const Char_t* fgkDoubleHitSkel;     // Name of correction object 
279   static const Char_t* fgkELossFitsSkel;     // Name of correction object 
280   static const Char_t* fgkVertexBiasSkel;    // Name of correction object 
281   static const Char_t* fgkMergingEffSkel;    // Name of correction object 
282   static const Char_t* fgkAcceptanceSkel;    // Name of correction object 
283   /* 
284    * @} 
285    */
286   ClassDef(AliForwardCorrectionManager,4) // Manager of corrections 
287 };
288
289 #endif
290 // Local Variables:
291 //   mode: C++ 
292 // End: 
293