]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FORWARD/analysis2/AliFMDCorrMergingEfficiency.h
More code clean up.
[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 ALIROOT_PWG2_FORWARD_ANALYSIS_ALIFMDCORRMERGINGEFFICIENCY_H
6 #define ALIROOT_PWG2_FORWARD_ANALYSIS_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 axis Vertex axis 
122    */
123   void SetVertexAxis(Int_t nBins, Double_t min, Double_t max);
124   /* @} */
125
126   /** 
127    * @{ 
128    * @name Auxiliary member functions 
129    */
130   /** 
131    * Declare this as a folder
132    * 
133    * @return Always true 
134    */
135   Bool_t IsFolder() const { return true; }
136   /** 
137    * Browse this object in the browser
138    * 
139    * @param b 
140    */
141   void Browse(TBrowser* b);
142   /** 
143    * Print this object 
144    * 
145    * @param option 
146    */  
147   void Print(Option_t* option="R") const; //*MENU*
148   /* @} */
149 protected:
150   /** 
151    * Find the vertex bin that corresponds to the passed vertex 
152    * 
153    * @param vertex The interaction points @f$z@f$-coordinate 
154    * 
155    * @return Vertex bin in @f$[1,N_{\box{vertex}}]@f$ or negative if 
156    * out of range 
157    */
158   Int_t FindVertexBin(Double_t vertex) const;
159   /** 
160    * Get the index corresponding to the given ring 
161    * 
162    * @param d Detector
163    * @param r Ring 
164    * 
165    * @return Index (0 based) or negative in case of errors
166    */
167   Int_t GetRingIndex(UShort_t d, Char_t r) const;
168   /** 
169    * Get the ring array corresponding to the specified ring
170    * 
171    * @param d Detector 
172    * @param r Ring 
173    * 
174    * @return Pointer to ring array, or null in case of problems
175    */
176   TObjArray* GetRingArray(UShort_t d, Char_t r) const;
177   /** 
178    * Get the ring array corresponding to the specified ring
179    * 
180    * @param d Detector 
181    * @param r Ring 
182    * 
183    * @return Pointer to ring array, or newly created container 
184    */
185   TObjArray* GetOrMakeRingArray(UShort_t d, Char_t r);
186
187   TObjArray fRingArray;      // Array of per-ring, per-vertex 2nd map
188   TAxis     fVertexAxis;     // The vertex axis 
189   ClassDef(AliFMDCorrMergingEfficiency,1); // 
190 };
191
192 //____________________________________________________________________
193 inline void 
194 AliFMDCorrMergingEfficiency::SetVertexAxis(Int_t nBins, Double_t min, 
195                                            Double_t max)
196 {
197   fVertexAxis.Set(nBins, min, max);
198 }
199 //____________________________________________________________________
200 inline void 
201 AliFMDCorrMergingEfficiency::SetVertexAxis(const TAxis& e)
202 {
203   fVertexAxis.Set(e.GetNbins(), e.GetXmin(), e.GetXmax());
204 }
205 #endif
206 // Local Variables:
207 //  mode: C++
208 // End: