]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FORWARD/analysis2/AliFMDEventInspector.h
Fix Coverity
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / AliFMDEventInspector.h
CommitLineData
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 18class AliESDEvent;
19class TH2D;
20class TH1D;
21class TH1I;
5e4d905e 22class TH1F;
e308a636 23class TH2F;
8565b10b 24class TAxis;
25class 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 */
46class AliFMDEventInspector : public TNamed
47{
48public:
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; }
31554871 177 /**
178 * Use the first physics vtx code.
179 *
180 * @param use Use it or not
181 */
182 void SetUseV0AndForNSD(Bool_t use) {fUseV0AND = use; }
8565b10b 183 /**
184 * Set the debug level. The higher the value the more output
185 *
186 * @param dbg Debug level
187 */
188 void SetDebug(Int_t dbg=1) { fDebug = dbg; }
189 /**
190 * Fetch our histograms from the passed list
191 *
192 * @param d Input
193 * @param hEventsTr On return, pointer to histogram, or null
194 * @param hEventsTrVtx On return, pointer to histogram, or null
195 * @param hTriggers On return, pointer to histogram, or null
196 *
197 * @return true on success, false otherwise
198 */
fb3430ac 199 Bool_t FetchHistograms(const TList* d,
8565b10b 200 TH1I*& hEventsTr,
201 TH1I*& hEventsTrVtx,
202 TH1I*& hTriggers) const;
0bd4b00f 203 /**
204 * Read the collision system, collision energy, and L3 field setting
205 * from the ESD
206 *
207 * @param esd ESD to get information from
208 *
209 * @return true on success, false
210 */
211 Bool_t ReadRunDetails(const AliESDEvent* esd);
212 /**
213 * Get the collision system (one of the value in ECollisionSystem)
214 *
215 * @return Collision system
216 */
217 UShort_t GetCollisionSystem() const { return fCollisionSystem; }
218 /**
219 * Get the center of mass energy (per nucleon pair) in GeV
220 *
221 * @return center of mass energy (per nucleon pair) in GeV
222 */
223 UShort_t GetEnergy() const { return fEnergy; }
224 /**
225 * Get the magnetic field setting of the L3 magnet in kilo Gauss.
226 *
227 * @return The magnetic field setting
228 */
229 Short_t GetField() const { return fField; }
230 /**
231 * Print information
232 *
233 * @param option Not used
234 */
235 void Print(Option_t* option="") const;
f7cfc454 236 /**
237 * Store information about running conditions in output list
238 *
239 * 3 TNamed objects are defined. The names are fixed, but the
240 * title is a string representation of the information, and the
241 * unique ID contains the identifier
242 *
243 * - sys Contains the collision system string and identifier.
244 * - sNN Contains the center-of-mass energy per nucleon (GeV)
245 * - field Contains the L3 magnetic field (kG)
9b2f2e39 246 * - run Contains the run number
f7cfc454 247 *
9b2f2e39 248 * @param runNo Run number - read off from ESD event
f7cfc454 249 */
9b2f2e39 250 virtual void StoreInformation(Int_t runNo);
8565b10b 251protected:
252 /**
253 * Read the trigger information from the ESD event
254 *
255 * @param esd ESD event
256 * @param triggers On return, contains the trigger bits
5bb5d1f6 257 * @param nClusters On return, number of SPD clusters in @f$ |\eta|<1@f$
8565b10b 258 *
259 * @return @c true on success, @c false otherwise
260 */
5bb5d1f6 261 Bool_t ReadTriggers(const AliESDEvent* esd, UInt_t& triggers,
262 UShort_t& nClusters);
8565b10b 263 /**
264 * Read the vertex information from the ESD event
265 *
266 * @param esd ESD event
267 * @param vz On return, the vertex Z position
268 *
269 * @return @c true on success, @c false otherwise
270 */
96110c91 271 Bool_t ReadVertex(const AliESDEvent* esd, Double_t& vz, Double_t& vx, Double_t& vy);
e1f47419 272 /**
273 * Read centrality from event
274 *
275 * @param esd Event
276 * @param cent On return, the centrality or negative if not found
ffca499d 277 * @param qual On return, centrality quality flag
e1f47419 278 *
279 * @return False on error, true otherwise
280 */
e308a636 281 virtual Bool_t ReadCentrality(const AliESDEvent* esd, Double_t& cent,
282 UShort_t& qual) const;
8565b10b 283
284 TH1I* fHEventsTr; //! Histogram of events w/trigger
285 TH1I* fHEventsTrVtx; //! Events w/trigger and vertex
5bb5d1f6 286 TH1I* fHEventsAccepted; //! Events w/trigger and vertex in range
96110c91 287 TH2D* fHEventsAcceptedXY; //! XY vtx with trigger and Z vertex in range
8565b10b 288 TH1I* fHTriggers; //! Triggers
0bd4b00f 289 TH1I* fHType; //! Type (low/high flux) of event
fe52e455 290 TH1I* fHWords; //! Trigger words
5e4d905e 291 TH1F* fHCent; //! Centrality
e308a636 292 TH2F* fHCentVsQual; //! Centrality vs quality
8565b10b 293 Int_t fLowFluxCut; // Low flux cut
294 Double_t fMaxVzErr; // Maximum error on v_z
295 TList* fList; //! Histogram container
0bd4b00f 296 UShort_t fEnergy; // CMS energy (per nucleon pair) [GeV]
297 Short_t fField; // L3 magnetic field [kG]
fb3430ac 298 UShort_t fCollisionSystem; // Collision system
8565b10b 299 Int_t fDebug; // Debug level
e308a636 300 TAxis* fCentAxis; // Centrality axis used in histograms
31554871 301 TAxis fVtxAxis; //Vtx Axis
e83d0620 302 Bool_t fUseFirstPhysicsVertex; //Use the vtx code from p+p first physics
31554871 303 Bool_t fUseV0AND; //Use the vtx code from p+p first physics
e308a636 304 ClassDef(AliFMDEventInspector,3); // Inspect the event
8565b10b 305};
306
307#endif
308// Local Variables:
309// mode: C++
310// End:
311
312
313