]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FORWARD/analysis2/AliFMDEventInspector.h
Improved eloss fitting - see NIM B1, 16
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / AliFMDEventInspector.h
CommitLineData
8565b10b 1#ifndef ALIROOT_PWG2_FORWARD_ANALYSIS2_ALIFMDEVENTINSPECTOR_H
2#define ALIROOT_PWG2_FORWARD_ANALYSIS2_ALIFMDEVENTINSPECTOR_H
3#include <TNamed.h>
4class AliESDEvent;
5class TH2D;
6class TH1D;
7class TH1I;
8class TAxis;
9class TList;
10
11/**
12 * This class inspects the event
13 *
14 * @par Input:
15 * - AliESDFMD object possibly corrected for sharing
16 *
17 * @par Output:
18 * - A histogram of v_z of events with triggers.
19 * - A histogram of v_z of events with vertex and triggers
20 * - A histogram of trigger counters
21 *
22 * Note, that these are added to the master output list
23 *
24 * @par Corrections used:
25 * - None
26 *
27 * @ingroup pwg2_forward_analysis
28 */
29class AliFMDEventInspector : public TNamed
30{
31public:
32 /**
33 * Return codes
34 */
35 enum ECodes {
36 /** all ok */
37 kOk = 0,
38 /** No ESD event */
39 kNoEvent = 0x1,
40 /** No triggers found */
41 kNoTriggers = 0x2,
42 /** No SPD data */
43 kNoSPD = 0x4,
44 /** No FMD data */
45 kNoFMD = 0x8,
46 /** No vertex found */
47 kNoVertex = 0x10,
48 /** Vertex out of range */
49 kBadVertex = 0x20
50 };
51 /**
52 * Trigger bins
53 */
54 enum ETrgBins {
55 kInel,
56 kInelGt0,
57 kNSD,
58 kEmpty,
59 kA,
60 kB,
61 kC,
62 kE
63 };
64 /**
65 * Constructor
66 */
67 AliFMDEventInspector();
68 /**
69 * Constructor
70 *
71 * @param name Name of object
72 */
73 AliFMDEventInspector(const char* name);
74 /**
75 * Copy constructor
76 *
77 * @param o Object to copy from
78 */
79 AliFMDEventInspector(const AliFMDEventInspector& o);
80 /**
81 * Destructor
82 */
83 virtual ~AliFMDEventInspector();
84 /**
85 * Assignement operator
86 *
87 * @param o Object to assign from
88 *
89 * @return Reference to this object
90 */
91 AliFMDEventInspector& operator=(const AliFMDEventInspector&);
92
93 /**
94 * Initialize the object
95 *
96 * @param vtxAxis Vertex axis in use
97 */
98 void Init(const TAxis& vtxAxis);
99 /**
100 * Process the event
101 *
102 * @param event Input event
103 * @param triggers On return, the triggers fired
104 * @param lowFlux On return, true if the event is considered a low-flux
105 * event (according to the setting of fLowFluxCut)
106 * @param ivz On return, the found vertex bin (zero-based)
c389303e 107 * @param vz On return, the z position of the interaction
8565b10b 108 *
109 * @return 0 (or kOk) on success, otherwise a bit mask of error codes
110 */
111 UInt_t Process(const AliESDEvent* event,
112 UInt_t& triggers,
113 Bool_t& lowFlux,
114 Int_t& ivz,
115 Double_t& vz);
116 /**
117 * Define the output histograms. These are put in a sub list of the
118 * passed list. The histograms are merged before the parent task calls
119 * AliAnalysisTaskSE::Terminate
120 *
121 * @param dir Directory to add to
122 */
123 void DefineOutput(TList* dir);
124 /**
125 * Set the number of SPD tracklets for which we consider the event a
126 * low-flux event or not .
127 *
128 * @param c Cut (default 1000)
129 */
130 void SetLowFluxCut(Int_t c) { fLowFluxCut = c; }
131 /**
132 * Set the maximum error on @f$ v_z@f$
133 *
134 * @param c Maximum error (in centimeters)
135 */
136 void SetMaxVzErr(Double_t c=0.1) { fMaxVzErr = c; }
137 /**
138 * Set the debug level. The higher the value the more output
139 *
140 * @param dbg Debug level
141 */
142 void SetDebug(Int_t dbg=1) { fDebug = dbg; }
143 /**
144 * Fetch our histograms from the passed list
145 *
146 * @param d Input
147 * @param hEventsTr On return, pointer to histogram, or null
148 * @param hEventsTrVtx On return, pointer to histogram, or null
149 * @param hTriggers On return, pointer to histogram, or null
150 *
151 * @return true on success, false otherwise
152 */
153 Bool_t FetchHistograms(TList* d,
154 TH1I*& hEventsTr,
155 TH1I*& hEventsTrVtx,
156 TH1I*& hTriggers) const;
157protected:
158 /**
159 * Read the trigger information from the ESD event
160 *
161 * @param esd ESD event
162 * @param triggers On return, contains the trigger bits
163 *
164 * @return @c true on success, @c false otherwise
165 */
166 Bool_t ReadTriggers(const AliESDEvent* esd, UInt_t& triggers);
167 /**
168 * Read the vertex information from the ESD event
169 *
170 * @param esd ESD event
171 * @param vz On return, the vertex Z position
172 *
173 * @return @c true on success, @c false otherwise
174 */
175 Bool_t ReadVertex(const AliESDEvent* esd, Double_t& vz);
176
177 TH1I* fHEventsTr; //! Histogram of events w/trigger
178 TH1I* fHEventsTrVtx; //! Events w/trigger and vertex
179 TH1I* fHTriggers; //! Triggers
180 Int_t fLowFluxCut; // Low flux cut
181 Double_t fMaxVzErr; // Maximum error on v_z
182 TList* fList; //! Histogram container
183 Int_t fDebug; // Debug level
184 ClassDef(AliFMDEventInspector,1); // Inspect the event
185};
186
187#endif
188// Local Variables:
189// mode: C++
190// End:
191
192
193