ATLAS Offline Software
Loading...
Searching...
No Matches
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
22namespace Trk {
23 class Track;
24 class Vertex;
25}
26#endif
27
28
29namespace InDet {
30
31 // ---------------- SecVtxTrackAccessor ----------------
32
34 public:
36 virtual ~SecVtxTrackAccessor() = 0;
37 virtual StatusCode access( const xAOD::TrackParticle& track,
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:
50 StatusCode access( const xAOD::TrackParticle& track,
51 const xAOD::Vertex* vertex = 0 );
52#ifndef XAOD_ANALYSIS
53 StatusCode access( const Trk::Track& track,
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:
70 StatusCode access ( const xAOD::TrackParticle& track,
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
81template <size_t index>
84 , m_paramValue(0)
85{
86 static_assert(index < 5, "Index for parameter accessor must be less than 5");
87}
88
89template <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
virtual StatusCode access(const xAOD::TrackParticle &track, const xAOD::Vertex *vertex=0)=0
virtual ~SecVtxTrackAccessor()=0
SecVtxTrackAccessor(const asg::IAsgTool *)
SummaryAccessor(const asg::IAsgTool *)
StatusCode access(const xAOD::TrackParticle &track, const xAOD::Vertex *vertex=0)
void setSummaryType(xAOD::SummaryType)
svParamAccessor(const asg::IAsgTool *)
StatusCode access(const xAOD::TrackParticle &track, const xAOD::Vertex *vertex=0)
A summary of the information contained by a track.
This class is a simplest representation of a vertex candidate.
Class mimicking the AthMessaging class from the offline software.
Base class for the dual-use tool interface classes.
Definition IAsgTool.h:41
Primary Vertex Finder.
Ensure that the ATLAS eigen extensions are properly loaded.
ParametersBase< TrackParametersDim, Charged > TrackParameters
Definition index.py:1
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Vertex_v1 Vertex
Define the latest version of the vertex class.
SummaryType
Enumerates the different types of information stored in Summary.