]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FORWARD/analysis2/AliCentralMultiplicityTask.h
The revisited SPD cluster analysis in the new AOD framework and the corrections for...
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / AliCentralMultiplicityTask.h
CommitLineData
6f791cc3 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;
13class AliESDEvent;
14class TH2D;
15class TList;
16class 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 */
54class AliCentralMultiplicityTask : public AliAnalysisTaskSE
55{
56public:
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 DefineOutput(1, TList::Class());
78 }
79 /**
80 * Copy constructor
81 *
82 * @param o Object to copy from
83 */
84 AliCentralMultiplicityTask(const AliCentralMultiplicityTask& o)
85 : AliAnalysisTaskSE(o),
86 fData(o.fData),
87 fList(o.fList),
88 fAODCentral(o.fAODCentral),
89 fManager(o.fManager)
90 {
91 DefineOutput(1, TList::Class());
92 }
93 /**
94 * Assignment operator
95 *
96 * @param o Object to assign from
97 *
98 * @return Reference to this object
99 */
100 AliCentralMultiplicityTask& operator=(const AliCentralMultiplicityTask& o)
101 {
102 fData = o.fData;
103 fList = o.fList;
104 fAODCentral = o.fAODCentral;
105 fManager = o.fManager;
106
107
108 DefineOutput(1, TList::Class());
109
110 return *this;
111 }
112 /**
113 * Create output objects
114 *
115 */
116 virtual void UserCreateOutputObjects();
117 /**
118 * Process each event
119 *
120 * @param option Not used
121 */
122 virtual void UserExec(Option_t* option);
123 /**
124 * End of job
125 *
126 * @param option Not used
127 */
128 virtual void Terminate(Option_t* option);
129 /**
130 * @}
131 */
132 /**
133 * Init the task and the manager
134 *
135 * @param option Not used
136 */
137 void InitManager(UShort_t sys,
138 UShort_t sNN,
139 Short_t field) {fManager.Init(sys, sNN, field);}
140 /**
141 * @}
142 */
143 /**
144 * Print information
145 *
146 * @param option Not used
147 */
148 virtual void Print(Option_t* option="") const;
149 /**
150 * Set Path for acceptance
151 *
152 * @param path
153 */
154 void SetAcceptancePath(const char* path) {fManager.SetAcceptancePath(path); }
155 /**
156 * Set Path for Secondary Map
157 *
158 * @param path
159 */
160
161 void SetSecMapPath(const char* path) {fManager.SetSecMapPath(path); }
162
163 char* GetFullFileName(UShort_t what ,
164 UShort_t sys,
165 UShort_t sNN,
166 Short_t field) {return fManager.GetFullFileName(what ,sys, sNN, field); }
167
168 const char* GetAcceptanceName() {return fManager.GetAcceptanceName(); }
169 const char* GetSecMapName() {return fManager.GetSecMapName(); }
170
171
172 class Manager {
173
174 // This is a small class to fetch corrections for secondaries and dead
175 // channels.
176
177 public:
178 Manager();
179 Manager(const Manager& o) :
180 fAcceptancePath(o.fAcceptancePath),
181 fSecMapPath(o.fSecMapPath),
182 fAcceptance(o.fAcceptance),
183 fSecmap(o.fSecmap),
184 fAcceptanceName(o.fAcceptanceName),
185 fSecMapName(o.fSecMapName) {}
186
187 /**
188 * Assignment operator
189 *
190 * @param o Object to assign from
191 *
192 * @return Reference to this object
193 */
194 Manager& operator=(const Manager& o)
195 {
196 fAcceptancePath = o.fAcceptancePath;
197 fSecMapPath = o.fSecMapPath;
198 fAcceptance = o.fAcceptance;
199 fSecmap = o.fSecmap;
200 fAcceptanceName = o.fAcceptanceName;
201 fSecMapName = o.fSecMapName;
202 return *this;
203 }
204
205 void Init(UShort_t sys,
206 UShort_t sNN,
207 Short_t field);
208 const char* GetAcceptancePath() {return fAcceptancePath.Data(); }
209 const char* GetSecMapPath() {return fSecMapPath.Data(); }
210 void SetAcceptancePath(const char* path) {fAcceptancePath=path; }
211 void SetSecMapPath(const char* path) {fSecMapPath=path; }
212 char* GetFullFileName(UShort_t what ,
213 UShort_t sys,
214 UShort_t sNN,
215 Short_t field) {return Form("%s/%s",
216what == 0 ? GetSecMapPath() : GetAcceptancePath(), GetFileName(what, sys, sNN, field));}
217 const char* GetAcceptanceName() {return fAcceptanceName.Data(); }
218 const char* GetSecMapName() {return fSecMapName.Data(); }
219
220 TH2D* GetSecMapCorrection(UShort_t vtxbin) {return fSecmap->GetCorrection(vtxbin);}
221 TH1D* GetAcceptanceCorrection(UShort_t vtxbin) {return fAcceptance->GetCorrection(vtxbin);}
222
223 private:
224
225
226 const char* GetFileName(UShort_t what ,
227 UShort_t sys,
228 UShort_t sNN,
229 Short_t field);
230
231
232 TString fAcceptancePath;
233 TString fSecMapPath;
234 AliCentralCorrAcceptance* fAcceptance;
235 AliCentralCorrSecondaryMap* fSecmap;
236 TString fAcceptanceName;
237 TString fSecMapName;
238
239 };
240
241protected:
242
243
244private:
245
246 TH2D* fData; //sum histogram if needed
247 TList* fList; //Output List for diagnostics
248 AliAODCentralMult fAODCentral; // Output object
249 Manager fManager; //Manager object for corrections
250 ClassDef(AliCentralMultiplicityTask,1) // Forward multiplicity class
251};
252
253#endif
254// Local Variables:
255// mode: C++
256// End:
257