]>
Commit | Line | Data |
---|---|---|
7984e5f7 | 1 | // |
2 | // Base class for classes that calculate the multiplicity in the | |
3 | // forward regions event-by-event | |
4 | // | |
1a26066e | 5 | #ifndef ALIFORWARDMULTIPLICITYBASE_H |
6 | #define ALIFORWARDMULTIPLICITYBASE_H | |
ffca499d | 7 | /** |
8 | * @file AliForwardMultiplicityBase.h | |
9 | * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk> | |
10 | * @date Wed Mar 23 14:06:29 2011 | |
11 | * | |
12 | * @brief | |
13 | * | |
14 | * | |
bd6f5206 | 15 | * @ingroup pwglf_forward_aod |
ffca499d | 16 | */ |
1a26066e | 17 | #include <AliAnalysisTaskSE.h> |
8449e3e0 | 18 | #include "AliForwardUtil.h" |
19 | #include "AliAODForwardMult.h" | |
20 | #include "AliAODForwardEP.h" | |
1a26066e | 21 | class AliFMDEventInspector; |
22 | class AliFMDEnergyFitter; | |
23 | class AliFMDSharingFilter; | |
24 | class AliFMDDensityCalculator; | |
72cc12cd | 25 | class AliFMDCorrector; |
1a26066e | 26 | class AliFMDHistCollector; |
8449e3e0 | 27 | class AliAODHandler; |
19abe41d | 28 | class AliForwardCorrectionManager; |
2b556440 | 29 | class AliFMDEventPlaneFinder; |
1a26066e | 30 | class AliESDEvent; |
31 | class TH2D; | |
32 | class TList; | |
33 | class TTree; | |
fb3430ac | 34 | class TAxis; |
1a26066e | 35 | |
1a26066e | 36 | /** |
bd6f5206 | 37 | * @defgroup pwglf_forward PWGLF Forward analysis |
1a26066e | 38 | * |
39 | * Code to do the multiplicity analysis in the forward psuedo-rapidity | |
40 | * regions | |
41 | * | |
42 | */ | |
43 | /** | |
bd6f5206 | 44 | * @defgroup pwglf_forward_tasks Tasks |
1a26066e | 45 | * |
46 | * Code to do the multiplicity analysis in the forward psuedo-rapidity | |
47 | * regions | |
48 | * | |
bd6f5206 | 49 | * @ingroup pwglf_forward |
1a26066e | 50 | */ |
ffca499d | 51 | /** |
bd6f5206 | 52 | * @defgroup pwglf_forward_topical Topical |
290052e7 | 53 | * |
54 | * The code divided according to topic | |
ffca499d | 55 | */ |
56 | /** | |
bd6f5206 | 57 | * @defgroup pwglf_forward_aod AOD |
290052e7 | 58 | * |
59 | * Code to do with AOD production | |
60 | * | |
bd6f5206 | 61 | * @ingroup pwglf_forward_topical |
ffca499d | 62 | */ |
1a26066e | 63 | /** |
7984e5f7 | 64 | * Base class for classes that calculate the multiplicity in the |
65 | * forward regions event-by-event | |
1a26066e | 66 | * |
67 | * @par Inputs: | |
68 | * - AliESDEvent | |
69 | * | |
70 | * @par Outputs: | |
71 | * - AliAODForwardMult | |
72 | * | |
73 | * @par Histograms | |
74 | * | |
75 | * @par Corrections used | |
76 | * | |
bd6f5206 | 77 | * @ingroup pwglf_forward_tasks |
78 | * @ingroup pwglf_forward_aod | |
1a26066e | 79 | * |
80 | */ | |
81 | class AliForwardMultiplicityBase : public AliAnalysisTaskSE | |
82 | { | |
83 | public: | |
84 | /** | |
85 | * @{ | |
86 | * @name Interface methods | |
87 | */ | |
88 | /** | |
89 | * Initialize the task | |
90 | * | |
91 | */ | |
92 | virtual void Init() { fFirstEvent = true; } | |
93 | /** | |
94 | * Create output objects | |
95 | * | |
96 | */ | |
8449e3e0 | 97 | virtual void UserCreateOutputObjects(); |
1a26066e | 98 | /** |
99 | * Process each event | |
100 | * | |
101 | * @param option Not used | |
102 | */ | |
103 | virtual void UserExec(Option_t* option) = 0; | |
104 | /** | |
105 | * End of job | |
106 | * | |
107 | * @param option Not used | |
108 | */ | |
8449e3e0 | 109 | virtual void Terminate(Option_t* option); |
1a26066e | 110 | /** |
111 | * @} | |
112 | */ | |
2a276c75 | 113 | /** |
114 | * Configure this task via a macro | |
115 | * | |
116 | * @param macro Macro to configure va | |
117 | * | |
118 | * @return true on success, false otherwise | |
119 | */ | |
120 | virtual Bool_t Configure(const char* macro="ForwardAODConfig.C"); | |
1a26066e | 121 | /** |
122 | * Print information | |
123 | * | |
124 | * @param option Not used | |
125 | */ | |
126 | virtual void Print(Option_t* option="") const; | |
127 | /** | |
128 | * Whether to enable low-flux code | |
129 | * | |
130 | * @param use IF true, enable low-flux code | |
131 | */ | |
132 | virtual void SetEnableLowFlux(Bool_t use=true) { fEnableLowFlux = use; } | |
133 | /** | |
134 | * @{ | |
135 | * @name Access to sub-algorithms | |
136 | */ | |
137 | /** | |
138 | * Get reference to the EventInspector algorithm | |
139 | * | |
140 | * @return Reference to AliFMDEventInspector object | |
141 | */ | |
142 | virtual AliFMDEventInspector& GetEventInspector() = 0; | |
1a26066e | 143 | /** |
144 | * Get reference to the SharingFilter algorithm | |
145 | * | |
146 | * @return Reference to AliFMDSharingFilter object | |
147 | */ | |
148 | virtual AliFMDSharingFilter& GetSharingFilter() = 0; | |
149 | /** | |
150 | * Get reference to the DensityCalculator algorithm | |
151 | * | |
152 | * @return Reference to AliFMDDensityCalculator object | |
153 | */ | |
154 | virtual AliFMDDensityCalculator& GetDensityCalculator() = 0; | |
155 | /** | |
156 | * Get reference to the Corrections algorithm | |
157 | * | |
72cc12cd | 158 | * @return Reference to AliFMDCorrector object |
1a26066e | 159 | */ |
72cc12cd | 160 | virtual AliFMDCorrector& GetCorrections() = 0; |
1a26066e | 161 | /** |
162 | * Get reference to the HistCollector algorithm | |
163 | * | |
164 | * @return Reference to AliFMDHistCollector object | |
165 | */ | |
166 | virtual AliFMDHistCollector& GetHistCollector() = 0; | |
1174780f | 167 | /** |
168 | * Get reference to the EventInspector algorithm | |
169 | * | |
170 | * @return Reference to AliFMDEventInspector object | |
171 | */ | |
172 | virtual const AliFMDEventInspector& GetEventInspector() const = 0; | |
1174780f | 173 | /** |
174 | * Get reference to the SharingFilter algorithm | |
175 | * | |
176 | * @return Reference to AliFMDSharingFilter object | |
177 | */ | |
178 | virtual const AliFMDSharingFilter& GetSharingFilter() const = 0; | |
179 | /** | |
180 | * Get reference to the DensityCalculator algorithm | |
181 | * | |
182 | * @return Reference to AliFMDDensityCalculator object | |
183 | */ | |
184 | virtual const AliFMDDensityCalculator& GetDensityCalculator() const = 0; | |
185 | /** | |
186 | * Get reference to the Corrections algorithm | |
187 | * | |
72cc12cd | 188 | * @return Reference to AliFMDCorrector object |
1174780f | 189 | */ |
72cc12cd | 190 | virtual const AliFMDCorrector& GetCorrections() const = 0; |
1174780f | 191 | /** |
192 | * Get reference to the HistCollector algorithm | |
193 | * | |
194 | * @return Reference to AliFMDHistCollector object | |
195 | */ | |
196 | virtual const AliFMDHistCollector& GetHistCollector() const = 0; | |
2b556440 | 197 | /** |
198 | * Get reference to the EventPlaneFinder algorithm | |
199 | * | |
200 | * @return Reference to AliFMDEventPlaneFinder object | |
201 | */ | |
202 | virtual AliFMDEventPlaneFinder& GetEventPlaneFinder() = 0; | |
203 | /** | |
204 | * Get reference to the EventPlaneFinder algorithm | |
205 | * | |
206 | * @return Reference to AliFMDEventPlaneFinder object | |
207 | */ | |
208 | virtual const AliFMDEventPlaneFinder& GetEventPlaneFinder() const = 0; | |
290052e7 | 209 | /* @} */ |
2b556440 | 210 | |
1a26066e | 211 | /** |
290052e7 | 212 | * Set the debug level |
213 | * | |
214 | * @param dbg | |
1a26066e | 215 | */ |
8449e3e0 | 216 | virtual void SetDebug(Int_t dbg); |
2a276c75 | 217 | /** |
218 | * Overload super class method for setting debug level to call our | |
219 | * SetDebug member function. | |
220 | * | |
221 | * @param dbg Debug level (0: no output, 1: essentials, 3: a whole lot) | |
222 | */ | |
223 | virtual void SetDebugLevel(Int_t dbg) | |
224 | { | |
225 | AliAnalysisTaskSE::SetDebugLevel(dbg); | |
226 | SetDebug(dbg); | |
227 | } | |
8449e3e0 | 228 | /** |
229 | * Set whether to make separate branches for each ring. If enabled | |
230 | * there will be 5 additional branches on the AOD tree - each | |
231 | * holding a TH2D object of the charged particle multiplicity in | |
232 | * @f$(\eta,\varphi)@f$ bins for that event. | |
233 | * | |
234 | * @param use If true, make separate branches for each ring. | |
235 | */ | |
236 | void SetStorePerRing(Bool_t use) { fStorePerRing = use; } | |
1a26066e | 237 | protected: |
238 | /** | |
239 | * Constructor | |
240 | * | |
241 | * @param name Name of task | |
242 | */ | |
19abe41d | 243 | AliForwardMultiplicityBase(const char* name); |
1a26066e | 244 | /** |
245 | * Constructor | |
246 | */ | |
19abe41d | 247 | AliForwardMultiplicityBase() |
248 | : AliAnalysisTaskSE(), | |
249 | fEnableLowFlux(true), | |
250 | fFirstEvent(true), | |
8449e3e0 | 251 | fStorePerRing(false), |
252 | fList(0), | |
253 | fHData(0), | |
254 | fHistos(), | |
255 | fAODFMD(), | |
256 | fAODEP(), | |
257 | fRingSums(), | |
19abe41d | 258 | fCorrManager(0) |
1a26066e | 259 | {} |
260 | /** | |
261 | * Copy constructor | |
262 | * | |
263 | * @param o Object to copy from | |
264 | */ | |
265 | AliForwardMultiplicityBase(const AliForwardMultiplicityBase& o) | |
266 | : AliAnalysisTaskSE(o), | |
267 | fEnableLowFlux(o.fEnableLowFlux), | |
19abe41d | 268 | fFirstEvent(o.fFirstEvent), |
8449e3e0 | 269 | fStorePerRing(o.fStorePerRing), |
270 | fList(o.fList), | |
271 | fHData(o.fHData), | |
272 | fHistos(o.fHistos), | |
273 | fAODFMD(o.fAODFMD), | |
274 | fAODEP(o.fAODEP), | |
275 | fRingSums(o.fRingSums), | |
19abe41d | 276 | fCorrManager(o.fCorrManager) |
8449e3e0 | 277 | { |
278 | DefineOutput(1, TList::Class()); | |
279 | DefineOutput(2, TList::Class()); | |
280 | } | |
1a26066e | 281 | /** |
282 | * Assignment operator | |
283 | * | |
284 | * @param o Object to assign from | |
285 | * | |
286 | * @return Reference to this object | |
287 | */ | |
fb3430ac | 288 | AliForwardMultiplicityBase& operator=(const AliForwardMultiplicityBase& o); |
1174780f | 289 | /** |
290 | * Check if all needed corrections are there and accounted for. If not, | |
291 | * do a Fatal exit | |
292 | * | |
293 | * @param what Which corrections is needed | |
294 | * | |
295 | * @return true if all present, false otherwise | |
296 | */ | |
297 | Bool_t CheckCorrections(UInt_t what) const; | |
290052e7 | 298 | /** |
7ec4d843 | 299 | * Read corrections |
290052e7 | 300 | * |
301 | * | |
302 | * @param pe On return, the eta axis | |
303 | * @param pv On return ,the vertex axis | |
304 | * @param mc True assume MC input | |
305 | * | |
306 | * @return true ons succcss | |
7ec4d843 | 307 | */ |
19abe41d | 308 | virtual Bool_t ReadCorrections(const TAxis*& pe, |
309 | const TAxis*& pv, | |
8449e3e0 | 310 | Bool_t mc=false, |
311 | Bool_t sat=false); | |
7ec4d843 | 312 | /** |
313 | * Get the ESD event. IF this is the first event, initialise | |
290052e7 | 314 | * |
315 | * @return Pointer to ESD event structore | |
7ec4d843 | 316 | */ |
317 | virtual AliESDEvent* GetESDEvent(); | |
1a26066e | 318 | /** |
7ec4d843 | 319 | * Initialise the sub objects and stuff. Called on first event |
320 | * | |
6ff251d8 | 321 | * @return false on errors |
7ec4d843 | 322 | */ |
8449e3e0 | 323 | virtual Bool_t SetupForData(); |
324 | /** | |
325 | * Initialize members based on eta and vertex axis - only available | |
326 | * after first event - called from SetupForData. | |
327 | * | |
328 | * @param pe @f$\eta@f$ axis | |
329 | * @param pv Interaction point Z-coordinate axis | |
330 | */ | |
331 | virtual void InitMembers(const TAxis* pe, const TAxis* pv); | |
332 | /** | |
333 | * Create output branches - called from UserCreateOutputObjects | |
334 | */ | |
335 | virtual void CreateBranches(AliAODHandler* ah); | |
7ec4d843 | 336 | /** |
1a26066e | 337 | * Mark this event as one to store in the AOD |
338 | * | |
339 | */ | |
340 | virtual void MarkEventForStore() const; | |
8449e3e0 | 341 | /** |
342 | * Do estimates of @f$dN/d\eta@f$ - called at Terminate | |
343 | * | |
344 | * @param input Input list | |
345 | * @param output Output list | |
346 | */ | |
347 | virtual void EstimatedNdeta(const TList* input, TList* output) const; | |
5ca83fee | 348 | /** |
349 | * Calculate a simple dN/deta from all accepted events | |
350 | * | |
351 | * @param input Input list | |
352 | * @param output Output list | |
353 | * @param nTr On return, number of triggers | |
354 | * @param nTrVtx On return, number of trigger+vertex events | |
355 | * @param nAcc On return, number of accepted events | |
356 | * | |
357 | * @return true on success | |
358 | */ | |
359 | virtual Bool_t MakeSimpledNdeta(const TList* input, | |
360 | TList* output, | |
361 | Double_t& nTr, | |
362 | Double_t& nTrVtx, | |
363 | Double_t& nAcc); | |
5bb5d1f6 | 364 | /** |
365 | * Make Ring @f$ dN/d\eta @f$ histogram and a stack | |
366 | * | |
367 | * @param input List with summed signals | |
368 | * @param output Output list | |
c6115ede | 369 | * @param inName Input name |
370 | * @param outName Output name | |
371 | * @param style Style | |
5bb5d1f6 | 372 | */ |
373 | virtual void MakeRingdNdeta(const TList* input, | |
374 | const char* inName, | |
375 | TList* output, | |
376 | const char* outName, | |
377 | Int_t style=20) const; | |
8449e3e0 | 378 | Bool_t fEnableLowFlux;// Whether to use low-flux specific code |
379 | Bool_t fFirstEvent; // Whether the event is the first seen | |
380 | Bool_t fStorePerRing; // Store each ring on separate branch | |
381 | TList* fList; // Output list | |
382 | TH2D* fHData; // Summed 1/Nd^2N_{ch}/dphideta | |
383 | AliForwardUtil::Histos fHistos; // Cache histograms | |
384 | AliAODForwardMult fAODFMD; // Output object | |
385 | AliAODForwardEP fAODEP; // Output object | |
386 | AliForwardUtil::Histos fRingSums; // Cache histograms | |
19abe41d | 387 | private: |
388 | /** | |
389 | * A pointer to the corrections manager. This is here to make the | |
390 | * corrections manager persistent - that is, when we write the | |
391 | * analysis train to a file (as done in PROOF) we should also write | |
392 | * down the corrections mananger. This pointer ensures that. | |
393 | * | |
394 | */ | |
395 | AliForwardCorrectionManager* fCorrManager; // Pointer to corrections manager | |
1a26066e | 396 | |
5934a3e3 | 397 | ClassDef(AliForwardMultiplicityBase,3) // Forward multiplicity class |
1a26066e | 398 | }; |
399 | ||
400 | #endif | |
290052e7 | 401 | |
1a26066e | 402 | // Local Variables: |
403 | // mode: C++ | |
404 | // End: | |
405 |