2 // Base class for classes that calculate the multiplicity in the
3 // forward regions event-by-event
5 #ifndef ALIFORWARDMULTIPLICITYBASE_H
6 #define ALIFORWARDMULTIPLICITYBASE_H
8 * @file AliForwardMultiplicityBase.h
9 * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
10 * @date Wed Mar 23 14:06:29 2011
15 * @ingroup pwglf_forward_aod
17 #include <AliAnalysisTaskSE.h>
18 #include "AliForwardUtil.h"
19 #include "AliAODForwardMult.h"
20 #include "AliAODForwardEP.h"
21 class AliFMDEventInspector;
22 class AliFMDEnergyFitter;
23 class AliFMDSharingFilter;
24 class AliFMDDensityCalculator;
25 class AliFMDCorrector;
26 class AliFMDHistCollector;
28 class AliForwardCorrectionManager;
29 class AliFMDEventPlaneFinder;
37 * @defgroup pwglf_forward PWGLF Forward analysis
39 * Code to do the multiplicity analysis in the forward psuedo-rapidity
44 * @defgroup pwglf_forward_tasks Tasks
46 * Code to do the multiplicity analysis in the forward psuedo-rapidity
49 * @ingroup pwglf_forward
52 * @defgroup pwglf_forward_topical Topical
54 * The code divided according to topic
57 * @defgroup pwglf_forward_aod AOD
59 * Code to do with AOD production
61 * @ingroup pwglf_forward_topical
64 * Base class for classes that calculate the multiplicity in the
65 * forward regions event-by-event
75 * @par Corrections used
77 * @ingroup pwglf_forward_tasks
78 * @ingroup pwglf_forward_aod
81 class AliForwardMultiplicityBase : public AliAnalysisTaskSE
86 * @name Interface methods
92 virtual void Init() { fFirstEvent = true; }
94 * Create output objects
97 virtual void UserCreateOutputObjects();
101 * @param option Not used
103 virtual void UserExec(Option_t* option) = 0;
107 * @param option Not used
109 virtual void Terminate(Option_t* option);
114 * Configure this task via a macro
116 * @param macro Macro to configure va
118 * @return true on success, false otherwise
120 virtual Bool_t Configure(const char* macro="ForwardAODConfig.C");
124 * @param option Not used
126 virtual void Print(Option_t* option="") const;
128 * Whether to enable low-flux code
130 * @param use IF true, enable low-flux code
132 virtual void SetEnableLowFlux(Bool_t use=true) { fEnableLowFlux = use; }
135 * @name Access to sub-algorithms
138 * Get reference to the EventInspector algorithm
140 * @return Reference to AliFMDEventInspector object
142 virtual AliFMDEventInspector& GetEventInspector() = 0;
144 * Get reference to the SharingFilter algorithm
146 * @return Reference to AliFMDSharingFilter object
148 virtual AliFMDSharingFilter& GetSharingFilter() = 0;
150 * Get reference to the DensityCalculator algorithm
152 * @return Reference to AliFMDDensityCalculator object
154 virtual AliFMDDensityCalculator& GetDensityCalculator() = 0;
156 * Get reference to the Corrections algorithm
158 * @return Reference to AliFMDCorrector object
160 virtual AliFMDCorrector& GetCorrections() = 0;
162 * Get reference to the HistCollector algorithm
164 * @return Reference to AliFMDHistCollector object
166 virtual AliFMDHistCollector& GetHistCollector() = 0;
168 * Get reference to the EventInspector algorithm
170 * @return Reference to AliFMDEventInspector object
172 virtual const AliFMDEventInspector& GetEventInspector() const = 0;
174 * Get reference to the SharingFilter algorithm
176 * @return Reference to AliFMDSharingFilter object
178 virtual const AliFMDSharingFilter& GetSharingFilter() const = 0;
180 * Get reference to the DensityCalculator algorithm
182 * @return Reference to AliFMDDensityCalculator object
184 virtual const AliFMDDensityCalculator& GetDensityCalculator() const = 0;
186 * Get reference to the Corrections algorithm
188 * @return Reference to AliFMDCorrector object
190 virtual const AliFMDCorrector& GetCorrections() const = 0;
192 * Get reference to the HistCollector algorithm
194 * @return Reference to AliFMDHistCollector object
196 virtual const AliFMDHistCollector& GetHistCollector() const = 0;
198 * Get reference to the EventPlaneFinder algorithm
200 * @return Reference to AliFMDEventPlaneFinder object
202 virtual AliFMDEventPlaneFinder& GetEventPlaneFinder() = 0;
204 * Get reference to the EventPlaneFinder algorithm
206 * @return Reference to AliFMDEventPlaneFinder object
208 virtual const AliFMDEventPlaneFinder& GetEventPlaneFinder() const = 0;
212 * Set the debug level
216 virtual void SetDebug(Int_t dbg);
218 * Overload super class method for setting debug level to call our
219 * SetDebug member function.
221 * @param dbg Debug level (0: no output, 1: essentials, 3: a whole lot)
223 virtual void SetDebugLevel(Int_t dbg)
225 AliAnalysisTaskSE::SetDebugLevel(dbg);
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.
234 * @param use If true, make separate branches for each ring.
236 void SetStorePerRing(Bool_t use) { fStorePerRing = use; }
241 * @param name Name of task
243 AliForwardMultiplicityBase(const char* name);
247 AliForwardMultiplicityBase()
248 : AliAnalysisTaskSE(),
249 fEnableLowFlux(true),
251 fStorePerRing(false),
263 * @param o Object to copy from
265 AliForwardMultiplicityBase(const AliForwardMultiplicityBase& o)
266 : AliAnalysisTaskSE(o),
267 fEnableLowFlux(o.fEnableLowFlux),
268 fFirstEvent(o.fFirstEvent),
269 fStorePerRing(o.fStorePerRing),
275 fRingSums(o.fRingSums),
276 fCorrManager(o.fCorrManager)
278 DefineOutput(1, TList::Class());
279 DefineOutput(2, TList::Class());
282 * Assignment operator
284 * @param o Object to assign from
286 * @return Reference to this object
288 AliForwardMultiplicityBase& operator=(const AliForwardMultiplicityBase& o);
290 * Check if all needed corrections are there and accounted for. If not,
293 * @param what Which corrections is needed
295 * @return true if all present, false otherwise
297 Bool_t CheckCorrections(UInt_t what) const;
302 * @param pe On return, the eta axis
303 * @param pv On return ,the vertex axis
304 * @param mc True assume MC input
306 * @return true ons succcss
308 virtual Bool_t ReadCorrections(const TAxis*& pe,
313 * Get the ESD event. IF this is the first event, initialise
315 * @return Pointer to ESD event structore
317 virtual AliESDEvent* GetESDEvent();
319 * Initialise the sub objects and stuff. Called on first event
321 * @return false on errors
323 virtual Bool_t SetupForData();
325 * Initialize members based on eta and vertex axis - only available
326 * after first event - called from SetupForData.
328 * @param pe @f$\eta@f$ axis
329 * @param pv Interaction point Z-coordinate axis
331 virtual void InitMembers(const TAxis* pe, const TAxis* pv);
333 * Create output branches - called from UserCreateOutputObjects
335 virtual void CreateBranches(AliAODHandler* ah);
337 * Mark this event as one to store in the AOD
340 virtual void MarkEventForStore() const;
342 * Do estimates of @f$dN/d\eta@f$ - called at Terminate
344 * @param input Input list
345 * @param output Output list
347 virtual void EstimatedNdeta(const TList* input, TList* output) const;
349 * Calculate a simple dN/deta from all accepted events
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
357 * @return true on success
359 virtual Bool_t MakeSimpledNdeta(const TList* input,
365 * Make Ring @f$ dN/d\eta @f$ histogram and a stack
367 * @param input List with summed signals
368 * @param output Output list
369 * @param inName Input name
370 * @param outName Output name
373 virtual void MakeRingdNdeta(const TList* input,
377 Int_t style=20) const;
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
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.
395 AliForwardCorrectionManager* fCorrManager; // Pointer to corrections manager
397 ClassDef(AliForwardMultiplicityBase,3) // Forward multiplicity class