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