]>
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 | */ | |
ce85db45 | 16 | #include <AliAnalysisTaskSE.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 | */ |
47 | class AliBasedNdetaTask : public AliAnalysisTaskSE | |
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 vertex range to use | |
114 | * | |
115 | * @param min Minimum (in centermeter) | |
116 | * @param max Maximum (in centermeter) | |
117 | */ | |
118 | void SetVertexRange(Double_t min, Double_t max) { fVtxMin=min; fVtxMax=max; } | |
119 | /** | |
120 | * Set the rebinning factor | |
121 | * | |
122 | * @param rebin Rebinning factor | |
123 | */ | |
124 | void SetRebinning(Int_t rebin) { fRebin = rebin; } | |
125 | /** | |
126 | * Set the trigger maskl | |
127 | * | |
128 | * @param mask Trigger mask | |
129 | */ | |
0be6c8cd | 130 | void SetTriggerMask(UShort_t mask); |
ce85db45 | 131 | /** |
132 | * Set the trigger mask | |
133 | * | |
134 | * @param mask trigger mask | |
135 | */ | |
136 | void SetTriggerMask(const char* mask); | |
e308a636 | 137 | /** |
138 | * Set the centrality bins to use. | |
139 | * | |
140 | * @code | |
141 | * UShort_t bins[] = { 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 }; | |
142 | * task->SetCentralityBins(11, bins); | |
143 | * @endcode | |
144 | * | |
145 | * @param n Number of bins (elements in @a bins minus 1) | |
146 | * @param bins Bin limits | |
147 | */ | |
148 | void SetCentralityAxis(UShort_t n, Short_t* bins); | |
3846ec25 | 149 | /** |
ffca499d | 150 | * Whether to cut edges when merging |
3846ec25 | 151 | * |
ffca499d | 152 | * @param cut If true, cut edges |
3846ec25 | 153 | */ |
154 | void SetCutEdges(Bool_t cut) {fCutEdges = cut;} | |
c25b5e1b | 155 | /** |
156 | * Set whether to correct for empty bins when projecting on the X axis. | |
157 | * | |
158 | * @param use Whether to correct for empty bins | |
159 | */ | |
160 | void SetCorrEmpty(Bool_t use) { fCorrEmpty = use; } | |
161 | /** | |
162 | * Set whether to use the ROOT TH2::ProjectionX method when | |
163 | * projecting on the X axis. | |
164 | * | |
165 | * @param use Whether to use TH2::ProjectionX | |
166 | */ | |
167 | void SetUseROOTProjectX(Bool_t use) { fUseROOTProj = use; } | |
e58000b7 | 168 | /** |
169 | * Trigger efficiency for selected trigger(s) | |
170 | * | |
171 | * @param e Trigger efficiency | |
172 | */ | |
173 | void SetTriggerEff(Double_t e) { fTriggerEff = e; } | |
174 | /** | |
175 | * Set the shape correction (a.k.a., track correction) for selected | |
176 | * trigger(s) | |
177 | * | |
178 | * @param h Correction | |
179 | */ | |
f67d699c | 180 | void SetShapeCorrection(const TH2F* h); |
a76fb27d | 181 | /** |
182 | * Get a string representing the normalization scheme | |
183 | * | |
184 | * @param scheme Normalization scheme bits | |
185 | * | |
186 | * @return String representation | |
187 | */ | |
188 | static const Char_t* NormalizationSchemeString(UShort_t scheme); | |
189 | /** | |
190 | * Parse a string representing the normalization scheme | |
191 | * | |
192 | * @param what String of the normalization scheme | |
193 | * | |
194 | * @return normalization scheme bits | |
195 | */ | |
196 | static UShort_t ParseNormalizationScheme(const Char_t* what); | |
678a4979 | 197 | /** |
ffca499d | 198 | * Setthe normalisation scheme to use |
199 | * | |
200 | * @param scheme Normalisation scheme | |
201 | */ | |
0be6c8cd | 202 | void SetNormalizationScheme(UShort_t scheme); |
ffca499d | 203 | /** |
204 | * Space, pipe, or comma separated list of options | |
205 | * | |
206 | * @param what List of options | |
678a4979 | 207 | */ |
ffca499d | 208 | void SetNormalizationScheme(const char* what); |
c89b9ac1 | 209 | /** |
210 | * Filename of final MC correction | |
211 | * | |
212 | * @param filename filename | |
213 | */ | |
214 | void SetMCFinalCorrFilename(const char* filename) { | |
215 | fFinalMCCorrFile.Clear(); | |
216 | fFinalMCCorrFile.Append(filename); | |
217 | } | |
678a4979 | 218 | /** |
219 | * Load the normalization data - done automatically if not set from outside | |
220 | * | |
e1f47419 | 221 | * @param sys system |
222 | * @param energy energy | |
678a4979 | 223 | */ |
e1f47419 | 224 | void LoadNormalizationData(UShort_t sys, UShort_t energy); |
225 | /** @} */ | |
0be6c8cd | 226 | /** |
227 | * Print information | |
228 | * | |
229 | * @param option Not used | |
230 | */ | |
231 | void Print(Option_t* option="") const; | |
e1f47419 | 232 | /** @{ |
233 | * @name Task interface | |
ce85db45 | 234 | */ |
ce85db45 | 235 | /** |
236 | * Initialise on master - does nothing | |
237 | * | |
238 | */ | |
239 | virtual void Init() {} | |
240 | /** | |
241 | * Create output objects. | |
242 | * | |
243 | * This is called once per slave process | |
244 | */ | |
245 | virtual void UserCreateOutputObjects(); | |
246 | /** | |
247 | * Process a single event | |
248 | * | |
249 | * @param option Not used | |
250 | */ | |
251 | virtual void UserExec(Option_t* option); | |
252 | /** | |
ffca499d | 253 | * Called at end of event processing. |
ce85db45 | 254 | * |
255 | * This is called once in the master | |
256 | * | |
257 | * @param option Not used | |
258 | */ | |
259 | virtual void Terminate(Option_t* option); | |
ffca499d | 260 | /* @} */ |
ce85db45 | 261 | |
262 | /** | |
e1f47419 | 263 | * @{ |
264 | * @name Services member functions | |
ce85db45 | 265 | */ |
ce85db45 | 266 | /** |
267 | * Make a copy of the input histogram and rebin that histogram | |
268 | * | |
ffca499d | 269 | * @param h Histogram to rebin |
270 | * @param rebin Rebinning factor | |
271 | * @param cutEdges Whether to cut edges when rebinning | |
ce85db45 | 272 | * |
273 | * @return New (rebinned) histogram | |
274 | */ | |
e1f47419 | 275 | static TH1D* Rebin(const TH1D* h, Int_t rebin, Bool_t cutEdges=false); |
ce85db45 | 276 | /** |
277 | * Make an extension of @a h to make it symmetric about 0 | |
278 | * | |
279 | * @param h Histogram to symmertrice | |
280 | * | |
281 | * @return Symmetric extension of @a h | |
282 | */ | |
e1f47419 | 283 | static TH1* Symmetrice(const TH1* h); |
ce85db45 | 284 | /** |
285 | * Project onto the X axis | |
286 | * | |
287 | * @param h 2D histogram | |
288 | * @param name New name | |
289 | * @param firstbin First bin to use | |
290 | * @param lastbin Last bin to use | |
9f773c15 | 291 | * @param useROOT Use TH2::ProjectionX instead of custom code |
ffca499d | 292 | * @param corr Whether to do corrections or not |
ce85db45 | 293 | * @param error Whether to calculate errors |
294 | * | |
295 | * @return Newly created histogram or null | |
296 | */ | |
e1f47419 | 297 | static TH1D* ProjectX(const TH2D* h, |
298 | const char* name, | |
299 | Int_t firstbin, | |
300 | Int_t lastbin, | |
c25b5e1b | 301 | bool useROOT=false, |
e1f47419 | 302 | bool corr=true, |
303 | bool error=true); | |
4fa8d795 | 304 | /** |
305 | * Scale the copy of the 2D histogram by coverage in supplied 1D histogram | |
306 | * | |
307 | * @param copy Data to scale | |
308 | * @param norm Coverage histogram | |
309 | */ | |
310 | static void ScaleToCoverage(TH2D* copy, const TH1D* norm); | |
ce85db45 | 311 | /** |
312 | * Set histogram graphical options, etc. | |
313 | * | |
314 | * @param h Histogram to modify | |
315 | * @param colour Marker color | |
316 | * @param marker Marker style | |
317 | * @param title Title of histogram | |
318 | * @param ytitle Title on y-axis. | |
319 | */ | |
e1f47419 | 320 | static void SetHistogramAttributes(TH1D* h, Int_t colour, Int_t marker, |
321 | const char* title, | |
322 | const char* ytitle="#frac{1}{N} #frac{dN_{ch}}{d#eta}"); | |
323 | /** @} */ | |
9ecab72f | 324 | |
325 | /** | |
326 | * Marker styles | |
327 | */ | |
328 | enum { | |
329 | kSolid = 0x000, | |
330 | kHollow = 0x001, | |
331 | kCircle = 0x002, | |
332 | kSquare = 0x004, | |
333 | kUpTriangle = 0x006, | |
334 | kDownTriangle = 0x008, | |
335 | kDiamond = 0x00a, | |
336 | kCross = 0x00c, | |
337 | kStar = 0x00e | |
338 | }; | |
290052e7 | 339 | /** |
340 | * Get the marker style from option bits | |
341 | * | |
342 | * @param bits Option bits | |
343 | * | |
344 | * @return Marker style | |
345 | */ | |
9ecab72f | 346 | static Int_t GetMarkerStyle(UShort_t bits); |
290052e7 | 347 | /** |
348 | * Get the marker option bits from a style | |
349 | * | |
350 | * @param style Style | |
351 | * | |
352 | * @return option bits | |
353 | */ | |
9ecab72f | 354 | static UShort_t GetMarkerBits(Int_t style); |
290052e7 | 355 | /** |
356 | * Flip an option bit | |
357 | * | |
358 | * @param style Style parameter | |
359 | * | |
360 | * @return New style | |
361 | */ | |
9ecab72f | 362 | static Int_t FlipHollowStyle(Int_t style); |
e1f47419 | 363 | protected: |
9ecab72f | 364 | /** |
365 | * Copy contructor | |
366 | */ | |
e1f47419 | 367 | AliBasedNdetaTask(const AliBasedNdetaTask&); |
9ecab72f | 368 | /** |
369 | * Assignment operator | |
370 | * | |
371 | * | |
372 | * @return | |
373 | */ | |
e1f47419 | 374 | AliBasedNdetaTask& operator=(const AliBasedNdetaTask&) { return *this; } |
9ecab72f | 375 | // Forward declaration |
e1f47419 | 376 | class CentralityBin; |
f67d699c | 377 | /** |
378 | * Create the CentralityBin objects if not already done. | |
379 | * | |
380 | */ | |
381 | virtual void InitializeCentBins(); | |
e1f47419 | 382 | /** |
383 | * Retrieve the histogram | |
384 | * | |
385 | * @param aod AOD event | |
386 | * @param mc Whether to get the MC histogram or not | |
387 | * | |
388 | * @return Retrieved histogram or null | |
389 | */ | |
390 | virtual TH2D* GetHistogram(const AliAODEvent* aod, Bool_t mc=false) = 0; | |
ffca499d | 391 | /** |
9ecab72f | 392 | * Get the colour to use for markers (only pp - in PbPb we use a rainbow) |
ffca499d | 393 | * |
394 | * @return Marker colour | |
395 | */ | |
9ecab72f | 396 | virtual Int_t GetColor() const { return kBlack; } |
ffca499d | 397 | /** |
398 | * Get the marker style | |
399 | * | |
400 | * @return Marker style | |
401 | */ | |
9ecab72f | 402 | virtual Int_t GetMarker() const { return GetMarkerStyle(kCircle); } |
e308a636 | 403 | /** |
404 | * Add a centrality bin | |
405 | * | |
ffca499d | 406 | * @param at Where in the list to add this bin |
e308a636 | 407 | * @param low Low cut |
408 | * @param high High cut | |
409 | */ | |
410 | void AddCentralityBin(UShort_t at, Short_t low, Short_t high); | |
e1f47419 | 411 | /** |
412 | * Make a centrality bin | |
413 | * | |
414 | * @param name Name used for histograms | |
415 | * @param low Low cut in percent | |
416 | * @param high High cut in percent | |
417 | * | |
418 | * @return A newly created centrality bin | |
419 | */ | |
420 | virtual CentralityBin* MakeCentralityBin(const char* name, Short_t low, | |
421 | Short_t high) const; | |
4fa8d795 | 422 | |
423 | //================================================================== | |
9ecab72f | 424 | /** |
425 | * Class that holds the sum of the data - possibly split into 0 or | |
426 | * non-zero bins | |
427 | * | |
428 | */ | |
4fa8d795 | 429 | struct Sum : public TNamed |
430 | { | |
431 | TH2D* fSum; // Sum of non-zero events | |
432 | TH2D* fSum0; // Sum of zero events | |
433 | TH1I* fEvents; // Distribution of events | |
f53fb4f6 | 434 | Int_t fDebug; // Debug level |
9ecab72f | 435 | /** |
436 | * I/O Constructor - do not use | |
437 | */ | |
f53fb4f6 | 438 | Sum() : fSum(0), fSum0(0), fEvents(0), fDebug(0) {} |
9ecab72f | 439 | /** |
440 | * Constructor | |
441 | * | |
442 | * @param name Name | |
443 | * @param postfix Possible post-fix | |
444 | */ | |
4fa8d795 | 445 | Sum(const char* name, const char* postfix) |
446 | : TNamed(name,postfix), | |
447 | fSum(0), | |
448 | fSum0(0), | |
f53fb4f6 | 449 | fEvents(0), |
450 | fDebug(0) | |
4fa8d795 | 451 | {} |
9ecab72f | 452 | /** |
453 | * Copy constructor | |
454 | * | |
455 | * @param o Object to copy from | |
456 | */ | |
4fa8d795 | 457 | Sum(const Sum& o) |
458 | : TNamed(o), | |
459 | fSum(o.fSum), | |
460 | fSum0(o.fSum0), | |
f53fb4f6 | 461 | fEvents(o.fEvents), |
462 | fDebug(o.fDebug) | |
4fa8d795 | 463 | {} |
9ecab72f | 464 | /** |
465 | * Assignment operator | |
466 | * | |
467 | * @param o Object to assign from | |
468 | * | |
469 | * @return Reference to this object | |
470 | */ | |
4fa8d795 | 471 | Sum& operator=(const Sum& o) { |
472 | SetName(o.GetName()); fSum = o.fSum; fSum0 = o.fSum0; fEvents=o.fEvents; | |
473 | return *this; | |
474 | } | |
9ecab72f | 475 | /** |
476 | * Destructor | |
477 | */ | |
4fa8d795 | 478 | ~Sum() {} |
9ecab72f | 479 | /** |
480 | * Initialise this object. | |
481 | * | |
482 | * @param list List to add histograms to | |
483 | * @param data Format of data to be cloned here | |
484 | * @param col Color | |
485 | */ | |
4fa8d795 | 486 | void Init(TList* list, const TH2D* data, Int_t col); |
9ecab72f | 487 | /** |
488 | * Add an event | |
489 | * | |
490 | * @param data Data to add | |
491 | * @param isZero If this is zero event | |
492 | */ | |
4fa8d795 | 493 | void Add(const TH2D* data, Bool_t isZero=false); |
f67d699c | 494 | /** |
495 | * Get the histogram name | |
496 | * | |
497 | * @param name Base name | |
498 | * @param what Which one | |
499 | * @param post Possible postfix | |
500 | * | |
501 | * @return Name | |
502 | */ | |
503 | static TString GetHistName(const char* name, Int_t what=0, | |
504 | const char* post=0); | |
9ecab72f | 505 | /** |
506 | * Get the histogram name | |
507 | * | |
508 | * @param what Which one | |
509 | * | |
510 | * @return Name | |
511 | */ | |
4fa8d795 | 512 | TString GetHistName(Int_t what=0) const; |
9ecab72f | 513 | /** |
514 | * Get the sum | |
515 | * | |
9ecab72f | 516 | * @param o Output list |
517 | * @param ntotal On return, the total number of events | |
518 | * @param zeroEff Zero-bin efficiency | |
519 | * @param otherEff Non-zero-bin efficiency | |
520 | * @param marker Marker to use | |
521 | * @param rootXproj Whether to use TH2::ProjectionX | |
522 | * @param corrEmpty Correct for empty bins | |
523 | * | |
524 | * @return The total sum histogram | |
525 | */ | |
f67d699c | 526 | TH2D* CalcSum(TList* o, Double_t& ntotal, |
527 | Double_t zeroEff, Double_t otherEff=1, Int_t marker=20, | |
528 | Bool_t rootXproj=false, Bool_t corrEmpty=true) const; | |
4fa8d795 | 529 | }; |
4fa8d795 | 530 | |
531 | //================================================================== | |
e1f47419 | 532 | /** |
533 | * Calculations done per centrality | |
534 | * | |
535 | */ | |
badf1074 | 536 | class CentralityBin : public TNamed |
e1f47419 | 537 | { |
badf1074 | 538 | public: |
ffca499d | 539 | /** dN |
e1f47419 | 540 | * Constructor |
541 | */ | |
542 | CentralityBin(); | |
543 | /** | |
544 | * Constructor | |
545 | * | |
546 | * @param name Name used for histograms (e.g., Forward) | |
547 | * @param low Lower centrality cut in percent | |
548 | * @param high Upper centrality cut in percent | |
549 | */ | |
550 | CentralityBin(const char* name, Short_t low, Short_t high); | |
551 | /** | |
552 | * Copy constructor | |
553 | * | |
554 | * @param other Object to copy from | |
555 | */ | |
556 | CentralityBin(const CentralityBin& other); | |
557 | /** | |
558 | * Destructor | |
559 | */ | |
560 | virtual ~CentralityBin(); | |
561 | /** | |
562 | * Assignment operator | |
563 | * | |
564 | * @param other Object to assign from | |
565 | * | |
566 | * @return Reference to this | |
567 | */ | |
568 | CentralityBin& operator=(const CentralityBin& other); | |
569 | /** | |
570 | * Check if this is the 'all' bin | |
571 | * | |
572 | * @return true if low and high cuts are both zero | |
573 | */ | |
574 | Bool_t IsAllBin() const { return fLow == 0 && fHigh == 0; } | |
575 | /** | |
576 | * Get the list name | |
577 | * | |
578 | * @return List Name | |
579 | */ | |
580 | const char* GetListName() const; | |
581 | /** | |
582 | * Create output objects | |
583 | * | |
584 | * @param dir Parent list | |
585 | */ | |
586 | virtual void CreateOutputObjects(TList* dir); | |
587 | /** | |
588 | * Process an event | |
589 | * | |
590 | * @param forward Forward data (for trigger, vertex, & centrality) | |
591 | * @param triggerMask Trigger mask | |
9ecab72f | 592 | * @param isZero True if this is a zero bin event |
e1f47419 | 593 | * @param vzMin Minimum IP z coordinate |
594 | * @param vzMax Maximum IP z coordinate | |
595 | * @param data Data histogram | |
596 | * @param mc MC histogram | |
597 | */ | |
598 | virtual void ProcessEvent(const AliAODForwardMult* forward, | |
ffca499d | 599 | Int_t triggerMask, |
4fa8d795 | 600 | Bool_t isZero, |
ffca499d | 601 | Double_t vzMin, |
602 | Double_t vzMax, | |
603 | const TH2D* data, | |
604 | const TH2D* mc); | |
b30dee70 | 605 | /** |
606 | * Calculate the Event-Level normalization. | |
607 | * | |
608 | * The full event level normalization for trigger @f$X@f$ is given by | |
609 | * @f{eqnarray*}{ | |
610 | * N &=& \frac{1}{\epsilon_X} | |
611 | * \left(N_A+\frac{N_A}{N_V}(N_{-V}-\beta)\right)\\ | |
612 | * &=& \frac{1}{\epsilon_X}N_A | |
613 | * \left(1+\frac{1}{N_V}(N_T-N_V-\beta)\right)\\ | |
614 | * &=& \frac{1}{\epsilon_X}N_A | |
615 | * \left(1+\frac{N_T}{N_V}-1-\frac{\beta}{N_V}\right)\\ | |
616 | * &=& \frac{1}{\epsilon_X}N_A | |
617 | * \left(\frac{1}{\epsilon_V}-\frac{\beta}{N_V}\right) | |
618 | * @f} | |
619 | * where | |
620 | * | |
621 | * - @f$\epsilon_X=\frac{N_{T,X}}{N_X}@f$ is the trigger | |
622 | * efficiency evaluated in simulation. | |
623 | * - @f$\epsilon_V=\frac{N_V}{N_T}@f$ is the vertex efficiency | |
624 | * evaluated from the data | |
625 | * - @f$N_X@f$ is the Monte-Carlo truth number of events of type | |
626 | * @f$X@f$. | |
627 | * - @f$N_{T,X}@f$ is the Monte-Carlo truth number of events of type | |
628 | * @f$X@f$ which was also triggered as such. | |
629 | * - @f$N_T@f$ is the number of data events that where triggered | |
630 | * as type @f$X@f$ and had a collision trigger (CINT1B) | |
631 | * - @f$N_V@f$ is the number of data events that where triggered | |
632 | * as type @f$X@f$, had a collision trigger (CINT1B), and had | |
633 | * a vertex. | |
634 | * - @f$N_{-V}@f$ is the number of data events that where triggered | |
635 | * as type @f$X@f$, had a collision trigger (CINT1B), but no | |
636 | * vertex. | |
637 | * - @f$N_A@f$ is the number of data events that where triggered | |
638 | * as type @f$X@f$, had a collision trigger (CINT1B), and had | |
639 | * a vertex in the selected range. | |
640 | * - @f$\beta=N_a+N_c-N_e@f$ is the number of control triggers that | |
641 | * were also triggered as type @f$X@f$. | |
642 | * - @f$N_a@f$ Number of beam-empty events also triggered as type | |
643 | * @f$X@f$ events (CINT1-A or CINT1-AC). | |
644 | * - @f$N_c@f$ Number of empty-beam events also triggered as type | |
645 | * @f$X@f$ events (CINT1-C). | |
646 | * - @f$N_e@f$ Number of empty-empty events also triggered as type | |
647 | * @f$X@f$ events (CINT1-E). | |
648 | * | |
649 | * Note, that if @f$ \beta \ll N_A@f$ the last term can be ignored, and | |
650 | * the expression simplyfies to | |
651 | * @f[ | |
652 | * N = \frac{1}{\epsilon_X}\frac{1}{\epsilon_V}N_A | |
653 | * @f] | |
654 | * | |
655 | * @param t Histogram of triggers | |
656 | * @param scheme Normalisation scheme | |
657 | * @param trgEff Trigger efficiency | |
658 | * @param ntotal On return, the total number of events to normalise to. | |
659 | * | |
660 | * @return @f$N_A/N@f$ or negative number in case of errors. | |
661 | */ | |
662 | virtual Double_t Normalization(const TH1I& t, | |
663 | UShort_t scheme, | |
664 | Double_t trgEff, | |
665 | Double_t& ntotal) const; | |
c25b5e1b | 666 | /** |
667 | * Generate the dN/deta result from input | |
668 | * | |
669 | * @param sum Sum of 2D hists | |
670 | * @param postfix Post fix on names | |
671 | * @param rootProj Whether to use ROOT TH2::ProjectionX | |
672 | * @param corrEmpty Correct for empty bins | |
673 | * @param shapeCorr Shape correction to use | |
674 | * @param scaler Event-level normalization scaler | |
675 | * @param symmetrice Whether to make symmetric extensions | |
676 | * @param rebin Whether to rebin | |
677 | * @param cutEdges Whether to cut edges when rebinning | |
9f773c15 | 678 | * @param marker Marker style |
c6115ede | 679 | * @param color Color of markers |
680 | * @param mclist List of MC data | |
681 | * @param truthlist List of MC truth data | |
c25b5e1b | 682 | */ |
683 | virtual void MakeResult(const TH2D* sum, | |
684 | const char* postfix, | |
685 | bool rootProj, | |
686 | bool corrEmpty, | |
f67d699c | 687 | const TH2F* shapeCorr, |
c25b5e1b | 688 | Double_t scaler, |
689 | bool symmetrice, | |
690 | Int_t rebin, | |
691 | bool cutEdges, | |
9ecab72f | 692 | Int_t marker, |
c89b9ac1 | 693 | Int_t color, |
694 | TList* mclist, | |
695 | TList* truthlist); | |
e1f47419 | 696 | /** |
697 | * End of processing | |
698 | * | |
699 | * @param sums List of sums | |
700 | * @param results Output list of results | |
ffca499d | 701 | * @param scheme Normalisation scheme options |
e1f47419 | 702 | * @param shapeCorr Shape correction or nil |
703 | * @param trigEff Trigger efficiency | |
704 | * @param symmetrice Whether to symmetrice the results | |
705 | * @param rebin Whether to rebin the results | |
c25b5e1b | 706 | * @param rootProj If true, use TH2::ProjectionX |
e1f47419 | 707 | * @param corrEmpty Whether to correct for empty bins |
708 | * @param cutEdges Whether to cut edges when rebinning | |
e1f47419 | 709 | * @param triggerMask Trigger mask |
ffca499d | 710 | * @param marker Marker style |
c6115ede | 711 | * @param color Color of markers |
712 | * @param mclist List of MC data | |
713 | * @param truthlist List of MC truth data | |
e1f47419 | 714 | */ |
715 | virtual void End(TList* sums, | |
716 | TList* results, | |
ffca499d | 717 | UShort_t scheme, |
f67d699c | 718 | const TH2F* shapeCorr, |
e1f47419 | 719 | Double_t trigEff, |
720 | Bool_t symmetrice, | |
721 | Int_t rebin, | |
c25b5e1b | 722 | Bool_t rootProj, |
e1f47419 | 723 | Bool_t corrEmpty, |
724 | Bool_t cutEdges, | |
ffca499d | 725 | Int_t triggerMask, |
9ecab72f | 726 | Int_t marker, |
c89b9ac1 | 727 | Int_t color, |
728 | TList* mclist, | |
729 | TList* truthlist); | |
e1f47419 | 730 | /** |
731 | * @{ | |
732 | * @name Access histograms | |
733 | */ | |
734 | /** | |
735 | * Get sum histogram | |
736 | * | |
737 | * @param mc If true, return MC histogram | |
738 | * | |
739 | * @return Sum histogram | |
740 | */ | |
4fa8d795 | 741 | const Sum* GetSum(Bool_t mc=false) const { return mc ? fSumMC : fSum; } |
e1f47419 | 742 | /** |
743 | * Get sum histogram | |
744 | * | |
745 | * @param mc If true, return MC histogram | |
746 | * | |
747 | * @return Sum histogram | |
748 | */ | |
4fa8d795 | 749 | Sum* GetSum(Bool_t mc=false) { return mc ? fSumMC : fSum; } |
e1f47419 | 750 | /** |
751 | * Get trigger histogram | |
752 | * | |
753 | * @return Trigger histogram | |
754 | */ | |
ffca499d | 755 | const TH1I* GetTriggers() const { return fTriggers; } |
e1f47419 | 756 | /** |
757 | * Get trigger histogram | |
758 | * | |
759 | * @return Trigger histogram | |
760 | */ | |
ffca499d | 761 | TH1I* GetTrigggers() { return fTriggers; } |
e1f47419 | 762 | /** @} */ |
5bb5d1f6 | 763 | |
9ecab72f | 764 | /** |
765 | * Get the color of the markers | |
766 | * | |
290052e7 | 767 | * @param fallback Fall-back color |
768 | * | |
769 | * @return Color for this centrality bin | |
9ecab72f | 770 | */ |
771 | Int_t GetColor(Int_t fallback=kRed+2) const; | |
772 | /** | |
773 | * Get list of results | |
774 | * | |
775 | * | |
290052e7 | 776 | * @return List of results |
9ecab72f | 777 | */ |
5bb5d1f6 | 778 | TList* GetResults() const { return fOutput; } |
9ecab72f | 779 | /** |
780 | * Get name of result histogram | |
781 | * | |
782 | * @param rebin | |
783 | * @param sym | |
784 | * @param postfix | |
785 | * | |
786 | * @return | |
787 | */ | |
5bb5d1f6 | 788 | const char* GetResultName(Int_t rebin, Bool_t sym, |
789 | const char* postfix="") const; | |
9ecab72f | 790 | /** |
791 | * Get a result | |
792 | * | |
793 | * @param rebin | |
794 | * @param sym | |
795 | * @param postfix | |
796 | * | |
797 | * @return | |
798 | */ | |
5bb5d1f6 | 799 | TH1* GetResult(Int_t rebin, Bool_t sym, |
800 | const char* postfix="") const; | |
290052e7 | 801 | /** |
802 | * Set the debug level | |
803 | * | |
804 | * @param lvl Debug level | |
805 | */ | |
f53fb4f6 | 806 | void SetDebugLevel(Int_t lvl); |
e1f47419 | 807 | protected: |
290052e7 | 808 | /** |
809 | * Read in sum hisotgram from list | |
810 | * | |
811 | * @param list List to read from | |
812 | * @param mc True for MC input | |
813 | * | |
814 | * @return true if sum histogram is found | |
815 | */ | |
f67d699c | 816 | virtual Bool_t ReadSum(TList* list, bool mc=false); |
e1f47419 | 817 | /** |
818 | * Create sum histogram | |
819 | * | |
820 | * @param data Data histogram to clone | |
821 | * @param mc (optional) MC histogram to clone | |
822 | */ | |
823 | virtual void CreateSums(const TH2D* data, const TH2D* mc); | |
824 | /** | |
825 | * Check the trigger, vertex, and centrality | |
826 | * | |
ffca499d | 827 | * @param forward Event input |
828 | * @param triggerMask The used trigger mask | |
829 | * @param vzMin Least @f$ v_z@f$ | |
830 | * @param vzMax Largest @f$ v_z@f$ | |
e1f47419 | 831 | * |
832 | * @return true if the event is to be used | |
833 | */ | |
834 | virtual Bool_t CheckEvent(const AliAODForwardMult* forward, | |
ffca499d | 835 | Int_t triggerMask, |
836 | Double_t vzMin, | |
837 | Double_t vzMax); | |
e1f47419 | 838 | TList* fSums; // Output list |
839 | TList* fOutput; // Output list | |
4fa8d795 | 840 | Sum* fSum; // Sum histogram |
841 | Sum* fSumMC; // MC sum histogram | |
ffca499d | 842 | TH1I* fTriggers; // Trigger histogram |
e1f47419 | 843 | UShort_t fLow; // Lower limit (inclusive) |
844 | UShort_t fHigh; // Upper limit (exclusive) | |
c89b9ac1 | 845 | Bool_t fDoFinalMCCorrection; //Do final MC correction |
f53fb4f6 | 846 | Int_t fDebug; // Debug level |
847 | ||
848 | ClassDef(CentralityBin,2); // A centrality bin | |
e1f47419 | 849 | }; |
ce85db45 | 850 | TList* fSums; // Container of sums |
851 | TList* fOutput; // Container of outputs | |
ce85db45 | 852 | Double_t fVtxMin; // Minimum v_z |
853 | Double_t fVtxMax; // Maximum v_z | |
854 | Int_t fTriggerMask; // Trigger mask | |
855 | Int_t fRebin; // Rebinning factor | |
856 | Bool_t fCutEdges; // Whether to cut edges when rebinning | |
857 | Bool_t fSymmetrice; // Whether to symmetrice data | |
858 | Bool_t fCorrEmpty; // Correct for empty bins | |
c25b5e1b | 859 | Bool_t fUseROOTProj; // Whether to use ROOT's ProjectionX |
e58000b7 | 860 | Double_t fTriggerEff; // Trigger efficiency for selected trigger(s) |
f67d699c | 861 | TH2F* fShapeCorr; // Shape correction |
e308a636 | 862 | TObjArray* fListOfCentralities; // Centrality bins |
a76fb27d | 863 | #if 0 |
e1f47419 | 864 | TNamed* fSNNString; // sqrt(s_NN) string |
865 | TNamed* fSysString; // Collision system string | |
a76fb27d | 866 | #else |
241cca4d | 867 | TObject* fSNNString; // sqrt(s_NN) string |
868 | TObject* fSysString; // Collision system string | |
a76fb27d | 869 | #endif |
e1f47419 | 870 | TH1D* fCent; // Centrality distribution |
e308a636 | 871 | TAxis* fCentAxis; // Centrality axis |
ffca499d | 872 | UShort_t fNormalizationScheme; // Normalization scheme |
a76fb27d | 873 | #if 0 |
4bcdcbc1 | 874 | TNamed* fSchemeString; // Normalization scheme string |
875 | TNamed* fTriggerString; // Trigger string | |
a76fb27d | 876 | #else |
241cca4d | 877 | TObject* fSchemeString; // Normalization scheme string |
878 | TObject* fTriggerString; // Trigger string | |
a76fb27d | 879 | #endif |
c89b9ac1 | 880 | TString fFinalMCCorrFile; //Filename for final MC corr |
881 | ||
241cca4d | 882 | ClassDef(AliBasedNdetaTask,8); // Determine multiplicity in base area |
ce85db45 | 883 | }; |
884 | ||
885 | #endif | |
886 | // | |
887 | // Local Variables: | |
888 | // mode: C++ | |
889 | // End: | |
890 | // |