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