2 // This class inspects the event
4 #ifndef ALIFMDEVENTINSPECTOR_H
5 #define ALIFMDEVENTINSPECTOR_H
7 * @file AliFMDEventInspector.h
8 * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
9 * @date Wed Mar 23 14:02:48 2011
14 * @ingroup pwglf_forward_aod
28 * This class inspects the event
31 * - AliESDFMD object possibly corrected for sharing
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
38 * Note, that these are added to the master output list
40 * @par Corrections used:
43 * @ingroup pwglf_forward_algo
44 * @ingroup pwglf_forward_aod
46 class AliFMDEventInspector : public TNamed
57 /** No triggers found */
63 /** No vertex found */
65 /** Vertex out of range */
88 enum ECollisionSystem {
96 AliFMDEventInspector();
100 * @param name Name of object
102 AliFMDEventInspector(const char* name);
106 * @param o Object to copy from
108 AliFMDEventInspector(const AliFMDEventInspector& o);
112 virtual ~AliFMDEventInspector();
114 * Assignement operator
116 * @param o Object to assign from
118 * @return Reference to this object
120 AliFMDEventInspector& operator=(const AliFMDEventInspector&);
123 * Initialize the object
125 * @param vtxAxis Vertex axis in use
127 virtual void Init(const TAxis& vtxAxis);
131 * @param event Input event
132 * @param triggers On return, the triggers fired
133 * @param lowFlux On return, true if the event is considered a low-flux
134 * event (according to the setting of fLowFluxCut)
135 * @param ivz On return, the found vertex bin (1-based). A zero
136 * means outside of the defined vertex range
137 * @param vz On return, the z position of the interaction
138 * @param cent On return, the centrality (in percent) or < 0
140 * @param nClusters On return, number of SPD clusters in @f$ |\eta|<1@f$
142 * @return 0 (or kOk) on success, otherwise a bit mask of error codes
144 UInt_t Process(const AliESDEvent* event,
150 UShort_t& nClusters);
152 * Define the output histograms. These are put in a sub list of the
153 * passed list. The histograms are merged before the parent task calls
154 * AliAnalysisTaskSE::Terminate
156 * @param dir Directory to add to
158 void DefineOutput(TList* dir);
160 * Set the number of SPD tracklets for which we consider the event a
161 * low-flux event or not .
163 * @param c Cut (default 1000)
165 void SetLowFluxCut(Int_t c) { fLowFluxCut = c; }
167 * Set the maximum error on @f$ v_z@f$
169 * @param c Maximum error (in centimeters)
171 void SetMaxVzErr(Double_t c=0.1) { fMaxVzErr = c; }
173 * Use the first physics vtx code.
175 * @param use Use it or not
177 void SetUseFirstPhysicsVtx(Bool_t use) {fUseFirstPhysicsVertex = use; }
179 * Use the first physics vtx code.
181 * @param use Use it or not
183 void SetUseV0AndForNSD(Bool_t use=true) {fUseV0AND = use; }
185 * Set the minimum number of contributors for a 2nd pile-up vertex
187 * @param nContrib Least number of contributors
189 void SetMinPileupContributors(UShort_t nContrib=3)
191 fMinPileupContrib = nContrib;
194 * Set minimum distance from primary vertex to 2nd pile-up vertex
196 * @param cm Distance (in centimeters)
198 void SetMinPileupDistance(Double_t cm=0.8)
200 fMinPileupDistance = cm;
203 * Set the debug level. The higher the value the more output
205 * @param dbg Debug level
207 void SetDebug(Int_t dbg=1) { fDebug = dbg; }
209 * Fetch our histograms from the passed list
212 * @param hEventsTr On return, pointer to histogram, or null
213 * @param hEventsTrVtx On return, pointer to histogram, or null
214 * @param hTriggers On return, pointer to histogram, or null
216 * @return true on success, false otherwise
218 Bool_t FetchHistograms(const TList* d,
221 TH1I*& hTriggers) const;
223 * Read the collision system, collision energy, and L3 field setting
226 * @param esd ESD to get information from
228 * @return true on success, false
230 Bool_t ReadRunDetails(const AliESDEvent* esd);
232 * Get the collision system (one of the value in ECollisionSystem)
234 * @return Collision system
236 UShort_t GetCollisionSystem() const { return fCollisionSystem; }
238 * Get the center of mass energy (per nucleon pair) in GeV
240 * @return center of mass energy (per nucleon pair) in GeV
242 UShort_t GetEnergy() const { return fEnergy; }
244 * Get the magnetic field setting of the L3 magnet in kilo Gauss.
246 * @return The magnetic field setting
248 Short_t GetField() const { return fField; }
252 * @param option Not used
254 void Print(Option_t* option="") const;
256 * Store information about running conditions in output list
258 * 3 TNamed objects are defined. The names are fixed, but the
259 * title is a string representation of the information, and the
260 * unique ID contains the identifier
262 * - sys Contains the collision system string and identifier.
263 * - sNN Contains the center-of-mass energy per nucleon (GeV)
264 * - field Contains the L3 magnetic field (kG)
265 * - run Contains the run number
267 * @param runNo Run number - read off from ESD event
269 virtual void StoreInformation(Int_t runNo);
272 * Read the trigger information from the ESD event
274 * @param esd ESD event
275 * @param triggers On return, contains the trigger bits
276 * @param nClusters On return, number of SPD clusters in @f$ |\eta|<1@f$
278 * @return @c true on success, @c false otherwise
280 Bool_t ReadTriggers(const AliESDEvent* esd, UInt_t& triggers,
281 UShort_t& nClusters);
283 * Read the vertex information from the ESD event
285 * @param esd ESD event
286 * @param vz On return, the vertex Z position
288 * @return @c true on success, @c false otherwise
290 Bool_t ReadVertex(const AliESDEvent* esd, Double_t& vz, Double_t& vx, Double_t& vy);
292 * Read centrality from event
295 * @param cent On return, the centrality or negative if not found
296 * @param qual On return, centrality quality flag
298 * @return False on error, true otherwise
300 virtual Bool_t ReadCentrality(const AliESDEvent* esd, Double_t& cent,
301 UShort_t& qual) const;
303 TH1I* fHEventsTr; //! Histogram of events w/trigger
304 TH1I* fHEventsTrVtx; //! Events w/trigger and vertex
305 TH1I* fHEventsAccepted; //! Events w/trigger and vertex in range
306 TH2D* fHEventsAcceptedXY; //! XY vtx with trigger and Z vertex in range
307 TH1I* fHTriggers; //! Triggers
308 TH1I* fHType; //! Type (low/high flux) of event
309 TH1I* fHWords; //! Trigger words
310 TH1F* fHCent; //! Centrality
311 TH2F* fHCentVsQual; //! Centrality vs quality
312 Int_t fLowFluxCut; // Low flux cut
313 Double_t fMaxVzErr; // Maximum error on v_z
314 TList* fList; //! Histogram container
315 UShort_t fEnergy; // CMS energy (per nucleon pair) [GeV]
316 Short_t fField; // L3 magnetic field [kG]
317 UShort_t fCollisionSystem; // Collision system
318 Int_t fDebug; // Debug level
319 TAxis* fCentAxis; // Centrality axis used in histograms
320 TAxis fVtxAxis; //Vtx Axis
321 Bool_t fUseFirstPhysicsVertex; //Use the vtx code from p+p first physics
322 Bool_t fUseV0AND; //Use the vtx code from p+p first physics
323 UShort_t fMinPileupContrib; // Minimum number of contributors to 2nd
325 Double_t fMinPileupDistance; // Minimum distance of 2nd pile-up
327 ClassDef(AliFMDEventInspector,4); // Inspect the event