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; }
169 Bool_t HasSecondaryCorrection() const { return fSecmap != 0; }
170 Bool_t HasAcceptanceCorrection() const { return fAcceptance != 0; }
173 * Get the acceptance path
177 const char* GetAcceptancePath() const {return fAcceptancePath.Data(); }
179 * Get the secondary path
183 const char* GetSecMapPath() const {return fSecMapPath.Data(); }
185 * Set the path to the acceptance maps
187 * @param path PAth to object file
189 void SetAcceptancePath(const char* path) {fAcceptancePath=path; }
191 * Set the path to the secondary maps
193 * @param path Path to object files
195 void SetSecMapPath(const char* path) {fSecMapPath=path; }
197 * Get full path name to object file
199 * @param what What to get
200 * @param sys Collision system
201 * @param sNN Center of mass energy
202 * @param field Magnetic field
206 const char* GetFullFileName(UShort_t what, UShort_t sys, UShort_t sNN,
207 Short_t field) const;
209 * Get the full path name
211 * @param what What to get
212 * @param sys Collision system
213 * @param sNN Center of mass energy
214 * @param field Magnetic field
218 const char* GetFileName(UShort_t what, UShort_t sys, UShort_t sNN,
219 Short_t field) const;
222 * Get the obejct name
224 * @param what which correction
226 * @return Name of object
228 const char* GetObjectName(UShort_t what) const {
229 return what == 0 ? GetSecMapName() : GetAcceptanceName(); }
231 * Get the directory part of the full file name
233 * @param what What correction
235 * @return directory path
237 const char* GetFileDir(UShort_t what) const {
238 return what == 0 ? fSecMapPath.Data() : fAcceptancePath.Data(); }
241 * Get the acceptance object name
245 const char* GetAcceptanceName() const {return fAcceptanceName.Data(); }
247 * Get the secondary object name
251 const char* GetSecMapName() const {return fSecMapName.Data(); }
254 * Get the secondary map
260 TH2D* GetSecMapCorrection(UShort_t vtxbin) const;
262 * Get the acceptance correction
268 TH1D* GetAcceptanceCorrection(UShort_t vtxbin) const;
270 * Get the secondary correction map object
272 AliCentralCorrSecondaryMap* GetSecMap() const { return fSecmap; }
274 * Write a correction object to (a temporary) file.
276 * @param what What kind of correction
277 * @param sys Collision system
278 * @param cms Center of mass energy
280 * @param o Object to write
281 * @param full If true, write to full path
283 * @return True on success
285 Bool_t WriteFile(UShort_t what, UShort_t sys, UShort_t cms, Short_t field,
286 TObject* o, Bool_t full) const;
288 void Print(Option_t* option="") const;
291 TString fAcceptancePath; // Path to acceptance
292 TString fSecMapPath; // Path to secondary map
293 AliCentralCorrAcceptance* fAcceptance; // Acceptance
294 AliCentralCorrSecondaryMap* fSecmap; // Secindary map
295 TString fAcceptanceName; // Acceptance name
296 TString fSecMapName; // Secindary name
297 Bool_t fIsInit; // Are we init
299 ClassDef(Manager,1); // Manager of data
302 * Get the ESD event and initialise manager on first event if not
305 * @return Pointer to valid ESD event object
307 virtual AliESDEvent* GetESDEvent();
309 * Mark this event for storage in AOD output
312 virtual void MarkEventForStore() const;
314 * Process the ESD SPD information
316 * @param hist Histogram to fill
317 * @param spdmult SPD multiplicity object
319 virtual void ProcessESD(TH2D& hist, const AliMultiplicity* spdmult) const;
323 * @param hist Histogram to correct
324 * @param vtxbin Vertex bin
326 virtual void CorrectData(TH2D& hist, UShort_t vtxbin) const;
328 * Get a reference to the manager
330 * @return Reference to corrections manager
332 Manager& GetManager() { return fManager; }
334 * Get a reference to the manager
336 * @return Reference to corrections manager
338 const Manager& GetManager() const { return fManager; }
339 void FindEtaLimits();
342 AliFMDEventInspector fInspector; // Inspect events
343 TH2D* fData; // sum histogram if needed
344 TList* fList; // Output List for diagnostics
345 AliAODCentralMult fAODCentral; // Output object
346 Manager fManager; // Manager object for corrections
347 Bool_t fUseSecondary; // Whether to secondary map
348 Bool_t fUseAcceptance; // Whether to use acceptance corr.
349 Bool_t fFirstEventSeen; // Have we seen first event
350 Int_t fIvz; // Event's vertex bin
351 TH2D* fNClusterTracklet; // # of clusters vs tracklets
352 TH2D* fClusterPerTracklet; // Clusters per tracklet.
353 TH1D* fNCluster; //! Number of clusters
354 TH1D* fNTracklet; //! number of tracklets
355 TArrayI fEtaMin; // Least eta bin to use
356 TArrayI fEtaMax; // Largest eta bin to use
357 ClassDef(AliCentralMultiplicityTask,2) // Forward multiplicity class