]>
Commit | Line | Data |
---|---|---|
bfcbb65a | 1 | #ifndef ALIFMDMULTCUTS_H |
2 | #define ALIFMDMULTCUTS_H | |
3 | #include <TObject.h> | |
7095962e | 4 | class TH2; |
bfcbb65a | 5 | |
290052e7 | 6 | /** |
7095962e CHC |
7 | * Cuts used when calculating the multiplicity. |
8 | * | |
9 | * We can define our cuts in four ways (in order of priorty) | |
10 | * | |
11 | * - Using a fixed value @f$ v@f$- AliFMDMultCuts:: SetMultCuts | |
12 | * - Using a fraction @f$ f@f$ of the most probably value (@f$ \Delta_p@f$) | |
7d596e9b | 13 | * from the energy loss fits |
7095962e | 14 | * - Using some number @f$ n@$ of widths (@f$ \xi@f$) below the most |
7d596e9b | 15 | * probable value (@f$ \Delta_p@f$) from the energy loss fits |
16 | * - Using some number @f$ n@$ of widths (@f$ \xi+\sigma@f$) below the | |
17 | * most probable value (@f$ \Delta_p@f$) from the energy loss fits | |
7095962e CHC |
18 | * - Using the @f$ x@f$ value for which @f$ P(x>p)@f$ given some cut |
19 | * value @f$ p@f$ | |
20 | * - Using the lower fit range of the energy loss fits | |
21 | * | |
7095962e CHC |
22 | * The member function AliFMDMultCuts::Reset resets all cut values, |
23 | * meaning the lower bound on the fits will be used by default. This | |
24 | * is useful to ensure a fresh start: | |
25 | * | |
26 | * @code | |
27 | AliFMDMultCuts c; | |
28 | c.Reset(); | |
7d596e9b | 29 | c.Set(AliFMDMultCuts::kLandauWidth,2); |
7095962e CHC |
30 | @endcode |
31 | * | |
32 | * The member function AliFMDMultCuts::GetMethod will return the | |
33 | * method identifier for the current method employed | |
34 | * (AliFMDMultCuts::EMethod). Like wise will the method | |
35 | * AliFMDMultCuts::GetMethodString give a human readable string of the | |
36 | * current method employed. | |
290052e7 | 37 | */ |
bfcbb65a | 38 | class AliFMDMultCuts : public TObject |
39 | { | |
40 | public: | |
7095962e | 41 | enum EMethod { |
c514a160 | 42 | kFixed, |
43 | kMPVFraction, | |
44 | kFitRange, | |
7095962e | 45 | kLandauWidth, |
7d596e9b | 46 | kLandauSigmaWidth, |
7095962e | 47 | kProbability |
c514a160 | 48 | }; |
7d596e9b | 49 | enum { |
50 | kBad = 1024 | |
51 | }; | |
52 | ||
290052e7 | 53 | /** |
54 | * CTOR | |
55 | */ | |
bfcbb65a | 56 | AliFMDMultCuts(); |
7095962e CHC |
57 | /** |
58 | * Set the cut for specified method. | |
59 | * | |
7d596e9b | 60 | * @param method Cut method |
61 | * @param fmd1i Value for FMD1i | |
62 | * @param fmd2i Value for FMD2i (if < 0, use fmd1i) | |
63 | * @param fmd2o Value for FMD2o (if < 0, use fmd1i) | |
64 | * @param fmd3i Value for FMD3i (if < 0, use fmd1i) | |
65 | * @param fmd3o Value for FMD3o (if < 0, use fmd1i) | |
7095962e CHC |
66 | */ |
67 | AliFMDMultCuts(EMethod method, | |
7d596e9b | 68 | Double_t fmd1i, |
69 | Double_t fmd2i=-1, | |
70 | Double_t fmd2o=-1, | |
71 | Double_t fmd3i=-1, | |
72 | Double_t fmd3o=-1); | |
290052e7 | 73 | /** |
74 | * Copy CTOR | |
75 | * | |
76 | * @param o Oject to copy from | |
77 | */ | |
bfcbb65a | 78 | AliFMDMultCuts(const AliFMDMultCuts& o); |
290052e7 | 79 | /** |
80 | * Assignment operator | |
81 | * | |
82 | * @param o Object to asing from | |
83 | * | |
84 | * @return Reference to this object | |
85 | */ | |
bfcbb65a | 86 | AliFMDMultCuts& operator=(const AliFMDMultCuts& o); |
7095962e CHC |
87 | /** |
88 | * Reset all cuts to default value. | |
89 | */ | |
90 | void Reset(); | |
290052e7 | 91 | /** |
92 | * Get the multiplicity cuts for a specific ring and pseudo-rapidity | |
93 | * | |
94 | * @param d Detector | |
95 | * @param r Ring | |
96 | * @param eta pseudo-rapidity | |
97 | * @param errors Get error on cut | |
98 | * | |
99 | * @return Cut value | |
100 | */ | |
bfcbb65a | 101 | Double_t GetMultCut(UShort_t d, Char_t r, Double_t eta, Bool_t errors) const; |
290052e7 | 102 | /** |
7d596e9b | 103 | * Get the multiplicity cuts for a specific ring and pseudo-rapidity bin |
290052e7 | 104 | * |
105 | * @param d Detector | |
106 | * @param r Ring | |
107 | * @param etabin pseudo-rapidity bin | |
108 | * @param errors Get error on cut | |
109 | * | |
110 | * @return Cut value | |
111 | */ | |
bfcbb65a | 112 | Double_t GetMultCut(UShort_t d, Char_t r, Int_t etabin, Bool_t errors) const; |
290052e7 | 113 | /** |
114 | * Set the cuts | |
115 | * | |
7d596e9b | 116 | * @param fmd1i Value for FMD1i |
117 | * @param fmd2i Value for FMD2i (if < 0, use fmd1i) | |
118 | * @param fmd2o Value for FMD2o (if < 0, use fmd1i) | |
119 | * @param fmd3i Value for FMD3i (if < 0, use fmd1i) | |
120 | * @param fmd3o Value for FMD3o (if < 0, use fmd1i) | |
121 | * | |
122 | * @deprecated Use AliFMDMultCuts::Set | |
290052e7 | 123 | */ |
bfcbb65a | 124 | void SetMultCuts(Double_t fmd1i, |
125 | Double_t fmd2i=-1, | |
126 | Double_t fmd2o=-1, | |
127 | Double_t fmd3i=-1, | |
7d596e9b | 128 | Double_t fmd3o=-1) |
129 | { | |
130 | DepSet("SetMultCuts", kFixed,fmd1i,fmd2i,fmd2o,fmd3i,fmd3o); | |
131 | } | |
290052e7 | 132 | /** |
133 | * Set the faction of most probable value | |
134 | * | |
135 | * @param frac Fraction | |
7d596e9b | 136 | * |
137 | * @deprecated Use AliFMDMultCuts::Set | |
290052e7 | 138 | */ |
7d596e9b | 139 | void SetMPVFraction(Double_t frac=0) |
140 | { | |
141 | DepSet("SetMPVFraction",kMPVFraction, frac); | |
142 | } | |
290052e7 | 143 | /** |
144 | * Set the number times the Landau width | |
145 | * | |
146 | * @param nXi Number of widths | |
7d596e9b | 147 | * |
148 | * @deprecated Use AliFMDMultCuts::Set | |
290052e7 | 149 | */ |
7d596e9b | 150 | void SetNXi(Double_t nXi) { DepSet("SetNXi", kLandauWidth, nXi); } |
290052e7 | 151 | /** |
152 | * Set wether to includle the Gaussian sigma in cut calculation | |
153 | * | |
154 | * @param in If true, use Gaussian variance | |
7d596e9b | 155 | * |
156 | * @deprecated Use AliFMDMultCuts::Set with kLandauSigmaWidth | |
290052e7 | 157 | */ |
7d596e9b | 158 | void SetIncludeSigma(Bool_t in); |
7095962e CHC |
159 | /** |
160 | * Set probability cut. See | |
161 | * AliFMDCorrELossFit::ELossFit::FindProbabilityCut | |
162 | * | |
163 | * @param cut Cut value | |
7d596e9b | 164 | * |
165 | * @deprecated Use AliFMDMultCuts::Set | |
7095962e | 166 | */ |
7d596e9b | 167 | void SetProbability(Double_t cut=1e-5) |
168 | { | |
169 | DepSet("SetProbability", kProbability, cut); | |
170 | } | |
7095962e CHC |
171 | /** |
172 | * Set the cut for specified method. | |
173 | * | |
7d596e9b | 174 | * Note, that if @a method is kFixed, and only @a fmd1i is specified, |
7095962e | 175 | * then the outer rings cut value is increased by 20% relative to @a |
7d596e9b | 176 | * fmd1i. |
7095962e CHC |
177 | * |
178 | * Also note, that if @a method is kLandauWidth, and @a cut2 is | |
179 | * larger than zero, then @f$\sigma@f$ of the fits are included in | |
180 | * the cut value. | |
181 | * | |
182 | * @param method Method to use | |
7d596e9b | 183 | * @param fmd1i Value for FMD1i |
184 | * @param fmd2i Value for FMD2i (if < 0, use fmd1i) | |
185 | * @param fmd2o Value for FMD2o (if < 0, use fmd1i) | |
186 | * @param fmd3i Value for FMD3i (if < 0, use fmd1i) | |
187 | * @param fmd3o Value for FMD3o (if < 0, use fmd1i) | |
7095962e CHC |
188 | */ |
189 | void Set(EMethod method, | |
7d596e9b | 190 | Double_t fmd1i, |
191 | Double_t fmd2i=-1, | |
192 | Double_t fmd2o=-1, | |
193 | Double_t fmd3i=-1, | |
194 | Double_t fmd3o=-1); | |
290052e7 | 195 | /** |
196 | * Print information | |
197 | * | |
198 | * @param option Not used | |
199 | */ | |
bfcbb65a | 200 | void Print(Option_t* option="") const; |
7095962e CHC |
201 | /** |
202 | * Fill a histogram with cut values. The histogram is assumed to | |
203 | * have rings on the y axis, and @f$ \eta@f$ on the x axis. | |
204 | * | |
205 | * @param h Histogram to fill | |
206 | */ | |
207 | void FillHistogram(TH2* h) const; | |
290052e7 | 208 | /** |
209 | * Define outputs | |
210 | * | |
211 | * @param l List to add to | |
212 | * @param name Name | |
213 | */ | |
bfcbb65a | 214 | void Output(TList* l, const char* name=0) const; |
241cca4d | 215 | /** |
216 | * Read in cuts stored in file | |
217 | * | |
218 | * @param l List to read from | |
219 | * @param name Name of possible sub-list | |
220 | * | |
221 | * @return true on success | |
222 | */ | |
223 | Bool_t Input(TList* l, const char* name); | |
c514a160 | 224 | /** |
225 | * Return methid Id | |
226 | * | |
227 | * @return method number | |
228 | */ | |
7d596e9b | 229 | EMethod GetMethod() const { return fMethod; } |
c514a160 | 230 | /** |
231 | * Get a string descriping the method used | |
232 | * | |
233 | * @return String | |
234 | */ | |
7d596e9b | 235 | const char* GetMethodString(Bool_t latex=false) const; |
236 | /** | |
237 | * helper function to translate a method into a string | |
238 | * | |
239 | * @param method Method identifier | |
240 | * | |
241 | * @return String | |
242 | */ | |
243 | static const char* Method2String(EMethod method, Bool_t latex); | |
244 | /** | |
245 | * Helper function to translate a string into a method identifier | |
246 | * | |
247 | * @param str String | |
248 | * | |
249 | * @return Method identifier | |
250 | */ | |
251 | static EMethod String2Method(const char* str); | |
bfcbb65a | 252 | protected: |
7d596e9b | 253 | /** |
254 | * Set the cut for specified method. | |
255 | * | |
256 | * @param method Cut method | |
257 | * @param fmd1i Value for FMD1i | |
258 | * @param fmd2i Value for FMD2i (if < 0, use fmd1i) | |
259 | * @param fmd2o Value for FMD2o (if < 0, use fmd1i) | |
260 | * @param fmd3i Value for FMD3i (if < 0, use fmd1i) | |
261 | * @param fmd3o Value for FMD3o (if < 0, use fmd1i) | |
262 | */ | |
263 | void DepSet(const char* what, | |
264 | EMethod method, | |
265 | Double_t fmd1i, | |
266 | Double_t fmd2i=-1, | |
267 | Double_t fmd2o=-1, | |
268 | Double_t fmd3i=-1, | |
269 | Double_t fmd3o=-1); | |
270 | /** | |
271 | * Get the cut parameter for a specific ring | |
272 | * | |
273 | * @param d Detector | |
274 | * @param r Ring | |
275 | * | |
276 | * @return Cut parameter | |
277 | */ | |
278 | Double_t GetCutParam(UShort_t d, Char_t r) const; | |
279 | ||
280 | Double_t fCuts[5]; // Fixed cuts | |
281 | EMethod fMethod; | |
7095962e | 282 | |
7d596e9b | 283 | ClassDef(AliFMDMultCuts,5); // Cuts on ESD Mult |
bfcbb65a | 284 | }; |
285 | ||
286 | #endif | |
287 | // Local Variables: | |
288 | // mode: C++ | |
289 | // End: |