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 virtual ~AliFMDEventInspector();
162 * Initialize the object
164 * @param vtxAxis Vertex axis in use
166 virtual void SetupForData(const TAxis& vtxAxis);
170 * @param event Input event
171 * @param triggers On return, the triggers fired
172 * @param lowFlux On return, true if the event is considered a low-flux
173 * event (according to the setting of fLowFluxCut)
174 * @param ivz On return, the found vertex bin (1-based). A zero
175 * means outside of the defined vertex range
176 * @param ip On return, coordinates of interaction point
177 * @param cent On return, the centrality (in percent) or < 0
179 * @param nClusters On return, number of SPD clusters in @f$ |\eta|<1@f$
181 * @return 0 (or kOk) on success, otherwise a bit mask of error codes
183 UInt_t Process(const AliESDEvent* event,
189 UShort_t& nClusters);
191 * Define the output histograms. These are put in a sub list of the
192 * passed list. The histograms are merged before the parent task calls
193 * AliAnalysisTaskSE::Terminate
195 * @param dir Directory to add to
197 void CreateOutputObjects(TList* dir);
199 * Set the number of SPD tracklets for which we consider the event a
200 * low-flux event or not .
202 * @param c Cut (default 1000)
204 void SetLowFluxCut(Int_t c) { fLowFluxCut = c; }
206 * Set the maximum error on @f$ v_z@f$
208 * @param c Maximum error (in centimeters)
210 void SetMaxVzErr(Double_t c=0.1) { fMaxVzErr = c; }
212 * Use the first physics vtx code.
214 * @param use Use it or not
216 void SetUseFirstPhysicsVtx(Bool_t use) {fUseFirstPhysicsVertex = use; }
218 * Use the first physics vtx code.
220 * @param use Use it or not
222 void SetpA2012Vtx(Bool_t use) {fUsepA2012Vertex= use; }
224 * Use the 2012 pA vtx code.
226 * @param use Use it or not
229 void SetUseV0AndForNSD(Bool_t use=true) {fUseV0AND = use; }
231 * Set the minimum number of contributors for a 2nd pile-up vertex
233 * @param nContrib Least number of contributors
235 void SetMinPileupContributors(UShort_t nContrib=3)
237 fMinPileupContrib = nContrib;
240 * Set minimum distance from primary vertex to 2nd pile-up vertex
242 * @param cm Distance (in centimeters)
244 void SetMinPileupDistance(Double_t cm=0.8)
246 fMinPileupDistance = cm;
249 * Enable selection of displaced vertices.
251 * @param use whether to use
253 void SetUseDisplacedVertices(Bool_t use=true)
255 fUseDisplacedVertices = use;
257 Bool_t IsUseDisplacedVertices() const { return fUseDisplacedVertices; }
259 * Set the lower centrality cut - if negative, do not use
261 * @deprecated We should accept all events in the AOD pass
263 * @param mincent Lower cut on centrality
265 void SetMinCentrality(Double_t mincent=-1.0);
267 * Set the upper centrality cut - if negative, do not use
269 * @deprecated We should accept all events in the AOD pass
271 * @param maxcent Upper cut on centrality
273 void SetMaxCentrality(Double_t maxcent=-1.0);
275 * Set the centrality method to use. Possible values are
277 * - VOM - VZERO multiplicity
278 * - V0A - VZERO amplitude
279 * - V0C - VZERO charge
280 * - FMD - FMD scaled energy loss
281 * - TRK - Number of tracks
282 * - TKL - Number of tracks
286 * - NPA - Neutral particles
287 * - ZNA - ZDC neutron amplitude
288 * - V0MvsFMD - VZERO versus FMD
289 * - TKLvsVOM - Tracks versus VZERO
294 void SetCentralityMethod(const TString& m) { fCentMethod = m; }
296 * Set the centrality method
298 * @param m Method identifier
300 void SetCentralityMethod(ECentMethod m);
302 * Set the debug level. The higher the value the more output
304 * @param dbg Debug level
306 void SetDebug(Int_t dbg=1) { fDebug = dbg; }
308 * Set whether this is MC or not. Needed by energy loss fitter task
309 * that never instantices AliFMDMCEventInspector. In particular, we
310 * need this to make sure we ignore the FAST partition flag in MC
313 * @param isMC If true, assume MC input
315 void SetMC(Bool_t isMC=true) { fMC = isMC; }
317 * Fetch our histograms from the passed list
320 * @param hEventsTr On return, pointer to histogram, or null
321 * @param hEventsTrVtx On return, pointer to histogram, or null
322 * @param hEventsAcc On return, pointer to histogram, or null
323 * @param hTriggers On return, pointer to histogram, or null
325 * @return true on success, false otherwise
327 Bool_t FetchHistograms(const TList* d,
331 TH1I*& hTriggers) const;
333 * Read the collision system, collision energy, and L3 field setting
336 * @param esd ESD to get information from
338 * @return true on success, false
340 Bool_t ReadRunDetails(const AliESDEvent* esd);
342 * Get the collision system (one of the value in ECollisionSystem)
344 * @return Collision system
346 UShort_t GetCollisionSystem() const { return fCollisionSystem; }
348 * Get the center of mass energy (per nucleon pair) in GeV
350 * @return center of mass energy (per nucleon pair) in GeV
352 UShort_t GetEnergy() const { return fEnergy; }
354 * Get the magnetic field setting of the L3 magnet in kilo Gauss.
356 * @return The magnetic field setting
358 Short_t GetField() const { return fField; }
360 * Get the current run number
362 * @return The current run number
364 ULong_t GetRunNumber() const { return fRunNumber; }
366 * Get the production year.
368 * - For real data, this is the year of the data taking
369 * - For MC this is the year the production is anchored to.
371 * @return A two-digit year (post millennium), or -1
373 Short_t GetProductionYear() const { return fProdYear; }
375 * Get the production period.
377 * - For real data, this is the period identifier of the data taking
378 * - For MC data, this is the period identifier the production was
381 * @return Period identifier or null
383 Char_t GetProductionPeriod() const { return fProdLetter; }
385 * Get the AliROOT revision used for this production
387 * @return SVN revision number or -1
389 Short_t GetProductionRevision() const { return fProdSVN; }
391 * Check if the production was an MC production anchored in some
394 * @return true if this (MC) production was anchored
396 Bool_t IsProductionMC() const { return fProdMC; }
401 * @param option Not used
403 void Print(Option_t* option="") const;
404 // getter for fmincentrality
405 // Double_t GetMinCentrality() const { return fMinCent;}
406 // gettter for fmaxcentrality
407 // Double_t GetMaxCentrality() const { return fMaxCent;}
409 * Store information about running conditions in output list
411 * 3 TNamed objects are defined. The names are fixed, but the
412 * title is a string representation of the information, and the
413 * unique ID contains the identifier
415 * - sys Contains the collision system string and identifier.
416 * - sNN Contains the center-of-mass energy per nucleon (GeV)
417 * - field Contains the L3 magnetic field (kG)
418 * - run Contains the run number
421 virtual void StoreInformation();
423 * Store - if possible - production information in a sub-list
426 virtual void StoreProduction();
428 * Return a string representing the return code
432 * @return String representation
434 static const char* CodeString(UInt_t mask);
437 * Copy constructor - not implemented
439 * @param o Object to copy from
441 AliFMDEventInspector(const AliFMDEventInspector& o);
443 * Assignement operator - not implemented
445 * @param o Object to assign from
447 * @return Reference to this object
449 AliFMDEventInspector& operator=(const AliFMDEventInspector& o);
451 * Cache the configure trigger classes from the physis selection.
453 * @param cache where to cache the trigger class.
454 * @param classes List of configured classes.
455 * @param o Object from OADB with config
457 void CacheConfiguredTriggerClasses(TList& cache,
458 const TList* classes,
459 AliOADBPhysicsSelection* o);
461 * Read the trigger information from the ESD event
463 * @param esd ESD event
464 * @param triggers On return, contains the trigger bits
465 * @param nClusters On return, number of SPD clusters in @f$ |\eta|<1@f$
467 * @return @c true on success, @c false otherwise
469 Bool_t ReadTriggers(const AliESDEvent& esd, UInt_t& triggers,
470 UShort_t& nClusters);
472 * Possible extra check for p-Pb from 2012/13 - require V0AND.
474 * @param esd Event structure
476 * @return true on success
478 Bool_t CheckpAExtraV0(const AliESDEvent& esd) const;
480 * Check, for the @f$\sqrt{s}=2.76GeV@f$ pp run wether this event
481 * was in the fast partition, and if so, filter it out.
483 * @param fastonly Event was in fast-only partition
485 * @return true if event was in the fast-only partition, for the run
488 virtual Bool_t CheckFastPartition(bool fastonly) const;
490 * Check if we have an NSD trigger for pp runs
493 * @param triggers Trigger mask to be filled
495 * @return true if we have an NSD trigger
497 virtual Bool_t CheckNSD(const AliESDEvent& esd, UInt_t& triggers) const;
499 * Check if we have an INEL>0 trigger
502 * @param nClusters On return, number of clusters
503 * @param triggers Trigger mask to be filled
505 * @return true if we have an INEL>0 trigger
507 virtual Bool_t CheckINELGT0(const AliESDEvent& esd, UShort_t& nClusters,
508 UInt_t& triggers) const;
510 * Check if this is a pile-up event
513 * @param triggers Trigger mask to be filled
515 * @return true if this is a pile-up event
517 virtual Bool_t CheckPileup(const AliESDEvent& esd, UInt_t& triggers) const;
519 * Check for multi-vertex pile-up
521 * @param esd ESD event
522 * @param checkOtherBC Also check other BC's
524 * @return true if multiple vertices found
526 virtual Bool_t CheckMultiVertex(const AliESDEvent& esd,
527 Bool_t checkOtherBC=false) const;
529 * Check if we have a cosmic trigger. These should be filtered out.
531 * @param trigStri Trigger string
533 * @return true if we have a cosmic trigger
535 virtual Bool_t CheckCosmics(const TString& trigStri) const;
537 * Check if the trigger string corresponds to an empty event
539 * @param trigStr Trigger string
540 * @param triggers Trigger mask to be filled
542 * @return true if the trigger string corresponds to an empty event
544 virtual Bool_t CheckEmpty(const TString& trigStr, UInt_t& triggers) const;
546 * Check the trigger words to see if we have a B, A, C, or E event.
549 * @param triggers Trigger mask to be filled
551 * @return always true
553 virtual Bool_t CheckWords(const AliESDEvent& esd, UInt_t& triggers) const;
555 * Read the vertex information from the ESD event
557 * @param esd ESD event
558 * @param ip On return, the coordinates of the IP
560 * @return @c true on success, @c false otherwise
562 Bool_t ReadVertex(const AliESDEvent& esd, TVector3& ip);
564 * Check the vertex using the method used in PWG-UD. That is
566 * - Check we have a vertex and status is OK
567 * - Check if we have an SPD vertex and that it's status is OK
568 * - Check if the vertex is from the Z-vertexer, and if it is,
569 * - Check that the dispersion and resolution is OK
572 * @param ip On return, the coordinates of the IP
576 virtual EVtxStatus CheckPWGUDVertex(const AliESDEvent& esd,
579 * Check the vertex. That is
581 * - Check if we have an SPD vertex and that it's status is OK
582 * - Check that we have enough contributors
583 * - Check that the reslution is OK
586 * @param ip On return, the coordinates of the IP
590 virtual EVtxStatus CheckpA2012Vertex(const AliESDEvent& esd,
593 * Check the vertex for pA 2012 settings. That is
597 * @param ip On return, the coordinates of the IP
599 * @return true if the vertex was found and met the requirements
605 virtual EVtxStatus CheckVertex(const AliESDEvent& esd, TVector3& ip) const;
607 * Read centrality from event
610 * @param cent On return, the centrality or negative if not found
611 * @param qual On return, centrality quality flag
613 * @return False on error, true otherwise
615 virtual Bool_t ReadCentrality(const AliESDEvent& esd, Double_t& cent,
616 UShort_t& qual) const;
618 TH1I* fHEventsTr; //! Histogram of events w/trigger
619 TH1I* fHEventsTrVtx; //! Events w/trigger and vertex
620 TH1I* fHEventsAccepted; //! Events w/trigger and vertex in range
621 TH2D* fHEventsAcceptedXY; //! XY vtx with trigger and Z vertex in range
622 TH1I* fHTriggers; //! Triggers
623 TH2I* fHTriggerCorr; //! Correlation of triggers
624 TH1I* fHType; //! Type (low/high flux) of event
625 TH1I* fHWords; //! Trigger words
626 TH1F* fHCent; //! Centrality
627 TH2F* fHCentVsQual; //! Centrality vs quality
628 TH1I* fHStatus; //! Event processing status
629 TH1I* fHVtxStatus; //! Vertex processing status
630 TH1I* fHTrgStatus; //! Trigger processing status
631 Int_t fLowFluxCut; // Low flux cut
632 Double_t fMaxVzErr; // Maximum error on v_z
633 TList* fList; //! Histogram container
634 UShort_t fEnergy; // CMS energy (per nucleon pair) [GeV]
635 Short_t fField; // L3 magnetic field [kG]
636 UShort_t fCollisionSystem; // Collision system
637 Int_t fDebug; // Debug level
638 TAxis* fCentAxis; // Centrality axis used in histograms
639 TAxis fVtxAxis; // IP_z Axis
640 Bool_t fUseFirstPhysicsVertex;//Use the vtx code from p+p first physics
641 Bool_t fUseV0AND; // Use the vtx code from p+p first physics
642 UShort_t fMinPileupContrib; // Min contributors to 2nd pile-up IP
643 Double_t fMinPileupDistance; // Min distance of 2nd pile-up IP
644 Bool_t fUseDisplacedVertices; // Analyze displaced vertices?
645 AliDisplacedVertexSelection fDisplacedVertex; //Displaced vertex selector
646 TList fCollWords; //! Configured collision words
647 TList fBgWords; //! Configured background words
648 TString fCentMethod; // Centrality method
649 Double_t fMinCent; // min centrality
650 Double_t fMaxCent; // max centrailty
651 Bool_t fUsepA2012Vertex; // flag to use pA2012 Veretx selection
652 ULong_t fRunNumber; // Current run number
653 Bool_t fMC; // Is this MC input
654 Short_t fProdYear; // Production year
655 Char_t fProdLetter; // Production letter
656 Short_t fProdPass; // Pass number
657 Int_t fProdSVN; // AliROOT revision used in production
658 Bool_t fProdMC; // True if anchor production
660 ClassDef(AliFMDEventInspector,12); // Inspect the event