ATLAS Offline Software
InDetSecVtxTrackAccessor.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 //Author: Lianyou Shan <lianyou.shan@cern.ch>
5 // -*- c++ -*-
6 // InDetSecVtxTrackAccessor.h
7 // Declarations of objects to access track properties
8 
9 #ifndef INDETSECVTXTRACKSELECTIONTOOL_INDETTRACKACCESSOR_H
10 #define INDETSECVTXTRACKSELECTIONTOOL_INDETTRACKACCESSOR_H
11 
14 #include "AsgTools/IAsgTool.h"
15 
18 #include "xAODTracking/Vertex.h"
19 
20 #ifndef XAOD_ANALYSIS
22 namespace Trk {
23  class Track;
24  class Vertex;
25 }
26 #endif
27 
28 
29 namespace InDet {
30 
31  // ---------------- SecVtxTrackAccessor ----------------
32 
34  public:
36  virtual ~SecVtxTrackAccessor() = 0;
38  const xAOD::Vertex* vertex = 0 ) = 0;
39 
40  // function to get properties from track
41  };
42 
43 // ---------------- SummaryAccessor ----------------
44 // summary values can be a uint8_t or a float: at some point may templatize,
45 // but would require templatizing cuts first
46  class SummaryAccessor : public virtual SecVtxTrackAccessor {
47  public:
51  const xAOD::Vertex* vertex = 0 );
52 #ifndef XAOD_ANALYSIS
54  const Trk::TrackParameters* perigee = 0,
55  const Trk::TrackSummary* summary = 0 );
56 #endif
57  uint8_t getValue() const {return m_summaryValue;}
58  private:
61  }; // class SummaryAccessor
62 
63  // ---------------- ParamAccessor ----------------
64  // using a separate accessor that acquires parameter based on index
65  // is useful because the index is the same in xAOD::TrackParticle and Trk::Track
66  template <size_t index>
67  class svParamAccessor : public virtual SecVtxTrackAccessor {
68  public:
71  const xAOD::Vertex* vertex = 0 );
72  Double_t getValue() const {return m_paramValue;}
73 
74  private:
75  Double_t m_paramValue;
76  }; // class svParamAccessor
77 
78 } // namespace InDet
79 
80 
81 template <size_t index>
84  , m_paramValue(0)
85 {
86  static_assert(index < 5, "Index for parameter accessor must be less than 5");
87 }
88 
89 template <size_t index>
91  const xAOD::Vertex* vertex )
92 {
93 
94  m_paramValue = track.definingParameters()[index];
95  if (index == 1) { // if this is a z-accessor (should be evaluated at compile-time)
96  if (vertex != nullptr) {
97  // if vertex is provided we need to cut w.r.t. the vertex
98  m_paramValue += track.vz() - vertex->z();
99  }
100  }
101  return StatusCode::SUCCESS;
102 }
103 
104 #endif // INDETTRACKSELECTIONTOOL_INDETTRACKACCESSOR_H
xAOD::Vertex
Vertex_v1 Vertex
Define the latest version of the vertex class.
Definition: Event/xAOD/xAODTracking/xAODTracking/Vertex.h:16
InDet::SummaryAccessor::access
StatusCode access(const xAOD::TrackParticle &track, const xAOD::Vertex *vertex=0)
Definition: InDetSecVtxTrackAccessor.cxx:32
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:575
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
index
Definition: index.py:1
InDet
DUMMY Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
asg::IAsgTool
Base class for the dual-use tool interface classes.
Definition: IAsgTool.h:41
InDet::SummaryAccessor::m_summaryType
xAOD::SummaryType m_summaryType
Definition: InDetSecVtxTrackAccessor.h:60
InDet::SummaryAccessor::m_summaryValue
uint8_t m_summaryValue
Definition: InDetSecVtxTrackAccessor.h:59
InDet::svParamAccessor::access
StatusCode access(const xAOD::TrackParticle &track, const xAOD::Vertex *vertex=0)
Definition: InDetSecVtxTrackAccessor.h:90
AsgMessaging.h
xAOD::SummaryType
SummaryType
Enumerates the different types of information stored in Summary.
Definition: TrackingPrimitives.h:228
InDet::SummaryAccessor::setSummaryType
void setSummaryType(xAOD::SummaryType)
Definition: InDetSecVtxTrackAccessor.cxx:27
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
InDet::SecVtxTrackAccessor::SecVtxTrackAccessor
SecVtxTrackAccessor(const asg::IAsgTool *)
Definition: InDetSecVtxTrackAccessor.cxx:13
TrackSummary.h
Trk::ParametersBase
Definition: ParametersBase.h:55
IAsgTool.h
Vertex.h
StatusCode.h
InDet::SecVtxTrackAccessor
Definition: InDetSecVtxTrackAccessor.h:33
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
InDet::SecVtxTrackAccessor::access
virtual StatusCode access(const xAOD::TrackParticle &track, const xAOD::Vertex *vertex=0)=0
Trk::TrackSummary
A summary of the information contained by a track.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:287
asg::AsgMessaging
Class mimicking the AthMessaging class from the offline software.
Definition: AsgMessaging.h:40
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
InDet::svParamAccessor
Definition: InDetSecVtxTrackAccessor.h:67
TrackParticle.h
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
DeMoScan.index
string index
Definition: DeMoScan.py:362
InDet::svParamAccessor::svParamAccessor
svParamAccessor(const asg::IAsgTool *)
Definition: InDetSecVtxTrackAccessor.h:82
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
InDet::SecVtxTrackAccessor::~SecVtxTrackAccessor
virtual ~SecVtxTrackAccessor()=0
InDet::svParamAccessor::getValue
Double_t getValue() const
Definition: InDetSecVtxTrackAccessor.h:72
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
InDet::SummaryAccessor
Definition: InDetSecVtxTrackAccessor.h:46
InDet::SummaryAccessor::getValue
uint8_t getValue() const
Definition: InDetSecVtxTrackAccessor.h:57
TrackingPrimitives.h
InDet::SummaryAccessor::SummaryAccessor
SummaryAccessor(const asg::IAsgTool *)
Definition: InDetSecVtxTrackAccessor.cxx:20
InDet::svParamAccessor::m_paramValue
Double_t m_paramValue
Definition: InDetSecVtxTrackAccessor.h:75
SCT_Monitoring::summary
@ summary
Definition: SCT_MonitoringNumbers.h:65