2 // This class inspects the event
4 #ifndef ALIFMDEVENTINSPECTOR_H
5 #define ALIFMDEVENTINSPECTOR_H
15 * This class inspects the event
18 * - AliESDFMD object possibly corrected for sharing
21 * - A histogram of v_z of events with triggers.
22 * - A histogram of v_z of events with vertex and triggers
23 * - A histogram of trigger counters
25 * Note, that these are added to the master output list
27 * @par Corrections used:
30 * @ingroup pwg2_forward_algo
32 class AliFMDEventInspector : public TNamed
43 /** No triggers found */
49 /** No vertex found */
51 /** Vertex out of range */
70 enum ECollisionSystem {
78 AliFMDEventInspector();
82 * @param name Name of object
84 AliFMDEventInspector(const char* name);
88 * @param o Object to copy from
90 AliFMDEventInspector(const AliFMDEventInspector& o);
94 virtual ~AliFMDEventInspector();
96 * Assignement operator
98 * @param o Object to assign from
100 * @return Reference to this object
102 AliFMDEventInspector& operator=(const AliFMDEventInspector&);
105 * Initialize the object
107 * @param vtxAxis Vertex axis in use
109 void Init(const TAxis& vtxAxis);
113 * @param event Input event
114 * @param triggers On return, the triggers fired
115 * @param lowFlux On return, true if the event is considered a low-flux
116 * event (according to the setting of fLowFluxCut)
117 * @param ivz On return, the found vertex bin (1-based). A zero
118 * means outside of the defined vertex range
119 * @param vz On return, the z position of the interaction
121 * @return 0 (or kOk) on success, otherwise a bit mask of error codes
123 UInt_t Process(const AliESDEvent* event,
129 * Define the output histograms. These are put in a sub list of the
130 * passed list. The histograms are merged before the parent task calls
131 * AliAnalysisTaskSE::Terminate
133 * @param dir Directory to add to
135 void DefineOutput(TList* dir);
137 * Set the number of SPD tracklets for which we consider the event a
138 * low-flux event or not .
140 * @param c Cut (default 1000)
142 void SetLowFluxCut(Int_t c) { fLowFluxCut = c; }
144 * Set the maximum error on @f$ v_z@f$
146 * @param c Maximum error (in centimeters)
148 void SetMaxVzErr(Double_t c=0.1) { fMaxVzErr = c; }
150 * Set the debug level. The higher the value the more output
152 * @param dbg Debug level
154 void SetDebug(Int_t dbg=1) { fDebug = dbg; }
156 * Fetch our histograms from the passed list
159 * @param hEventsTr On return, pointer to histogram, or null
160 * @param hEventsTrVtx On return, pointer to histogram, or null
161 * @param hTriggers On return, pointer to histogram, or null
163 * @return true on success, false otherwise
165 Bool_t FetchHistograms(TList* d,
168 TH1I*& hTriggers) const;
170 * Read the collision system, collision energy, and L3 field setting
173 * @param esd ESD to get information from
175 * @return true on success, false
177 Bool_t ReadRunDetails(const AliESDEvent* esd);
179 * Get the collision system (one of the value in ECollisionSystem)
181 * @return Collision system
183 UShort_t GetCollisionSystem() const { return fCollisionSystem; }
185 * Get the center of mass energy (per nucleon pair) in GeV
187 * @return center of mass energy (per nucleon pair) in GeV
189 UShort_t GetEnergy() const { return fEnergy; }
191 * Get the magnetic field setting of the L3 magnet in kilo Gauss.
193 * @return The magnetic field setting
195 Short_t GetField() const { return fField; }
199 * @param option Not used
201 void Print(Option_t* option="") const;
204 * Read the trigger information from the ESD event
206 * @param esd ESD event
207 * @param triggers On return, contains the trigger bits
209 * @return @c true on success, @c false otherwise
211 Bool_t ReadTriggers(const AliESDEvent* esd, UInt_t& triggers);
213 * Read the vertex information from the ESD event
215 * @param esd ESD event
216 * @param vz On return, the vertex Z position
218 * @return @c true on success, @c false otherwise
220 Bool_t ReadVertex(const AliESDEvent* esd, Double_t& vz);
222 TH1I* fHEventsTr; //! Histogram of events w/trigger
223 TH1I* fHEventsTrVtx; //! Events w/trigger and vertex
224 TH1I* fHTriggers; //! Triggers
225 TH1I* fHType; //! Type (low/high flux) of event
226 Int_t fLowFluxCut; // Low flux cut
227 Double_t fMaxVzErr; // Maximum error on v_z
228 TList* fList; //! Histogram container
229 UShort_t fEnergy; // CMS energy (per nucleon pair) [GeV]
230 Short_t fField; // L3 magnetic field [kG]
231 UShort_t fCollisionSystem; //
232 Int_t fDebug; // Debug level
233 ClassDef(AliFMDEventInspector,1); // Inspect the event