2 // This class contains the acceptance correction due to dead channels
5 #ifndef ALIFMDCORRACCEPTANCE_H
6 #define ALIFMDCORRACCEPTANCE_H
8 * @file AliFMDCorrAcceptance.h
9 * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
10 * @date Wed Mar 23 14:00:40 2011
14 * @ingroup pwglf_forward_corr
18 #include <TObjArray.h>
24 * This class contains the acceptance correction due to dead channels
26 * These are generated from the on-line dead channel calculations
28 * @ingroup pwglf_forward_corr
30 class AliFMDCorrAcceptance : public TObject
36 AliFMDCorrAcceptance();
40 * @param o Object to copy from
42 AliFMDCorrAcceptance(const AliFMDCorrAcceptance& o);
47 virtual ~AliFMDCorrAcceptance();
50 * @name Get corrections and parameters
55 * @param o Object to assign from
57 * @return Reference to this object
59 AliFMDCorrAcceptance& operator=(const AliFMDCorrAcceptance& o);
61 * Get the acceptance correction @f$ a_{r,v}@f$
63 * @param d Detector number (1-3)
64 * @param r Ring identifier (I or O)
65 * @param v Primary interaction point @f$z@f$ coordinate
67 * @return The correction @f$ a_{r,v}@f$
69 TH2D* GetCorrection(UShort_t d, Char_t r, Double_t v) const;
71 * Get the acceptance correction @f$ a_{r,v}@f$
73 * @param d Detector number (1-3)
74 * @param r Ring identifier (I or O)
75 * @param b Bin corresponding to the primary interaction point
76 * @f$z@f$ coordinate (1 based)
78 * @return The correction @f$ a_{r,v}@f$
80 TH2D* GetCorrection(UShort_t d, Char_t r, UShort_t b) const;
82 * Get the phi acceptance
90 TH1D* GetPhiAcceptance(UShort_t d, Char_t r, Double_t v) const;
92 * Get the phi acceptance
96 * @param b vertex bin number
100 TH1D* GetPhiAcceptance(UShort_t d, Char_t r, UShort_t b) const;
102 * Get the vertex axis used
104 * @return vertex axis
106 const TAxis& GetVertexAxis() const { return fVertexAxis; }
108 * @return true if the overflow bins along eta are set to the ratio
109 * of OK strips to all strips for a given eta bin.
111 Bool_t HasOverflow() const { return fHasOverflow; }
116 * @name Set corrections and parameters
119 * Set the acceptance correction @f$ a_{r,v}(\eta)@f$.
120 * Note, that the object takes ownership of the passed pointer.
122 * @param d Detector number (1-3)
123 * @param r Ring identifier (I or O)
124 * @param v Primary interaction point @f$z@f$ coordinate
125 * @param h @f$ a_{r,v}(\eta)@f$
127 * @return true if operation succeeded
129 Bool_t SetCorrection(UShort_t d, Char_t r, Double_t v, TH2D* h);
131 * Set the acceptance correction @f$ a_{r,v}(\eta)@f$
132 * Note, that the object takes ownership of the passed pointer.
134 * @param d Detector number (1-3)
135 * @param r Ring identifier (I or O)
136 * @param b Bin corresponding to the primary interaction point
137 * @f$z@f$ coordinate (1 based)
138 * @param h @f$ a_{r,v}(\eta)@f$
140 * @return true if operation succeeded
142 Bool_t SetCorrection(UShort_t d, Char_t r, UShort_t b, TH2D* h);
144 * Set the vertex axis to use
146 * @param axis Vertex axis
148 void SetVertexAxis(const TAxis& axis);
150 * Set the vertex axis to use
152 * @param nBins Number of bins
156 void SetVertexAxis(Int_t nBins, Double_t min, Double_t max);
158 * Set that we have (or not) the overflow bin present
160 * @param present If true, assume the overflow bins are filled
162 void SetHasOverflow(Bool_t present=true) { fHasOverflow = present; }
167 * @name Auxiliary member functions
170 * Declare this as a folder
172 * @return Always true
174 Bool_t IsFolder() const { return true; }
176 * Browse this object in the browser
180 void Browse(TBrowser* b);
186 void Print(Option_t* option="R") const; //*MENU*
187 void ls(Option_t* option="") const; //*MENU*
188 // void Draw(Option_t* option="");
189 // void SaveAs(const Char_t* filename, Option_t* option="colz") const;
193 * Find the vertex bin that corresponds to the passed vertex
195 * @param vertex The interaction points @f$z@f$-coordinate
197 * @return Vertex bin in @f$[1,N_{\mbox{vertex}}]@f$ or negative if
200 Int_t FindVertexBin(Double_t vertex) const;
202 * Get the index corresponding to the given ring
207 * @return Index (0 based) or negative in case of errors
209 Int_t GetRingIndex(UShort_t d, Char_t r) const;
211 * Get the ring array corresponding to the specified ring
217 * @return Pointer to ring array, or null in case of problems
219 TObjArray* GetRingArray(const TObjArray& m, UShort_t d, Char_t r) const;
221 * Get the ring array corresponding to the specified ring
227 * @return Pointer to ring array, or newly created container
229 TObjArray* GetOrMakeRingArray(TObjArray& m, UShort_t d, Char_t r) const;
230 TObject* GetObject(const TObjArray& m, UShort_t d,
231 Char_t r, UShort_t b) const;
233 void FillCache() const;
235 TObjArray fRingArray; // Array of per-ring, per-vertex 2d map
236 mutable TObjArray* fCache; //! Array of per-ring, per-vertex 1d factors
237 TAxis fVertexAxis; // The vertex axis
238 Bool_t fHasOverflow; // Whether we have the overflow bin set
239 ClassDef(AliFMDCorrAcceptance,2); // Acceptance correction due to dead areas
242 //____________________________________________________________________
244 AliFMDCorrAcceptance::SetVertexAxis(Int_t nBins, Double_t min,
247 fVertexAxis.Set(nBins, min, max);
249 //____________________________________________________________________
251 AliFMDCorrAcceptance::SetVertexAxis(const TAxis& e)
253 fVertexAxis.Set(e.GetNbins(), e.GetXmin(), e.GetXmax());