ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkVertexFitter
TrkVertexFitters
src
SequentialVertexSmoother.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrkVertexFitters/SequentialVertexSmoother.h
"
6
#include "
TrkVertexFitterInterfaces/IVertexTrackUpdator.h
"
7
#include "
VxVertex/VxTrackAtVertex.h
"
8
9
namespace
Trk
10
{
11
12
//tool-related methods
13
StatusCode
SequentialVertexSmoother::initialize
()
14
{
15
16
//uploading the corresponding tools
17
if
(
m_vertexTrackUpdator
.retrieve().isFailure() ) {
18
msg
(MSG::FATAL) <<
"Failed to retrieve tool "
<<
m_vertexTrackUpdator
<<
endmsg
;
19
return
StatusCode::FAILURE;
20
}
21
msg
(MSG::INFO) <<
"Retrieved tool "
<<
m_vertexTrackUpdator
<<
endmsg
;
22
23
return
StatusCode::SUCCESS;
24
}
//end of initialize method
25
26
27
//class constructor
28
SequentialVertexSmoother::SequentialVertexSmoother
(
const
std::string& t,
const
std::string& n,
const
IInterface* p):
29
AthAlgTool
(t,n,p),
30
m_vertexTrackUpdator
(
"Trk::KalmanVertexTrackUpdator"
, this)
31
{
32
declareProperty
(
"VertexTrackUpdator"
,
m_vertexTrackUpdator
);
33
declareInterface<IVertexSmoother>(
this
);
34
}
//end of constructor description
35
36
//class destructor empty so far
37
SequentialVertexSmoother::~SequentialVertexSmoother
() =
default
;
38
39
//smooth method itself
40
// Had to make the vtx non-const because xAOD::Vertex stores
41
// Trk::VxTrackAtVertex and not Trk::VxTrackAtVertex*
42
void
SequentialVertexSmoother::smooth
(
xAOD::Vertex
& vtx)
const
43
{
44
45
//vector of associated tracks at vertex:
46
//protection check whether vxTrackAtVertices are attached to the object
47
if
( vtx.
vxTrackAtVertexAvailable
() )
//TODO: is this the right thing to check?
48
{
49
std::vector<Trk::VxTrackAtVertex> & tracks = vtx.
vxTrackAtVertex
();
50
51
//updating the tracks one by one
52
if
(!tracks.empty())
53
{
54
for
(
auto
& track : tracks)
55
{
56
//TODO: There were previously null pointer checks on both the contents and vector itself
57
// of std::vector<Trk::VxTrackAtVertex*>* in VxCandidate
58
// but now in xAOD::Vertex, there is only a std::vector<Trk::VxTrackAtVertex> so
59
// pointer checks are not possible
60
//
61
// -David S.
62
m_vertexTrackUpdator
->update( track, vtx );
63
}
//end of loop over all tracks in particular vertex
64
}
65
else
{
66
67
//something wrong: notification to user
68
msg
(MSG::ERROR) <<
"Vertex to be smoothed containes no tracks!"
<<
endmsg
;
69
msg
(MSG::ERROR) <<
"No action taken; Initial xAOD::Vertex returned."
<<
endmsg
;
70
}
//end of protection statement
71
}
else
{
72
msg
(MSG::ERROR) <<
"Vertex to be smoothed has no vxTrackAtVertices available!"
<<
endmsg
;
73
msg
(MSG::ERROR) <<
"No action taken; Initial xAOD::Vertex returned."
<<
endmsg
;
74
}
//end of protection check whether vxTrackAtVertices are attached to the object
75
}
//end of smooth method
76
77
}
//end of the namespace definitions
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
IVertexTrackUpdator.h
SequentialVertexSmoother.h
VxTrackAtVertex.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition
AthCommonMsg.h:24
Trk::SequentialVertexSmoother::~SequentialVertexSmoother
virtual ~SequentialVertexSmoother()
Trk::SequentialVertexSmoother::smooth
virtual void smooth(xAOD::Vertex &vtx) const override
Smooth method itself: updates the tracks belonging to the VxCandidate with the knowledge of the verte...
Definition
SequentialVertexSmoother.cxx:42
Trk::SequentialVertexSmoother::SequentialVertexSmoother
SequentialVertexSmoother(const std::string &t, const std::string &n, const IInterface *p)
constructor and destructor
Definition
SequentialVertexSmoother.cxx:28
Trk::SequentialVertexSmoother::m_vertexTrackUpdator
ToolHandle< IVertexTrackUpdator > m_vertexTrackUpdator
Definition
SequentialVertexSmoother.h:67
Trk::SequentialVertexSmoother::initialize
virtual StatusCode initialize() override
default AlgTools methods
Definition
SequentialVertexSmoother.cxx:13
xAOD::Vertex_v1::vxTrackAtVertexAvailable
bool vxTrackAtVertexAvailable() const
Check if VxTrackAtVertices are attached to the object.
Definition
Vertex_v1.cxx:231
xAOD::Vertex_v1::vxTrackAtVertex
std::vector< Trk::VxTrackAtVertex > & vxTrackAtVertex()
Non-const access to the VxTrackAtVertex vector.
Definition
Vertex_v1.cxx:203
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition
FakeTrackBuilder.h:9
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