]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/AliMCTruthdNdetaTask.h
Multiple fixes:
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AliMCTruthdNdetaTask.h
1 //
2 // Task to analyse the AOD for for dN/deta in the forward regions 
3 //
4 #ifndef ALIMCTRUTHDNDETATASK_H
5 #define ALIMCTRUTHDNDETATASK_H
6 /**
7  * @file   AliMCTruthdNdetaTask.h
8  * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
9  * @date   Wed Mar 23 14:04:54 2011
10  * 
11  * @brief  
12  * 
13  * 
14  * @ingroup pwglf_forward_dndeta
15  */
16 #include "AliBasedNdetaTask.h"
17 class TList;
18 class TH2D;
19 class TH1D;
20
21 /**
22  * Tasks to determine @f$ dN/d\eta@f$ in the forward regions
23  *
24  * @ingroup pwglf_forward_tasks_dndeta
25  * @ingroup pwglf_forward_dndeta
26  */
27 class AliMCTruthdNdetaTask : public AliBasedNdetaTask
28 {
29 public:
30   /** 
31    * Constructor 
32    * 
33    */
34   AliMCTruthdNdetaTask();
35   /** 
36    * Constructor
37    * 
38    * @param name    Name of task 
39    */
40   AliMCTruthdNdetaTask(const char* name);
41   /**
42    * Destructor
43    * 
44    */
45   virtual ~AliMCTruthdNdetaTask() {}
46   /** 
47    * Called at end of event processing.
48    *
49    * This is called once in the master 
50    * 
51    * @param option Not used 
52    */
53   virtual void Terminate(Option_t* option);
54 protected:
55   /** 
56    * Copy constructor 
57    *
58    * @param o Object to copy from 
59    */
60   AliMCTruthdNdetaTask(const AliMCTruthdNdetaTask& o);
61   /** 
62    * Assigmement operator
63    * 
64    * @return Reference to this
65    */
66   AliMCTruthdNdetaTask& operator=(const AliMCTruthdNdetaTask&) { return *this; }
67
68   /** 
69    * Retrieve the histogram 
70    * 
71    * @param aod AOD event 
72    * @param mc  Whether to get the MC histogram or not
73    * 
74    * @return Retrieved histogram or null
75    */
76   TH2D* GetHistogram(const AliAODEvent* aod, Bool_t mc);
77   /** 
78    * Get the marker style 
79    * 
80    * @return Marker style 
81    */
82   virtual Int_t GetMarker() const { return GetMarkerStyle(kStar); }
83   /** 
84    * Get the colour to use for markers (only pp - in PbPb we use a rainbow)
85    * 
86    * @return Marker colour 
87    */
88   virtual Int_t GetColor() const { return kGray+2; }
89   /** 
90    * Make a new centrality bin
91    * 
92    * @param name   Histogram names
93    * @param l      Lower cut
94    * @param h      Upper cut
95    * 
96    * @return Newly allocated object (of our type)
97    */
98   AliBasedNdetaTask::CentralityBin* 
99   MakeCentralityBin(const char* name, Short_t l, Short_t h) const;
100
101   /**
102    * Class that holds data for a single centrality bin 
103    * 
104    */
105   class CentralityBin : public AliBasedNdetaTask::CentralityBin 
106   {
107   public:
108     /** 
109      * Constructor 
110      */
111     CentralityBin() : AliBasedNdetaTask::CentralityBin(), fSumTruth(0) {}
112     /** 
113      * Constructor 
114      * 
115      * @param name Name used for histograms (e.g., Forward)
116      * @param low  Lower centrality cut in percent 
117      * @param high Upper centrality cut in percent 
118      */
119     CentralityBin(const char* name, Short_t low, Short_t high)
120       : AliBasedNdetaTask::CentralityBin(name, low, high), 
121         fSumTruth(0)
122     {}
123     /** 
124      * Copy constructor 
125      * 
126      * @param other Object to copy from 
127      */
128     CentralityBin(const CentralityBin& other) 
129       : AliBasedNdetaTask::CentralityBin(other), 
130         fSumTruth(other.fSumTruth) 
131     {}
132     /** 
133      * Destructor 
134      */
135     virtual ~CentralityBin() {}
136     /** 
137      * Assignement operator 
138      * 
139      * 
140      * @return 
141      */
142     CentralityBin& operator=(const CentralityBin&) { return *this; }
143     /** 
144      * Process an event
145      * 
146      * @param forward     Forward data (for trigger, vertex, & centrality)
147      * @param triggerMask Trigger mask 
148      * @param isZero      True if this is a zero bin event 
149      * @param vzMin       Minimum IP z coordinate
150      * @param vzMax       Maximum IP z coordinate
151      * @param data        Data histogram 
152      * @param mc          MC histogram
153      */
154     virtual void ProcessEvent(const AliAODForwardMult* forward, 
155                               Int_t                    triggerMask,
156                               Bool_t                   isZero,
157                               Double_t                 vzMin, 
158                               Double_t                 vzMax, 
159                               const TH2D*              data, 
160                               const TH2D*              mc);
161     /** 
162      * End of processing 
163      * 
164      * @param sums        List of sums
165      * @param results     Output list of results
166      * @param scheme      Normalisation scheme options
167      * @param shapeCorr   Shape correction or nil
168      * @param trigEff     Trigger efficiency 
169      * @param symmetrice  Whether to symmetrice the results
170      * @param rebin       Whether to rebin the results
171      * @param rootProj    If true, use TH2::ProjectionX
172      * @param corrEmpty   Whether to correct for empty bins
173      * @param cutEdges    Whether to cut edges when rebinning
174      * @param triggerMask Trigger mask 
175      * @param color       Marker colour 
176      * @param marker      Marker style 
177      * @param mclist      List of MC results 
178      * @param truthlist   List of MC truth results 
179      */
180     virtual void End(TList*      sums, 
181                      TList*      results,
182                      UShort_t    scheme,
183                      const TH2F* shapeCorr, 
184                      Double_t    trigEff,
185                      Bool_t      symmetrice,
186                      Int_t       rebin, 
187                      Bool_t      rootProj,
188                      Bool_t      corrEmpty, 
189                      Bool_t      cutEdges, 
190                      Int_t       triggerMask,
191                      Int_t       marker,
192                      Int_t       color,
193                      TList*      mclist,
194                      TList*      truthlist);
195   protected: 
196     TH2D*           fSumTruth;    //  Sum of primary histograms
197     ClassDef(CentralityBin,1); // A centrality bin     
198   };
199
200   ClassDef(AliMCTruthdNdetaTask,1); // Determine multiplicity in forward region
201 };
202
203 #endif
204 //
205 // Local Variables:
206 //  mode: C++
207 // End:
208 //