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 * Set whether this is MC or not. Needed by energy loss fitter task
323 * that never instantices AliFMDMCEventInspector. In particular, we
324 * need this to make sure we ignore the FAST partition flag in MC
327 * @param isMC If true, assume MC input
329 void SetMC(Bool_t isMC=true) { fMC = isMC; }
331 * Fetch our histograms from the passed list
334 * @param hEventsTr On return, pointer to histogram, or null
335 * @param hEventsTrVtx On return, pointer to histogram, or null
336 * @param hEventsAcc On return, pointer to histogram, or null
337 * @param hTriggers On return, pointer to histogram, or null
339 * @return true on success, false otherwise
341 Bool_t FetchHistograms(const TList* d,
345 TH1I*& hTriggers) const;
347 * Read the collision system, collision energy, and L3 field setting
350 * @param esd ESD to get information from
352 * @return true on success, false
354 Bool_t ReadRunDetails(const AliESDEvent* esd);
356 * Get the collision system (one of the value in ECollisionSystem)
358 * @return Collision system
360 UShort_t GetCollisionSystem() const { return fCollisionSystem; }
362 * Get the center of mass energy (per nucleon pair) in GeV
364 * @return center of mass energy (per nucleon pair) in GeV
366 UShort_t GetEnergy() const { return fEnergy; }
368 * Get the magnetic field setting of the L3 magnet in kilo Gauss.
370 * @return The magnetic field setting
372 Short_t GetField() const { return fField; }
374 * Get the current run number
376 * @return The current run number
378 ULong_t GetRunNumber() const { return fRunNumber; }
382 * @param option Not used
384 void Print(Option_t* option="") const;
385 // getter for fmincentrality
386 // Double_t GetMinCentrality() const { return fMinCent;}
387 // gettter for fmaxcentrality
388 // Double_t GetMaxCentrality() const { return fMaxCent;}
390 * Store information about running conditions in output list
392 * 3 TNamed objects are defined. The names are fixed, but the
393 * title is a string representation of the information, and the
394 * unique ID contains the identifier
396 * - sys Contains the collision system string and identifier.
397 * - sNN Contains the center-of-mass energy per nucleon (GeV)
398 * - field Contains the L3 magnetic field (kG)
399 * - run Contains the run number
402 virtual void StoreInformation();
404 * Return a string representing the return code
408 * @return String representation
410 static const char* CodeString(UInt_t mask);
413 * Cache the configure trigger classes from the physis selection.
415 * @param cache where to cache the trigger class.
416 * @param classes List of configured classes.
417 * @param o Object from OADB with config
419 void CacheConfiguredTriggerClasses(TList& cache,
420 const TList* classes,
421 AliOADBPhysicsSelection* o);
423 * Read the trigger information from the ESD event
425 * @param esd ESD event
426 * @param triggers On return, contains the trigger bits
427 * @param nClusters On return, number of SPD clusters in @f$ |\eta|<1@f$
429 * @return @c true on success, @c false otherwise
431 Bool_t ReadTriggers(const AliESDEvent& esd, UInt_t& triggers,
432 UShort_t& nClusters);
434 * Possible extra check for p-Pb from 2012/13 - require V0AND.
436 * @param esd Event structure
438 * @return true on success
440 Bool_t CheckpAExtraV0(const AliESDEvent& esd) const;
442 * Check, for the @f$\sqrt{s}=2.76GeV@f$ pp run wether this event
443 * was in the fast partition, and if so, filter it out.
445 * @param fastonly Event was in fast-only partition
447 * @return true if event was in the fast-only partition, for the run
450 virtual Bool_t CheckFastPartition(bool fastonly) const;
452 * Check if we have an NSD trigger for pp runs
455 * @param triggers Trigger mask to be filled
457 * @return true if we have an NSD trigger
459 virtual Bool_t CheckNSD(const AliESDEvent& esd, UInt_t& triggers) const;
461 * Check if we have an INEL>0 trigger
464 * @param nClusters On return, number of clusters
465 * @param triggers Trigger mask to be filled
467 * @return true if we have an INEL>0 trigger
469 virtual Bool_t CheckINELGT0(const AliESDEvent& esd, UShort_t& nClusters,
470 UInt_t& triggers) const;
472 * Check if this is a pile-up event
475 * @param triggers Trigger mask to be filled
477 * @return true if this is a pile-up event
479 virtual Bool_t CheckPileup(const AliESDEvent& esd, UInt_t& triggers) const;
481 * Check for multi-vertex pile-up
483 * @param esd ESD event
485 * @return true if multiple vertices found
487 virtual Bool_t CheckMultiVertex(const AliESDEvent& esd) const;
489 * Check if we have a cosmic trigger. These should be filtered out.
491 * @param trigStri Trigger string
493 * @return true if we have a cosmic trigger
495 virtual Bool_t CheckCosmics(const TString& trigStri) const;
497 * Check if the trigger string corresponds to an empty event
499 * @param trigStr Trigger string
500 * @param triggers Trigger mask to be filled
502 * @return true if the trigger string corresponds to an empty event
504 virtual Bool_t CheckEmpty(const TString& trigStr, UInt_t& triggers) const;
506 * Check the trigger words to see if we have a B, A, C, or E event.
509 * @param triggers Trigger mask to be filled
511 * @return always true
513 virtual Bool_t CheckWords(const AliESDEvent& esd, UInt_t& triggers) const;
515 * Read the vertex information from the ESD event
517 * @param esd ESD event
518 * @param ip On return, the coordinates of the IP
520 * @return @c true on success, @c false otherwise
522 Bool_t ReadVertex(const AliESDEvent& esd, TVector3& ip);
524 * Check the vertex using the method used in PWG-UD. That is
526 * - Check we have a vertex and status is OK
527 * - Check if we have an SPD vertex and that it's status is OK
528 * - Check if the vertex is from the Z-vertexer, and if it is,
529 * - Check that the dispersion and resolution is OK
532 * @param ip On return, the coordinates of the IP
536 virtual EVtxStatus CheckPWGUDVertex(const AliESDEvent& esd,
539 * Check the vertex. That is
541 * - Check if we have an SPD vertex and that it's status is OK
542 * - Check that we have enough contributors
543 * - Check that the reslution is OK
546 * @param ip On return, the coordinates of the IP
550 virtual EVtxStatus CheckpA2012Vertex(const AliESDEvent& esd,
553 * Check the vertex for pA 2012 settings. That is
557 * @param ip On return, the coordinates of the IP
559 * @return true if the vertex was found and met the requirements
565 virtual EVtxStatus CheckVertex(const AliESDEvent& esd, TVector3& ip) const;
567 * Read centrality from event
570 * @param cent On return, the centrality or negative if not found
571 * @param qual On return, centrality quality flag
573 * @return False on error, true otherwise
575 virtual Bool_t ReadCentrality(const AliESDEvent& esd, Double_t& cent,
576 UShort_t& qual) const;
578 TH1I* fHEventsTr; //! Histogram of events w/trigger
579 TH1I* fHEventsTrVtx; //! Events w/trigger and vertex
580 TH1I* fHEventsAccepted; //! Events w/trigger and vertex in range
581 TH2D* fHEventsAcceptedXY; //! XY vtx with trigger and Z vertex in range
582 TH1I* fHTriggers; //! Triggers
583 TH2I* fHTriggerCorr; //! Correlation of triggers
584 TH1I* fHType; //! Type (low/high flux) of event
585 TH1I* fHWords; //! Trigger words
586 TH1F* fHCent; //! Centrality
587 TH2F* fHCentVsQual; //! Centrality vs quality
588 TH1I* fHStatus; //! Event processing status
589 TH1I* fHVtxStatus; //! Vertex processing status
590 TH1I* fHTrgStatus; //! Trigger processing status
591 Int_t fLowFluxCut; // Low flux cut
592 Double_t fMaxVzErr; // Maximum error on v_z
593 TList* fList; //! Histogram container
594 UShort_t fEnergy; // CMS energy (per nucleon pair) [GeV]
595 Short_t fField; // L3 magnetic field [kG]
596 UShort_t fCollisionSystem; // Collision system
597 Int_t fDebug; // Debug level
598 TAxis* fCentAxis; // Centrality axis used in histograms
599 TAxis fVtxAxis; //Vtx Axis
600 Bool_t fUseFirstPhysicsVertex; //Use the vtx code from p+p first physics
601 Bool_t fUseV0AND; //Use the vtx code from p+p first physics
602 UShort_t fMinPileupContrib; // Minimum number of contributors to 2nd
604 Double_t fMinPileupDistance; // Minimum distance of 2nd pile-up
606 Bool_t fUseDisplacedVertices; //Analyze displaced vertices?
607 AliDisplacedVertexSelection fDisplacedVertex; //Displaced vertex selector
608 TList fCollWords; //! Configured collision words
609 TList fBgWords; //! Configured background words
611 Double_t fMinCent; //min centrality
612 Double_t fMaxCent; //max centrailty
613 Bool_t fUsepA2012Vertex;// flag to use pA2012 Veretx selection
614 ULong_t fRunNumber; // Current run number
615 Bool_t fMC; // Is this MC input
616 ClassDef(AliFMDEventInspector,11); // Inspect the event