ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkVertexFitter
TrkVertexSeedFinderUtils
src
Mode3dTo1dFinder.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
/*********************************************************************
6
Mode3dTo1dFinder.cxx - Description in header file
7
*********************************************************************/
8
9
#include "
TrkVertexSeedFinderUtils/Mode3dTo1dFinder.h
"
10
#include "
TrkParameters/TrackParameters.h
"
11
#include "
TrkVertexSeedFinderUtils/IMode1dFinder.h
"
12
#include "
TrkVertexSeedFinderUtils/SeedFinderParamDefs.h
"
13
#include <cmath>
14
15
namespace
Trk
16
{
17
18
Mode3dTo1dFinder::Mode3dTo1dFinder
(
const
std::string& t,
const
std::string& n,
const
IInterface* p) :
19
base_class(t,n,p),
20
m_mode1dfinder
(
"Trk::FsmwMode1dFinder"
, this)
21
{
22
declareProperty(
"Mode1dFinder"
,
m_mode1dfinder
);
23
}
24
25
26
StatusCode
Mode3dTo1dFinder::initialize
()
27
{
28
ATH_CHECK
( AlgTool::initialize() );
29
ATH_CHECK
(
m_mode1dfinder
.retrieve() );
30
return
StatusCode::SUCCESS;
31
}
32
33
34
Amg::Vector3D
35
Mode3dTo1dFinder::getMode
(
const
double
/*vx*/
,
36
const
double
/*vy*/
,
37
const
std::vector<Trk::PositionAndWeight> & myVectorOfPoints)
const
38
{
39
//create a vector of double values from a vector of "Point" objects
40
41
std::vector<Trk::PositionAndWeight>::const_iterator begin = myVectorOfPoints.begin();
42
std::vector<Trk::PositionAndWeight>::const_iterator end = myVectorOfPoints.end();
43
44
std::vector<Trk::DoubleAndWeight> allx;
45
std::vector<Trk::DoubleAndWeight> ally;
46
std::vector<Trk::DoubleAndWeight> allz;
47
48
for
(std::vector<PositionAndWeight>::const_iterator i = begin; i!=end; ++i) {
49
allx.emplace_back(i->first.x(),i->second);
50
ally.emplace_back(i->first.y(),i->second);
51
allz.emplace_back(i->first.z(),i->second);
52
}
53
54
// now find the mode separately for the distributions in x, y and z
55
return
Amg::Vector3D
(
m_mode1dfinder
->getMode(allx),
56
m_mode1dfinder
->getMode(ally),
57
m_mode1dfinder
->getMode(allz));
58
}
59
60
61
Amg::Vector3D
62
Mode3dTo1dFinder::getMode
(
const
double
vx,
63
const
double
vy,
64
const
std::vector<Trk::PositionAndWeight> & myVectorOfPoints,
65
std::unique_ptr<IMode3dInfo>&
/*info*/
)
const
66
{
67
return
getMode
(vx, vy, myVectorOfPoints);
68
}
69
70
71
//obtain the 3d-mode (position) from a list of positions (distribution in space) - NO WEIGHTS
72
Amg::Vector3D
73
Mode3dTo1dFinder::getMode
(
const
double
/*vx*/
,
74
const
double
/*vy*/
,
75
const
std::vector<Amg::Vector3D> & myVectorOfPoints)
const
76
{
77
//create a vector of double values from a vector of "Point" objects
78
79
std::vector<Amg::Vector3D>::const_iterator begin = myVectorOfPoints.begin();
80
std::vector<Amg::Vector3D>::const_iterator end = myVectorOfPoints.end();
81
82
std::vector<double> allx;
83
std::vector<double> ally;
84
std::vector<double> allz;
85
86
for
(std::vector<Amg::Vector3D>::const_iterator i = begin; i!=end; ++i) {
87
allx.push_back((*i).x());
88
ally.push_back((*i).y());
89
allz.push_back((*i).z());
90
}
91
92
// now find the mode separately for the distributions in x, y and z
93
return
Amg::Vector3D
(
m_mode1dfinder
->getMode(std::move(allx)),
94
m_mode1dfinder
->getMode(std::move(ally)),
95
m_mode1dfinder
->getMode(std::move(allz)));
96
}
97
98
99
Amg::Vector3D
100
Mode3dTo1dFinder::getMode
(
const
double
vx,
101
const
double
vy,
102
const
std::vector<Amg::Vector3D> & myVectorOfPoints,
103
std::unique_ptr<IMode3dInfo>&
/*info*/
)
const
104
105
{
106
return
getMode
(vx, vy, myVectorOfPoints);
107
}
108
109
110
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
IMode1dFinder.h
Mode3dTo1dFinder.h
SeedFinderParamDefs.h
TrackParameters.h
Trk::Mode3dTo1dFinder::m_mode1dfinder
ToolHandle< IMode1dFinder > m_mode1dfinder
Definition
Mode3dTo1dFinder.h:105
Trk::Mode3dTo1dFinder::initialize
virtual StatusCode initialize() override
Definition
Mode3dTo1dFinder.cxx:26
Trk::Mode3dTo1dFinder::getMode
virtual Amg::Vector3D getMode(const double vx, const double vy, const std::vector< Trk::PositionAndWeight > &points) const override final
Obtain the 3d-mode (position) from a list of positions (distribution in space).
Definition
Mode3dTo1dFinder.cxx:35
Trk::Mode3dTo1dFinder::Mode3dTo1dFinder
Mode3dTo1dFinder(const std::string &t, const std::string &n, const IInterface *p)
Definition
Mode3dTo1dFinder.cxx:18
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:47
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition
FakeTrackBuilder.h:9
Generated on
for ATLAS Offline Software by
1.17.0