]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FORWARD/analysis2/AliFMDCorrMergingEfficiency.h
Added script to test the energy loss assumptions and
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / AliFMDCorrMergingEfficiency.h
CommitLineData
0bd4b00f 1//
2// This class contains the secondary correction and the double hit
3// correction used in low-flux events.
4//
7984e5f7 5#ifndef ALIFMDCORRMERGINGEFFICIENCY_H
6#define ALIFMDCORRMERGINGEFFICIENCY_H
ffca499d 7/**
8 * @file AliFMDCorrMergingEfficiency.h
9 * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
10 * @date Wed Mar 23 14:01:28 2011
11 *
12 * @brief
13 *
14 *
15 * @ingroup pwg2_forward_corr
16 */
0bd4b00f 17#include <TObject.h>
18#include <TObjArray.h>
19#include <TAxis.h>
20class TH1D;
21
22/**
23 * This class contains the merging efficiency correction.
24 *
25 * The secondary correction is given by
26 * @f[
27 * m_{r,v}(\eta) =
28 * @f]
29 *
30 * These are generated from Monte-Carlo truth and ESD information.
31 *
32 * @ingroup pwg2_forward_corr
33 */
34class AliFMDCorrMergingEfficiency : public TObject
35{
36public:
37 /**
38 * Default constructor
39 */
40 AliFMDCorrMergingEfficiency();
41 /**
42 * Copy constructor
43 *
44 * @param o Object to copy from
45 */
46 AliFMDCorrMergingEfficiency(const AliFMDCorrMergingEfficiency& o);
47 /**
48 * Destructor
49 *
50 */
51 virtual ~AliFMDCorrMergingEfficiency();
52 /**
53 * @{
54 * @name Get corrections and parameters
55 */
56 /**
57 * Assignment operator
58 *
59 * @param o Object to assign from
60 *
61 * @return Reference to this object
62 */
63 AliFMDCorrMergingEfficiency& operator=(const AliFMDCorrMergingEfficiency& o);
64 /**
65 * Get the secondary correction @f$ c_{r,v}@f$
66 *
67 * @param d Detector number (1-3)
68 * @param r Ring identifier (I or O)
69 * @param v Primary interaction point @f$z@f$ coordinate
70 *
71 * @return The correction @f$ c_{r,v}@f$
72 */
73 TH1D* GetCorrection(UShort_t d, Char_t r, Double_t v) const;
74 /**
75 * Get the secondary correction @f$ c_{r,v}@f$
76 *
77 * @param d Detector number (1-3)
78 * @param r Ring identifier (I or O)
79 * @param b Bin corresponding to the primary interaction point
80 * @f$z@f$ coordinate (1 based)
81 *
82 * @return The correction @f$ c_{r,v}@f$
83 */
84 TH1D* GetCorrection(UShort_t d, Char_t r, UShort_t b) const;
85 /**
86 * Get the vertex axis used
87 *
88 * @return vertex axis
89 */
90 const TAxis& GetVertexAxis() const { return fVertexAxis; }
91 /* @} */
92
93 /**
94 * @{
95 * @name Set corrections and parameters
96 */
97 /**
98 * Set the secondary map correction @f$ m_{r,v}(\eta)@f$.
99 * Note, that the object takes ownership of the passed pointer.
100 *
101 * @param d Detector number (1-3)
102 * @param r Ring identifier (I or O)
103 * @param v Primary interaction point @f$z@f$ coordinate
104 * @param h @f$ m_{r,v}(\eta)@f$
105 *
106 * @return true if operation succeeded
107 */
108 Bool_t SetCorrection(UShort_t d, Char_t r, Double_t v, TH1D* h);
109 /**
110 * Set the secondary map correction @f$ m_{r,v}(\eta)@f$
111 * Note, that the object takes ownership of the passed pointer.
112 *
113 * @param d Detector number (1-3)
114 * @param r Ring identifier (I or O)
115 * @param b Bin corresponding to the primary interaction point
116 * @f$z@f$ coordinate (1 based)
117 * @param h @f$ m_{r,v}(\eta)@f$
118 *
119 * @return true if operation succeeded
120 */
121 Bool_t SetCorrection(UShort_t d, Char_t r, UShort_t b, TH1D* h);
122 /**
123 * Set the vertex axis to use
124 *
125 * @param axis Vertex axis
126 */
127 void SetVertexAxis(const TAxis& axis);
128 /**
129 * Set the vertex axis to use
130 *
7c1a1f1d 131 * @param nBins Number of bins
132 * @param min Minimum
133 * @param max Maximum
0bd4b00f 134 */
135 void SetVertexAxis(Int_t nBins, Double_t min, Double_t max);
136 /* @} */
137
138 /**
139 * @{
140 * @name Auxiliary member functions
141 */
142 /**
143 * Declare this as a folder
144 *
145 * @return Always true
146 */
147 Bool_t IsFolder() const { return true; }
148 /**
149 * Browse this object in the browser
150 *
151 * @param b
152 */
153 void Browse(TBrowser* b);
154 /**
155 * Print this object
156 *
157 * @param option
158 */
159 void Print(Option_t* option="R") const; //*MENU*
160 /* @} */
161protected:
162 /**
163 * Find the vertex bin that corresponds to the passed vertex
164 *
165 * @param vertex The interaction points @f$z@f$-coordinate
166 *
7c1a1f1d 167 * @return Vertex bin in @f$[1,N_{\mbox{vertex}}]@f$ or negative if
0bd4b00f 168 * out of range
169 */
170 Int_t FindVertexBin(Double_t vertex) const;
171 /**
172 * Get the index corresponding to the given ring
173 *
174 * @param d Detector
175 * @param r Ring
176 *
177 * @return Index (0 based) or negative in case of errors
178 */
179 Int_t GetRingIndex(UShort_t d, Char_t r) const;
180 /**
181 * Get the ring array corresponding to the specified ring
182 *
183 * @param d Detector
184 * @param r Ring
185 *
186 * @return Pointer to ring array, or null in case of problems
187 */
188 TObjArray* GetRingArray(UShort_t d, Char_t r) const;
189 /**
190 * Get the ring array corresponding to the specified ring
191 *
192 * @param d Detector
193 * @param r Ring
194 *
195 * @return Pointer to ring array, or newly created container
196 */
197 TObjArray* GetOrMakeRingArray(UShort_t d, Char_t r);
198
199 TObjArray fRingArray; // Array of per-ring, per-vertex 2nd map
200 TAxis fVertexAxis; // The vertex axis
201 ClassDef(AliFMDCorrMergingEfficiency,1); //
202};
203
204//____________________________________________________________________
205inline void
206AliFMDCorrMergingEfficiency::SetVertexAxis(Int_t nBins, Double_t min,
207 Double_t max)
208{
209 fVertexAxis.Set(nBins, min, max);
210}
211//____________________________________________________________________
212inline void
213AliFMDCorrMergingEfficiency::SetVertexAxis(const TAxis& e)
214{
215 fVertexAxis.Set(e.GetNbins(), e.GetXmin(), e.GetXmax());
216}
217#endif
218// Local Variables:
219// mode: C++
220// End: