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 "AliBaseESDTask.h"
18 #include "AliFMDEventInspector.h"
19 #include "AliAODCentralMult.h"
20 class AliCentralCorrectionManager;
22 class AliMultiplicity;
29 * Class that calculates the multiplicity in the
30 * central region event-by-event
40 * @par Corrections used
42 * @ingroup pwglf_forward_tasks
43 * @ingroup pwglf_forward_aod
46 class AliCentralMultiplicityTask : public AliBaseESDTask
51 * @name Interface methods
56 * @param name Name of task
58 AliCentralMultiplicityTask(const char* name);
62 * Reserved for ROOT's I/O system - do not use
64 AliCentralMultiplicityTask();
66 * Create output objects
68 * @return true on success
70 virtual Bool_t Book();
72 * Creat output objects in tree
76 virtual void CreateBranches(AliAODHandler* ah);
78 * Called just before first event
80 * @param v Vertex axis
81 * @param e @f$\eta@f$ axis
83 * @return true on success
85 virtual Bool_t PreData(const TAxis& v, const TAxis& e);
89 * @return true on success
91 virtual Bool_t PreEvent();
95 * @param esd ESD event
97 * @return true on success
99 virtual Bool_t Event(AliESDEvent& esd);
103 * @return true on success
105 virtual Bool_t Finalize();
109 * @param option Not used
111 virtual void Print(Option_t* option="") const;
113 * Set whether to use the secondary corrections
115 * @param use Whether to use secondary corrections
117 virtual void SetUseSecondary(Bool_t use) { fUseSecondary = use; }
119 * Set whether to use the acceptance corrections
121 * @param use Whether to use acceptance corrections
123 virtual void SetUseAcceptance(Bool_t use) { fUseAcceptance = use; }
125 * Set whether to make diagnostics or not
127 * @param use If true, store some extra diagnostic histograms
129 virtual void SetMakeDiagnostics(Bool_t use=true) { fStore = use; }
131 * Get the event inspector
133 * @return Reference to used event inspector
135 AliFMDEventInspector& GetEventInspector() { return fInspector; }
137 * Get the event inspector
139 * @return Reference to used event inspector
141 const AliFMDEventInspector& GetEventInspector() const { return fInspector; }
147 * @param o Object to copy from
149 AliCentralMultiplicityTask(const AliCentralMultiplicityTask& o);
151 * Assignment operator
153 * @param o Object to assign from
155 * @return Reference to this object
157 AliCentralMultiplicityTask& operator=(const AliCentralMultiplicityTask& o);
159 * Process the ESD SPD information
161 * @param hist Histogram to fill
162 * @param spdmult SPD multiplicity object
164 virtual void ProcessESD(TH2D& hist,
165 const AliMultiplicity* spdmult) const;
169 * Used to store and apply corrections and fiducial cuts
171 struct VtxBin : public TObject
176 * @param iVz Bin number
177 * @param minIpZ Least @f$IP_{z}@f$
178 * @param maxIpZ Largest @f$IP_{z}@f$
180 VtxBin(Int_t iVz=0, Double_t minIpZ=0, Double_t maxIpZ=0);
184 * @param o Object to copy from
186 VtxBin(const VtxBin& o);
188 * Assignment operator
190 * @param o Object to assign from
192 * @return Reference to this object
194 VtxBin& operator=(const VtxBin& o);
200 const char* GetName() const;
205 * @param coverage Template
206 * @param store Whether to store results
208 void SetupForData(TList* l, TH2* coverage, Bool_t store=true);
210 * Correct the input data
212 * @param aodHist Histogram
213 * @param useSecondary Whether to use secondary correction or not
214 * @param useAcceptance Whether to use acceptance correction or not
215 * @param sum Whether to sum or not
217 void Correct(TH2D& aodHist,
219 Bool_t useAcceptance,
220 Bool_t sum=true) const;
224 * @param option Not used
226 void Print(Option_t* option="") const;
228 Int_t fId; // Vertex bin number
229 Double_t fMinIpZ; // Least value of ipZ
230 Double_t fMaxIpZ; // Largest value of ipZ
231 Int_t fEtaMin; // Smallest eta bin to use
232 Int_t fEtaMax; // Largest eta bin to use
233 TH2* fSec; // Our secondary correction
234 TH1* fAcc; // Our acceptance correction
235 mutable TH2* fHits; // Diagnostics sum
242 * Make a simple @f$\frac{dN_{ch}}{d\eta}@f$ estimate.
244 * @param input Sum list
245 * @param output Output list
246 * @param nTr On return, the number of events w/triggers
247 * @param nTrVtx On return, the number of events w/triggers+vertex
248 * @param nAcc On return, the number of accepted events
250 * @return true on success, false otherwise
252 Bool_t MakeSimpledNdeta(const TList* input,
257 TAxis* DefaultEtaAxis() const { return new TAxis(200,-4,6); }
258 TAxis* DefaultVertexAxis() const { return new TAxis(10,-10,10); }
259 AliFMDEventInspector fInspector; // Inspect events
260 AliAODCentralMult fAODCentral; // Output object
261 Bool_t fUseSecondary; // Whether to secondary map
262 Bool_t fUseAcceptance; // Whether to use acceptance corr.
263 Int_t fIvz; // Event's vertex bin
264 TH2D* fNClusterTracklet; // # of clusters vs tracklets
265 TH2D* fClusterPerTracklet; // Clusters per tracklet.
266 TH1D* fNCluster; //! Number of clusters
267 TH1D* fNTracklet; //! number of tracklets
268 TObjArray* fVtxList; //! Array of vertex bins
269 Bool_t fStore; // Store diagnostics
270 TH2D* fHData; // Sum of signals
272 ClassDef(AliCentralMultiplicityTask,5) // Forward multiplicity class