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;}
166 struct VtxBin : public TNamed
175 * @param low Lower @f$v_z@f$ bound
176 * @param high Upper @f$v_z@f$ bound
177 * @param etaAxis @f$\eta@f$ axis to use
179 VtxBin(Double_t low, Double_t high, const TAxis& etaAxis);
183 * @param o Object to copy from
185 VtxBin(const VtxBin& o);
187 * Assignment operator
189 * @param o Object to assign from
191 * @return Reference to this object
193 VtxBin& operator=(const VtxBin& o);
197 * @param low Lower @f$v_z@f$ bound
198 * @param high Upper @f$v_z@f$ bound
202 static const char* BinName(Double_t low, Double_t high);
204 * Declare output in passed list
206 * @param list List to put output in
208 void DefineOutput(TList* list);
210 * Calculate the background correction
212 * @param hits Summed hits (track-refs)
213 * @param primary Summed primaries
215 * @return Background correction
217 TH2D* MakeBg(const TH2D* hits, const TH2D* primary) const;
221 * @param o List to add output to
223 * @param iVz Vertex bin
224 * @param map Corrections map
226 void Finish(const TList* i,
229 AliFMDCorrSecondaryMap* map);
231 AliForwardUtil::Histos fHists; // Cache of per-ring histograms
232 TH2D* fPrimary; // Cache or primary
233 TH1D* fCounts; // Event count
235 ClassDef(VtxBin,1); // Vertex bin
238 * Define our vertex bins
240 * @param list List to read or add binst from/to
242 void DefineBins(TList* list);
244 AliFMDMCEventInspector fInspector; // Event inspector
245 AliFMDMCTrackDensity fTrackDensity; // Get the track density
247 AliESDFMD fESDFMD; // Cache object
248 TObjArray* fVtxBins; // Vertex bins
249 Bool_t fFirstEvent; // First event flag
250 TH1I* fHEvents; // All Events
251 TH1I* fHEventsTr; // Histogram of events w/trigger
252 TH1I* fHEventsTrVtx; // Events w/trigger and vertex
253 TAxis fVtxAxis; // Vertex axis
254 TAxis fEtaAxis; // Eta axis
255 TList* fList; // Output list
257 ClassDef(AliForwardMCCorrectionsTask,1) // Forward corrections class