ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkVertexFitter
TrkVertexWeightCalculators
src
SumPtVertexWeightCalculator.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 "
TrkVertexWeightCalculators/SumPtVertexWeightCalculator.h
"
6
#include "
TrkParameters/TrackParameters.h
"
7
#include "
VxVertex/VxTrackAtVertex.h
"
8
9
#include "
xAODTracking/TrackParticle.h
"
10
#include "
xAODTracking/Vertex.h
"
11
12
namespace
Trk
{
13
14
StatusCode
15
SumPtVertexWeightCalculator::initialize
()
16
{
17
return
StatusCode::SUCCESS;
18
}
// end of initialize method
19
20
StatusCode
21
SumPtVertexWeightCalculator::finalize
()
22
{
23
return
StatusCode::SUCCESS;
24
}
25
26
// class constructor implementation
27
SumPtVertexWeightCalculator::SumPtVertexWeightCalculator
(
const
std::string& t,
28
const
std::string& n,
29
const
IInterface* p)
30
:
AthAlgTool
(t, n, p)
31
{
32
declareInterface<IVertexWeightCalculator>(
this
);
33
}
34
35
double
36
SumPtVertexWeightCalculator::estimateSignalCompatibility
(
37
const
xAOD::Vertex
&
vertex
)
const
38
{
39
double
total_pt = 0;
40
ATH_MSG_VERBOSE
(
"Estimating vertex sorting score from "
41
<<
vertex
.nTrackParticles() <<
" tracks at vertex."
);
42
for
(
const
auto
& elTrackParticle :
vertex
.trackParticleLinks()) {
43
44
if
(not elTrackParticle.isValid()) {
45
ATH_MSG_WARNING
(
46
"No valid link to tracks in xAOD::Vertex object. Skipping track for "
47
"signal compatibility (may be serious)."
);
48
continue
;
49
}
50
51
const
Trk::Perigee
& perigee =
52
(*elTrackParticle.cptr())->perigeeParameters();
53
if
(
m_doSumPt2Selection
) {
54
total_pt += std::pow(1. / perigee.parameters()[
Trk::qOverP
] *
55
sin(perigee.parameters()[
Trk::theta
]) / 1000.,
56
2);
57
}
else
{
58
total_pt += std::fabs(1. / perigee.parameters()[
Trk::qOverP
]) *
59
sin(perigee.parameters()[
Trk::theta
]) / 1000.;
60
}
61
}
62
ATH_MSG_DEBUG
(
"Calculated vertex sumpt "
<< std::setprecision(3) << total_pt);
63
return
total_pt;
64
}
65
66
}
67
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
TrackParticle.h
Vertex.h
SumPtVertexWeightCalculator.h
TrackParameters.h
VxTrackAtVertex.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
Trk::SumPtVertexWeightCalculator::SumPtVertexWeightCalculator
SumPtVertexWeightCalculator(const std::string &t, const std::string &n, const IInterface *p)
constructor
Definition
SumPtVertexWeightCalculator.cxx:27
Trk::SumPtVertexWeightCalculator::estimateSignalCompatibility
virtual double estimateSignalCompatibility(const xAOD::Vertex &vertex) const override final
WeightCalculator.
Definition
SumPtVertexWeightCalculator.cxx:36
Trk::SumPtVertexWeightCalculator::finalize
virtual StatusCode finalize() override
Definition
SumPtVertexWeightCalculator.cxx:21
Trk::SumPtVertexWeightCalculator::m_doSumPt2Selection
Gaudi::Property< bool > m_doSumPt2Selection
Flag to Set SumPt^2 not SumPt as selection criteria.
Definition
SumPtVertexWeightCalculator.h:65
Trk::SumPtVertexWeightCalculator::initialize
virtual StatusCode initialize() override
Definition
SumPtVertexWeightCalculator.cxx:15
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition
FakeTrackBuilder.h:9
Trk::Perigee
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
Definition
Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:33
Trk::vertex
@ vertex
Definition
MeasurementType.h:21
Trk::theta
@ theta
Definition
ParamDefs.h:66
Trk::qOverP
@ qOverP
perigee
Definition
ParamDefs.h:67
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