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 * Configure this task via a macro
83 * @param macro Macro to configure va
85 * @return true on success, false otherwise
87 virtual Bool_t Configure(const char* macro="CentralAODConfig.C");
89 * Create output objects
92 virtual void UserCreateOutputObjects();
96 * @param option Not used
98 virtual void UserExec(Option_t* option);
102 * @param option Not used
104 virtual void Terminate(Option_t* option);
108 * @param option Not used
110 virtual void Print(Option_t* option="") const;
112 * Set whether to use the secondary corrections
114 * @param use Whether to use secondary corrections
116 virtual void SetUseSecondary(Bool_t use) { fUseSecondary = use; }
118 * Set whether to use the acceptance corrections
120 * @param use Whether to use acceptance corrections
122 virtual void SetUseAcceptance(Bool_t use) { fUseAcceptance = use; }
124 AliFMDEventInspector& GetInspector() { return fInspector; }
125 const AliFMDEventInspector& GetInspector() const { return fInspector; }
127 //__________________________________________________________________
129 * Manager of corrections
131 * This is a small class to fetch corrections for secondaries and
148 Manager(const Manager& o);
152 virtual ~Manager() {}
154 * Assignment operator
156 * @param o Object to assign from
158 * @return Reference to this object
160 Manager& operator=(const Manager& o);
165 * @param sys Collision system (1: pp, 2: PbPb)
166 * @param sNN Center of mass energy per nucleon pair [GeV]
167 * @param field Magnetic field [kG]
169 void Init(UShort_t sys, UShort_t sNN, Short_t field);
174 * @return true if initialized
176 Bool_t IsInit() { return fIsInit; }
178 * Check if we have the secondary correction
180 * @return true if it is read in
182 Bool_t HasSecondaryCorrection() const { return fSecmap != 0; }
184 * Check if we have the acceptance correction
186 * @return true if it is read in
188 Bool_t HasAcceptanceCorrection() const { return fAcceptance != 0; }
191 * Get the acceptance path
195 const char* GetAcceptancePath() const {return fAcceptancePath.Data(); }
197 * Get the secondary path
201 const char* GetSecMapPath() const {return fSecMapPath.Data(); }
203 * Set the path to the acceptance maps
205 * @param path PAth to object file
207 void SetAcceptancePath(const char* path) {fAcceptancePath=path; }
209 * Set the path to the secondary maps
211 * @param path Path to object files
213 void SetSecMapPath(const char* path) {fSecMapPath=path; }
215 * Get full path name to object file
217 * @param what What to get
218 * @param sys Collision system
219 * @param sNN Center of mass energy
220 * @param field Magnetic field
224 const char* GetFullFileName(UShort_t what, UShort_t sys, UShort_t sNN,
225 Short_t field) const;
227 * Get the full path name
229 * @param what What to get
230 * @param sys Collision system
231 * @param sNN Center of mass energy
232 * @param field Magnetic field
236 const char* GetFileName(UShort_t what, UShort_t sys, UShort_t sNN,
237 Short_t field) const;
240 * Get the obejct name
242 * @param what which correction
244 * @return Name of object
246 const char* GetObjectName(UShort_t what) const {
247 return what == 0 ? GetSecMapName() : GetAcceptanceName(); }
249 * Get the directory part of the full file name
251 * @param what What correction
253 * @return directory path
255 const char* GetFileDir(UShort_t what) const {
256 return what == 0 ? fSecMapPath.Data() : fAcceptancePath.Data(); }
259 * Get the acceptance object name
263 const char* GetAcceptanceName() const {return fAcceptanceName.Data(); }
265 * Get the secondary object name
269 const char* GetSecMapName() const {return fSecMapName.Data(); }
272 * Get the secondary map
278 TH2D* GetSecMapCorrection(UShort_t vtxbin) const;
280 * Get the acceptance correction
286 TH1D* GetAcceptanceCorrection(UShort_t vtxbin) const;
288 * Get the secondary correction map object
290 * @return The secondary correction map
292 AliCentralCorrSecondaryMap* GetSecMap() const { return fSecmap; }
294 * Write a correction object to (a temporary) file.
296 * @param what What kind of correction
297 * @param sys Collision system
298 * @param cms Center of mass energy
300 * @param o Object to write
301 * @param full If true, write to full path
303 * @return True on success
305 Bool_t WriteFile(UShort_t what, UShort_t sys, UShort_t cms, Short_t field,
306 TObject* o, Bool_t full) const;
310 * @param option Not used
312 void Print(Option_t* option="") const;
315 TString fAcceptancePath; // Path to acceptance
316 TString fSecMapPath; // Path to secondary map
317 AliCentralCorrAcceptance* fAcceptance; // Acceptance
318 AliCentralCorrSecondaryMap* fSecmap; // Secindary map
319 TString fAcceptanceName; // Acceptance name
320 TString fSecMapName; // Secindary name
321 Bool_t fIsInit; // Are we init
323 ClassDef(Manager,2); // Manager of data
326 * Get the ESD event and initialise manager on first event if not
329 * @return Pointer to valid ESD event object
331 virtual AliESDEvent* GetESDEvent();
333 * Mark this event for storage in AOD output
336 virtual void MarkEventForStore() const;
338 * Process the ESD SPD information
340 * @param hist Histogram to fill
341 * @param spdmult SPD multiplicity object
343 virtual void ProcessESD(TH2D& hist, const AliMultiplicity* spdmult) const;
347 * @param hist Histogram to correct
348 * @param vtxbin Vertex bin
350 virtual void CorrectData(TH2D& hist, UShort_t vtxbin) const;
352 * Get a reference to the manager
354 * @return Reference to corrections manager
356 Manager& GetManager() { return fManager; }
358 * Get a reference to the manager
360 * @return Reference to corrections manager
362 const Manager& GetManager() const { return fManager; }
363 void FindEtaLimits();
366 AliFMDEventInspector fInspector; // Inspect events
367 TH2D* fData; // sum histogram if needed
368 TList* fList; // Output List for diagnostics
369 TList* fHits; // Per-vertex histograms
370 AliAODCentralMult fAODCentral; // Output object
371 Manager fManager; // Manager object for corrections
372 Bool_t fUseSecondary; // Whether to secondary map
373 Bool_t fUseAcceptance; // Whether to use acceptance corr.
374 Bool_t fFirstEventSeen; // Have we seen first event
375 Int_t fIvz; // Event's vertex bin
376 TH2D* fNClusterTracklet; // # of clusters vs tracklets
377 TH2D* fClusterPerTracklet; // Clusters per tracklet.
378 TH1D* fNCluster; //! Number of clusters
379 TH1D* fNTracklet; //! number of tracklets
380 TArrayI fEtaMin; // Least eta bin to use
381 TArrayI fEtaMax; // Largest eta bin to use
382 ClassDef(AliCentralMultiplicityTask,4) // Forward multiplicity class