]>
Commit | Line | Data |
---|---|---|
7984e5f7 | 1 | // |
2 | // Calculate the corrections in the forward regions | |
3 | // | |
72cc12cd | 4 | #ifndef ALIFORWARDMCCORRECTIONS_H |
5 | #define ALIFORWARDMCCORRECTIONS_H | |
ffca499d | 6 | /** |
7 | * @file AliForwardMCCorrectionsTask.h | |
8 | * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk> | |
9 | * @date Wed Mar 23 14:05:51 2011 | |
10 | * | |
11 | * @brief | |
12 | * | |
13 | * | |
bd6f5206 | 14 | * @ingroup pwglf_forward_aod |
ffca499d | 15 | */ |
563a673f | 16 | #include <AliAnalysisTaskSE.h> |
563a673f | 17 | #include <AliESDFMD.h> |
5bb5d1f6 | 18 | #include "AliFMDMCEventInspector.h" |
a5249a18 | 19 | #include "AliFMDMCTrackDensity.h" |
563a673f | 20 | #include <TH1I.h> |
563a673f | 21 | class AliESDEvent; |
a5249a18 | 22 | class AliFMDCorrSecondaryMap; |
563a673f | 23 | class TH2D; |
a5249a18 | 24 | class TH1D; |
563a673f | 25 | class TList; |
563a673f | 26 | |
27 | ||
28 | /** | |
29 | * Calculate the corrections in the forward regions | |
30 | * | |
31 | * @par Inputs: | |
32 | * - AliESDEvent | |
33 | * | |
34 | * @par Outputs: | |
35 | * - AliAODForwardMult | |
36 | * | |
37 | * @par Histograms | |
38 | * | |
39 | * @par Corrections used | |
40 | * | |
bd6f5206 | 41 | * @ingroup pwglf_forward_tasks |
42 | * @ingroup pwglf_forward_mc | |
43 | * @ingroup pwglf_forward_aod | |
563a673f | 44 | * |
45 | */ | |
0bd4b00f | 46 | class AliForwardMCCorrectionsTask : public AliAnalysisTaskSE |
563a673f | 47 | { |
48 | public: | |
49 | /** | |
50 | * Constructor | |
51 | * | |
52 | * @param name Name of task | |
53 | */ | |
0bd4b00f | 54 | AliForwardMCCorrectionsTask(const char* name); |
563a673f | 55 | /** |
56 | * Constructor | |
57 | */ | |
0bd4b00f | 58 | AliForwardMCCorrectionsTask(); |
563a673f | 59 | /** |
60 | * Copy constructor | |
61 | * | |
62 | * @param o Object to copy from | |
63 | */ | |
0bd4b00f | 64 | AliForwardMCCorrectionsTask(const AliForwardMCCorrectionsTask& o); |
563a673f | 65 | /** |
66 | * Assignment operator | |
67 | * | |
68 | * @param o Object to assign from | |
69 | * | |
70 | * @return Reference to this object | |
71 | */ | |
0bd4b00f | 72 | AliForwardMCCorrectionsTask& operator=(const AliForwardMCCorrectionsTask& o); |
563a673f | 73 | /** |
74 | * @{ | |
75 | * @name Interface methods | |
76 | */ | |
77 | /** | |
78 | * Initialize the task | |
79 | * | |
80 | */ | |
81 | virtual void Init(); | |
82 | /** | |
83 | * Create output objects | |
84 | * | |
85 | */ | |
86 | virtual void UserCreateOutputObjects(); | |
87 | /** | |
88 | * Process each event | |
89 | * | |
90 | * @param option Not used | |
91 | */ | |
92 | virtual void UserExec(Option_t* option); | |
93 | /** | |
94 | * End of job | |
95 | * | |
96 | * @param option Not used | |
97 | */ | |
98 | virtual void Terminate(Option_t* option); | |
99 | /** | |
100 | * @} | |
101 | */ | |
7984e5f7 | 102 | /** |
103 | * Print this object | |
104 | * | |
105 | * @param option Not used | |
106 | */ | |
563a673f | 107 | void Print(Option_t* option="") const; |
108 | ||
7984e5f7 | 109 | /** |
110 | * Set the vertex axis to use | |
111 | * | |
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 | |
115 | */ | |
563a673f | 116 | void SetVertexAxis(Int_t nBins, Double_t vzMin, Double_t vzMax=-1000000); |
7984e5f7 | 117 | /** |
118 | * Set the vertex axis to use | |
119 | * | |
120 | * @param axis Axis | |
121 | */ | |
563a673f | 122 | void SetVertexAxis(const TAxis& axis); |
7984e5f7 | 123 | /** |
124 | * Set the eta axis to use | |
125 | * | |
126 | * @param nBins Number of bins | |
ffca499d | 127 | * @param etaMin Least @f$\eta@f$ |
128 | * @param etaMax Largest @f$\eta@f$ | |
7984e5f7 | 129 | */ |
563a673f | 130 | void SetEtaAxis(Int_t nBins, Double_t etaMin, Double_t etaMax=-1000000); |
7984e5f7 | 131 | /** |
132 | * Set the eta axis to use | |
133 | * | |
134 | * @param axis Axis | |
135 | */ | |
563a673f | 136 | void SetEtaAxis(const TAxis& axis); |
7984e5f7 | 137 | /** |
a5249a18 | 138 | * Get a reference to the track density calculator |
7984e5f7 | 139 | * |
a5249a18 | 140 | * @return Reference to the track density calculator |
7984e5f7 | 141 | */ |
a5249a18 | 142 | AliFMDMCTrackDensity& GetTrackDensity() { return fTrackDensity; } |
7984e5f7 | 143 | /** |
a5249a18 | 144 | * Get a reference to the track density calculator |
7984e5f7 | 145 | * |
a5249a18 | 146 | * @return Reference to the track density calculator |
7984e5f7 | 147 | */ |
a5249a18 | 148 | const AliFMDMCTrackDensity& GetTrackDensity() const { return fTrackDensity; } |
7984e5f7 | 149 | /** |
a5249a18 | 150 | * Get a reference to the event inspector |
7984e5f7 | 151 | * |
a5249a18 | 152 | * @return Reference to the event inspector |
7984e5f7 | 153 | */ |
a5249a18 | 154 | AliFMDMCEventInspector& GetEventInspector() { return fInspector; } |
7984e5f7 | 155 | /** |
a5249a18 | 156 | * Get a reference to the event inspector |
157 | * | |
158 | * @return Reference to the event inspector | |
159 | */ | |
160 | const AliFMDMCEventInspector& GetEventInspector() const { return fInspector;} | |
ffd35d33 | 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;} | |
165 | ||
166 | ||
167 | ||
168 | ||
a5249a18 | 169 | protected: |
170 | /** | |
171 | * A vertex bin | |
7984e5f7 | 172 | * |
7984e5f7 | 173 | */ |
a5249a18 | 174 | struct VtxBin : public TNamed |
175 | { | |
176 | /** | |
177 | * Constructor | |
178 | */ | |
179 | VtxBin(); | |
180 | /** | |
181 | * Constructor | |
182 | * | |
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 | */ | |
187 | VtxBin(Double_t low, Double_t high, const TAxis& etaAxis); | |
188 | /** | |
189 | * Copy constructor | |
190 | * | |
191 | * @param o Object to copy from | |
192 | */ | |
193 | VtxBin(const VtxBin& o); | |
194 | /** | |
195 | * Assignment operator | |
196 | * | |
197 | * @param o Object to assign from | |
198 | * | |
199 | * @return Reference to this object | |
200 | */ | |
201 | VtxBin& operator=(const VtxBin& o); | |
202 | /** | |
203 | * Get bin name | |
204 | * | |
205 | * @param low Lower @f$v_z@f$ bound | |
206 | * @param high Upper @f$v_z@f$ bound | |
207 | * | |
208 | * @return Bin name | |
209 | */ | |
210 | static const char* BinName(Double_t low, Double_t high); | |
211 | /** | |
212 | * Declare output in passed list | |
213 | * | |
214 | * @param list List to put output in | |
215 | */ | |
5934a3e3 | 216 | void CreateOutputObjects(TList* list); |
a5249a18 | 217 | /** |
218 | * Calculate the background correction | |
219 | * | |
220 | * @param hits Summed hits (track-refs) | |
221 | * @param primary Summed primaries | |
222 | * | |
223 | * @return Background correction | |
224 | */ | |
225 | TH2D* MakeBg(const TH2D* hits, const TH2D* primary) const; | |
226 | /** | |
227 | * End of job process | |
228 | * | |
c6115ede | 229 | * @param o List to add output to |
230 | * @param i Input | |
231 | * @param iVz Vertex bin | |
232 | * @param map Corrections map | |
a5249a18 | 233 | */ |
5934a3e3 | 234 | void Terminate(const TList* i, |
a5249a18 | 235 | TList* o, |
236 | UShort_t iVz, | |
237 | AliFMDCorrSecondaryMap* map); | |
238 | ||
239 | AliForwardUtil::Histos fHists; // Cache of per-ring histograms | |
240 | TH2D* fPrimary; // Cache or primary | |
241 | TH1D* fCounts; // Event count | |
242 | ||
5934a3e3 | 243 | ClassDef(VtxBin,2); // Vertex bin |
a5249a18 | 244 | }; |
7984e5f7 | 245 | /** |
a5249a18 | 246 | * Define our vertex bins |
7984e5f7 | 247 | * |
a5249a18 | 248 | * @param list List to read or add binst from/to |
7984e5f7 | 249 | */ |
a5249a18 | 250 | void DefineBins(TList* list); |
251 | ||
5bb5d1f6 | 252 | AliFMDMCEventInspector fInspector; // Event inspector |
a5249a18 | 253 | AliFMDMCTrackDensity fTrackDensity; // Get the track density |
563a673f | 254 | |
a5249a18 | 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 | |
ffd35d33 | 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 | |
563a673f | 266 | |
ffd35d33 | 267 | ClassDef(AliForwardMCCorrectionsTask,3) // Forward corrections class |
563a673f | 268 | }; |
269 | ||
270 | #endif | |
271 | // Local Variables: | |
272 | // mode: C++ | |
273 | // End: | |
274 |