]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/AliBasedNdetaTask.h
Renamed some member functions for more logical names
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AliBasedNdetaTask.h
1 //
2 // Task to analyse the AOD for for dN/deta in the base regions 
3 //
4 #ifndef ALIBASEDNDETATASK_H
5 #define ALIBASEDNDETATASK_H
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 pwglf_forward_dndeta
14  * 
15  */
16 #include <AliAnalysisTaskSE.h>
17 class TAxis;
18 class TList;
19 class TH2D;
20 class TH2F;
21 class TH1D;
22 class TH1I;
23 class AliAODEvent;
24 class AliAODForwardMult;
25 class TObjArray;
26
27 /** 
28  * @defgroup pwglf_forward_tasks_dndeta dN/deta tasks 
29  *
30  * Code to produce @f$ dN/d\eta@f$
31  *
32  * @ingroup pwglf_forward_tasks 
33  */
34 /**
35  * @defgroup pwglf_forward_dndeta dN/deta
36  *
37  * @f$ dN/d\eta@f$ code 
38  *
39  * @ingroup pwglf_forward_topical
40  */
41 /**
42  * Base class for tasks to determine @f$ dN/d\eta@f$ 
43  *
44  * @ingroup pwglf_forward_tasks_dndeta
45  * @ingroup pwglf_forward_dndeta
46  */
47 class AliBasedNdetaTask : public AliAnalysisTaskSE
48 {
49 public:
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,
64     /** 
65      * Do the shape correction
66      */
67     kShape = 0x2, 
68     /** 
69      * Correct for background events (A+C-E). Not implemented yet
70      */
71     kBackground = 0x4,
72     /**
73      * Correct for the trigger efficiency from MC 
74      */
75     kTriggerEfficiency = 0x8,
76     /** 
77      * Correct using zero-bin efficiency only 
78      */
79     kZeroBin = 0x10,
80     /**
81      * Do the full correction
82      */
83     kFull = kEventLevel | kShape | kBackground | kTriggerEfficiency,
84   };
85   /** 
86    * Constructor 
87    * 
88    */
89   AliBasedNdetaTask();
90   /** 
91    * Constructor
92    * 
93    * @param name    Name of task 
94    */
95   AliBasedNdetaTask(const char* name);
96   /**
97    * Destructor
98    * 
99    */
100   virtual ~AliBasedNdetaTask();
101
102   /** 
103    * @{ 
104    * @name Task configuration 
105    */
106   /** 
107    * Set the debug level 
108    * 
109    * @param level Debug level
110    */
111   virtual void SetDebugLevel(Int_t level);
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    */
130   void SetTriggerMask(UShort_t mask);
131   /** 
132    * Set the trigger mask 
133    * 
134    * @param mask trigger mask 
135    */
136   void SetTriggerMask(const char* mask);
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);
149   /** 
150    * Whether to cut edges when merging 
151    * 
152    * @param cut If true, cut edges 
153    */
154   void SetCutEdges(Bool_t cut) {fCutEdges = cut;}
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; }
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    * 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; } 
180   /** 
181    * Set the shape correction (a.k.a., track correction) for selected
182    * trigger(s)
183    * 
184    * @param h Correction
185    */
186   void SetShapeCorrection(const TH2F* h);
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);
203   /** 
204    * Setthe normalisation scheme to use 
205    * 
206    * @param scheme Normalisation scheme 
207    */
208   void SetNormalizationScheme(UShort_t scheme);
209   /** 
210    * Space, pipe, or comma separated list of options
211    * 
212    * @param what List of options 
213    */
214   void SetNormalizationScheme(const char* what);
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   }
224   /** 
225    * Load the normalization data - done automatically if not set from outside
226    * 
227    * @param sys system
228    * @param energy energy
229    */
230   void LoadNormalizationData(UShort_t sys, UShort_t energy);  
231   /** @} */
232   /** 
233    * Print information 
234    * 
235    * @param option Not used
236    */
237   void Print(Option_t* option="") const;
238   /** @{ 
239    *  @name Task interface 
240    */
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   /** 
259    * Called at end of event processing.
260    *
261    * This is called once in the master 
262    * 
263    * @param option Not used 
264    */
265   virtual void Terminate(Option_t* option);
266   /* @} */
267
268   /** 
269    * @{ 
270    * @name Services member functions 
271    */
272   /** 
273    * Make a copy of the input histogram and rebin that histogram
274    * 
275    * @param h         Histogram to rebin
276    * @param rebin     Rebinning factor 
277    * @param cutEdges  Whether to cut edges when rebinning
278    * 
279    * @return New (rebinned) histogram
280    */
281   static TH1D* Rebin(const TH1D* h, Int_t rebin, Bool_t cutEdges=false);
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    */
289   static TH1* Symmetrice(const TH1* h);
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
297    * @param useROOT   Use TH2::ProjectionX instead of custom code 
298    * @param corr      Whether to do corrections or not 
299    * @param error     Whether to calculate errors
300    * 
301    * @return Newly created histogram or null
302    */
303   static TH1D* ProjectX(const TH2D* h, 
304                         const char* name,
305                         Int_t firstbin, 
306                         Int_t lastbin, 
307                         bool  useROOT=false,
308                         bool  corr=true,
309                         bool  error=true);
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);
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);
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    */
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   /** @} */
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   };
352   /** 
353    * Get the marker style from option bits
354    * 
355    * @param bits Option bits 
356    * 
357    * @return Marker style 
358    */
359   static Int_t GetMarkerStyle(UShort_t bits);
360   /** 
361    * Get the marker option bits from a style 
362    * 
363    * @param style Style
364    * 
365    * @return option bits
366    */
367   static UShort_t GetMarkerBits(Int_t style);
368   /** 
369    * Flip an option bit 
370    * 
371    * @param style Style parameter
372    * 
373    * @return New style 
374    */
375   static Int_t FlipHollowStyle(Int_t style);
376 protected:
377   /** 
378    * Copy contructor
379    */
380   AliBasedNdetaTask(const AliBasedNdetaTask&);
381   /** 
382    * Assignment operator 
383    * 
384    * 
385    * @return 
386    */
387   AliBasedNdetaTask& operator=(const AliBasedNdetaTask&) { return *this; }
388   // Forward declaration 
389   class CentralityBin;
390   /** 
391    * Create the CentralityBin objects if not already done.
392    * 
393    */
394   virtual void InitializeCentBins();
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;
404   /** 
405    * Get the colour to use for markers (only pp - in PbPb we use a rainbow)
406    * 
407    * @return Marker colour 
408    */
409   virtual Int_t GetColor() const { return kBlack; }
410   /** 
411    * Get the marker style 
412    * 
413    * @return Marker style 
414    */
415   virtual Int_t GetMarker() const { return GetMarkerStyle(kCircle); }
416   /** 
417    * Add a centrality bin 
418    * 
419    * @param at   Where in the list to add this bin 
420    * @param low  Low cut
421    * @param high High cut
422    */
423   void AddCentralityBin(UShort_t at, Short_t low, Short_t high);
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;
435   
436   //==================================================================
437   /**
438    * Class that holds the sum of the data - possibly split into 0 or
439    * non-zero bins 
440    * 
441    */
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 
447     Int_t fDebug;   // Debug level
448     /** 
449      * I/O Constructor - do not use
450      */    
451     Sum() : fSum(0), fSum0(0), fEvents(0), fDebug(0) {}
452     /** 
453      * Constructor 
454      * 
455      * @param name      Name
456      * @param postfix   Possible post-fix 
457      */
458     Sum(const char* name, const char* postfix) 
459       : TNamed(name,postfix), 
460         fSum(0), 
461         fSum0(0), 
462         fEvents(0), 
463         fDebug(0) 
464     {}
465     /** 
466      * Copy constructor
467      * 
468      * @param o Object to copy from 
469      */
470     Sum(const Sum& o) 
471       : TNamed(o), 
472         fSum(o.fSum), 
473         fSum0(o.fSum0), 
474         fEvents(o.fEvents), 
475         fDebug(o.fDebug) 
476     {}
477     /** 
478      * Assignment operator 
479      * 
480      * @param o Object to assign from 
481      * 
482      * @return Reference to this object 
483      */
484     Sum& operator=(const Sum& o) {
485       SetName(o.GetName()); fSum = o.fSum; fSum0 = o.fSum0; fEvents=o.fEvents;
486       return *this;
487     }
488     /** 
489      * Destructor 
490      */
491     ~Sum() {}
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      */
499     void Init(TList* list, const TH2D* data, Int_t col);
500     /** 
501      * Add an event 
502      * 
503      * @param data    Data to add
504      * @param isZero  If this is zero event
505      */
506     void Add(const TH2D* data, Bool_t isZero=false);
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);
518     /** 
519      * Get the histogram name 
520      * 
521      * @param what Which one 
522      * 
523      * @return Name 
524      */
525     TString GetHistName(Int_t what=0) const;
526     /** 
527      * Get the sum 
528      * 
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      */
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;
542   };
543     
544   //==================================================================
545   /**
546    * Calculations done per centrality 
547    * 
548    */
549   class CentralityBin : public TNamed
550   {
551   public:
552     /** dN
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
598      * @param mask  Trigger mask
599      */
600     virtual void CreateOutputObjects(TList* dir, Int_t mask);
601     /** 
602      * Process an event
603      * 
604      * @param forward     Forward data (for trigger, vertex, & centrality)
605      * @param triggerMask Trigger mask 
606      * @param isZero      True if this is a zero bin event 
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, 
613                               Int_t                    triggerMask,
614                               Bool_t                   isZero,
615                               Double_t                 vzMin, 
616                               Double_t                 vzMax, 
617                               const TH2D*              data, 
618                               const TH2D*              mc);
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.
673      * @param text    If non-null, fill with normalization calculation
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,
680                                    Double_t&   ntotal,
681                                    TString*    text) const;
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 
694      * @param marker     Marker style 
695      * @param color       Color of markers 
696      * @param mclist      List of MC data 
697      * @param truthlist   List of MC truth data 
698      */
699     virtual void MakeResult(const TH2D* sum,  
700                             const char* postfix, 
701                             bool        rootProj, 
702                             bool        corrEmpty,
703                             const TH2F* shapeCorr,
704                             Double_t    scaler,
705                             bool        symmetrice, 
706                             Int_t       rebin, 
707                             bool        cutEdges, 
708                             Int_t       marker,
709                             Int_t       color, 
710                             TList*      mclist,
711                             TList*      truthlist);
712     /** 
713      * End of processing 
714      * 
715      * @param sums        List of sums
716      * @param results     Output list of results
717      * @param scheme      Normalisation scheme options
718      * @param shapeCorr   Shape correction or nil
719      * @param trigEff     Trigger efficiency 
720      * @param trigEff0    0-bin trigger efficiency 
721      * @param symmetrice  Whether to symmetrice the results
722      * @param rebin       Whether to rebin the results
723      * @param rootProj    If true, use TH2::ProjectionX
724      * @param corrEmpty   Whether to correct for empty bins
725      * @param cutEdges    Whether to cut edges when rebinning
726      * @param triggerMask Trigger mask 
727      * @param marker      Marker style 
728      * @param color       Color of markers 
729      * @param mclist      List of MC data 
730      * @param truthlist   List of MC truth data 
731      */
732     virtual void End(TList*      sums, 
733                      TList*      results,
734                      UShort_t    scheme,
735                      const TH2F* shapeCorr, 
736                      Double_t    trigEff,
737                      Double_t    trigEff0,
738                      Bool_t      symmetrice,
739                      Int_t       rebin, 
740                      Bool_t      rootProj,
741                      Bool_t      corrEmpty, 
742                      Bool_t      cutEdges, 
743                      Int_t       triggerMask,
744                      Int_t       marker,
745                      Int_t       color,
746                      TList*      mclist,
747                      TList*      truthlist);
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      */
759     const Sum* GetSum(Bool_t mc=false) const { return mc ? fSumMC : fSum; }
760     /** 
761      * Get sum histogram 
762      * 
763      * @param mc If true, return MC histogram 
764      * 
765      * @return Sum histogram
766      */
767     Sum* GetSum(Bool_t mc=false) { return mc ? fSumMC : fSum; }
768     /** 
769      * Get trigger histogram
770      * 
771      * @return Trigger histogram
772      */
773     const TH1I* GetTriggers() const { return fTriggers; } 
774     /** 
775      * Get trigger histogram
776      * 
777      * @return Trigger histogram 
778      */
779     TH1I* GetTrigggers() { return fTriggers; }
780     /** @} */
781
782     /** 
783      * Get the color of the markers
784      *
785      * @param fallback Fall-back color 
786      *
787      * @return Color for this centrality bin 
788      */
789     Int_t GetColor(Int_t fallback=kRed+2) const;
790     /** 
791      * Get list of results 
792      * 
793      * 
794      * @return List of results
795      */
796     TList* GetResults() const { return fOutput; }
797     /** 
798      * Get name of result histogram 
799      * 
800      * @param rebin 
801      * @param sym 
802      * @param postfix 
803      * 
804      * @return 
805      */
806     const char* GetResultName(Int_t rebin, Bool_t sym, 
807                               const char* postfix="") const;
808     /** 
809      * Get a result 
810      * 
811      * @param rebin 
812      * @param sym 
813      * @param postfix 
814      * 
815      * @return 
816      */
817     TH1* GetResult(Int_t rebin, Bool_t sym, 
818                    const char* postfix="") const;
819     /** 
820      * Set the debug level
821      * 
822      * @param lvl Debug level
823      */
824     void SetDebugLevel(Int_t lvl);
825   protected:
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      */
834     virtual Bool_t ReadSum(TList* list, bool mc=false);
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      * 
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$
849      * 
850      * @return true if the event is to be used 
851      */
852     virtual Bool_t CheckEvent(const AliAODForwardMult* forward, 
853                               Int_t                    triggerMask,
854                               Double_t                 vzMin, 
855                               Double_t vzMax);
856     TList*   fSums;      // Output list 
857     TList*   fOutput;    // Output list 
858     Sum*     fSum;       // Sum histogram
859     Sum*     fSumMC;     // MC sum histogram
860     TH1I*    fTriggers;  // Trigger histogram 
861     UShort_t fLow;       // Lower limit (inclusive)
862     UShort_t fHigh;      // Upper limit (exclusive)
863     Bool_t   fDoFinalMCCorrection; //Do final MC correction
864     Int_t    fDebug;    // Debug level 
865
866     ClassDef(CentralityBin,3); // A centrality bin 
867   };
868   TList*          fSums;         // Container of sums 
869   TList*          fOutput;       // Container of outputs 
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 
877   Bool_t          fUseROOTProj;  // Whether to use ROOT's ProjectionX
878   Double_t        fTriggerEff;   // Trigger efficiency for selected trigger(s)
879   Double_t        fTriggerEff0;  // Bin-0 Trigger efficiency for sel trigger(s)
880   TH2F*           fShapeCorr;    // Shape correction 
881   TObjArray*      fListOfCentralities; // Centrality bins 
882   TObject*        fSNNString;    // sqrt(s_NN) string 
883   TObject*        fSysString;    // Collision system string 
884   TH1D*           fCent;         // Centrality distribution 
885   TAxis*          fCentAxis;     // Centrality axis
886   UShort_t        fNormalizationScheme; // Normalization scheme
887   TObject*        fSchemeString;    // Normalization scheme string
888   TObject*        fTriggerString;    // Trigger string 
889   TString         fFinalMCCorrFile; //Filename for final MC corr
890   
891   ClassDef(AliBasedNdetaTask,10); // Determine charged particle density
892 };
893
894 #endif
895 //
896 // Local Variables:
897 //  mode: C++
898 // End:
899 //