]>
Commit | Line | Data |
---|---|---|
7984e5f7 | 1 | // |
2 | // This class inspects the event | |
3 | // | |
4 | #ifndef ALIFMDEVENTINSPECTOR_H | |
5 | #define ALIFMDEVENTINSPECTOR_H | |
8565b10b | 6 | #include <TNamed.h> |
7 | class AliESDEvent; | |
8 | class TH2D; | |
9 | class TH1D; | |
10 | class TH1I; | |
5e4d905e | 11 | class TH1F; |
e308a636 | 12 | class TH2F; |
8565b10b | 13 | class TAxis; |
14 | class TList; | |
15 | ||
16 | /** | |
17 | * This class inspects the event | |
18 | * | |
19 | * @par Input: | |
20 | * - AliESDFMD object possibly corrected for sharing | |
21 | * | |
22 | * @par Output: | |
23 | * - A histogram of v_z of events with triggers. | |
24 | * - A histogram of v_z of events with vertex and triggers | |
25 | * - A histogram of trigger counters | |
26 | * | |
27 | * Note, that these are added to the master output list | |
28 | * | |
29 | * @par Corrections used: | |
30 | * - None | |
31 | * | |
9fe74763 | 32 | * @ingroup pwg2_forward_algo |
8565b10b | 33 | */ |
34 | class AliFMDEventInspector : public TNamed | |
35 | { | |
36 | public: | |
37 | /** | |
38 | * Return codes | |
39 | */ | |
40 | enum ECodes { | |
41 | /** all ok */ | |
42 | kOk = 0, | |
43 | /** No ESD event */ | |
44 | kNoEvent = 0x1, | |
45 | /** No triggers found */ | |
46 | kNoTriggers = 0x2, | |
47 | /** No SPD data */ | |
48 | kNoSPD = 0x4, | |
49 | /** No FMD data */ | |
50 | kNoFMD = 0x8, | |
51 | /** No vertex found */ | |
52 | kNoVertex = 0x10, | |
53 | /** Vertex out of range */ | |
e58000b7 | 54 | kBadVertex = 0x20, |
55 | /** Suspected pileup */ | |
56 | kPileUp = 0x40, | |
57 | /** Suspected pileup */ | |
58 | kMCNSD = 0x80 | |
8565b10b | 59 | }; |
60 | /** | |
61 | * Trigger bins | |
62 | */ | |
63 | enum ETrgBins { | |
64 | kInel, | |
65 | kInelGt0, | |
66 | kNSD, | |
67 | kEmpty, | |
68 | kA, | |
69 | kB, | |
70 | kC, | |
71 | kE | |
72 | }; | |
0bd4b00f | 73 | /** |
74 | * Collision systems | |
75 | */ | |
76 | enum ECollisionSystem { | |
77 | kUnknown, | |
78 | kPP, | |
79 | kPbPb | |
80 | }; | |
8565b10b | 81 | /** |
82 | * Constructor | |
83 | */ | |
84 | AliFMDEventInspector(); | |
85 | /** | |
86 | * Constructor | |
87 | * | |
88 | * @param name Name of object | |
89 | */ | |
90 | AliFMDEventInspector(const char* name); | |
91 | /** | |
92 | * Copy constructor | |
93 | * | |
94 | * @param o Object to copy from | |
95 | */ | |
96 | AliFMDEventInspector(const AliFMDEventInspector& o); | |
97 | /** | |
98 | * Destructor | |
99 | */ | |
100 | virtual ~AliFMDEventInspector(); | |
101 | /** | |
102 | * Assignement operator | |
103 | * | |
104 | * @param o Object to assign from | |
105 | * | |
106 | * @return Reference to this object | |
107 | */ | |
108 | AliFMDEventInspector& operator=(const AliFMDEventInspector&); | |
109 | ||
110 | /** | |
111 | * Initialize the object | |
112 | * | |
113 | * @param vtxAxis Vertex axis in use | |
114 | */ | |
e1f47419 | 115 | virtual void Init(const TAxis& vtxAxis); |
8565b10b | 116 | /** |
117 | * Process the event | |
118 | * | |
119 | * @param event Input event | |
120 | * @param triggers On return, the triggers fired | |
121 | * @param lowFlux On return, true if the event is considered a low-flux | |
122 | * event (according to the setting of fLowFluxCut) | |
0bd4b00f | 123 | * @param ivz On return, the found vertex bin (1-based). A zero |
124 | * means outside of the defined vertex range | |
c389303e | 125 | * @param vz On return, the z position of the interaction |
5e4d905e | 126 | * @param cent On return, the centrality (in percent) or < 0 |
127 | * if not found | |
8565b10b | 128 | * |
129 | * @return 0 (or kOk) on success, otherwise a bit mask of error codes | |
130 | */ | |
131 | UInt_t Process(const AliESDEvent* event, | |
132 | UInt_t& triggers, | |
133 | Bool_t& lowFlux, | |
0bd4b00f | 134 | UShort_t& ivz, |
5e4d905e | 135 | Double_t& vz, |
136 | Double_t& cent); | |
8565b10b | 137 | /** |
138 | * Define the output histograms. These are put in a sub list of the | |
139 | * passed list. The histograms are merged before the parent task calls | |
140 | * AliAnalysisTaskSE::Terminate | |
141 | * | |
142 | * @param dir Directory to add to | |
143 | */ | |
144 | void DefineOutput(TList* dir); | |
145 | /** | |
146 | * Set the number of SPD tracklets for which we consider the event a | |
147 | * low-flux event or not . | |
148 | * | |
149 | * @param c Cut (default 1000) | |
150 | */ | |
151 | void SetLowFluxCut(Int_t c) { fLowFluxCut = c; } | |
152 | /** | |
153 | * Set the maximum error on @f$ v_z@f$ | |
154 | * | |
155 | * @param c Maximum error (in centimeters) | |
156 | */ | |
157 | void SetMaxVzErr(Double_t c=0.1) { fMaxVzErr = c; } | |
158 | /** | |
159 | * Set the debug level. The higher the value the more output | |
160 | * | |
161 | * @param dbg Debug level | |
162 | */ | |
163 | void SetDebug(Int_t dbg=1) { fDebug = dbg; } | |
164 | /** | |
165 | * Fetch our histograms from the passed list | |
166 | * | |
167 | * @param d Input | |
168 | * @param hEventsTr On return, pointer to histogram, or null | |
169 | * @param hEventsTrVtx On return, pointer to histogram, or null | |
170 | * @param hTriggers On return, pointer to histogram, or null | |
171 | * | |
172 | * @return true on success, false otherwise | |
173 | */ | |
fb3430ac | 174 | Bool_t FetchHistograms(const TList* d, |
8565b10b | 175 | TH1I*& hEventsTr, |
176 | TH1I*& hEventsTrVtx, | |
177 | TH1I*& hTriggers) const; | |
0bd4b00f | 178 | /** |
179 | * Read the collision system, collision energy, and L3 field setting | |
180 | * from the ESD | |
181 | * | |
182 | * @param esd ESD to get information from | |
183 | * | |
184 | * @return true on success, false | |
185 | */ | |
186 | Bool_t ReadRunDetails(const AliESDEvent* esd); | |
187 | /** | |
188 | * Get the collision system (one of the value in ECollisionSystem) | |
189 | * | |
190 | * @return Collision system | |
191 | */ | |
192 | UShort_t GetCollisionSystem() const { return fCollisionSystem; } | |
193 | /** | |
194 | * Get the center of mass energy (per nucleon pair) in GeV | |
195 | * | |
196 | * @return center of mass energy (per nucleon pair) in GeV | |
197 | */ | |
198 | UShort_t GetEnergy() const { return fEnergy; } | |
199 | /** | |
200 | * Get the magnetic field setting of the L3 magnet in kilo Gauss. | |
201 | * | |
202 | * @return The magnetic field setting | |
203 | */ | |
204 | Short_t GetField() const { return fField; } | |
205 | /** | |
206 | * Print information | |
207 | * | |
208 | * @param option Not used | |
209 | */ | |
210 | void Print(Option_t* option="") const; | |
8565b10b | 211 | protected: |
212 | /** | |
213 | * Read the trigger information from the ESD event | |
214 | * | |
215 | * @param esd ESD event | |
216 | * @param triggers On return, contains the trigger bits | |
217 | * | |
218 | * @return @c true on success, @c false otherwise | |
219 | */ | |
220 | Bool_t ReadTriggers(const AliESDEvent* esd, UInt_t& triggers); | |
221 | /** | |
222 | * Read the vertex information from the ESD event | |
223 | * | |
224 | * @param esd ESD event | |
225 | * @param vz On return, the vertex Z position | |
226 | * | |
227 | * @return @c true on success, @c false otherwise | |
228 | */ | |
229 | Bool_t ReadVertex(const AliESDEvent* esd, Double_t& vz); | |
e1f47419 | 230 | /** |
231 | * Read centrality from event | |
232 | * | |
233 | * @param esd Event | |
234 | * @param cent On return, the centrality or negative if not found | |
235 | * | |
236 | * @return False on error, true otherwise | |
237 | */ | |
e308a636 | 238 | virtual Bool_t ReadCentrality(const AliESDEvent* esd, Double_t& cent, |
239 | UShort_t& qual) const; | |
8565b10b | 240 | |
241 | TH1I* fHEventsTr; //! Histogram of events w/trigger | |
242 | TH1I* fHEventsTrVtx; //! Events w/trigger and vertex | |
243 | TH1I* fHTriggers; //! Triggers | |
0bd4b00f | 244 | TH1I* fHType; //! Type (low/high flux) of event |
fe52e455 | 245 | TH1I* fHWords; //! Trigger words |
5e4d905e | 246 | TH1F* fHCent; //! Centrality |
e308a636 | 247 | TH2F* fHCentVsQual; //! Centrality vs quality |
8565b10b | 248 | Int_t fLowFluxCut; // Low flux cut |
249 | Double_t fMaxVzErr; // Maximum error on v_z | |
250 | TList* fList; //! Histogram container | |
0bd4b00f | 251 | UShort_t fEnergy; // CMS energy (per nucleon pair) [GeV] |
252 | Short_t fField; // L3 magnetic field [kG] | |
fb3430ac | 253 | UShort_t fCollisionSystem; // Collision system |
8565b10b | 254 | Int_t fDebug; // Debug level |
e308a636 | 255 | TAxis* fCentAxis; // Centrality axis used in histograms |
256 | ClassDef(AliFMDEventInspector,3); // Inspect the event | |
8565b10b | 257 | }; |
258 | ||
259 | #endif | |
260 | // Local Variables: | |
261 | // mode: C++ | |
262 | // End: | |
263 | ||
264 | ||
265 |