ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetValidation
InDetTrackPerfMon
src
VertexParametersHelper.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef INDETTRACKPERFMON_VERTEXPARAMETERSHELPER_H
6
#define INDETTRACKPERFMON_VERTEXPARAMETERSHELPER_H
7
16
18
#include "
xAODTracking/Vertex.h
"
19
#include "
xAODTruth/TruthVertex.h
"
20
22
#include <cmath>
23
24
25
namespace
IDTPM
{
26
28
template
<
class
V >
29
inline
float
posX
(
const
V& v ) {
return
v.x(); }
30
32
template
<
class
V >
33
inline
float
posY
(
const
V& v ) {
return
v.y(); }
34
36
template
<
class
V >
37
inline
float
posZ
(
const
V& v ) {
return
v.z(); }
38
40
inline
float
getChiSquared
(
const
xAOD::Vertex
& v ) {
return
v.chiSquared(); }
41
inline
float
getChiSquared
(
const
xAOD::TruthVertex
& ) {
return
-9999; }
42
//inline float chiSquared( const V& v ) defined in TrackParametersHelper
43
45
inline
float
getNdof
(
const
xAOD::Vertex
& v ) {
return
v.numberDoF(); }
46
inline
float
getNdof
(
const
xAOD::TruthVertex
& ) {
return
-9999; }
47
//inline float ndof( const V& v ) defined in TrackParametersHelper
48
50
inline
uint8_t
getHasValidTime
(
const
xAOD::Vertex
& v ) {
51
static
thread_local
SG::ConstAccessor< uint8_t >
accHasValidTime(
"hasValidTime"
);
52
return
accHasValidTime.
isAvailable
(v) ? accHasValidTime(v) : 0;
53
}
54
inline
uint8_t
getHasValidTime
(
const
xAOD::TruthVertex
& ) {
return
1; }
55
//inline uint8_t hasValidTime( const V& v ) defined in TrackParametersHelper
56
58
inline
float
getTime
(
const
xAOD::Vertex
& v ) {
59
static
thread_local
SG::ConstAccessor< float >
accTime(
"time"
);
60
return
accTime.
isAvailable
(v) ? accTime(v) : -9999.;
61
}
62
inline
float
getTime
(
const
xAOD::TruthVertex
& v ) {
return
v.t(); }
63
//inline float time( const V& v ) defined in TrackParametersHelper
64
66
inline
int
getVertexType
(
const
xAOD::Vertex
& v ) {
return
int( v.vertexType() ); }
67
inline
int
getVertexType
(
const
xAOD::TruthVertex
& ) {
return
-1; }
68
template
<
class
V >
69
inline
int
vertexType
(
const
V& v ) {
return
getVertexType
(v); }
70
72
enum
VposDefs
:
int
{
VposX
=0,
VposY
=1,
VposZ
=2,
NVpos
=3 };
73
75
inline
float
getCov
(
const
xAOD::Vertex
& v,
VposDefs
par1,
VposDefs
par2 ) {
76
return
v.covariancePosition()( par1, par2 );
77
}
78
inline
float
getCov
(
const
xAOD::TruthVertex
&,
VposDefs
,
VposDefs
) {
return
0.; }
79
template
<
class
V >
80
inline
float
cov
(
const
V& v,
VposDefs
par1,
VposDefs
par2 ) {
return
getCov
( v, par1, par2 ); }
81
83
inline
float
getError
(
const
xAOD::Vertex
& v,
VposDefs
par ) {
84
return
(
cov
(v, par, par) < 0 ) ? 0. : std::sqrt(
cov
(v, par, par) ); }
85
inline
float
getError
(
const
xAOD::TruthVertex
&,
VposDefs
) {
return
0.; }
86
template
<
class
V >
87
inline
float
error
(
const
V& v,
VposDefs
par ) {
return
getError
( v, par ); }
88
90
inline
float
getTimeErr
(
const
xAOD::Vertex
& v ) {
91
static
thread_local
SG::ConstAccessor< float >
accTimeResol(
"timeResolution"
);
92
return
accTimeResol.
isAvailable
(v) ? accTimeResol(v) : -9999.;
93
}
94
inline
float
getTimeErr
(
const
xAOD::TruthVertex
& ) {
return
0.; }
95
template
<
class
V >
96
inline
float
timeErr
(
const
V& v ) {
return
getTimeErr
(v); }
97
98
}
// namespace IDTPM
99
100
#endif
// > ! INDETTRACKPERFMON_VERTEXPARAMETERSHELPER_H
Vertex.h
TruthVertex.h
SG::ConstAccessor< uint8_t >
SG::ConstAccessor::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
IDTPM
Athena include(s).
Definition
IPlotsDefinitionSvc.h:25
IDTPM::getTime
float getTime(const xAOD::TrackParticle &p)
Accessor utility function for getting the track time.
Definition
TrackParametersHelper.h:156
IDTPM::VposDefs
VposDefs
enum for vertex position
Definition
VertexParametersHelper.h:72
IDTPM::VposX
@ VposX
Definition
VertexParametersHelper.h:72
IDTPM::VposY
@ VposY
Definition
VertexParametersHelper.h:72
IDTPM::VposZ
@ VposZ
Definition
VertexParametersHelper.h:72
IDTPM::NVpos
@ NVpos
Definition
VertexParametersHelper.h:72
IDTPM::getHasValidTime
uint8_t getHasValidTime(const xAOD::TrackParticle &p)
Accessor utility function for getting the track hasValidTime.
Definition
TrackParametersHelper.h:150
IDTPM::getTimeErr
float getTimeErr(const xAOD::Vertex &v)
Accessor utility function for getting the vertex time resolution.
Definition
VertexParametersHelper.h:90
IDTPM::posX
float posX(const V &v)
Accessor utility function for getting the value of vertex position x.
Definition
VertexParametersHelper.h:29
IDTPM::posZ
float posZ(const V &v)
Accessor utility function for getting the value of vertex position z.
Definition
VertexParametersHelper.h:37
IDTPM::getError
float getError(const xAOD::TrackParticle &p, Trk::ParamDefs par)
Accessor utility function for getting the track parameters error.
Definition
TrackParametersHelper.h:170
IDTPM::getNdof
float getNdof(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of dof.
Definition
TrackParametersHelper.h:131
IDTPM::posY
float posY(const V &v)
Accessor utility function for getting the value of vertex position y.
Definition
VertexParametersHelper.h:33
IDTPM::getChiSquared
float getChiSquared(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of chi^2.
Definition
TrackParametersHelper.h:125
IDTPM::timeErr
float timeErr(const V &v)
Definition
VertexParametersHelper.h:96
IDTPM::getCov
float getCov(const xAOD::TrackParticle &p, Trk::ParamDefs par1, Trk::ParamDefs par2)
Accessor utility function for getting the track parameters covariance.
Definition
TrackParametersHelper.h:162
IDTPM::getVertexType
int getVertexType(const xAOD::Vertex &v)
Accessor utility function for getting the vertex type.
Definition
VertexParametersHelper.h:66
IDTPM::cov
float cov(const U &p, Trk::ParamDefs par1, Trk::ParamDefs par2)
Definition
TrackParametersHelper.h:166
IDTPM::vertexType
int vertexType(const V &v)
Definition
VertexParametersHelper.h:69
error
Definition
IImpactPoint3dEstimator.h:72
xAOD::TruthVertex
TruthVertex_v1 TruthVertex
Typedef to implementation.
Definition
TruthVertex.h:15
xAOD::Vertex
Vertex_v1 Vertex
Define the latest version of the vertex class.
Definition
Event/xAOD/xAODTracking/xAODTracking/Vertex.h:16
Generated on
for ATLAS Offline Software by
1.17.0