ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetRecTools
InDetSecVtxTrackSelectionTool
Root
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
12
#include "
AsgMessaging/StatusCode.h
"
13
#include "
AsgMessaging/AsgMessaging.h
"
14
#include "
AsgTools/IAsgTool.h
"
15
16
#include "
xAODTracking/TrackingPrimitives.h
"
17
#include "
xAODTracking/TrackParticle.h
"
18
#include "
xAODTracking/Vertex.h
"
19
20
#ifndef XAOD_ANALYSIS
21
#include "
TrkTrackSummary/TrackSummary.h
"
22
namespace
Trk
{
23
class
Track
;
24
class
Vertex
;
25
}
26
#endif
27
28
29
namespace
InDet
{
30
31
// ---------------- SecVtxTrackAccessor ----------------
32
33
class
SecVtxTrackAccessor
:
public
asg::AsgMessaging
{
34
public
:
35
SecVtxTrackAccessor
(
const
asg::IAsgTool
*);
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
:
48
SummaryAccessor
(
const
asg::IAsgTool
*);
49
void
setSummaryType
(
xAOD::SummaryType
);
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
:
59
uint8_t
m_summaryValue
;
60
xAOD::SummaryType
m_summaryType
;
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
:
69
svParamAccessor
(
const
asg::IAsgTool
*);
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
81
template
<
size_t
index>
82
InDet::svParamAccessor<index>::svParamAccessor
(
const
asg::IAsgTool
* tool)
83
:
InDet
::
SecVtxTrackAccessor
(tool)
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>
90
StatusCode
InDet::svParamAccessor<index>::access
(
const
xAOD::TrackParticle
& track,
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
AsgMessaging.h
StatusCode.h
TrackParticle.h
Vertex.h
IAsgTool.h
TrackingPrimitives.h
TrackSummary.h
InDet::SecVtxTrackAccessor::access
virtual StatusCode access(const xAOD::TrackParticle &track, const xAOD::Vertex *vertex=0)=0
InDet::SecVtxTrackAccessor::~SecVtxTrackAccessor
virtual ~SecVtxTrackAccessor()=0
InDet::SecVtxTrackAccessor::SecVtxTrackAccessor
SecVtxTrackAccessor(const asg::IAsgTool *)
Definition
InDetSecVtxTrackAccessor.cxx:13
InDet::SummaryAccessor::m_summaryValue
uint8_t m_summaryValue
Definition
InDetSecVtxTrackAccessor.h:59
InDet::SummaryAccessor::m_summaryType
xAOD::SummaryType m_summaryType
Definition
InDetSecVtxTrackAccessor.h:60
InDet::SummaryAccessor::SummaryAccessor
SummaryAccessor(const asg::IAsgTool *)
Definition
InDetSecVtxTrackAccessor.cxx:20
InDet::SummaryAccessor::getValue
uint8_t getValue() const
Definition
InDetSecVtxTrackAccessor.h:57
InDet::SummaryAccessor::access
StatusCode access(const xAOD::TrackParticle &track, const xAOD::Vertex *vertex=0)
Definition
InDetSecVtxTrackAccessor.cxx:32
InDet::SummaryAccessor::setSummaryType
void setSummaryType(xAOD::SummaryType)
Definition
InDetSecVtxTrackAccessor.cxx:27
InDet::svParamAccessor::getValue
Double_t getValue() const
Definition
InDetSecVtxTrackAccessor.h:72
InDet::svParamAccessor::svParamAccessor
svParamAccessor(const asg::IAsgTool *)
Definition
InDetSecVtxTrackAccessor.h:82
InDet::svParamAccessor::m_paramValue
Double_t m_paramValue
Definition
InDetSecVtxTrackAccessor.h:75
InDet::svParamAccessor::access
StatusCode access(const xAOD::TrackParticle &track, const xAOD::Vertex *vertex=0)
Definition
InDetSecVtxTrackAccessor.h:90
Trk::TrackSummary
A summary of the information contained by a track.
Definition
Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:287
Trk::Track
The ATLAS Track class.
Definition
Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
Trk::Vertex
This class is a simplest representation of a vertex candidate.
Definition
Tracking/TrkEvent/VxVertex/VxVertex/Vertex.h:26
asg::AsgMessaging
Class mimicking the AthMessaging class from the offline software.
Definition
AsgMessaging.h:40
asg::IAsgTool
Base class for the dual-use tool interface classes.
Definition
IAsgTool.h:41
InDet
Primary Vertex Finder.
Definition
VP1ErrorUtils.h:36
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition
FakeTrackBuilder.h:9
Trk::TrackParameters
ParametersBase< TrackParametersDim, Charged > TrackParameters
Definition
Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:27
index
Definition
index.py:1
xAOD::TrackParticle
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Definition
Event/xAOD/xAODTracking/xAODTracking/TrackParticle.h:13
xAOD::Vertex
Vertex_v1 Vertex
Define the latest version of the vertex class.
Definition
Event/xAOD/xAODTracking/xAODTracking/Vertex.h:16
xAOD::SummaryType
SummaryType
Enumerates the different types of information stored in Summary.
Definition
TrackingPrimitives.h:229
Generated on
for ATLAS Offline Software by
1.17.0