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