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
19 #include "AliDisplacedVertexSelection.h"
21 class AliOADBPhysicsSelection;
32 * This class inspects the event
35 * - AliESDFMD object possibly corrected for sharing
38 * - A histogram of v_z of events with triggers.
39 * - A histogram of v_z of events with vertex and triggers
40 * - A histogram of trigger counters
42 * Note, that these are added to the master output list
44 * @par Corrections used:
47 * @ingroup pwglf_forward_algo
48 * @ingroup pwglf_forward_aod
50 class AliFMDEventInspector : public TNamed
59 /** No ESD event - bin 2 */
61 /** No triggers found - bin 3 */
63 /** No SPD data - bin 4 */
65 /** No FMD data - bin 5 */
67 /** No vertex found - bin 6 */
69 /** Vertex out of range - bin 7 */
92 enum ECollisionSystem {
100 AliFMDEventInspector();
104 * @param name Name of object
106 AliFMDEventInspector(const char* name);
110 * @param o Object to copy from
112 AliFMDEventInspector(const AliFMDEventInspector& o);
116 virtual ~AliFMDEventInspector();
118 * Assignement operator
120 * @param o Object to assign from
122 * @return Reference to this object
124 AliFMDEventInspector& operator=(const AliFMDEventInspector&);
127 * Initialize the object
129 * @param vtxAxis Vertex axis in use
131 virtual void Init(const TAxis& vtxAxis);
135 * @param event Input event
136 * @param triggers On return, the triggers fired
137 * @param lowFlux On return, true if the event is considered a low-flux
138 * event (according to the setting of fLowFluxCut)
139 * @param ivz On return, the found vertex bin (1-based). A zero
140 * means outside of the defined vertex range
141 * @param vz On return, the z position of the interaction
142 * @param cent On return, the centrality (in percent) or < 0
144 * @param nClusters On return, number of SPD clusters in @f$ |\eta|<1@f$
146 * @return 0 (or kOk) on success, otherwise a bit mask of error codes
148 UInt_t Process(const AliESDEvent* event,
154 UShort_t& nClusters);
156 * Define the output histograms. These are put in a sub list of the
157 * passed list. The histograms are merged before the parent task calls
158 * AliAnalysisTaskSE::Terminate
160 * @param dir Directory to add to
162 void DefineOutput(TList* dir);
164 * Set the number of SPD tracklets for which we consider the event a
165 * low-flux event or not .
167 * @param c Cut (default 1000)
169 void SetLowFluxCut(Int_t c) { fLowFluxCut = c; }
171 * Set the maximum error on @f$ v_z@f$
173 * @param c Maximum error (in centimeters)
175 void SetMaxVzErr(Double_t c=0.1) { fMaxVzErr = c; }
177 * Use the first physics vtx code.
179 * @param use Use it or not
181 void SetUseFirstPhysicsVtx(Bool_t use) {fUseFirstPhysicsVertex = use; }
183 * Use the first physics vtx code.
185 * @param use Use it or not
187 void SetUseV0AndForNSD(Bool_t use=true) {fUseV0AND = use; }
189 * Set the minimum number of contributors for a 2nd pile-up vertex
191 * @param nContrib Least number of contributors
193 void SetMinPileupContributors(UShort_t nContrib=3)
195 fMinPileupContrib = nContrib;
198 * Set minimum distance from primary vertex to 2nd pile-up vertex
200 * @param cm Distance (in centimeters)
202 void SetMinPileupDistance(Double_t cm=0.8)
204 fMinPileupDistance = cm;
207 * Enable selection of displaced vertices.
209 * @param use whether to use
211 void SetUseDisplacedVertices(Bool_t use=true)
213 fUseDisplacedVertices = use;
217 * Set the debug level. The higher the value the more output
219 * @param dbg Debug level
221 void SetDebug(Int_t dbg=1) { fDebug = dbg; }
223 * Fetch our histograms from the passed list
226 * @param hEventsTr On return, pointer to histogram, or null
227 * @param hEventsTrVtx On return, pointer to histogram, or null
228 * @param hTriggers On return, pointer to histogram, or null
230 * @return true on success, false otherwise
232 Bool_t FetchHistograms(const TList* d,
235 TH1I*& hTriggers) const;
237 * Read the collision system, collision energy, and L3 field setting
240 * @param esd ESD to get information from
242 * @return true on success, false
244 Bool_t ReadRunDetails(const AliESDEvent* esd);
246 * Get the collision system (one of the value in ECollisionSystem)
248 * @return Collision system
250 UShort_t GetCollisionSystem() const { return fCollisionSystem; }
252 * Get the center of mass energy (per nucleon pair) in GeV
254 * @return center of mass energy (per nucleon pair) in GeV
256 UShort_t GetEnergy() const { return fEnergy; }
258 * Get the magnetic field setting of the L3 magnet in kilo Gauss.
260 * @return The magnetic field setting
262 Short_t GetField() const { return fField; }
266 * @param option Not used
268 void Print(Option_t* option="") const;
270 * Store information about running conditions in output list
272 * 3 TNamed objects are defined. The names are fixed, but the
273 * title is a string representation of the information, and the
274 * unique ID contains the identifier
276 * - sys Contains the collision system string and identifier.
277 * - sNN Contains the center-of-mass energy per nucleon (GeV)
278 * - field Contains the L3 magnetic field (kG)
279 * - run Contains the run number
281 * @param runNo Run number - read off from ESD event
283 virtual void StoreInformation(Int_t runNo);
285 * Return a string representing the return code
289 * @return String representation
291 static const char* CodeString(UInt_t mask);
294 * Cache the configure trigger classes from the physis selection.
296 * @param cache where to cache the trigger class.
297 * @param classes List of configured classes.
298 * @param o Object from OADB with config
300 void CacheConfiguredTriggerClasses(TList& cache,
301 const TList* classes,
302 AliOADBPhysicsSelection* o);
304 * Read the trigger information from the ESD event
306 * @param esd ESD event
307 * @param triggers On return, contains the trigger bits
308 * @param nClusters On return, number of SPD clusters in @f$ |\eta|<1@f$
310 * @return @c true on success, @c false otherwise
312 Bool_t ReadTriggers(const AliESDEvent& esd, UInt_t& triggers,
313 UShort_t& nClusters);
314 Bool_t CheckpAExtraV0(const AliESDEvent& esd) const;
316 * Check, for the @f$\sqrt{s}=2.76GeV@f$ pp run wether this event
317 * was in the fast partition, and if so, filter it out.
319 * @param fastonly Event was in fast-only partition
321 * @return true if event was in the fast-only partition, for the run
324 virtual Bool_t CheckFastPartition(bool fastonly) const;
326 * Check if we have an NSD trigger for pp runs
329 * @param triggers Trigger mask to be filled
331 * @return true if we have an NSD trigger
333 virtual Bool_t CheckNSD(const AliESDEvent& esd, UInt_t& triggers) const;
335 * Check if we have an INEL>0 trigger
338 * @param nClusters On return, number of clusters
339 * @param triggers Trigger mask to be filled
341 * @return true if we have an INEL>0 trigger
343 virtual Bool_t CheckINELGT0(const AliESDEvent& esd, UShort_t& nClusters,
344 UInt_t& triggers) const;
346 * Check if this is a pile-up event
349 * @param triggers Trigger mask to be filled
351 * @return true if this is a pile-up event
353 virtual Bool_t CheckPileup(const AliESDEvent& esd, UInt_t& triggers) const;
355 * Check if we have a cosmic trigger. These should be filtered out.
357 * @param trigStri Trigger string
359 * @return true if we have a cosmic trigger
361 virtual Bool_t CheckCosmics(const TString& trigStri) const;
363 * Check if the trigger string corresponds to an empty event
365 * @param trigStr Trigger string
366 * @param triggers Trigger mask to be filled
368 * @return true if the trigger string corresponds to an empty event
370 virtual Bool_t CheckEmpty(const TString& trigStr, UInt_t& triggers) const;
372 * Check the trigger words to see if we have a B, A, C, or E event.
375 * @param triggers Trigger mask to be filled
377 * @return always true
379 virtual Bool_t CheckWords(const AliESDEvent& esd, UInt_t& triggers) const;
381 * Read the vertex information from the ESD event
383 * @param esd ESD event
384 * @param vz On return, the vertex Z position
385 * @param vx On return, the vertex X position
386 * @param vy On return, the vertex Y position
388 * @return @c true on success, @c false otherwise
390 Bool_t ReadVertex(const AliESDEvent& esd,
395 * Check the vertex using the method used in PWG-UD. That is
397 * - Check we have a vertex and status is OK
398 * - Check if we have an SPD vertex and that it's status is OK
399 * - Check if the vertex is from the Z-vertexer, and if it is,
400 * - Check that the dispersion and resolution is OK
403 * @param vz On return, the Z coordinate of the IP
404 * @param vx On return, possibly the X coordinate of the IP
405 * @param vy On return, possibly the Y coordinate of the IP
407 * @return true if the vertex was found and met the requirements
409 virtual Bool_t CheckPWGUDVertex(const AliESDEvent& esd,
414 * Check the vertex. That is
416 * - Check if we have an SPD vertex and that it's status is OK
417 * - Check that we have enough contributors
418 * - Check that the reslution is OK
421 * @param vz On return, the Z coordinate of the IP
422 * @param vx On return, possibly the X coordinate of the IP
423 * @param vy On return, possibly the Y coordinate of the IP
425 * @return true if the vertex was found and met the requirements
427 virtual Bool_t CheckVertex(const AliESDEvent& esd,
432 * Read centrality from event
435 * @param cent On return, the centrality or negative if not found
436 * @param qual On return, centrality quality flag
438 * @return False on error, true otherwise
440 Bool_t ReadCentrality(const AliESDEvent& esd, Double_t& cent,
441 UShort_t& qual) const;
443 TH1I* fHEventsTr; //! Histogram of events w/trigger
444 TH1I* fHEventsTrVtx; //! Events w/trigger and vertex
445 TH1I* fHEventsAccepted; //! Events w/trigger and vertex in range
446 TH2D* fHEventsAcceptedXY; //! XY vtx with trigger and Z vertex in range
447 TH1I* fHTriggers; //! Triggers
448 TH2I* fHTriggerCorr; //! Correlation of triggers
449 TH1I* fHType; //! Type (low/high flux) of event
450 TH1I* fHWords; //! Trigger words
451 TH1F* fHCent; //! Centrality
452 TH2F* fHCentVsQual; //! Centrality vs quality
453 TH1I* fHStatus; //! Event processing status
454 Int_t fLowFluxCut; // Low flux cut
455 Double_t fMaxVzErr; // Maximum error on v_z
456 TList* fList; //! Histogram container
457 UShort_t fEnergy; // CMS energy (per nucleon pair) [GeV]
458 Short_t fField; // L3 magnetic field [kG]
459 UShort_t fCollisionSystem; // Collision system
460 Int_t fDebug; // Debug level
461 TAxis* fCentAxis; // Centrality axis used in histograms
462 TAxis fVtxAxis; //Vtx Axis
463 Bool_t fUseFirstPhysicsVertex; //Use the vtx code from p+p first physics
464 Bool_t fUseV0AND; //Use the vtx code from p+p first physics
465 UShort_t fMinPileupContrib; // Minimum number of contributors to 2nd
467 Double_t fMinPileupDistance; // Minimum distance of 2nd pile-up
469 Bool_t fUseDisplacedVertices; //Analyze displaced vertices?
470 AliDisplacedVertexSelection fDisplacedVertex; //Displaced vertex selector
471 TList fCollWords; //! Configured collision words
472 TList fBgWords; //! Configured background words
473 ClassDef(AliFMDEventInspector,5); // Inspect the event