2 // This class contains the secondary correction and the double hit
3 // correction used in low-flux events.
5 #ifndef ALIFMDCORRSECONDARYMAP_H
6 #define ALIFMDCORRSECONDARYMAP_H
8 * @file AliFMDCorrSecondaryMap.h
9 * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
10 * @date Wed Mar 23 14:01:42 2011
14 * @ingroup pwglf_forward_corr
18 #include <TObjArray.h>
23 * This class contains the secondary correction.
25 * The secondary correction is given by
27 * c_{r,v}(\eta,\varphi) =
28 * \frac{\sum_i N_{ch,i,v,\mbox{primary}}(\eta,\varphi)}{
29 * \sum_i N_{ch,i,r,v,\mbox{FMD}}(\eta,\varphi)}
31 * where @f$N_{ch,i,v,\mbox{primary}}(\eta,\varphi)@f$ is the
32 * is the number of primary charged particles that fall within
33 * the @f$(\eta,\varphi)@f$ bin in event @f$i@f$ with vertex @f$v@f$,
34 * and is the total (primary <i>and</i> secondary) charged particles
35 * that hit ring @f$r@f$ within @f$(\eta,\varphi)@f$ bin in event
36 * @f$i@f$ with vertex @f$v@f$.
38 * These are generated from Monte-Carlo truth information.
40 * @ingroup pwglf_forward_corr
42 class AliFMDCorrSecondaryMap : public TObject
48 AliFMDCorrSecondaryMap();
52 * @param o Object to copy from
54 AliFMDCorrSecondaryMap(const AliFMDCorrSecondaryMap& o);
59 virtual ~AliFMDCorrSecondaryMap();
62 * @name Get corrections and parameters
67 * @param o Object to assign from
69 * @return Reference to this object
71 AliFMDCorrSecondaryMap& operator=(const AliFMDCorrSecondaryMap& o);
73 * Get the secondary correction @f$ c_{r,v}@f$
75 * @param d Detector number (1-3)
76 * @param r Ring identifier (I or O)
77 * @param v Primary interaction point @f$z@f$ coordinate
79 * @return The correction @f$ c_{r,v}@f$
81 TH2D* GetCorrection(UShort_t d, Char_t r, Double_t v) const;
83 * Get the secondary correction @f$ c_{r,v}@f$
85 * @param d Detector number (1-3)
86 * @param r Ring identifier (I or O)
87 * @param b Bin corresponding to the primary interaction point
88 * @f$z@f$ coordinate (1 based)
90 * @return The correction @f$ c_{r,v}@f$
92 TH2D* GetCorrection(UShort_t d, Char_t r, UShort_t b) const;
94 * Get the vertex axis used
98 const TAxis& GetVertexAxis() const { return fVertexAxis; }
100 * Get the eta axis used
104 const TAxis& GetEtaAxis() const { return fEtaAxis; }
109 * @name Set corrections and parameters
112 * Set the secondary map correction @f$ c_{r,v}(\eta,\varphi)@f$.
113 * Note, that the object takes ownership of the passed pointer.
115 * @param d Detector number (1-3)
116 * @param r Ring identifier (I or O)
117 * @param v Primary interaction point @f$z@f$ coordinate
118 * @param h @f$ c_{r,v}(\eta,\varphi)@f$
120 * @return true if operation succeeded
122 Bool_t SetCorrection(UShort_t d, Char_t r, Double_t v, TH2D* h);
124 * Set the secondary map correction @f$ c_{r,v}(\eta,\varphi)@f$
125 * Note, that the object takes ownership of the passed pointer.
127 * @param d Detector number (1-3)
128 * @param r Ring identifier (I or O)
129 * @param b Bin corresponding to the primary interaction point
130 * @f$z@f$ coordinate (1 based)
131 * @param h @f$ c_{r,v}(\eta,\varphi)@f$
133 * @return true if operation succeeded
135 Bool_t SetCorrection(UShort_t d, Char_t r, UShort_t b, TH2D* h);
137 * Set the vertex axis to use
139 * @param axis Vertex axis
141 void SetVertexAxis(const TAxis& axis);
143 * Set the vertex axis to use
145 * @param nBins Number of bins
149 void SetVertexAxis(Int_t nBins, Double_t min, Double_t max);
151 * Set the eta axis to use
153 * @param axis Eta axis
155 void SetEtaAxis(const TAxis& axis);
157 * Set the eta axis to use
159 * @param nBins Number of bins
163 void SetEtaAxis(Int_t nBins, Double_t min, Double_t max);
168 * @name Auxiliary member functions
171 * Declare this as a folder
173 * @return Always true
175 Bool_t IsFolder() const { return true; }
177 * Browse this object in the browser
181 void Browse(TBrowser* b);
187 void Print(Option_t* option="R") const; //*MENU*
191 * Find the vertex bin that corresponds to the passed vertex
193 * @param vertex The interaction points @f$z@f$-coordinate
195 * @return Vertex bin in @f$[1,N_{\mbox{vertex}}]@f$ or negative if
198 Int_t FindVertexBin(Double_t vertex) const;
200 * Get the index corresponding to the given ring
205 * @return Index (0 based) or negative in case of errors
207 Int_t GetRingIndex(UShort_t d, Char_t r) const;
209 * Get the ring array corresponding to the specified ring
214 * @return Pointer to ring array, or null in case of problems
216 TObjArray* GetRingArray(UShort_t d, Char_t r) const;
218 * Get the ring array corresponding to the specified ring
223 * @return Pointer to ring array, or newly created container
225 TObjArray* GetOrMakeRingArray(UShort_t d, Char_t r);
227 TObjArray fRingArray; // Array of per-ring, per-vertex 2nd map
228 TAxis fVertexAxis; // The vertex axis
229 TAxis fEtaAxis; // The eta axis
230 ClassDef(AliFMDCorrSecondaryMap,1); //
233 //____________________________________________________________________
235 AliFMDCorrSecondaryMap::SetVertexAxis(Int_t nBins, Double_t min, Double_t max)
237 fVertexAxis.Set(nBins, min, max);
239 //____________________________________________________________________
241 AliFMDCorrSecondaryMap::SetVertexAxis(const TAxis& e)
243 fVertexAxis.Set(e.GetNbins(), e.GetXmin(), e.GetXmax());
245 //____________________________________________________________________
247 AliFMDCorrSecondaryMap::SetEtaAxis(Int_t nBins, Double_t min, Double_t max)
249 fEtaAxis.Set(nBins, min, max);
251 //____________________________________________________________________
253 AliFMDCorrSecondaryMap::SetEtaAxis(const TAxis& e)
255 fEtaAxis.Set(e.GetNbins(), e.GetXmin(), e.GetXmax());