]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FORWARD/analysis2/AliFMDCorrMergingEfficiency.h
small fix to the merging efficiency on or off
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / AliFMDCorrMergingEfficiency.h
1 //
2 // This class contains the secondary correction and the double hit
3 // correction used in low-flux events.
4 //
5 #ifndef ALIFMDCORRMERGINGEFFICIENCY_H
6 #define ALIFMDCORRMERGINGEFFICIENCY_H
7 #include <TObject.h>
8 #include <TObjArray.h>
9 #include <TAxis.h>
10 class TH1D;
11
12 /**
13  * This class contains the merging efficiency correction.
14  *
15  * The secondary correction is given by 
16  * @f[
17  *   m_{r,v}(\eta) = 
18  * @f]
19  *
20  * These are generated from Monte-Carlo truth and ESD information. 
21  *
22  * @ingroup pwg2_forward_corr
23  */
24 class AliFMDCorrMergingEfficiency : public TObject 
25 {
26 public:
27   /** 
28    * Default constructor 
29    */
30   AliFMDCorrMergingEfficiency();
31   /** 
32    * Copy constructor 
33    * 
34    * @param o Object to copy from 
35    */
36   AliFMDCorrMergingEfficiency(const AliFMDCorrMergingEfficiency& o);
37   /**
38    * Destructor 
39    * 
40    */
41   virtual ~AliFMDCorrMergingEfficiency();
42   /** 
43    * @{ 
44    * @name Get corrections and parameters 
45    */
46   /** 
47    * Assignment operator 
48    * 
49    * @param o Object to assign from 
50    * 
51    * @return Reference to this object 
52    */
53   AliFMDCorrMergingEfficiency& operator=(const AliFMDCorrMergingEfficiency& o);
54   /** 
55    * Get the secondary correction @f$ c_{r,v}@f$ 
56    *
57    * @param d  Detector number (1-3)
58    * @param r  Ring identifier (I or O)
59    * @param v  Primary interaction point @f$z@f$ coordinate
60    * 
61    * @return The correction @f$ c_{r,v}@f$ 
62    */
63   TH1D* GetCorrection(UShort_t d, Char_t r, Double_t v) const;
64   /** 
65    * Get the secondary correction @f$ c_{r,v}@f$ 
66    *
67    * @param d  Detector number (1-3)
68    * @param r  Ring identifier (I or O)
69    * @param b  Bin corresponding to the primary interaction point 
70    *           @f$z@f$ coordinate (1 based)
71    * 
72    * @return The correction @f$ c_{r,v}@f$ 
73    */
74   TH1D* GetCorrection(UShort_t d, Char_t r, UShort_t b) const;
75   /** 
76    * Get the vertex axis used 
77    * 
78    * @return vertex axis 
79    */
80   const TAxis& GetVertexAxis() const { return fVertexAxis; }
81   /* @} */
82
83   /** 
84    * @{ 
85    * @name Set corrections and parameters 
86    */
87   /** 
88    * Set the secondary map correction @f$ m_{r,v}(\eta)@f$.
89    * Note, that the object takes ownership of the passed pointer.
90    * 
91    * @param d    Detector number (1-3)
92    * @param r    Ring identifier (I or O)
93    * @param v    Primary interaction point @f$z@f$ coordinate  
94    * @param h    @f$ m_{r,v}(\eta)@f$ 
95    * 
96    * @return true if operation succeeded 
97    */
98   Bool_t SetCorrection(UShort_t d, Char_t r, Double_t v, TH1D* h);
99   /** 
100    * Set the secondary map correction @f$ m_{r,v}(\eta)@f$ 
101    * Note, that the object takes ownership of the passed pointer.
102    * 
103    * @param d    Detector number (1-3)
104    * @param r    Ring identifier (I or O)
105    * @param b    Bin corresponding to the primary interaction point 
106    *             @f$z@f$ coordinate  (1 based)
107    * @param h    @f$ m_{r,v}(\eta)@f$ 
108    * 
109    * @return true if operation succeeded 
110    */
111   Bool_t SetCorrection(UShort_t d, Char_t r, UShort_t b, TH1D* h);
112   /** 
113    * Set the vertex axis to use 
114    * 
115    * @param axis Vertex axis 
116    */
117   void SetVertexAxis(const TAxis& axis);
118   /** 
119    * Set the vertex axis to use 
120    * 
121    * @param nBins   Number of bins
122    * @param min     Minimum
123    * @param max     Maximum
124    */
125   void SetVertexAxis(Int_t nBins, Double_t min, Double_t max);
126   /* @} */
127
128   /** 
129    * @{ 
130    * @name Auxiliary member functions 
131    */
132   /** 
133    * Declare this as a folder
134    * 
135    * @return Always true 
136    */
137   Bool_t IsFolder() const { return true; }
138   /** 
139    * Browse this object in the browser
140    * 
141    * @param b 
142    */
143   void Browse(TBrowser* b);
144   /** 
145    * Print this object 
146    * 
147    * @param option 
148    */  
149   void Print(Option_t* option="R") const; //*MENU*
150   /* @} */
151 protected:
152   /** 
153    * Find the vertex bin that corresponds to the passed vertex 
154    * 
155    * @param vertex The interaction points @f$z@f$-coordinate 
156    * 
157    * @return Vertex bin in @f$[1,N_{\mbox{vertex}}]@f$ or negative if 
158    * out of range 
159    */
160   Int_t FindVertexBin(Double_t vertex) const;
161   /** 
162    * Get the index corresponding to the given ring 
163    * 
164    * @param d Detector
165    * @param r Ring 
166    * 
167    * @return Index (0 based) or negative in case of errors
168    */
169   Int_t GetRingIndex(UShort_t d, Char_t r) const;
170   /** 
171    * Get the ring array corresponding to the specified ring
172    * 
173    * @param d Detector 
174    * @param r Ring 
175    * 
176    * @return Pointer to ring array, or null in case of problems
177    */
178   TObjArray* GetRingArray(UShort_t d, Char_t r) const;
179   /** 
180    * Get the ring array corresponding to the specified ring
181    * 
182    * @param d Detector 
183    * @param r Ring 
184    * 
185    * @return Pointer to ring array, or newly created container 
186    */
187   TObjArray* GetOrMakeRingArray(UShort_t d, Char_t r);
188
189   TObjArray fRingArray;      // Array of per-ring, per-vertex 2nd map
190   TAxis     fVertexAxis;     // The vertex axis 
191   ClassDef(AliFMDCorrMergingEfficiency,1); // 
192 };
193
194 //____________________________________________________________________
195 inline void 
196 AliFMDCorrMergingEfficiency::SetVertexAxis(Int_t nBins, Double_t min, 
197                                            Double_t max)
198 {
199   fVertexAxis.Set(nBins, min, max);
200 }
201 //____________________________________________________________________
202 inline void 
203 AliFMDCorrMergingEfficiency::SetVertexAxis(const TAxis& e)
204 {
205   fVertexAxis.Set(e.GetNbins(), e.GetXmin(), e.GetXmax());
206 }
207 #endif
208 // Local Variables:
209 //  mode: C++
210 // End: