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;
33 * This class inspects the event
36 * - AliESDFMD object possibly corrected for sharing
39 * - A histogram of v_z of events with triggers.
40 * - A histogram of v_z of events with vertex and triggers
41 * - A histogram of trigger counters
43 * Note, that these are added to the master output list
45 * @par Corrections used:
48 * @ingroup pwglf_forward_algo
49 * @ingroup pwglf_forward_aod
51 class AliFMDEventInspector : public TNamed
60 /** No ESD event - bin 2 */
62 /** No triggers found - bin 3 */
64 /** No SPD data - bin 4 */
66 /** No FMD data - bin 5 */
68 /** No vertex found - bin 6 */
70 /** Vertex out of range - bin 7 */
114 enum ECollisionSystem {
145 static const char* fgkFolderName;
149 AliFMDEventInspector();
153 * @param name Name of object
155 AliFMDEventInspector(const char* name);
159 * @param o Object to copy from
161 AliFMDEventInspector(const AliFMDEventInspector& o);
165 virtual ~AliFMDEventInspector();
167 * Assignement operator
169 * @param o Object to assign from
171 * @return Reference to this object
173 AliFMDEventInspector& operator=(const AliFMDEventInspector&);
176 * Initialize the object
178 * @param vtxAxis Vertex axis in use
180 virtual void SetupForData(const TAxis& vtxAxis);
184 * @param event Input event
185 * @param triggers On return, the triggers fired
186 * @param lowFlux On return, true if the event is considered a low-flux
187 * event (according to the setting of fLowFluxCut)
188 * @param ivz On return, the found vertex bin (1-based). A zero
189 * means outside of the defined vertex range
190 * @param ip On return, coordinates of interaction point
191 * @param cent On return, the centrality (in percent) or < 0
193 * @param nClusters On return, number of SPD clusters in @f$ |\eta|<1@f$
195 * @return 0 (or kOk) on success, otherwise a bit mask of error codes
197 UInt_t Process(const AliESDEvent* event,
203 UShort_t& nClusters);
205 * Define the output histograms. These are put in a sub list of the
206 * passed list. The histograms are merged before the parent task calls
207 * AliAnalysisTaskSE::Terminate
209 * @param dir Directory to add to
211 void CreateOutputObjects(TList* dir);
213 * Set the number of SPD tracklets for which we consider the event a
214 * low-flux event or not .
216 * @param c Cut (default 1000)
218 void SetLowFluxCut(Int_t c) { fLowFluxCut = c; }
220 * Set the maximum error on @f$ v_z@f$
222 * @param c Maximum error (in centimeters)
224 void SetMaxVzErr(Double_t c=0.1) { fMaxVzErr = c; }
226 * Use the first physics vtx code.
228 * @param use Use it or not
230 void SetUseFirstPhysicsVtx(Bool_t use) {fUseFirstPhysicsVertex = use; }
232 * Use the first physics vtx code.
234 * @param use Use it or not
236 void SetpA2012Vtx(Bool_t use) {fUsepA2012Vertex= use; }
238 * Use the 2012 pA vtx code.
240 * @param use Use it or not
243 void SetUseV0AndForNSD(Bool_t use=true) {fUseV0AND = use; }
245 * Set the minimum number of contributors for a 2nd pile-up vertex
247 * @param nContrib Least number of contributors
249 void SetMinPileupContributors(UShort_t nContrib=3)
251 fMinPileupContrib = nContrib;
254 * Set minimum distance from primary vertex to 2nd pile-up vertex
256 * @param cm Distance (in centimeters)
258 void SetMinPileupDistance(Double_t cm=0.8)
260 fMinPileupDistance = cm;
263 * Enable selection of displaced vertices.
265 * @param use whether to use
267 void SetUseDisplacedVertices(Bool_t use=true)
269 fUseDisplacedVertices = use;
271 Bool_t IsUseDisplacedVertices() const { return fUseDisplacedVertices; }
273 * Set the lower centrality cut - if negative, do not use
275 * @deprecated We should accept all events in the AOD pass
277 * @param mincent Lower cut on centrality
279 void SetMinCentrality(Double_t mincent=-1.0);
281 * Set the upper centrality cut - if negative, do not use
283 * @deprecated We should accept all events in the AOD pass
285 * @param mincent Upper cut on centrality
287 void SetMaxCentrality(Double_t maxcent=-1.0);
289 * Set the centrality method to use. Possible values are
291 * - VOM - VZERO multiplicity
292 * - V0A - VZERO amplitude
293 * - V0C - VZERO charge
294 * - FMD - FMD scaled energy loss
295 * - TRK - Number of tracks
296 * - TKL - Number of tracks
300 * - NPA - Neutral particles
301 * - ZNA - ZDC neutron amplitude
302 * - V0MvsFMD - VZERO versus FMD
303 * - TKLvsVOM - Tracks versus VZERO
308 void SetCentralityMethod(const TString& m) { fCentMethod = m; }
310 * Set the centrality method
312 * @param m Method identifier
314 void SetCentralityMethod(ECentMethod m);
316 * Set the debug level. The higher the value the more output
318 * @param dbg Debug level
320 void SetDebug(Int_t dbg=1) { fDebug = dbg; }
322 * Fetch our histograms from the passed list
325 * @param hEventsTr On return, pointer to histogram, or null
326 * @param hEventsTrVtx On return, pointer to histogram, or null
327 * @param hEventsAcc On return, pointer to histogram, or null
328 * @param hTriggers On return, pointer to histogram, or null
330 * @return true on success, false otherwise
332 Bool_t FetchHistograms(const TList* d,
336 TH1I*& hTriggers) const;
338 * Read the collision system, collision energy, and L3 field setting
341 * @param esd ESD to get information from
343 * @return true on success, false
345 Bool_t ReadRunDetails(const AliESDEvent* esd);
347 * Get the collision system (one of the value in ECollisionSystem)
349 * @return Collision system
351 UShort_t GetCollisionSystem() const { return fCollisionSystem; }
353 * Get the center of mass energy (per nucleon pair) in GeV
355 * @return center of mass energy (per nucleon pair) in GeV
357 UShort_t GetEnergy() const { return fEnergy; }
359 * Get the magnetic field setting of the L3 magnet in kilo Gauss.
361 * @return The magnetic field setting
363 Short_t GetField() const { return fField; }
365 * Get the current run number
367 * @return The current run number
369 ULong_t GetRunNumber() const { return fRunNumber; }
373 * @param option Not used
375 void Print(Option_t* option="") const;
376 // getter for fmincentrality
377 // Double_t GetMinCentrality() const { return fMinCent;}
378 // gettter for fmaxcentrality
379 // Double_t GetMaxCentrality() const { return fMaxCent;}
381 * Store information about running conditions in output list
383 * 3 TNamed objects are defined. The names are fixed, but the
384 * title is a string representation of the information, and the
385 * unique ID contains the identifier
387 * - sys Contains the collision system string and identifier.
388 * - sNN Contains the center-of-mass energy per nucleon (GeV)
389 * - field Contains the L3 magnetic field (kG)
390 * - run Contains the run number
393 virtual void StoreInformation();
395 * Return a string representing the return code
399 * @return String representation
401 static const char* CodeString(UInt_t mask);
404 * Cache the configure trigger classes from the physis selection.
406 * @param cache where to cache the trigger class.
407 * @param classes List of configured classes.
408 * @param o Object from OADB with config
410 void CacheConfiguredTriggerClasses(TList& cache,
411 const TList* classes,
412 AliOADBPhysicsSelection* o);
414 * Read the trigger information from the ESD event
416 * @param esd ESD event
417 * @param triggers On return, contains the trigger bits
418 * @param nClusters On return, number of SPD clusters in @f$ |\eta|<1@f$
420 * @return @c true on success, @c false otherwise
422 Bool_t ReadTriggers(const AliESDEvent& esd, UInt_t& triggers,
423 UShort_t& nClusters);
425 * Possible extra check for p-Pb from 2012/13 - require V0AND.
427 * @param esd Event structure
429 * @return true on success
431 Bool_t CheckpAExtraV0(const AliESDEvent& esd) const;
433 * Check, for the @f$\sqrt{s}=2.76GeV@f$ pp run wether this event
434 * was in the fast partition, and if so, filter it out.
436 * @param fastonly Event was in fast-only partition
438 * @return true if event was in the fast-only partition, for the run
441 virtual Bool_t CheckFastPartition(bool fastonly) const;
443 * Check if we have an NSD trigger for pp runs
446 * @param triggers Trigger mask to be filled
448 * @return true if we have an NSD trigger
450 virtual Bool_t CheckNSD(const AliESDEvent& esd, UInt_t& triggers) const;
452 * Check if we have an INEL>0 trigger
455 * @param nClusters On return, number of clusters
456 * @param triggers Trigger mask to be filled
458 * @return true if we have an INEL>0 trigger
460 virtual Bool_t CheckINELGT0(const AliESDEvent& esd, UShort_t& nClusters,
461 UInt_t& triggers) const;
463 * Check if this is a pile-up event
466 * @param triggers Trigger mask to be filled
468 * @return true if this is a pile-up event
470 virtual Bool_t CheckPileup(const AliESDEvent& esd, UInt_t& triggers) const;
472 * Check if we have a cosmic trigger. These should be filtered out.
474 * @param trigStri Trigger string
476 * @return true if we have a cosmic trigger
478 virtual Bool_t CheckCosmics(const TString& trigStri) const;
480 * Check if the trigger string corresponds to an empty event
482 * @param trigStr Trigger string
483 * @param triggers Trigger mask to be filled
485 * @return true if the trigger string corresponds to an empty event
487 virtual Bool_t CheckEmpty(const TString& trigStr, UInt_t& triggers) const;
489 * Check the trigger words to see if we have a B, A, C, or E event.
492 * @param triggers Trigger mask to be filled
494 * @return always true
496 virtual Bool_t CheckWords(const AliESDEvent& esd, UInt_t& triggers) const;
498 * Read the vertex information from the ESD event
500 * @param esd ESD event
501 * @param ip On return, the coordinates of the IP
503 * @return @c true on success, @c false otherwise
505 Bool_t ReadVertex(const AliESDEvent& esd, TVector3& ip);
507 * Check the vertex using the method used in PWG-UD. That is
509 * - Check we have a vertex and status is OK
510 * - Check if we have an SPD vertex and that it's status is OK
511 * - Check if the vertex is from the Z-vertexer, and if it is,
512 * - Check that the dispersion and resolution is OK
515 * @param ip On return, the coordinates of the IP
519 virtual EVtxStatus CheckPWGUDVertex(const AliESDEvent& esd,
522 * Check the vertex. That is
524 * - Check if we have an SPD vertex and that it's status is OK
525 * - Check that we have enough contributors
526 * - Check that the reslution is OK
529 * @param ip On return, the coordinates of the IP
533 virtual EVtxStatus CheckpA2012Vertex(const AliESDEvent& esd,
536 * Check the vertex for pA 2012 settings. That is
540 * @param ip On return, the coordinates of the IP
542 * @return true if the vertex was found and met the requirements
548 virtual EVtxStatus CheckVertex(const AliESDEvent& esd, TVector3& ip) const;
550 * Read centrality from event
553 * @param cent On return, the centrality or negative if not found
554 * @param qual On return, centrality quality flag
556 * @return False on error, true otherwise
558 virtual Bool_t ReadCentrality(const AliESDEvent& esd, Double_t& cent,
559 UShort_t& qual) const;
561 TH1I* fHEventsTr; //! Histogram of events w/trigger
562 TH1I* fHEventsTrVtx; //! Events w/trigger and vertex
563 TH1I* fHEventsAccepted; //! Events w/trigger and vertex in range
564 TH2D* fHEventsAcceptedXY; //! XY vtx with trigger and Z vertex in range
565 TH1I* fHTriggers; //! Triggers
566 TH2I* fHTriggerCorr; //! Correlation of triggers
567 TH1I* fHType; //! Type (low/high flux) of event
568 TH1I* fHWords; //! Trigger words
569 TH1F* fHCent; //! Centrality
570 TH2F* fHCentVsQual; //! Centrality vs quality
571 TH1I* fHStatus; //! Event processing status
572 TH1I* fHVtxStatus; //! Vertex processing status
573 TH1I* fHTrgStatus; //! Trigger processing status
574 Int_t fLowFluxCut; // Low flux cut
575 Double_t fMaxVzErr; // Maximum error on v_z
576 TList* fList; //! Histogram container
577 UShort_t fEnergy; // CMS energy (per nucleon pair) [GeV]
578 Short_t fField; // L3 magnetic field [kG]
579 UShort_t fCollisionSystem; // Collision system
580 Int_t fDebug; // Debug level
581 TAxis* fCentAxis; // Centrality axis used in histograms
582 TAxis fVtxAxis; //Vtx Axis
583 Bool_t fUseFirstPhysicsVertex; //Use the vtx code from p+p first physics
584 Bool_t fUseV0AND; //Use the vtx code from p+p first physics
585 UShort_t fMinPileupContrib; // Minimum number of contributors to 2nd
587 Double_t fMinPileupDistance; // Minimum distance of 2nd pile-up
589 Bool_t fUseDisplacedVertices; //Analyze displaced vertices?
590 AliDisplacedVertexSelection fDisplacedVertex; //Displaced vertex selector
591 TList fCollWords; //! Configured collision words
592 TList fBgWords; //! Configured background words
594 Double_t fMinCent; //min centrality
595 Double_t fMaxCent; //max centrailty
596 Bool_t fUsepA2012Vertex;// flag to use pA2012 Veretx selection
597 ULong_t fRunNumber; // Current run number
599 ClassDef(AliFMDEventInspector,9); // Inspect the event