]>
Commit | Line | Data |
---|---|---|
ce85db45 | 1 | // |
2 | // Task to analyse the AOD for for dN/deta in the base regions | |
3 | // | |
4 | #ifndef ALIBASEDNDETATASK_H | |
5 | #define ALIBASEDNDETATASK_H | |
ffca499d | 6 | /** |
7 | * @file AliBasedNdetaTask.h | |
8 | * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk> | |
9 | * @date Wed Mar 23 13:58:12 2011 | |
10 | * | |
11 | * @brief | |
12 | * | |
bd6f5206 | 13 | * @ingroup pwglf_forward_dndeta |
ffca499d | 14 | * |
15 | */ | |
c8b1a7db | 16 | #include "AliBaseAODTask.h" |
e308a636 | 17 | class TAxis; |
ce85db45 | 18 | class TList; |
19 | class TH2D; | |
f67d699c | 20 | class TH2F; |
ce85db45 | 21 | class TH1D; |
ffca499d | 22 | class TH1I; |
ce85db45 | 23 | class AliAODEvent; |
e1f47419 | 24 | class AliAODForwardMult; |
e308a636 | 25 | class TObjArray; |
ce85db45 | 26 | |
ffca499d | 27 | /** |
bd6f5206 | 28 | * @defgroup pwglf_forward_tasks_dndeta dN/deta tasks |
290052e7 | 29 | * |
30 | * Code to produce @f$ dN/d\eta@f$ | |
31 | * | |
bd6f5206 | 32 | * @ingroup pwglf_forward_tasks |
ffca499d | 33 | */ |
34 | /** | |
bd6f5206 | 35 | * @defgroup pwglf_forward_dndeta dN/deta |
ffca499d | 36 | * |
37 | * @f$ dN/d\eta@f$ code | |
38 | * | |
bd6f5206 | 39 | * @ingroup pwglf_forward_topical |
ffca499d | 40 | */ |
ce85db45 | 41 | /** |
ffca499d | 42 | * Base class for tasks to determine @f$ dN/d\eta@f$ |
43 | * | |
bd6f5206 | 44 | * @ingroup pwglf_forward_tasks_dndeta |
45 | * @ingroup pwglf_forward_dndeta | |
ce85db45 | 46 | */ |
c8b1a7db | 47 | class AliBasedNdetaTask : public AliBaseAODTask |
ce85db45 | 48 | { |
49 | public: | |
ffca499d | 50 | /** |
51 | * Bit mask values of the normalisation scheme | |
52 | */ | |
53 | enum { | |
54 | /** Only normalize to accepted events */ | |
55 | kNone = 0, | |
56 | /** | |
57 | * Do the full normalisation | |
58 | * @f[ | |
59 | * N = \frac{1}{\epsilon_X}(N_A-N_A/N_V(N_T-N_V)) = | |
60 | * \frac{1}{\epsilon_X}\frac{1}{\epsilon_V}N_A | |
61 | * @f] | |
62 | */ | |
63 | kEventLevel = 0x1, | |
ffca499d | 64 | /** |
65 | * Do the shape correction | |
66 | */ | |
0be6c8cd | 67 | kShape = 0x2, |
ffca499d | 68 | /** |
69 | * Correct for background events (A+C-E). Not implemented yet | |
70 | */ | |
0be6c8cd | 71 | kBackground = 0x4, |
ffca499d | 72 | /** |
0be6c8cd | 73 | * Correct for the trigger efficiency from MC |
ffca499d | 74 | */ |
0be6c8cd | 75 | kTriggerEfficiency = 0x8, |
4fa8d795 | 76 | /** |
77 | * Correct using zero-bin efficiency only | |
78 | */ | |
79 | kZeroBin = 0x10, | |
0be6c8cd | 80 | /** |
81 | * Do the full correction | |
ffca499d | 82 | */ |
0be6c8cd | 83 | kFull = kEventLevel | kShape | kBackground | kTriggerEfficiency, |
ffca499d | 84 | }; |
ce85db45 | 85 | /** |
86 | * Constructor | |
87 | * | |
88 | */ | |
89 | AliBasedNdetaTask(); | |
90 | /** | |
91 | * Constructor | |
92 | * | |
93 | * @param name Name of task | |
ce85db45 | 94 | */ |
95 | AliBasedNdetaTask(const char* name); | |
e1f47419 | 96 | /** |
97 | * Destructor | |
98 | * | |
99 | */ | |
100 | virtual ~AliBasedNdetaTask(); | |
ce85db45 | 101 | |
e1f47419 | 102 | /** |
103 | * @{ | |
104 | * @name Task configuration | |
105 | */ | |
290052e7 | 106 | /** |
107 | * Set the debug level | |
108 | * | |
109 | * @param level Debug level | |
110 | */ | |
f53fb4f6 | 111 | virtual void SetDebugLevel(Int_t level); |
ce85db45 | 112 | /** |
113 | * Set the rebinning factor | |
114 | * | |
115 | * @param rebin Rebinning factor | |
116 | */ | |
117 | void SetRebinning(Int_t rebin) { fRebin = rebin; } | |
3846ec25 | 118 | /** |
ffca499d | 119 | * Whether to cut edges when merging |
3846ec25 | 120 | * |
ffca499d | 121 | * @param cut If true, cut edges |
3846ec25 | 122 | */ |
123 | void SetCutEdges(Bool_t cut) {fCutEdges = cut;} | |
c25b5e1b | 124 | /** |
125 | * Set whether to correct for empty bins when projecting on the X axis. | |
126 | * | |
127 | * @param use Whether to correct for empty bins | |
128 | */ | |
129 | void SetCorrEmpty(Bool_t use) { fCorrEmpty = use; } | |
130 | /** | |
131 | * Set whether to use the ROOT TH2::ProjectionX method when | |
132 | * projecting on the X axis. | |
133 | * | |
134 | * @param use Whether to use TH2::ProjectionX | |
135 | */ | |
136 | void SetUseROOTProjectX(Bool_t use) { fUseROOTProj = use; } | |
e58000b7 | 137 | /** |
138 | * Trigger efficiency for selected trigger(s) | |
139 | * | |
140 | * @param e Trigger efficiency | |
141 | */ | |
142 | void SetTriggerEff(Double_t e) { fTriggerEff = e; } | |
66cf95f2 | 143 | /** |
144 | * Trigger efficiency for 0-bin for selected trigger(s) | |
145 | * | |
146 | * @param e Trigger efficiency for 0-bin | |
147 | */ | |
148 | void SetTriggerEff0(Double_t e) { fTriggerEff0 = e; } | |
e58000b7 | 149 | /** |
150 | * Set the shape correction (a.k.a., track correction) for selected | |
151 | * trigger(s) | |
152 | * | |
153 | * @param h Correction | |
154 | */ | |
f67d699c | 155 | void SetShapeCorrection(const TH2F* h); |
bfab35d9 | 156 | /** |
157 | * Set satellite vertex flag | |
158 | * | |
159 | * @param satVtx | |
160 | */ | |
161 | void SetSatelliteVertices(Bool_t satVtx) { fSatelliteVertices = satVtx; } | |
dc1adf8d | 162 | /** |
163 | * Set which centrality estimator to use - if not set, use the one | |
164 | * from the Forward AOD object. Note, the string is diagnosed, and | |
165 | * if found not to be valid, then a the program terminates via a | |
166 | * Fatal. | |
167 | * | |
168 | * @param method String definining centrality method (case insensitive) | |
169 | * Typical values are | |
170 | * - V0M (e.g., PbPb) | |
171 | * - V0A | |
172 | * - V0C | |
173 | * - FMD | |
174 | * - ZNA (e.g., pPb) | |
175 | * - ZNC (e.g., Pbp) | |
176 | * - ZPA | |
177 | * - ZPC | |
178 | * - ZEMvsZDC | |
179 | * | |
180 | * @return true if @a method is valid estimator | |
181 | */ | |
182 | Bool_t SetCentralityMethod(const TString& method); | |
a76fb27d | 183 | /** |
184 | * Get a string representing the normalization scheme | |
185 | * | |
186 | * @param scheme Normalization scheme bits | |
187 | * | |
188 | * @return String representation | |
189 | */ | |
190 | static const Char_t* NormalizationSchemeString(UShort_t scheme); | |
191 | /** | |
192 | * Parse a string representing the normalization scheme | |
193 | * | |
194 | * @param what String of the normalization scheme | |
195 | * | |
196 | * @return normalization scheme bits | |
197 | */ | |
198 | static UShort_t ParseNormalizationScheme(const Char_t* what); | |
678a4979 | 199 | /** |
ffca499d | 200 | * Setthe normalisation scheme to use |
201 | * | |
202 | * @param scheme Normalisation scheme | |
203 | */ | |
0be6c8cd | 204 | void SetNormalizationScheme(UShort_t scheme); |
ffca499d | 205 | /** |
206 | * Space, pipe, or comma separated list of options | |
207 | * | |
208 | * @param what List of options | |
678a4979 | 209 | */ |
ffca499d | 210 | void SetNormalizationScheme(const char* what); |
c89b9ac1 | 211 | /** |
212 | * Filename of final MC correction | |
213 | * | |
214 | * @param filename filename | |
215 | */ | |
216 | void SetMCFinalCorrFilename(const char* filename) { | |
217 | fFinalMCCorrFile.Clear(); | |
218 | fFinalMCCorrFile.Append(filename); | |
219 | } | |
678a4979 | 220 | /** |
221 | * Load the normalization data - done automatically if not set from outside | |
222 | * | |
e1f47419 | 223 | * @param sys system |
224 | * @param energy energy | |
678a4979 | 225 | */ |
e1f47419 | 226 | void LoadNormalizationData(UShort_t sys, UShort_t energy); |
227 | /** @} */ | |
0be6c8cd | 228 | /** |
229 | * Print information | |
230 | * | |
231 | * @param option Not used | |
232 | */ | |
233 | void Print(Option_t* option="") const; | |
e1f47419 | 234 | /** @{ |
235 | * @name Task interface | |
ce85db45 | 236 | */ |
ce85db45 | 237 | /** |
238 | * Create output objects. | |
239 | * | |
240 | * This is called once per slave process | |
c8b1a7db | 241 | * |
242 | * @return true on success | |
ce85db45 | 243 | */ |
c8b1a7db | 244 | virtual Bool_t Book(); |
ce85db45 | 245 | /** |
246 | * Process a single event | |
247 | * | |
c8b1a7db | 248 | * @return true on success |
ce85db45 | 249 | */ |
c8b1a7db | 250 | virtual Bool_t Event(AliAODEvent& aod); |
ce85db45 | 251 | /** |
ffca499d | 252 | * Called at end of event processing. |
ce85db45 | 253 | * |
254 | * This is called once in the master | |
255 | * | |
c8b1a7db | 256 | * @return true on success |
ce85db45 | 257 | */ |
c8b1a7db | 258 | virtual Bool_t Finalize(); |
ffca499d | 259 | /* @} */ |
ce85db45 | 260 | |
261 | /** | |
e1f47419 | 262 | * @{ |
263 | * @name Services member functions | |
ce85db45 | 264 | */ |
ce85db45 | 265 | /** |
266 | * Make a copy of the input histogram and rebin that histogram | |
267 | * | |
ffca499d | 268 | * @param h Histogram to rebin |
269 | * @param rebin Rebinning factor | |
270 | * @param cutEdges Whether to cut edges when rebinning | |
ce85db45 | 271 | * |
272 | * @return New (rebinned) histogram | |
273 | */ | |
e1f47419 | 274 | static TH1D* Rebin(const TH1D* h, Int_t rebin, Bool_t cutEdges=false); |
ce85db45 | 275 | /** |
276 | * Make an extension of @a h to make it symmetric about 0 | |
277 | * | |
278 | * @param h Histogram to symmertrice | |
279 | * | |
280 | * @return Symmetric extension of @a h | |
281 | */ | |
e1f47419 | 282 | static TH1* Symmetrice(const TH1* h); |
ce85db45 | 283 | /** |
284 | * Project onto the X axis | |
285 | * | |
286 | * @param h 2D histogram | |
287 | * @param name New name | |
288 | * @param firstbin First bin to use | |
289 | * @param lastbin Last bin to use | |
9f773c15 | 290 | * @param useROOT Use TH2::ProjectionX instead of custom code |
ffca499d | 291 | * @param corr Whether to do corrections or not |
ce85db45 | 292 | * @param error Whether to calculate errors |
293 | * | |
294 | * @return Newly created histogram or null | |
295 | */ | |
e1f47419 | 296 | static TH1D* ProjectX(const TH2D* h, |
297 | const char* name, | |
298 | Int_t firstbin, | |
299 | Int_t lastbin, | |
c25b5e1b | 300 | bool useROOT=false, |
e1f47419 | 301 | bool corr=true, |
302 | bool error=true); | |
4fa8d795 | 303 | /** |
304 | * Scale the copy of the 2D histogram by coverage in supplied 1D histogram | |
305 | * | |
306 | * @param copy Data to scale | |
307 | * @param norm Coverage histogram | |
308 | */ | |
309 | static void ScaleToCoverage(TH2D* copy, const TH1D* norm); | |
5ca83fee | 310 | /** |
311 | * Scale the copy of the 1D histogram by coverage in supplied 1D histogram | |
312 | * | |
313 | * @param copy Data to scale | |
314 | * @param norm Coverage histogram | |
315 | */ | |
316 | static void ScaleToCoverage(TH1D* copy, const TH1D* norm); | |
ce85db45 | 317 | /** |
318 | * Set histogram graphical options, etc. | |
319 | * | |
320 | * @param h Histogram to modify | |
321 | * @param colour Marker color | |
322 | * @param marker Marker style | |
323 | * @param title Title of histogram | |
324 | * @param ytitle Title on y-axis. | |
325 | */ | |
e1f47419 | 326 | static void SetHistogramAttributes(TH1D* h, Int_t colour, Int_t marker, |
327 | const char* title, | |
c8b1a7db | 328 | const char* ytitle=0); |
e1f47419 | 329 | /** @} */ |
9ecab72f | 330 | |
331 | /** | |
332 | * Marker styles | |
333 | */ | |
334 | enum { | |
335 | kSolid = 0x000, | |
336 | kHollow = 0x001, | |
337 | kCircle = 0x002, | |
338 | kSquare = 0x004, | |
339 | kUpTriangle = 0x006, | |
340 | kDownTriangle = 0x008, | |
341 | kDiamond = 0x00a, | |
342 | kCross = 0x00c, | |
343 | kStar = 0x00e | |
344 | }; | |
290052e7 | 345 | /** |
346 | * Get the marker style from option bits | |
347 | * | |
348 | * @param bits Option bits | |
349 | * | |
350 | * @return Marker style | |
351 | */ | |
9ecab72f | 352 | static Int_t GetMarkerStyle(UShort_t bits); |
290052e7 | 353 | /** |
354 | * Get the marker option bits from a style | |
355 | * | |
356 | * @param style Style | |
357 | * | |
358 | * @return option bits | |
359 | */ | |
9ecab72f | 360 | static UShort_t GetMarkerBits(Int_t style); |
290052e7 | 361 | /** |
362 | * Flip an option bit | |
363 | * | |
364 | * @param style Style parameter | |
365 | * | |
366 | * @return New style | |
367 | */ | |
9ecab72f | 368 | static Int_t FlipHollowStyle(Int_t style); |
f17f33fc | 369 | /** |
370 | * Setter of empirical correction | |
371 | * | |
372 | * @param h 2D histogram of ratio of nominal @f$ 1/N | |
373 | * dN_{ch}/d\eta@f$ to satellite @f$ 1/N dN_{ch}/d\eta@f$ in PbPb | |
374 | * collisions as a function of @f$\eta@f$ and interaction point | |
375 | * Z-coordinate @f$ IP_{z}@f$ | |
376 | */ | |
377 | void SetGlobalEmpiricalcorrection(TH2D* h){fEmpiricalCorrection=h;} | |
e1f47419 | 378 | protected: |
9ecab72f | 379 | /** |
c8b1a7db | 380 | * Copy contructor - not defined |
9ecab72f | 381 | */ |
e1f47419 | 382 | AliBasedNdetaTask(const AliBasedNdetaTask&); |
9ecab72f | 383 | /** |
c8b1a7db | 384 | * Assignment operator - not defined |
9ecab72f | 385 | * |
386 | * | |
387 | * @return | |
388 | */ | |
c8b1a7db | 389 | AliBasedNdetaTask& operator=(const AliBasedNdetaTask&); |
9ecab72f | 390 | // Forward declaration |
e1f47419 | 391 | class CentralityBin; |
c8b1a7db | 392 | /** |
393 | * Check if the event corresponds to the selected trigger(s), | |
394 | * vertex, and centrality. Derived classes can overload this to | |
395 | * enable event processing - even if the event is not within cuts. | |
396 | * | |
397 | * @param forward Forward object | |
398 | * | |
399 | * @return true if the event is within the cuts. | |
400 | */ | |
401 | virtual Bool_t CheckEvent(const AliAODForwardMult& forward); | |
f67d699c | 402 | /** |
403 | * Create the CentralityBin objects if not already done. | |
404 | * | |
405 | */ | |
406 | virtual void InitializeCentBins(); | |
e1f47419 | 407 | /** |
408 | * Retrieve the histogram | |
409 | * | |
410 | * @param aod AOD event | |
411 | * @param mc Whether to get the MC histogram or not | |
412 | * | |
413 | * @return Retrieved histogram or null | |
414 | */ | |
c8b1a7db | 415 | virtual TH2D* GetHistogram(const AliAODEvent& aod, Bool_t mc=false) = 0; |
ffca499d | 416 | /** |
9ecab72f | 417 | * Get the colour to use for markers (only pp - in PbPb we use a rainbow) |
ffca499d | 418 | * |
419 | * @return Marker colour | |
420 | */ | |
9ecab72f | 421 | virtual Int_t GetColor() const { return kBlack; } |
ffca499d | 422 | /** |
423 | * Get the marker style | |
424 | * | |
425 | * @return Marker style | |
426 | */ | |
9ecab72f | 427 | virtual Int_t GetMarker() const { return GetMarkerStyle(kCircle); } |
bfab35d9 | 428 | /** |
429 | * Massage data histograms if needed | |
430 | * | |
431 | * @param vtx | |
432 | * @param data | |
433 | * @param mcData | |
434 | */ | |
435 | virtual void CheckEventData(Double_t vtx, | |
436 | TH2* data, | |
437 | TH2* mcData); | |
e308a636 | 438 | /** |
439 | * Add a centrality bin | |
440 | * | |
ffca499d | 441 | * @param at Where in the list to add this bin |
e308a636 | 442 | * @param low Low cut |
443 | * @param high High cut | |
444 | */ | |
445 | void AddCentralityBin(UShort_t at, Short_t low, Short_t high); | |
e1f47419 | 446 | /** |
447 | * Make a centrality bin | |
448 | * | |
449 | * @param name Name used for histograms | |
450 | * @param low Low cut in percent | |
451 | * @param high High cut in percent | |
452 | * | |
453 | * @return A newly created centrality bin | |
454 | */ | |
455 | virtual CentralityBin* MakeCentralityBin(const char* name, Short_t low, | |
456 | Short_t high) const; | |
4fa8d795 | 457 | |
3d9b0442 | 458 | // function which applies empirical correction to the AOD object |
459 | Bool_t ApplyEmpiricalCorrection(const AliAODForwardMult* aod,TH2D* data); | |
4fa8d795 | 460 | //================================================================== |
9ecab72f | 461 | /** |
462 | * Class that holds the sum of the data - possibly split into 0 or | |
463 | * non-zero bins | |
464 | * | |
465 | */ | |
4fa8d795 | 466 | struct Sum : public TNamed |
467 | { | |
468 | TH2D* fSum; // Sum of non-zero events | |
469 | TH2D* fSum0; // Sum of zero events | |
470 | TH1I* fEvents; // Distribution of events | |
f53fb4f6 | 471 | Int_t fDebug; // Debug level |
9ecab72f | 472 | /** |
473 | * I/O Constructor - do not use | |
474 | */ | |
f53fb4f6 | 475 | Sum() : fSum(0), fSum0(0), fEvents(0), fDebug(0) {} |
9ecab72f | 476 | /** |
477 | * Constructor | |
478 | * | |
479 | * @param name Name | |
480 | * @param postfix Possible post-fix | |
481 | */ | |
4fa8d795 | 482 | Sum(const char* name, const char* postfix) |
483 | : TNamed(name,postfix), | |
484 | fSum(0), | |
485 | fSum0(0), | |
f53fb4f6 | 486 | fEvents(0), |
487 | fDebug(0) | |
4fa8d795 | 488 | {} |
9ecab72f | 489 | /** |
490 | * Copy constructor | |
491 | * | |
492 | * @param o Object to copy from | |
493 | */ | |
4fa8d795 | 494 | Sum(const Sum& o) |
495 | : TNamed(o), | |
496 | fSum(o.fSum), | |
497 | fSum0(o.fSum0), | |
f53fb4f6 | 498 | fEvents(o.fEvents), |
499 | fDebug(o.fDebug) | |
4fa8d795 | 500 | {} |
9ecab72f | 501 | /** |
502 | * Assignment operator | |
503 | * | |
504 | * @param o Object to assign from | |
505 | * | |
506 | * @return Reference to this object | |
507 | */ | |
997ba0f4 | 508 | Sum& operator=(const Sum& o) |
509 | { | |
510 | if (&o == this) return *this; | |
4fa8d795 | 511 | SetName(o.GetName()); fSum = o.fSum; fSum0 = o.fSum0; fEvents=o.fEvents; |
512 | return *this; | |
513 | } | |
9ecab72f | 514 | /** |
515 | * Destructor | |
516 | */ | |
4fa8d795 | 517 | ~Sum() {} |
9ecab72f | 518 | /** |
519 | * Initialise this object. | |
520 | * | |
521 | * @param list List to add histograms to | |
522 | * @param data Format of data to be cloned here | |
523 | * @param col Color | |
524 | */ | |
4fa8d795 | 525 | void Init(TList* list, const TH2D* data, Int_t col); |
9ecab72f | 526 | /** |
527 | * Add an event | |
528 | * | |
529 | * @param data Data to add | |
530 | * @param isZero If this is zero event | |
531 | */ | |
4fa8d795 | 532 | void Add(const TH2D* data, Bool_t isZero=false); |
f67d699c | 533 | /** |
534 | * Get the histogram name | |
535 | * | |
536 | * @param name Base name | |
537 | * @param what Which one | |
538 | * @param post Possible postfix | |
539 | * | |
540 | * @return Name | |
541 | */ | |
542 | static TString GetHistName(const char* name, Int_t what=0, | |
543 | const char* post=0); | |
9ecab72f | 544 | /** |
545 | * Get the histogram name | |
546 | * | |
547 | * @param what Which one | |
548 | * | |
549 | * @return Name | |
550 | */ | |
4fa8d795 | 551 | TString GetHistName(Int_t what=0) const; |
9ecab72f | 552 | /** |
553 | * Get the sum | |
554 | * | |
9ecab72f | 555 | * @param o Output list |
556 | * @param ntotal On return, the total number of events | |
557 | * @param zeroEff Zero-bin efficiency | |
558 | * @param otherEff Non-zero-bin efficiency | |
559 | * @param marker Marker to use | |
560 | * @param rootXproj Whether to use TH2::ProjectionX | |
561 | * @param corrEmpty Correct for empty bins | |
562 | * | |
563 | * @return The total sum histogram | |
564 | */ | |
f67d699c | 565 | TH2D* CalcSum(TList* o, Double_t& ntotal, |
566 | Double_t zeroEff, Double_t otherEff=1, Int_t marker=20, | |
567 | Bool_t rootXproj=false, Bool_t corrEmpty=true) const; | |
e12f8c42 | 568 | |
c8b1a7db | 569 | ClassDef(Sum,2); // Summed histograms |
4fa8d795 | 570 | }; |
4fa8d795 | 571 | |
572 | //================================================================== | |
e1f47419 | 573 | /** |
574 | * Calculations done per centrality | |
575 | * | |
576 | */ | |
badf1074 | 577 | class CentralityBin : public TNamed |
e1f47419 | 578 | { |
badf1074 | 579 | public: |
bfab35d9 | 580 | /** |
e1f47419 | 581 | * Constructor |
582 | */ | |
583 | CentralityBin(); | |
584 | /** | |
585 | * Constructor | |
586 | * | |
587 | * @param name Name used for histograms (e.g., Forward) | |
588 | * @param low Lower centrality cut in percent | |
589 | * @param high Upper centrality cut in percent | |
590 | */ | |
591 | CentralityBin(const char* name, Short_t low, Short_t high); | |
592 | /** | |
593 | * Copy constructor | |
594 | * | |
595 | * @param other Object to copy from | |
596 | */ | |
597 | CentralityBin(const CentralityBin& other); | |
598 | /** | |
599 | * Destructor | |
600 | */ | |
601 | virtual ~CentralityBin(); | |
602 | /** | |
603 | * Assignment operator | |
604 | * | |
605 | * @param other Object to assign from | |
606 | * | |
607 | * @return Reference to this | |
608 | */ | |
609 | CentralityBin& operator=(const CentralityBin& other); | |
610 | /** | |
611 | * Check if this is the 'all' bin | |
612 | * | |
613 | * @return true if low and high cuts are both zero | |
614 | */ | |
615 | Bool_t IsAllBin() const { return fLow == 0 && fHigh == 0; } | |
616 | /** | |
617 | * Get the list name | |
618 | * | |
619 | * @return List Name | |
620 | */ | |
621 | const char* GetListName() const; | |
622 | /** | |
623 | * Create output objects | |
624 | * | |
625 | * @param dir Parent list | |
1a7e2e15 | 626 | * @param mask Trigger mask |
e1f47419 | 627 | */ |
1a7e2e15 | 628 | virtual void CreateOutputObjects(TList* dir, Int_t mask); |
e1f47419 | 629 | /** |
630 | * Process an event | |
631 | * | |
632 | * @param forward Forward data (for trigger, vertex, & centrality) | |
633 | * @param triggerMask Trigger mask | |
9ecab72f | 634 | * @param isZero True if this is a zero bin event |
e1f47419 | 635 | * @param vzMin Minimum IP z coordinate |
636 | * @param vzMax Maximum IP z coordinate | |
637 | * @param data Data histogram | |
638 | * @param mc MC histogram | |
bfab35d9 | 639 | * |
640 | * @return true if the event was selected | |
e1f47419 | 641 | */ |
bfab35d9 | 642 | virtual Bool_t ProcessEvent(const AliAODForwardMult* forward, |
643 | Int_t triggerMask, | |
644 | Bool_t isZero, | |
645 | Double_t vzMin, | |
646 | Double_t vzMax, | |
647 | const TH2D* data, | |
648 | const TH2D* mc); | |
b30dee70 | 649 | /** |
650 | * Calculate the Event-Level normalization. | |
651 | * | |
652 | * The full event level normalization for trigger @f$X@f$ is given by | |
653 | * @f{eqnarray*}{ | |
654 | * N &=& \frac{1}{\epsilon_X} | |
655 | * \left(N_A+\frac{N_A}{N_V}(N_{-V}-\beta)\right)\\ | |
656 | * &=& \frac{1}{\epsilon_X}N_A | |
657 | * \left(1+\frac{1}{N_V}(N_T-N_V-\beta)\right)\\ | |
658 | * &=& \frac{1}{\epsilon_X}N_A | |
659 | * \left(1+\frac{N_T}{N_V}-1-\frac{\beta}{N_V}\right)\\ | |
660 | * &=& \frac{1}{\epsilon_X}N_A | |
661 | * \left(\frac{1}{\epsilon_V}-\frac{\beta}{N_V}\right) | |
662 | * @f} | |
663 | * where | |
664 | * | |
665 | * - @f$\epsilon_X=\frac{N_{T,X}}{N_X}@f$ is the trigger | |
666 | * efficiency evaluated in simulation. | |
667 | * - @f$\epsilon_V=\frac{N_V}{N_T}@f$ is the vertex efficiency | |
668 | * evaluated from the data | |
669 | * - @f$N_X@f$ is the Monte-Carlo truth number of events of type | |
670 | * @f$X@f$. | |
671 | * - @f$N_{T,X}@f$ is the Monte-Carlo truth number of events of type | |
672 | * @f$X@f$ which was also triggered as such. | |
673 | * - @f$N_T@f$ is the number of data events that where triggered | |
674 | * as type @f$X@f$ and had a collision trigger (CINT1B) | |
675 | * - @f$N_V@f$ is the number of data events that where triggered | |
676 | * as type @f$X@f$, had a collision trigger (CINT1B), and had | |
677 | * a vertex. | |
678 | * - @f$N_{-V}@f$ is the number of data events that where triggered | |
679 | * as type @f$X@f$, had a collision trigger (CINT1B), but no | |
680 | * vertex. | |
681 | * - @f$N_A@f$ is the number of data events that where triggered | |
682 | * as type @f$X@f$, had a collision trigger (CINT1B), and had | |
683 | * a vertex in the selected range. | |
684 | * - @f$\beta=N_a+N_c-N_e@f$ is the number of control triggers that | |
685 | * were also triggered as type @f$X@f$. | |
686 | * - @f$N_a@f$ Number of beam-empty events also triggered as type | |
687 | * @f$X@f$ events (CINT1-A or CINT1-AC). | |
688 | * - @f$N_c@f$ Number of empty-beam events also triggered as type | |
689 | * @f$X@f$ events (CINT1-C). | |
690 | * - @f$N_e@f$ Number of empty-empty events also triggered as type | |
691 | * @f$X@f$ events (CINT1-E). | |
692 | * | |
693 | * Note, that if @f$ \beta \ll N_A@f$ the last term can be ignored, and | |
694 | * the expression simplyfies to | |
695 | * @f[ | |
696 | * N = \frac{1}{\epsilon_X}\frac{1}{\epsilon_V}N_A | |
697 | * @f] | |
698 | * | |
699 | * @param t Histogram of triggers | |
700 | * @param scheme Normalisation scheme | |
701 | * @param trgEff Trigger efficiency | |
702 | * @param ntotal On return, the total number of events to normalise to. | |
1a7e2e15 | 703 | * @param text If non-null, fill with normalization calculation |
b30dee70 | 704 | * |
705 | * @return @f$N_A/N@f$ or negative number in case of errors. | |
706 | */ | |
707 | virtual Double_t Normalization(const TH1I& t, | |
708 | UShort_t scheme, | |
709 | Double_t trgEff, | |
1a7e2e15 | 710 | Double_t& ntotal, |
711 | TString* text) const; | |
c25b5e1b | 712 | /** |
713 | * Generate the dN/deta result from input | |
714 | * | |
715 | * @param sum Sum of 2D hists | |
716 | * @param postfix Post fix on names | |
717 | * @param rootProj Whether to use ROOT TH2::ProjectionX | |
718 | * @param corrEmpty Correct for empty bins | |
719 | * @param shapeCorr Shape correction to use | |
720 | * @param scaler Event-level normalization scaler | |
721 | * @param symmetrice Whether to make symmetric extensions | |
722 | * @param rebin Whether to rebin | |
723 | * @param cutEdges Whether to cut edges when rebinning | |
9f773c15 | 724 | * @param marker Marker style |
c6115ede | 725 | * @param color Color of markers |
726 | * @param mclist List of MC data | |
727 | * @param truthlist List of MC truth data | |
c25b5e1b | 728 | */ |
729 | virtual void MakeResult(const TH2D* sum, | |
730 | const char* postfix, | |
731 | bool rootProj, | |
732 | bool corrEmpty, | |
f67d699c | 733 | const TH2F* shapeCorr, |
c25b5e1b | 734 | Double_t scaler, |
735 | bool symmetrice, | |
736 | Int_t rebin, | |
737 | bool cutEdges, | |
9ecab72f | 738 | Int_t marker, |
c89b9ac1 | 739 | Int_t color, |
740 | TList* mclist, | |
741 | TList* truthlist); | |
e1f47419 | 742 | /** |
743 | * End of processing | |
744 | * | |
745 | * @param sums List of sums | |
746 | * @param results Output list of results | |
ffca499d | 747 | * @param scheme Normalisation scheme options |
e1f47419 | 748 | * @param shapeCorr Shape correction or nil |
749 | * @param trigEff Trigger efficiency | |
66cf95f2 | 750 | * @param trigEff0 0-bin trigger efficiency |
e1f47419 | 751 | * @param symmetrice Whether to symmetrice the results |
752 | * @param rebin Whether to rebin the results | |
c25b5e1b | 753 | * @param rootProj If true, use TH2::ProjectionX |
e1f47419 | 754 | * @param corrEmpty Whether to correct for empty bins |
755 | * @param cutEdges Whether to cut edges when rebinning | |
e1f47419 | 756 | * @param triggerMask Trigger mask |
ffca499d | 757 | * @param marker Marker style |
c6115ede | 758 | * @param color Color of markers |
759 | * @param mclist List of MC data | |
760 | * @param truthlist List of MC truth data | |
e1f47419 | 761 | */ |
762 | virtual void End(TList* sums, | |
763 | TList* results, | |
ffca499d | 764 | UShort_t scheme, |
f67d699c | 765 | const TH2F* shapeCorr, |
e1f47419 | 766 | Double_t trigEff, |
66cf95f2 | 767 | Double_t trigEff0, |
e1f47419 | 768 | Bool_t symmetrice, |
769 | Int_t rebin, | |
c25b5e1b | 770 | Bool_t rootProj, |
e1f47419 | 771 | Bool_t corrEmpty, |
772 | Bool_t cutEdges, | |
ffca499d | 773 | Int_t triggerMask, |
9ecab72f | 774 | Int_t marker, |
c89b9ac1 | 775 | Int_t color, |
776 | TList* mclist, | |
777 | TList* truthlist); | |
e1f47419 | 778 | /** |
779 | * @{ | |
780 | * @name Access histograms | |
781 | */ | |
782 | /** | |
783 | * Get sum histogram | |
784 | * | |
785 | * @param mc If true, return MC histogram | |
786 | * | |
787 | * @return Sum histogram | |
788 | */ | |
4fa8d795 | 789 | const Sum* GetSum(Bool_t mc=false) const { return mc ? fSumMC : fSum; } |
e1f47419 | 790 | /** |
791 | * Get sum histogram | |
792 | * | |
793 | * @param mc If true, return MC histogram | |
794 | * | |
795 | * @return Sum histogram | |
796 | */ | |
4fa8d795 | 797 | Sum* GetSum(Bool_t mc=false) { return mc ? fSumMC : fSum; } |
e1f47419 | 798 | /** |
799 | * Get trigger histogram | |
800 | * | |
801 | * @return Trigger histogram | |
802 | */ | |
ffca499d | 803 | const TH1I* GetTriggers() const { return fTriggers; } |
e1f47419 | 804 | /** |
805 | * Get trigger histogram | |
806 | * | |
807 | * @return Trigger histogram | |
808 | */ | |
bfab35d9 | 809 | TH1I* GetTriggers() { return fTriggers; } |
810 | /** | |
811 | * Get trigger histogram | |
812 | * | |
813 | * @return Trigger histogram | |
814 | */ | |
815 | const TH1I* GetStatus() const { return fStatus; } | |
816 | /** | |
817 | * Get trigger histogram | |
818 | * | |
819 | * @return Trigger histogram | |
820 | */ | |
821 | TH1I* GetStatus() { return fStatus; } | |
e1f47419 | 822 | /** @} */ |
5bb5d1f6 | 823 | |
9ecab72f | 824 | /** |
825 | * Get the color of the markers | |
826 | * | |
290052e7 | 827 | * @param fallback Fall-back color |
828 | * | |
829 | * @return Color for this centrality bin | |
9ecab72f | 830 | */ |
831 | Int_t GetColor(Int_t fallback=kRed+2) const; | |
832 | /** | |
833 | * Get list of results | |
834 | * | |
290052e7 | 835 | * @return List of results |
9ecab72f | 836 | */ |
5bb5d1f6 | 837 | TList* GetResults() const { return fOutput; } |
9ecab72f | 838 | /** |
c8b1a7db | 839 | * Get name of result histogram. Note, the returned pointer points |
840 | * to static memory and should be copied/used immediately. | |
9ecab72f | 841 | * |
c8b1a7db | 842 | * @param rebin Whether to get rebinned result |
843 | * @param sym Whether to get symmetric extension | |
844 | * @param postfix Possible postfix (e.g., "MC") | |
9ecab72f | 845 | * |
846 | * @return | |
847 | */ | |
5bb5d1f6 | 848 | const char* GetResultName(Int_t rebin, Bool_t sym, |
849 | const char* postfix="") const; | |
9ecab72f | 850 | /** |
851 | * Get a result | |
852 | * | |
c8b1a7db | 853 | * @param rebin Whether to get rebinned result |
854 | * @param sym Whether to get symmetric extension | |
855 | * @param postfix Possible postfix (e.g., "MC") | |
856 | * @param verbose If true, complain about missing histogram | |
9ecab72f | 857 | * |
c8b1a7db | 858 | * @return Pointer to histogram or null |
9ecab72f | 859 | */ |
c8b1a7db | 860 | TH1* GetResult(Int_t rebin, |
861 | Bool_t sym, | |
862 | const char* postfix="", | |
863 | Bool_t verbose=true) const; | |
290052e7 | 864 | /** |
865 | * Set the debug level | |
866 | * | |
867 | * @param lvl Debug level | |
868 | */ | |
f53fb4f6 | 869 | void SetDebugLevel(Int_t lvl); |
bfab35d9 | 870 | /** |
871 | * Set satellite vertex flag | |
872 | * | |
873 | * @param satVtx | |
874 | */ | |
875 | void SetSatelliteVertices(Bool_t satVtx) { fSatelliteVertices = satVtx; } | |
e1f47419 | 876 | protected: |
290052e7 | 877 | /** |
878 | * Read in sum hisotgram from list | |
879 | * | |
880 | * @param list List to read from | |
881 | * @param mc True for MC input | |
882 | * | |
883 | * @return true if sum histogram is found | |
884 | */ | |
f67d699c | 885 | virtual Bool_t ReadSum(TList* list, bool mc=false); |
e1f47419 | 886 | /** |
887 | * Create sum histogram | |
888 | * | |
889 | * @param data Data histogram to clone | |
890 | * @param mc (optional) MC histogram to clone | |
891 | */ | |
892 | virtual void CreateSums(const TH2D* data, const TH2D* mc); | |
893 | /** | |
894 | * Check the trigger, vertex, and centrality | |
895 | * | |
ffca499d | 896 | * @param forward Event input |
897 | * @param triggerMask The used trigger mask | |
898 | * @param vzMin Least @f$ v_z@f$ | |
899 | * @param vzMax Largest @f$ v_z@f$ | |
e1f47419 | 900 | * |
901 | * @return true if the event is to be used | |
902 | */ | |
903 | virtual Bool_t CheckEvent(const AliAODForwardMult* forward, | |
ffca499d | 904 | Int_t triggerMask, |
905 | Double_t vzMin, | |
906 | Double_t vzMax); | |
e1f47419 | 907 | TList* fSums; // Output list |
908 | TList* fOutput; // Output list | |
4fa8d795 | 909 | Sum* fSum; // Sum histogram |
910 | Sum* fSumMC; // MC sum histogram | |
ffca499d | 911 | TH1I* fTriggers; // Trigger histogram |
bfab35d9 | 912 | TH1I* fStatus; // Trigger histogram |
e1f47419 | 913 | UShort_t fLow; // Lower limit (inclusive) |
914 | UShort_t fHigh; // Upper limit (exclusive) | |
c89b9ac1 | 915 | Bool_t fDoFinalMCCorrection; //Do final MC correction |
bfab35d9 | 916 | Bool_t fSatelliteVertices; // Satellite vertex flag |
f53fb4f6 | 917 | Int_t fDebug; // Debug level |
918 | ||
c8b1a7db | 919 | ClassDef(CentralityBin,4); // A centrality bin |
e1f47419 | 920 | }; |
ce85db45 | 921 | Int_t fRebin; // Rebinning factor |
922 | Bool_t fCutEdges; // Whether to cut edges when rebinning | |
923 | Bool_t fSymmetrice; // Whether to symmetrice data | |
924 | Bool_t fCorrEmpty; // Correct for empty bins | |
c25b5e1b | 925 | Bool_t fUseROOTProj; // Whether to use ROOT's ProjectionX |
e58000b7 | 926 | Double_t fTriggerEff; // Trigger efficiency for selected trigger(s) |
66cf95f2 | 927 | Double_t fTriggerEff0; // Bin-0 Trigger efficiency for sel trigger(s) |
f67d699c | 928 | TH2F* fShapeCorr; // Shape correction |
e308a636 | 929 | TObjArray* fListOfCentralities; // Centrality bins |
ffca499d | 930 | UShort_t fNormalizationScheme; // Normalization scheme |
c89b9ac1 | 931 | TString fFinalMCCorrFile; //Filename for final MC corr |
bfab35d9 | 932 | Bool_t fSatelliteVertices; // satellite vertex flag |
f17f33fc | 933 | TH2D* fEmpiricalCorrection; // Empirical correction |
934 | TH2D* fMeanVsC; //mean signal per event vs cent | |
dc1adf8d | 935 | TString fCentMethod; // Centrality estimator |
936 | ClassDef(AliBasedNdetaTask,15); // Determine charged particle density | |
ce85db45 | 937 | }; |
938 | ||
939 | #endif | |
940 | // | |
941 | // Local Variables: | |
942 | // mode: C++ | |
943 | // End: | |
944 | // |