2 // This class contains the secondary correction and the double hit
3 // correction used in low-flux events.
5 #ifndef ALIFMDCORRVERTEXBIAS_H
6 #define ALIFMDCORRVERTEXBIAS_H
8 * @file AliFMDCorrVertexBias.h
9 * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
10 * @date Wed Mar 23 14:01:56 2011
15 * @ingroup pwglf_forward_corr
18 #include <TObjArray.h>
23 * This class contains the correction for the bias introduced by
24 * different vertex bins
26 * The correction is given by
28 * b_{v}(\eta,\varphi) = \frac{1/N_{t}\sum_i^{N_{tv}} N_{ch,i,primary}}{
29 * 1/N_{v}\sum_i^{N_{v}} N_{ch,i,primary}}
32 * where @f$N_{ch,i,primary}@f$ is the number of primary particles in
33 * the given @f$(\eta,\varphi)@f$, and where the denominator sum runs
34 * over all events with a vertex within the given vertex bin, and the
35 * sum in the numerator runs over only events that have a valid
36 * trigger and reconstructed vertex. @f$ N_{t}@f$ is the number of
37 * events with a valid trigger (but not necessarily a valid vertex).
38 * The vertex information used @f$v@f$ is in all cases the MC truth
41 * These are generated from Monte-Carlo truth and ESD information.
43 * @ingroup pwglf_forward_corr
45 class AliFMDCorrVertexBias : public TObject
51 AliFMDCorrVertexBias();
55 * @param o Object to copy from
57 AliFMDCorrVertexBias(const AliFMDCorrVertexBias& o);
62 virtual ~AliFMDCorrVertexBias();
65 * @name Get corrections and parameters
70 * @param o Object to assign from
72 * @return Reference to this object
74 AliFMDCorrVertexBias& operator=(const AliFMDCorrVertexBias& o);
76 * Get the vertex bias correction @f$ b_{v}@f$
78 * @param r Ring type (I or O)
79 * @param v Primary interaction point @f$z@f$ coordinate
81 * @return The correction @f$ b_{v}@f$
83 TH2D* GetCorrection(Char_t r, Double_t v) const;
85 * Get the vertex bias correction @f$ b_{v}@f$
87 * @param r Ring type (I or O)
88 * @param b Bin corresponding to the primary interaction point
89 * @f$z@f$ coordinate (1 based)
91 * @return The correction @f$ b_{v}@f$
93 TH2D* GetCorrection(Char_t r, UShort_t b) const;
95 * Get the vertex axis used
99 const TAxis& GetVertexAxis() const { return fVertexAxis; }
104 * @name Set corrections and parameters
107 * Set the vertex bias correction @f$ b_{v}(\eta,\varphi)@f$.
108 * Note, that the object takes ownership of the passed pointer.
110 * @param r Ring type (I or O)
111 * @param v Primary interaction point @f$z@f$ coordinate
112 * @param h @f$ b_{v}(\eta,\varphi)@f$
114 * @return true if operation succeeded
116 Bool_t SetCorrection(Char_t r, Double_t v, TH2D* h);
118 * Set the vertex bias correction @f$ b_{v}(\eta,\varphi)@f$
119 * Note, that the object takes ownership of the passed pointer.
121 * @param r Ring type (I or O)
122 * @param b Bin corresponding to the primary interaction point
123 * @f$z@f$ coordinate (1 based)
124 * @param h @f$ b_{v}(\eta,\varphi)@f$
126 * @return true if operation succeeded
128 Bool_t SetCorrection(Char_t r, UShort_t b, TH2D* h);
130 * Set the vertex axis to use
132 * @param axis Vertex axis
134 void SetVertexAxis(const TAxis& axis);
136 * Set the vertex axis to use
138 * @param nBins Number of bins
142 void SetVertexAxis(Int_t nBins, Double_t min, Double_t max);
147 * @name Auxiliary member functions
150 * Declare this as a folder
152 * @return Always true
154 Bool_t IsFolder() const { return true; }
156 * Browse this object in the browser
160 void Browse(TBrowser* b);
166 void Print(Option_t* option="R") const; //*MENU*
170 * Find the vertex bin that corresponds to the passed vertex
172 * @param vertex The interaction points @f$z@f$-coordinate
174 * @return Vertex bin in @f$[1,N_{\mbox{vertex}}]@f$ or negative if
177 Int_t FindVertexBin(Double_t vertex) const;
179 * Get the vertex array corresponding to the specified ring
181 * @param v vertex bin (1 based)
183 * @return Pointer to vertex array, or null in case of problems
185 TObjArray* GetVertexArray(UShort_t v) const;
187 * Get the vertex array corresponding to the specified ring
189 * @param v vertex bin (1 based)
191 * @return Pointer to vertex array, or newly created container
193 TObjArray* GetOrMakeVertexArray(UShort_t v);
195 TObjArray fVertexArray; // Array of per-ring, per-vertex 2nd map
196 TAxis fVertexAxis; // The vertex axis
197 ClassDef(AliFMDCorrVertexBias,1); //
200 //____________________________________________________________________
202 AliFMDCorrVertexBias::SetVertexAxis(Int_t nBins, Double_t min, Double_t max)
204 fVertexAxis.Set(nBins, min, max);
206 //____________________________________________________________________
208 AliFMDCorrVertexBias::SetVertexAxis(const TAxis& e)
210 fVertexAxis.Set(e.GetNbins(), e.GetXmin(), e.GetXmax());