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