2 // Calculate the corrections in the forward regions
4 #ifndef ALIFORWARDMCCORRECTIONS_H
5 #define ALIFORWARDMCCORRECTIONS_H
7 * @file AliForwardMCCorrectionsTask.h
8 * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
9 * @date Wed Mar 23 14:05:51 2011
14 * @ingroup pwglf_forward_aod
16 #include <AliAnalysisTaskSE.h>
17 #include <AliESDFMD.h>
18 #include "AliFMDMCEventInspector.h"
19 #include "AliFMDMCTrackDensity.h"
22 class AliFMDCorrSecondaryMap;
29 * Calculate the corrections in the forward regions
39 * @par Corrections used
41 * @ingroup pwglf_forward_tasks
42 * @ingroup pwglf_forward_mc
43 * @ingroup pwglf_forward_aod
46 class AliForwardMCCorrectionsTask : public AliAnalysisTaskSE
52 * @param name Name of task
54 AliForwardMCCorrectionsTask(const char* name);
58 AliForwardMCCorrectionsTask();
62 * @param o Object to copy from
64 AliForwardMCCorrectionsTask(const AliForwardMCCorrectionsTask& o);
68 * @param o Object to assign from
70 * @return Reference to this object
72 AliForwardMCCorrectionsTask& operator=(const AliForwardMCCorrectionsTask& o);
75 * @name Interface methods
83 * Create output objects
86 virtual void UserCreateOutputObjects();
90 * @param option Not used
92 virtual void UserExec(Option_t* option);
96 * @param option Not used
98 virtual void Terminate(Option_t* option);
105 * @param option Not used
107 void Print(Option_t* option="") const;
110 * Set the vertex axis to use
112 * @param nBins Number of bins
113 * @param vzMin Least @f$z@f$ coordinate of interation point
114 * @param vzMax Largest @f$z@f$ coordinate of interation point
116 void SetVertexAxis(Int_t nBins, Double_t vzMin, Double_t vzMax=-1000000);
118 * Set the vertex axis to use
122 void SetVertexAxis(const TAxis& axis);
124 * Set the eta axis to use
126 * @param nBins Number of bins
127 * @param etaMin Least @f$\eta@f$
128 * @param etaMax Largest @f$\eta@f$
130 void SetEtaAxis(Int_t nBins, Double_t etaMin, Double_t etaMax=-1000000);
132 * Set the eta axis to use
136 void SetEtaAxis(const TAxis& axis);
138 * Get a reference to the track density calculator
140 * @return Reference to the track density calculator
142 AliFMDMCTrackDensity& GetTrackDensity() { return fTrackDensity; }
144 * Get a reference to the track density calculator
146 * @return Reference to the track density calculator
148 const AliFMDMCTrackDensity& GetTrackDensity() const { return fTrackDensity; }
150 * Get a reference to the event inspector
152 * @return Reference to the event inspector
154 AliFMDMCEventInspector& GetEventInspector() { return fInspector; }
156 * Get a reference to the event inspector
158 * @return Reference to the event inspector
160 const AliFMDMCEventInspector& GetEventInspector() const { return fInspector;}
161 // setter for the fUseESDVertexCoordinate flag
162 void SetUseESDVertexCoordinate(Bool_t use){ fUseESDVertexCoordinate=use;}
163 // setter for the fCalculateafterESDeventcuts flag
164 void SetCalculateafterESDeventcuts(Bool_t use){ fCalculateafterESDeventcuts=use;}
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
187 VtxBin(Double_t low, Double_t high, const TAxis& etaAxis);
191 * @param o Object to copy from
193 VtxBin(const VtxBin& o);
195 * Assignment operator
197 * @param o Object to assign from
199 * @return Reference to this object
201 VtxBin& operator=(const VtxBin& o);
205 * @param low Lower @f$v_z@f$ bound
206 * @param high Upper @f$v_z@f$ bound
210 static const char* BinName(Double_t low, Double_t high);
212 * Declare output in passed list
214 * @param list List to put output in
216 void CreateOutputObjects(TList* list);
218 * Calculate the background correction
220 * @param hits Summed hits (track-refs)
221 * @param primary Summed primaries
223 * @return Background correction
225 TH2D* MakeBg(const TH2D* hits, const TH2D* primary) const;
229 * @param o List to add output to
231 * @param iVz Vertex bin
232 * @param map Corrections map
234 void Terminate(const TList* i,
237 AliFMDCorrSecondaryMap* map);
239 AliForwardUtil::Histos fHists; // Cache of per-ring histograms
240 TH2D* fPrimary; // Cache or primary
241 TH1D* fCounts; // Event count
243 ClassDef(VtxBin,2); // Vertex bin
246 * Define our vertex bins
248 * @param list List to read or add binst from/to
250 void DefineBins(TList* list);
252 AliFMDMCEventInspector fInspector; // Event inspector
253 AliFMDMCTrackDensity fTrackDensity; // Get the track density
255 AliESDFMD fESDFMD; // Cache object
256 TObjArray* fVtxBins; // Vertex bins
257 Bool_t fFirstEvent; // First event flag
258 TH1I* fHEvents; // All Events
259 TH1I* fHEventsTr; // Histogram of events w/trigger
260 TH1I* fHEventsTrVtx; // Events w/trigger and vertex
261 TAxis fVtxAxis; // Vertex axis
262 TAxis fEtaAxis; // Eta axis
263 TList* fList; // Output list
264 Bool_t fUseESDVertexCoordinate; // if yes it will used Z vertex from ESD in calculations
265 Bool_t fCalculateafterESDeventcuts; //if yes corrections will be calculated for events passing esd cuts
267 ClassDef(AliForwardMCCorrectionsTask,3) // Forward corrections class