2 // This class contains the secondary correction and the double hit
3 // correction used in low-flux events.
5 #ifndef ALIROOT_PWG2_FORWARD_ANALYSIS_ALIFMDCORRVERTEXBIAS_H
6 #define ALIROOT_PWG2_FORWARD_ANALYSIS_ALIFMDCORRVERTEXBIAS_H
13 * This class contains the correction for the bias introduced by
14 * different vertex bins
16 * The correction is given by
18 * b_{v}(\eta,\varphi) = \frac{1/N_{t}\sum_i^{N_{tv}} N_{ch,i,primary}}{
19 * 1/N_{v}\sum_i^{N_{v}} N_{ch,i,primary}}
22 * where @f$N_{ch,i,primary}@f$ is the number of primary particles in
23 * the given @f$(\eta,\varphi)@f$, and where the denominator sum runs
24 * over all events with a vertex within the given vertex bin, and the
25 * sum in the numerator runs over only events that have a valid
26 * trigger and reconstructed vertex. @f$ N_{t}@f$ is the number of
27 * events with a valid trigger (but not necessarily a valid vertex).
28 * The vertex information used @f$v@f$ is in all cases the MC truth
31 * These are generated from Monte-Carlo truth and ESD information.
33 * @ingroup pwg2_forward_corr
35 class AliFMDCorrVertexBias : public TObject
41 AliFMDCorrVertexBias();
45 * @param o Object to copy from
47 AliFMDCorrVertexBias(const AliFMDCorrVertexBias& o);
52 virtual ~AliFMDCorrVertexBias();
55 * @name Get corrections and parameters
60 * @param o Object to assign from
62 * @return Reference to this object
64 AliFMDCorrVertexBias& operator=(const AliFMDCorrVertexBias& o);
66 * Get the vertex bias correction @f$ b_{v}@f$
68 * @param r Ring type (I or O)
69 * @param v Primary interaction point @f$z@f$ coordinate
71 * @return The correction @f$ b_{v}@f$
73 TH2D* GetCorrection(Char_t r, Double_t v) const;
75 * Get the vertex bias correction @f$ b_{v}@f$
77 * @param r Ring type (I or O)
78 * @param b Bin corresponding to the primary interaction point
79 * @f$z@f$ coordinate (1 based)
81 * @return The correction @f$ b_{v}@f$
83 TH2D* GetCorrection(Char_t r, UShort_t b) const;
85 * Get the vertex axis used
89 const TAxis& GetVertexAxis() const { return fVertexAxis; }
94 * @name Set corrections and parameters
97 * Set the vertex bias correction @f$ b_{v}(\eta,\varphi)@f$.
98 * Note, that the object takes ownership of the passed pointer.
100 * @param r Ring type (I or O)
101 * @param v Primary interaction point @f$z@f$ coordinate
102 * @param h @f$ b_{v}(\eta,\varphi)@f$
104 * @return true if operation succeeded
106 Bool_t SetCorrection(Char_t r, Double_t v, TH2D* h);
108 * Set the vertex bias correction @f$ b_{v}(\eta,\varphi)@f$
109 * Note, that the object takes ownership of the passed pointer.
111 * @param r Ring type (I or O)
112 * @param b Bin corresponding to the primary interaction point
113 * @f$z@f$ coordinate (1 based)
114 * @param h @f$ b_{v}(\eta,\varphi)@f$
116 * @return true if operation succeeded
118 Bool_t SetCorrection(Char_t r, UShort_t b, TH2D* h);
120 * Set the vertex axis to use
122 * @param axis Vertex axis
124 void SetVertexAxis(const TAxis& axis);
126 * Set the vertex axis to use
128 * @param nBins Number of bins
132 void SetVertexAxis(Int_t nBins, Double_t min, Double_t max);
137 * @name Auxiliary member functions
140 * Declare this as a folder
142 * @return Always true
144 Bool_t IsFolder() const { return true; }
146 * Browse this object in the browser
150 void Browse(TBrowser* b);
156 void Print(Option_t* option="R") const; //*MENU*
160 * Find the vertex bin that corresponds to the passed vertex
162 * @param vertex The interaction points @f$z@f$-coordinate
164 * @return Vertex bin in @f$[1,N_{\mbox{vertex}}]@f$ or negative if
167 Int_t FindVertexBin(Double_t vertex) const;
169 * Get the vertex array corresponding to the specified ring
171 * @param v vertex bin (1 based)
173 * @return Pointer to vertex array, or null in case of problems
175 TObjArray* GetVertexArray(UShort_t v) const;
177 * Get the vertex array corresponding to the specified ring
179 * @param v vertex bin (1 based)
181 * @return Pointer to vertex array, or newly created container
183 TObjArray* GetOrMakeVertexArray(UShort_t v);
185 TObjArray fVertexArray; // Array of per-ring, per-vertex 2nd map
186 TAxis fVertexAxis; // The vertex axis
187 ClassDef(AliFMDCorrVertexBias,1); //
190 //____________________________________________________________________
192 AliFMDCorrVertexBias::SetVertexAxis(Int_t nBins, Double_t min, Double_t max)
194 fVertexAxis.Set(nBins, min, max);
196 //____________________________________________________________________
198 AliFMDCorrVertexBias::SetVertexAxis(const TAxis& e)
200 fVertexAxis.Set(e.GetNbins(), e.GetXmin(), e.GetXmax());