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