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