2 // Base class for classes that calculate the multiplicity in the
3 // SPD clusters event-by-event
5 #ifndef ALICENTRALMULTIPLICITYTASK_H
6 #define ALICENTRALMULTIPLICITYTASK_H
8 * @file AliCentralMultiplicityTask.h
9 * @author Hans Hjersing Dalsgaard
10 * @date Wed Mar 23 14:00:03 2011
14 * @ingroup pwglf_forward_aod
17 #include <AliAnalysisTaskSE.h>
18 #include "AliFMDEventInspector.h"
19 #include "AliAODCentralMult.h"
20 #include "AliCentralCorrAcceptance.h"
21 #include "AliCentralCorrSecondaryMap.h"
22 //class AliForwardCorrectionManager;
24 class AliMultiplicity;
30 * Class that calculates the multiplicity in the
31 * central region event-by-event
41 * @par Corrections used
43 * @ingroup pwglf_forward_tasks
44 * @ingroup pwglf_forward_aod
47 class AliCentralMultiplicityTask : public AliAnalysisTaskSE
52 * @name Interface methods
57 * @param name Name of task
59 AliCentralMultiplicityTask(const char* name);
63 * Reserved for ROOT's I/O system - do not use
65 AliCentralMultiplicityTask();
69 * @param o Object to copy from
71 AliCentralMultiplicityTask(const AliCentralMultiplicityTask& o);
75 * @param o Object to assign from
77 * @return Reference to this object
79 AliCentralMultiplicityTask& operator=(const AliCentralMultiplicityTask& o);
81 * Create output objects
84 virtual void UserCreateOutputObjects();
88 * @param option Not used
90 virtual void UserExec(Option_t* option);
94 * @param option Not used
96 virtual void Terminate(Option_t* option);
100 * @param option Not used
102 virtual void Print(Option_t* option="") const;
104 * Set whether to use the secondary corrections
106 * @param use Whether to use secondary corrections
108 virtual void SetUseSecondary(Bool_t use) { fUseSecondary = use; }
110 * Set whether to use the acceptance corrections
112 * @param use Whether to use acceptance corrections
114 virtual void SetUseAcceptance(Bool_t use) { fUseAcceptance = use; }
116 AliFMDEventInspector& GetInspector() { return fInspector; }
117 const AliFMDEventInspector& GetInspector() const { return fInspector; }
119 //__________________________________________________________________
121 * Manager of corrections
123 * This is a small class to fetch corrections for secondaries and
140 Manager(const Manager& o);
144 virtual ~Manager() {}
146 * Assignment operator
148 * @param o Object to assign from
150 * @return Reference to this object
152 Manager& operator=(const Manager& o);
157 * @param sys Collision system (1: pp, 2: PbPb)
158 * @param sNN Center of mass energy per nucleon pair [GeV]
159 * @param field Magnetic field [kG]
161 void Init(UShort_t sys, UShort_t sNN, Short_t field);
167 Bool_t IsInit() { return fIsInit; }
171 * Get the acceptance path
175 const char* GetAcceptancePath() const {return fAcceptancePath.Data(); }
177 * Get the secondary path
181 const char* GetSecMapPath() const {return fSecMapPath.Data(); }
183 * Set the path to the acceptance maps
185 * @param path PAth to object file
187 void SetAcceptancePath(const char* path) {fAcceptancePath=path; }
189 * Set the path to the secondary maps
191 * @param path Path to object files
193 void SetSecMapPath(const char* path) {fSecMapPath=path; }
195 * Get full path name to object file
197 * @param what What to get
198 * @param sys Collision system
199 * @param sNN Center of mass energy
200 * @param field Magnetic field
204 const char* GetFullFileName(UShort_t what, UShort_t sys, UShort_t sNN,
205 Short_t field) const;
207 * Get the full path name
209 * @param what What to get
210 * @param sys Collision system
211 * @param sNN Center of mass energy
212 * @param field Magnetic field
216 const char* GetFileName(UShort_t what, UShort_t sys, UShort_t sNN,
217 Short_t field) const;
220 * Get the obejct name
222 * @param what which correction
224 * @return Name of object
226 const char* GetObjectName(UShort_t what) const {
227 return what == 0 ? GetSecMapName() : GetAcceptanceName(); }
229 * Get the directory part of the full file name
231 * @param what What correction
233 * @return directory path
235 const char* GetFileDir(UShort_t what) const {
236 return what == 0 ? fSecMapPath.Data() : fAcceptancePath.Data(); }
239 * Get the acceptance object name
243 const char* GetAcceptanceName() const {return fAcceptanceName.Data(); }
245 * Get the secondary object name
249 const char* GetSecMapName() const {return fSecMapName.Data(); }
252 * Get the secondary map
258 TH2D* GetSecMapCorrection(UShort_t vtxbin) const;
260 * Get the acceptance correction
266 TH1D* GetAcceptanceCorrection(UShort_t vtxbin) const;
268 * Get the secondary correction map object
270 AliCentralCorrSecondaryMap* GetSecMap() const { return fSecmap; }
272 * Write a correction object to (a temporary) file.
274 * @param what What kind of correction
275 * @param sys Collision system
276 * @param cms Center of mass energy
278 * @param o Object to write
279 * @param full If true, write to full path
281 * @return True on success
283 Bool_t WriteFile(UShort_t what, UShort_t sys, UShort_t cms, Short_t field,
284 TObject* o, Bool_t full) const;
286 void Print(Option_t* option="") const;
289 TString fAcceptancePath; // Path to acceptance
290 TString fSecMapPath; // Path to secondary map
291 AliCentralCorrAcceptance* fAcceptance; // Acceptance
292 AliCentralCorrSecondaryMap* fSecmap; // Secindary map
293 TString fAcceptanceName; // Acceptance name
294 TString fSecMapName; // Secindary name
295 Bool_t fIsInit; // Are we init
297 ClassDef(Manager,1); // Manager of data
300 * Get the ESD event and initialise manager on first event if not
303 * @return Pointer to valid ESD event object
305 virtual AliESDEvent* GetESDEvent();
307 * Mark this event for storage in AOD output
310 virtual void MarkEventForStore() const;
312 * Process the ESD SPD information
314 * @param hist Histogram to fill
315 * @param spdmult SPD multiplicity object
317 virtual void ProcessESD(TH2D& hist, const AliMultiplicity* spdmult) const;
321 * @param hist Histogram to correct
322 * @param vtxbin Vertex bin
324 virtual void CorrectData(TH2D& hist, UShort_t vtxbin) const;
326 * Get a reference to the manager
328 * @return Reference to corrections manager
330 Manager& GetManager() { return fManager; }
332 * Get a reference to the manager
334 * @return Reference to corrections manager
336 const Manager& GetManager() const { return fManager; }
337 void FindEtaLimits();
340 AliFMDEventInspector fInspector; // Inspect events
341 TH2D* fData; // sum histogram if needed
342 TList* fList; // Output List for diagnostics
343 AliAODCentralMult fAODCentral; // Output object
344 Manager fManager; // Manager object for corrections
345 Bool_t fUseSecondary; // Whether to secondary map
346 Bool_t fUseAcceptance; // Whether to use acceptance corr.
347 Bool_t fFirstEventSeen; // Have we seen first event
348 Int_t fIvz; // Event's vertex bin
349 TH2D* fNClusterTracklet; // # of clusters vs tracklets
350 TH2D* fClusterPerTracklet; // Clusters per tracklet.
351 TH1D* fNCluster; //! Number of clusters
352 TH1D* fNTracklet; //! number of tracklets
353 TArrayI fEtaMin; // Least eta bin to use
354 TArrayI fEtaMax; // Largest eta bin to use
355 ClassDef(AliCentralMultiplicityTask,2) // Forward multiplicity class