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