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