]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FORWARD/analysis2/AliCentralMultiplicityTask.h
637b8589bd9243c665cb0ce70bc9368f1051bdb9
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / AliCentralMultiplicityTask.h
1 // 
2 // Base class for classes that calculate the multiplicity in the
3 // SPD clusters event-by-event
4 // 
5 #ifndef ALICENTRALMULTIPLICITYTASK_H
6 #define ALICENTRALMULTIPLICITYTASK_H
7 #include <AliAnalysisTaskSE.h>
8 #include "AliForwardUtil.h"
9 #include "AliAODCentralMult.h"
10 #include "AliCentralCorrAcceptance.h"
11 #include "AliCentralCorrSecondaryMap.h"
12 //class AliForwardCorrectionManager;
13 class AliESDEvent;
14 class TH2D;
15 class TList;
16 class TTree;
17
18
19 /** 
20  * @mainpage ALICE PWG2 Forward Multiplcity Analysis 
21  */
22 /** 
23  * @defgroup pwg2_forward PWG2 Forward analysis
24  *
25  * Code to do the multiplicity analysis in the central pseudo-rapidity
26  * regions
27  *
28  */
29 /** 
30  * @defgroup pwg2_forward_tasks Tasks
31  *
32  * Code to do the multiplicity analysis in the central pseudo-rapidity
33  * regions
34  *
35  * @ingroup pwg2_forward 
36  */
37 /** 
38  * Class that calculates the multiplicity in the
39  * central region event-by-event
40  * 
41  * @par Inputs: 
42  *   - AliESDEvent 
43  *
44  * @par Outputs: 
45  *   - AliAODCentralMult 
46  * 
47  * @par Histograms 
48  *   
49  * @par Corrections used 
50  * 
51  * @ingroup pwg2_forward_tasks
52  * 
53  */
54 class AliCentralMultiplicityTask : public AliAnalysisTaskSE
55 {
56 public:
57   /** 
58    * @{ 
59    * @name Interface methods 
60    */
61    /** 
62    * Constructor 
63    * 
64    * @param name Name of task 
65    */
66   AliCentralMultiplicityTask(const char* name); 
67   /** 
68    * Constructor
69    */
70   AliCentralMultiplicityTask() 
71     : AliAnalysisTaskSE(),
72       fData(0),
73       fList(0),
74       fAODCentral(),
75       fManager()
76   {
77   }
78   /** 
79    * Copy constructor 
80    * 
81    * @param o Object to copy from 
82    */
83   AliCentralMultiplicityTask(const AliCentralMultiplicityTask& o)
84     : AliAnalysisTaskSE(o),
85       fData(o.fData),
86       fList(o.fList),
87       fAODCentral(o.fAODCentral),
88       fManager(o.fManager)
89   {
90     DefineOutput(1, TList::Class());
91   }
92   /** 
93    * Assignment operator 
94    * 
95    * @param o Object to assign from 
96    * 
97    * @return Reference to this object 
98    */
99   AliCentralMultiplicityTask& operator=(const AliCentralMultiplicityTask& o)
100   {
101     fData       = o.fData;
102     fList       = o.fList;
103     fAODCentral = o.fAODCentral;
104     fManager    = o.fManager;
105     
106     
107     DefineOutput(1, TList::Class());
108     
109     return *this;
110   }
111   /** 
112    * Create output objects 
113    * 
114    */
115   virtual void UserCreateOutputObjects();
116   /** 
117    * Process each event 
118    *
119    * @param option Not used
120    */  
121   virtual void UserExec(Option_t* option);
122   /** 
123    * End of job
124    * 
125    * @param option Not used 
126    */
127   virtual void Terminate(Option_t* option);
128   /** 
129    * @} 
130    */
131   /** 
132    * Init the task and the manager  
133    * 
134    * @param option Not used
135    */
136   void InitManager(UShort_t sys, 
137                    UShort_t  sNN,
138                    Short_t   field) {fManager.Init(sys, sNN, field);}
139   /** 
140    * @} 
141    */
142   /** 
143    * Print information 
144    * 
145    * @param option Not used
146    */
147   virtual void Print(Option_t* option="") const;
148
149   //__________________________________________________________________
150   /**
151    * Manager of corrections 
152    *
153    * This is a small class to fetch corrections for secondaries and
154    * dead channels.
155    * 
156    */
157   class Manager 
158   {
159   public:
160     /** 
161      * Constructor
162      * 
163      */
164     Manager();
165     /** 
166      * Copy constructor 
167      * 
168      * @param o 
169      */
170     Manager(const Manager& o);
171     /** 
172      * Destructor
173      */
174     virtual ~Manager() {}
175     /** 
176      * Assignment operator 
177      * 
178      * @param o Object to assign from 
179      * 
180      * @return Reference to this object 
181      */
182     Manager& operator=(const Manager& o);
183     
184     /** 
185      * Initialize 
186      * 
187      * @param sys    Collision system (1: pp, 2: PbPb)
188      * @param sNN    Center of mass energy per nucleon pair [GeV]
189      * @param field  Magnetic field [kG]
190      */
191     void Init(UShort_t sys, UShort_t sNN, Short_t field);
192     /** 
193      * Get the acceptance path
194      * 
195      * @return 
196      */
197     const char* GetAcceptancePath() const {return fAcceptancePath.Data(); }
198     /** 
199      * Get the secondary path 
200      * 
201      * @return 
202      */
203     const char* GetSecMapPath() const {return fSecMapPath.Data(); }
204     /** 
205      * Set the path to the acceptance maps 
206      * 
207      * @param path PAth to object file 
208      */
209     void SetAcceptancePath(const char* path) {fAcceptancePath=path; }
210     /** 
211      * Set the path to the secondary maps 
212      * 
213      * @param path Path to object files 
214      */
215     void  SetSecMapPath(const char* path) {fSecMapPath=path; }
216     /** 
217      * Get full path name to object file 
218      * 
219      * @param what   What to get 
220      * @param sys    Collision system
221      * @param sNN    Center of mass energy 
222      * @param field  Magnetic field 
223      * 
224      * @return 
225      */
226     const char* GetFullFileName(UShort_t what, UShort_t sys, UShort_t sNN, 
227                                 Short_t  field) const;
228     /** 
229      * Get the acceptance object name 
230      * 
231      * @return 
232      */
233     const char* GetAcceptanceName() const {return fAcceptanceName.Data(); }
234     /** 
235      * Get the secondary object name 
236      * 
237      * @return 
238      */
239     const char* GetSecMapName() const {return fSecMapName.Data(); }
240     
241     /** 
242      * Get the secondary map
243      * 
244      * @param vtxbin 
245      * 
246      * @return 
247      */
248     TH2D* GetSecMapCorrection(UShort_t vtxbin) const;
249     /** 
250      * Get the acceptance correction 
251      * 
252      * @param vtxbin 
253      * 
254      * @return 
255      */
256     TH1D* GetAcceptanceCorrection(UShort_t vtxbin) const;
257   private:
258     /** 
259      * Get the full path name 
260      * 
261      * @param what   What to get
262      * @param sys    Collision system
263      * @param sNN    Center of mass energy 
264      * @param field  Magnetic field 
265      * 
266      * @return 
267      */
268     const char* GetFileName(UShort_t what, UShort_t sys, UShort_t sNN,
269                             Short_t field) const;
270     
271     
272     TString                     fAcceptancePath; // Path to acceptance 
273     TString                     fSecMapPath;     // Path to secondary map
274     AliCentralCorrAcceptance*   fAcceptance;     // Acceptance 
275     AliCentralCorrSecondaryMap* fSecmap;         // Secindary map
276     TString                     fAcceptanceName; // Acceptance name
277     TString                     fSecMapName;     // Secindary name
278
279     ClassDef(Manager,1); // Manager of data 
280   };
281
282   /** 
283    * Get a reference to the manager 
284    * 
285    * @return Reference to corrections manager 
286    */
287   Manager& GetManager() { return fManager; }
288   /** 
289    * Get a reference to the manager 
290    * 
291    * @return Reference to corrections manager 
292    */
293   const Manager& GetManager() const { return fManager; }
294
295
296 protected: 
297   
298   TH2D*                  fData;          //sum histogram if needed
299   TList*                 fList;          //Output List for diagnostics
300   AliAODCentralMult      fAODCentral;    // Output object
301   Manager                fManager;       //Manager object for corrections
302   ClassDef(AliCentralMultiplicityTask,1) // Forward multiplicity class
303 };
304
305 #endif
306 // Local Variables:
307 //  mode: C++
308 // End:
309