]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/FORWARD/analysis2/AliBasedNdetaTask.h
Chiara O. implemented a way to bypass HIJING internal calculation
[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);
5ca83fee 317 /**
318 * Scale the copy of the 1D histogram by coverage in supplied 1D histogram
319 *
320 * @param copy Data to scale
321 * @param norm Coverage histogram
322 */
323 static void ScaleToCoverage(TH1D* copy, const TH1D* norm);
ce85db45 324 /**
325 * Set histogram graphical options, etc.
326 *
327 * @param h Histogram to modify
328 * @param colour Marker color
329 * @param marker Marker style
330 * @param title Title of histogram
331 * @param ytitle Title on y-axis.
332 */
e1f47419 333 static void SetHistogramAttributes(TH1D* h, Int_t colour, Int_t marker,
334 const char* title,
335 const char* ytitle="#frac{1}{N} #frac{dN_{ch}}{d#eta}");
336 /** @} */
9ecab72f 337
338 /**
339 * Marker styles
340 */
341 enum {
342 kSolid = 0x000,
343 kHollow = 0x001,
344 kCircle = 0x002,
345 kSquare = 0x004,
346 kUpTriangle = 0x006,
347 kDownTriangle = 0x008,
348 kDiamond = 0x00a,
349 kCross = 0x00c,
350 kStar = 0x00e
351 };
290052e7 352 /**
353 * Get the marker style from option bits
354 *
355 * @param bits Option bits
356 *
357 * @return Marker style
358 */
9ecab72f 359 static Int_t GetMarkerStyle(UShort_t bits);
290052e7 360 /**
361 * Get the marker option bits from a style
362 *
363 * @param style Style
364 *
365 * @return option bits
366 */
9ecab72f 367 static UShort_t GetMarkerBits(Int_t style);
290052e7 368 /**
369 * Flip an option bit
370 *
371 * @param style Style parameter
372 *
373 * @return New style
374 */
9ecab72f 375 static Int_t FlipHollowStyle(Int_t style);
e1f47419 376protected:
9ecab72f 377 /**
378 * Copy contructor
379 */
e1f47419 380 AliBasedNdetaTask(const AliBasedNdetaTask&);
9ecab72f 381 /**
382 * Assignment operator
383 *
384 *
385 * @return
386 */
e1f47419 387 AliBasedNdetaTask& operator=(const AliBasedNdetaTask&) { return *this; }
9ecab72f 388 // Forward declaration
e1f47419 389 class CentralityBin;
f67d699c 390 /**
391 * Create the CentralityBin objects if not already done.
392 *
393 */
394 virtual void InitializeCentBins();
e1f47419 395 /**
396 * Retrieve the histogram
397 *
398 * @param aod AOD event
399 * @param mc Whether to get the MC histogram or not
400 *
401 * @return Retrieved histogram or null
402 */
403 virtual TH2D* GetHistogram(const AliAODEvent* aod, Bool_t mc=false) = 0;
ffca499d 404 /**
9ecab72f 405 * Get the colour to use for markers (only pp - in PbPb we use a rainbow)
ffca499d 406 *
407 * @return Marker colour
408 */
9ecab72f 409 virtual Int_t GetColor() const { return kBlack; }
ffca499d 410 /**
411 * Get the marker style
412 *
413 * @return Marker style
414 */
9ecab72f 415 virtual Int_t GetMarker() const { return GetMarkerStyle(kCircle); }
e308a636 416 /**
417 * Add a centrality bin
418 *
ffca499d 419 * @param at Where in the list to add this bin
e308a636 420 * @param low Low cut
421 * @param high High cut
422 */
423 void AddCentralityBin(UShort_t at, Short_t low, Short_t high);
e1f47419 424 /**
425 * Make a centrality bin
426 *
427 * @param name Name used for histograms
428 * @param low Low cut in percent
429 * @param high High cut in percent
430 *
431 * @return A newly created centrality bin
432 */
433 virtual CentralityBin* MakeCentralityBin(const char* name, Short_t low,
434 Short_t high) const;
4fa8d795 435
436 //==================================================================
9ecab72f 437 /**
438 * Class that holds the sum of the data - possibly split into 0 or
439 * non-zero bins
440 *
441 */
4fa8d795 442 struct Sum : public TNamed
443 {
444 TH2D* fSum; // Sum of non-zero events
445 TH2D* fSum0; // Sum of zero events
446 TH1I* fEvents; // Distribution of events
f53fb4f6 447 Int_t fDebug; // Debug level
9ecab72f 448 /**
449 * I/O Constructor - do not use
450 */
f53fb4f6 451 Sum() : fSum(0), fSum0(0), fEvents(0), fDebug(0) {}
9ecab72f 452 /**
453 * Constructor
454 *
455 * @param name Name
456 * @param postfix Possible post-fix
457 */
4fa8d795 458 Sum(const char* name, const char* postfix)
459 : TNamed(name,postfix),
460 fSum(0),
461 fSum0(0),
f53fb4f6 462 fEvents(0),
463 fDebug(0)
4fa8d795 464 {}
9ecab72f 465 /**
466 * Copy constructor
467 *
468 * @param o Object to copy from
469 */
4fa8d795 470 Sum(const Sum& o)
471 : TNamed(o),
472 fSum(o.fSum),
473 fSum0(o.fSum0),
f53fb4f6 474 fEvents(o.fEvents),
475 fDebug(o.fDebug)
4fa8d795 476 {}
9ecab72f 477 /**
478 * Assignment operator
479 *
480 * @param o Object to assign from
481 *
482 * @return Reference to this object
483 */
4fa8d795 484 Sum& operator=(const Sum& o) {
485 SetName(o.GetName()); fSum = o.fSum; fSum0 = o.fSum0; fEvents=o.fEvents;
486 return *this;
487 }
9ecab72f 488 /**
489 * Destructor
490 */
4fa8d795 491 ~Sum() {}
9ecab72f 492 /**
493 * Initialise this object.
494 *
495 * @param list List to add histograms to
496 * @param data Format of data to be cloned here
497 * @param col Color
498 */
4fa8d795 499 void Init(TList* list, const TH2D* data, Int_t col);
9ecab72f 500 /**
501 * Add an event
502 *
503 * @param data Data to add
504 * @param isZero If this is zero event
505 */
4fa8d795 506 void Add(const TH2D* data, Bool_t isZero=false);
f67d699c 507 /**
508 * Get the histogram name
509 *
510 * @param name Base name
511 * @param what Which one
512 * @param post Possible postfix
513 *
514 * @return Name
515 */
516 static TString GetHistName(const char* name, Int_t what=0,
517 const char* post=0);
9ecab72f 518 /**
519 * Get the histogram name
520 *
521 * @param what Which one
522 *
523 * @return Name
524 */
4fa8d795 525 TString GetHistName(Int_t what=0) const;
9ecab72f 526 /**
527 * Get the sum
528 *
9ecab72f 529 * @param o Output list
530 * @param ntotal On return, the total number of events
531 * @param zeroEff Zero-bin efficiency
532 * @param otherEff Non-zero-bin efficiency
533 * @param marker Marker to use
534 * @param rootXproj Whether to use TH2::ProjectionX
535 * @param corrEmpty Correct for empty bins
536 *
537 * @return The total sum histogram
538 */
f67d699c 539 TH2D* CalcSum(TList* o, Double_t& ntotal,
540 Double_t zeroEff, Double_t otherEff=1, Int_t marker=20,
541 Bool_t rootXproj=false, Bool_t corrEmpty=true) const;
4fa8d795 542 };
4fa8d795 543
544 //==================================================================
e1f47419 545 /**
546 * Calculations done per centrality
547 *
548 */
badf1074 549 class CentralityBin : public TNamed
e1f47419 550 {
badf1074 551 public:
ffca499d 552 /** dN
e1f47419 553 * Constructor
554 */
555 CentralityBin();
556 /**
557 * Constructor
558 *
559 * @param name Name used for histograms (e.g., Forward)
560 * @param low Lower centrality cut in percent
561 * @param high Upper centrality cut in percent
562 */
563 CentralityBin(const char* name, Short_t low, Short_t high);
564 /**
565 * Copy constructor
566 *
567 * @param other Object to copy from
568 */
569 CentralityBin(const CentralityBin& other);
570 /**
571 * Destructor
572 */
573 virtual ~CentralityBin();
574 /**
575 * Assignment operator
576 *
577 * @param other Object to assign from
578 *
579 * @return Reference to this
580 */
581 CentralityBin& operator=(const CentralityBin& other);
582 /**
583 * Check if this is the 'all' bin
584 *
585 * @return true if low and high cuts are both zero
586 */
587 Bool_t IsAllBin() const { return fLow == 0 && fHigh == 0; }
588 /**
589 * Get the list name
590 *
591 * @return List Name
592 */
593 const char* GetListName() const;
594 /**
595 * Create output objects
596 *
597 * @param dir Parent list
1a7e2e15 598 * @param mask Trigger mask
e1f47419 599 */
1a7e2e15 600 virtual void CreateOutputObjects(TList* dir, Int_t mask);
e1f47419 601 /**
602 * Process an event
603 *
604 * @param forward Forward data (for trigger, vertex, & centrality)
605 * @param triggerMask Trigger mask
9ecab72f 606 * @param isZero True if this is a zero bin event
e1f47419 607 * @param vzMin Minimum IP z coordinate
608 * @param vzMax Maximum IP z coordinate
609 * @param data Data histogram
610 * @param mc MC histogram
611 */
612 virtual void ProcessEvent(const AliAODForwardMult* forward,
ffca499d 613 Int_t triggerMask,
4fa8d795 614 Bool_t isZero,
ffca499d 615 Double_t vzMin,
616 Double_t vzMax,
617 const TH2D* data,
618 const TH2D* mc);
b30dee70 619 /**
620 * Calculate the Event-Level normalization.
621 *
622 * The full event level normalization for trigger @f$X@f$ is given by
623 * @f{eqnarray*}{
624 * N &=& \frac{1}{\epsilon_X}
625 * \left(N_A+\frac{N_A}{N_V}(N_{-V}-\beta)\right)\\
626 * &=& \frac{1}{\epsilon_X}N_A
627 * \left(1+\frac{1}{N_V}(N_T-N_V-\beta)\right)\\
628 * &=& \frac{1}{\epsilon_X}N_A
629 * \left(1+\frac{N_T}{N_V}-1-\frac{\beta}{N_V}\right)\\
630 * &=& \frac{1}{\epsilon_X}N_A
631 * \left(\frac{1}{\epsilon_V}-\frac{\beta}{N_V}\right)
632 * @f}
633 * where
634 *
635 * - @f$\epsilon_X=\frac{N_{T,X}}{N_X}@f$ is the trigger
636 * efficiency evaluated in simulation.
637 * - @f$\epsilon_V=\frac{N_V}{N_T}@f$ is the vertex efficiency
638 * evaluated from the data
639 * - @f$N_X@f$ is the Monte-Carlo truth number of events of type
640 * @f$X@f$.
641 * - @f$N_{T,X}@f$ is the Monte-Carlo truth number of events of type
642 * @f$X@f$ which was also triggered as such.
643 * - @f$N_T@f$ is the number of data events that where triggered
644 * as type @f$X@f$ and had a collision trigger (CINT1B)
645 * - @f$N_V@f$ is the number of data events that where triggered
646 * as type @f$X@f$, had a collision trigger (CINT1B), and had
647 * a vertex.
648 * - @f$N_{-V}@f$ is the number of data events that where triggered
649 * as type @f$X@f$, had a collision trigger (CINT1B), but no
650 * vertex.
651 * - @f$N_A@f$ is the number of data events that where triggered
652 * as type @f$X@f$, had a collision trigger (CINT1B), and had
653 * a vertex in the selected range.
654 * - @f$\beta=N_a+N_c-N_e@f$ is the number of control triggers that
655 * were also triggered as type @f$X@f$.
656 * - @f$N_a@f$ Number of beam-empty events also triggered as type
657 * @f$X@f$ events (CINT1-A or CINT1-AC).
658 * - @f$N_c@f$ Number of empty-beam events also triggered as type
659 * @f$X@f$ events (CINT1-C).
660 * - @f$N_e@f$ Number of empty-empty events also triggered as type
661 * @f$X@f$ events (CINT1-E).
662 *
663 * Note, that if @f$ \beta \ll N_A@f$ the last term can be ignored, and
664 * the expression simplyfies to
665 * @f[
666 * N = \frac{1}{\epsilon_X}\frac{1}{\epsilon_V}N_A
667 * @f]
668 *
669 * @param t Histogram of triggers
670 * @param scheme Normalisation scheme
671 * @param trgEff Trigger efficiency
672 * @param ntotal On return, the total number of events to normalise to.
1a7e2e15 673 * @param text If non-null, fill with normalization calculation
b30dee70 674 *
675 * @return @f$N_A/N@f$ or negative number in case of errors.
676 */
677 virtual Double_t Normalization(const TH1I& t,
678 UShort_t scheme,
679 Double_t trgEff,
1a7e2e15 680 Double_t& ntotal,
681 TString* text) const;
c25b5e1b 682 /**
683 * Generate the dN/deta result from input
684 *
685 * @param sum Sum of 2D hists
686 * @param postfix Post fix on names
687 * @param rootProj Whether to use ROOT TH2::ProjectionX
688 * @param corrEmpty Correct for empty bins
689 * @param shapeCorr Shape correction to use
690 * @param scaler Event-level normalization scaler
691 * @param symmetrice Whether to make symmetric extensions
692 * @param rebin Whether to rebin
693 * @param cutEdges Whether to cut edges when rebinning
9f773c15 694 * @param marker Marker style
c6115ede 695 * @param color Color of markers
696 * @param mclist List of MC data
697 * @param truthlist List of MC truth data
c25b5e1b 698 */
699 virtual void MakeResult(const TH2D* sum,
700 const char* postfix,
701 bool rootProj,
702 bool corrEmpty,
f67d699c 703 const TH2F* shapeCorr,
c25b5e1b 704 Double_t scaler,
705 bool symmetrice,
706 Int_t rebin,
707 bool cutEdges,
9ecab72f 708 Int_t marker,
c89b9ac1 709 Int_t color,
710 TList* mclist,
711 TList* truthlist);
e1f47419 712 /**
713 * End of processing
714 *
715 * @param sums List of sums
716 * @param results Output list of results
ffca499d 717 * @param scheme Normalisation scheme options
e1f47419 718 * @param shapeCorr Shape correction or nil
719 * @param trigEff Trigger efficiency
66cf95f2 720 * @param trigEff0 0-bin trigger efficiency
e1f47419 721 * @param symmetrice Whether to symmetrice the results
722 * @param rebin Whether to rebin the results
c25b5e1b 723 * @param rootProj If true, use TH2::ProjectionX
e1f47419 724 * @param corrEmpty Whether to correct for empty bins
725 * @param cutEdges Whether to cut edges when rebinning
e1f47419 726 * @param triggerMask Trigger mask
ffca499d 727 * @param marker Marker style
c6115ede 728 * @param color Color of markers
729 * @param mclist List of MC data
730 * @param truthlist List of MC truth data
e1f47419 731 */
732 virtual void End(TList* sums,
733 TList* results,
ffca499d 734 UShort_t scheme,
f67d699c 735 const TH2F* shapeCorr,
e1f47419 736 Double_t trigEff,
66cf95f2 737 Double_t trigEff0,
e1f47419 738 Bool_t symmetrice,
739 Int_t rebin,
c25b5e1b 740 Bool_t rootProj,
e1f47419 741 Bool_t corrEmpty,
742 Bool_t cutEdges,
ffca499d 743 Int_t triggerMask,
9ecab72f 744 Int_t marker,
c89b9ac1 745 Int_t color,
746 TList* mclist,
747 TList* truthlist);
e1f47419 748 /**
749 * @{
750 * @name Access histograms
751 */
752 /**
753 * Get sum histogram
754 *
755 * @param mc If true, return MC histogram
756 *
757 * @return Sum histogram
758 */
4fa8d795 759 const Sum* GetSum(Bool_t mc=false) const { return mc ? fSumMC : fSum; }
e1f47419 760 /**
761 * Get sum histogram
762 *
763 * @param mc If true, return MC histogram
764 *
765 * @return Sum histogram
766 */
4fa8d795 767 Sum* GetSum(Bool_t mc=false) { return mc ? fSumMC : fSum; }
e1f47419 768 /**
769 * Get trigger histogram
770 *
771 * @return Trigger histogram
772 */
ffca499d 773 const TH1I* GetTriggers() const { return fTriggers; }
e1f47419 774 /**
775 * Get trigger histogram
776 *
777 * @return Trigger histogram
778 */
ffca499d 779 TH1I* GetTrigggers() { return fTriggers; }
e1f47419 780 /** @} */
5bb5d1f6 781
9ecab72f 782 /**
783 * Get the color of the markers
784 *
290052e7 785 * @param fallback Fall-back color
786 *
787 * @return Color for this centrality bin
9ecab72f 788 */
789 Int_t GetColor(Int_t fallback=kRed+2) const;
790 /**
791 * Get list of results
792 *
793 *
290052e7 794 * @return List of results
9ecab72f 795 */
5bb5d1f6 796 TList* GetResults() const { return fOutput; }
9ecab72f 797 /**
798 * Get name of result histogram
799 *
800 * @param rebin
801 * @param sym
802 * @param postfix
803 *
804 * @return
805 */
5bb5d1f6 806 const char* GetResultName(Int_t rebin, Bool_t sym,
807 const char* postfix="") const;
9ecab72f 808 /**
809 * Get a result
810 *
811 * @param rebin
812 * @param sym
813 * @param postfix
814 *
815 * @return
816 */
5bb5d1f6 817 TH1* GetResult(Int_t rebin, Bool_t sym,
818 const char* postfix="") const;
290052e7 819 /**
820 * Set the debug level
821 *
822 * @param lvl Debug level
823 */
f53fb4f6 824 void SetDebugLevel(Int_t lvl);
e1f47419 825 protected:
290052e7 826 /**
827 * Read in sum hisotgram from list
828 *
829 * @param list List to read from
830 * @param mc True for MC input
831 *
832 * @return true if sum histogram is found
833 */
f67d699c 834 virtual Bool_t ReadSum(TList* list, bool mc=false);
e1f47419 835 /**
836 * Create sum histogram
837 *
838 * @param data Data histogram to clone
839 * @param mc (optional) MC histogram to clone
840 */
841 virtual void CreateSums(const TH2D* data, const TH2D* mc);
842 /**
843 * Check the trigger, vertex, and centrality
844 *
ffca499d 845 * @param forward Event input
846 * @param triggerMask The used trigger mask
847 * @param vzMin Least @f$ v_z@f$
848 * @param vzMax Largest @f$ v_z@f$
e1f47419 849 *
850 * @return true if the event is to be used
851 */
852 virtual Bool_t CheckEvent(const AliAODForwardMult* forward,
ffca499d 853 Int_t triggerMask,
854 Double_t vzMin,
855 Double_t vzMax);
e1f47419 856 TList* fSums; // Output list
857 TList* fOutput; // Output list
4fa8d795 858 Sum* fSum; // Sum histogram
859 Sum* fSumMC; // MC sum histogram
ffca499d 860 TH1I* fTriggers; // Trigger histogram
e1f47419 861 UShort_t fLow; // Lower limit (inclusive)
862 UShort_t fHigh; // Upper limit (exclusive)
c89b9ac1 863 Bool_t fDoFinalMCCorrection; //Do final MC correction
f53fb4f6 864 Int_t fDebug; // Debug level
865
5934a3e3 866 ClassDef(CentralityBin,3); // A centrality bin
e1f47419 867 };
ce85db45 868 TList* fSums; // Container of sums
869 TList* fOutput; // Container of outputs
ce85db45 870 Double_t fVtxMin; // Minimum v_z
871 Double_t fVtxMax; // Maximum v_z
872 Int_t fTriggerMask; // Trigger mask
873 Int_t fRebin; // Rebinning factor
874 Bool_t fCutEdges; // Whether to cut edges when rebinning
875 Bool_t fSymmetrice; // Whether to symmetrice data
876 Bool_t fCorrEmpty; // Correct for empty bins
c25b5e1b 877 Bool_t fUseROOTProj; // Whether to use ROOT's ProjectionX
e58000b7 878 Double_t fTriggerEff; // Trigger efficiency for selected trigger(s)
66cf95f2 879 Double_t fTriggerEff0; // Bin-0 Trigger efficiency for sel trigger(s)
f67d699c 880 TH2F* fShapeCorr; // Shape correction
e308a636 881 TObjArray* fListOfCentralities; // Centrality bins
66cf95f2 882 TObject* fSNNString; // sqrt(s_NN) string
883 TObject* fSysString; // Collision system string
e1f47419 884 TH1D* fCent; // Centrality distribution
e308a636 885 TAxis* fCentAxis; // Centrality axis
ffca499d 886 UShort_t fNormalizationScheme; // Normalization scheme
241cca4d 887 TObject* fSchemeString; // Normalization scheme string
888 TObject* fTriggerString; // Trigger string
c89b9ac1 889 TString fFinalMCCorrFile; //Filename for final MC corr
890
5934a3e3 891 ClassDef(AliBasedNdetaTask,10); // Determine charged particle density
ce85db45 892};
893
894#endif
895//
896// Local Variables:
897// mode: C++
898// End:
899//