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