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