]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FORWARD/analysis2/AliFMDCorrAcceptance.h
Renames and new scripts
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / AliFMDCorrAcceptance.h
CommitLineData
1298ee54 1//
8973b4ed 2// This class contains the acceptance correction due to dead channels
1298ee54 3//
4//
8973b4ed 5#ifndef ALIFMDCORRACCEPTANCE_H
6#define ALIFMDCORRACCEPTANCE_H
1298ee54 7#include <TObject.h>
8#include <TObjArray.h>
9#include <TAxis.h>
10class TH2D;
11
12/**
8973b4ed 13 * This class contains the acceptance correction due to dead channels
1298ee54 14 *
8973b4ed 15 * These are generated from the on-line dead channel calculations
1298ee54 16 *
17 * @ingroup pwg2_forward_corr
18 */
8973b4ed 19class AliFMDCorrAcceptance : public TObject
1298ee54 20{
21public:
22 /**
23 * Default constructor
24 */
8973b4ed 25 AliFMDCorrAcceptance();
1298ee54 26 /**
27 * Copy constructor
28 *
29 * @param o Object to copy from
30 */
8973b4ed 31 AliFMDCorrAcceptance(const AliFMDCorrAcceptance& o);
1298ee54 32 /**
33 * Destructor
34 *
35 */
8973b4ed 36 virtual ~AliFMDCorrAcceptance();
1298ee54 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 */
8973b4ed 48 AliFMDCorrAcceptance& operator=(const AliFMDCorrAcceptance& o);
1298ee54 49 /**
8973b4ed 50 * Get the acceptance correction @f$ a_{r,v}@f$
1298ee54 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 *
8973b4ed 56 * @return The correction @f$ a_{r,v}@f$
1298ee54 57 */
58 TH2D* GetCorrection(UShort_t d, Char_t r, Double_t v) const;
59 /**
8973b4ed 60 * Get the acceptance correction @f$ a_{r,v}@f$
1298ee54 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 *
8973b4ed 67 * @return The correction @f$ a_{r,v}@f$
1298ee54 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 /**
8973b4ed 83 * Set the acceptance correction @f$ a_{r,v}(\eta)@f$.
1298ee54 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
8973b4ed 89 * @param h @f$ a_{r,v}(\eta)@f$
1298ee54 90 *
91 * @return true if operation succeeded
92 */
93 Bool_t SetCorrection(UShort_t d, Char_t r, Double_t v, TH2D* h);
94 /**
8973b4ed 95 * Set the acceptance correction @f$ a_{r,v}(\eta)@f$
1298ee54 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)
8973b4ed 102 * @param h @f$ a_{r,v}(\eta)@f$
1298ee54 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 /* @} */
146protected:
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
8973b4ed 186 ClassDef(AliFMDCorrAcceptance,1); // Acceptance correction due to dead areas
1298ee54 187};
188
189//____________________________________________________________________
190inline void
8973b4ed 191AliFMDCorrAcceptance::SetVertexAxis(Int_t nBins, Double_t min,
1298ee54 192 Double_t max)
193{
194 fVertexAxis.Set(nBins, min, max);
195}
196//____________________________________________________________________
197inline void
8973b4ed 198AliFMDCorrAcceptance::SetVertexAxis(const TAxis& e)
1298ee54 199{
200 fVertexAxis.Set(e.GetNbins(), e.GetXmin(), e.GetXmax());
201}
202#endif
203// Local Variables:
204// mode: C++
205// End: