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