2 // Calculate the corrections in the base regions
4 #ifndef ALIBASEMCCORRECTIONS_H
5 #define ALIBASEMCCORRECTIONS_H
7 * @file AliBaseMCCorrectionsTask.h
8 * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
9 * @date Wed Mar 23 14:05:51 2011
14 * @ingroup pwglf_base_aod
16 #include <AliBaseESDTask.h>
17 #include <AliESDFMD.h>
18 #include "AliFMDMCEventInspector.h"
20 class AliBaseMCTrackDensity;
21 class AliCorrectionManagerBase;
29 * Calculate the corrections in the base regions
39 * @par Corrections used
41 * @ingroup pwglf_base_tasks
42 * @ingroup pwglf_base_mc
43 * @ingroup pwglf_base_aod
46 class AliBaseMCCorrectionsTask : public AliBaseESDTask
52 * @param name Name of task
55 AliBaseMCCorrectionsTask(const char* name,
56 AliCorrectionManagerBase* m);
60 AliBaseMCCorrectionsTask();
63 * @name Interface methods
66 * Create output objects
68 * @return true on success
70 virtual Bool_t Book();
74 * @param esd ESD event
76 * @return true on success
78 virtual Bool_t Event(AliESDEvent& esd);
82 * @return true on success
84 virtual Bool_t Finalize();
91 * @param option Not used
93 void Print(Option_t* option="") const;
96 * Set the vertex axis to use
98 * @param nBins Number of bins
99 * @param vzMin Least @f$z@f$ coordinate of interation point
100 * @param vzMax Largest @f$z@f$ coordinate of interation point
102 void SetVertexAxis(Int_t nBins, Double_t vzMin, Double_t vzMax=-1000000);
104 * Set the vertex axis to use
108 void SetVertexAxis(const TAxis& axis);
110 * Set the eta axis to use
112 * @param nBins Number of bins
113 * @param etaMin Least @f$\eta@f$
114 * @param etaMax Largest @f$\eta@f$
116 void SetEtaAxis(Int_t nBins, Double_t etaMin, Double_t etaMax=-1000000);
118 * Set the eta axis to use
122 void SetEtaAxis(const TAxis& axis);
124 * Get a reference to the track density calculator
126 * @return Reference to the track density calculator
128 virtual AliBaseMCTrackDensity& GetTrackDensity() = 0;
130 * Get a reference to the track density calculator
132 * @return Reference to the track density calculator
134 virtual const AliBaseMCTrackDensity& GetTrackDensity() const = 0;
136 * Get a reference to the event inspector
138 * @return Reference to the event inspector
140 AliFMDEventInspector& GetEventInspector() { return fInspector; }
142 * Get a reference to the event inspector
144 * @return Reference to the event inspector
146 const AliFMDEventInspector& GetEventInspector() const { return fInspector;}
148 * setter for the fUseESDVertexCoordinate flag
150 void SetUseESDVertex(Bool_t use){ fUseESDVertex = use;}
152 * setter for the fCalculateafterESDeventcuts flag
154 void SetAfterEventSel(Bool_t use){ fAfterEventSel = use; }
159 * @param o Object to copy from
161 AliBaseMCCorrectionsTask(const AliBaseMCCorrectionsTask& o);
163 * Assignment operator
165 * @param o Object to assign from
167 * @return Reference to this object
169 AliBaseMCCorrectionsTask& operator=(const AliBaseMCCorrectionsTask& o);
174 struct VtxBin : public TNamed
183 * @param low Lower @f$v_z@f$ bound
184 * @param high Upper @f$v_z@f$ bound
185 * @param etaAxis @f$\eta@f$ axis to use
186 * @param nPhi Number of @f$\varphi@f$ bins
188 VtxBin(Double_t low, Double_t high, const TAxis& etaAxis, UShort_t nPhi);
193 * @param o Object to copy from
195 VtxBin(const VtxBin& o);
197 * Assignment operator
199 * @param o Object to assign from
201 * @return Reference to this object
203 VtxBin& operator=(const VtxBin& o);
207 * @param low Lower @f$v_z@f$ bound
208 * @param high Upper @f$v_z@f$ bound
212 static const char* BinName(Double_t low, Double_t high);
214 * Declare output in passed list
216 * @param list List to put output in
218 virtual TList* CreateOutputObjects(TList* list);
219 TH2D* fPrimary; // Cache or primary
220 TH1D* fCounts; // Event count
222 ClassDef(VtxBin,1); // Vertex bin
224 virtual TAxis* DefaultVertexAxis() const { return const_cast<TAxis*>(&fVtxAxis); }
225 virtual TAxis* DefaultEtaAxis() const { return const_cast<TAxis*>(&fEtaAxis); }
227 * Create a vertex bin
229 * @param low Low cut on @f$IP_{z}@f$
230 * @param high High cut on @f$IP_{z}@f$
232 * @return Newly create vertex bin
234 virtual VtxBin* CreateVtxBin(Double_t low, Double_t high) = 0;
236 * Process an ESD event
238 * @param esd ESD event
240 * @param bin Vertex bin
241 * @param vz @f$IP_{z}@f$
243 * @return true on success
245 virtual Bool_t ProcessESD(const AliESDEvent& esd,
246 const AliMCEvent& mc,
250 * Create corrections objects and store them in passed list
252 * @param results Output list
254 virtual void CreateCorrections(TList* results) = 0;
256 * Do the final processing of a vertex bin
258 * @param bin Vertex bin
259 * @param iVz Vertex bin number
261 * @return true on successd
263 virtual Bool_t FinalizeVtxBin(VtxBin* bin,
266 * Define our vertex bins
268 * @param list List to read or add binst from/to
270 void DefineBins(TList* list);
272 AliFMDMCEventInspector fInspector; // Event inspector
274 TObjArray* fVtxBins; // Vertex bins
275 TH1I* fHEvents; // All Events
276 TH1I* fHEventsTr; // Histogram of events w/trigger
277 TH1I* fHEventsTrVtx; // Events w/trigger and vertex
278 TAxis fVtxAxis; // Vertex axis
279 TAxis fEtaAxis; // Eta axis
280 Bool_t fUseESDVertex; // if true use Z vertex from ESD in calculations
281 Bool_t fAfterEventSel; //if true corr. be calc. after events selection
283 ClassDef(AliBaseMCCorrectionsTask,1) // Base corrections class