ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::Mode3dTo1dFinder Class Referencefinal

#include <Mode3dTo1dFinder.h>

Inheritance diagram for Trk::Mode3dTo1dFinder:
Collaboration diagram for Trk::Mode3dTo1dFinder:

Public Member Functions

 Mode3dTo1dFinder (const std::string &t, const std::string &n, const IInterface *p)
virtual StatusCode initialize () override
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)
virtual Amg::Vector3D getMode (const double vx, const double vy, const std::vector< Trk::PositionAndWeight > &points, std::unique_ptr< IMode3dInfo > &info) const override final
 Obtain the 3d-mode (position) from a list of positions (distribution in space)
virtual Amg::Vector3D getMode (const double vx, const double vy, const std::vector< Amg::Vector3D > &points) const override final
 Obtain the 3d-mode (position) from a list of positions (distribution in space)
virtual Amg::Vector3D getMode (const double vx, const double vy, const std::vector< Amg::Vector3D > &points, std::unique_ptr< IMode3dInfo > &info) const override final
 Obtain the 3d-mode (position) from a list of positions (distribution in space)

Private Attributes

ToolHandle< IMode1dFinderm_mode1dfinder

Detailed Description

Definition at line 32 of file Mode3dTo1dFinder.h.

Constructor & Destructor Documentation

◆ Mode3dTo1dFinder()

Trk::Mode3dTo1dFinder::Mode3dTo1dFinder ( const std::string & t,
const std::string & n,
const IInterface * p )

Definition at line 18 of file Mode3dTo1dFinder.cxx.

18 :
19 base_class(t,n,p),
20 m_mode1dfinder("Trk::FsmwMode1dFinder", this)
21 {
22 declareProperty("Mode1dFinder", m_mode1dfinder);
23 }
ToolHandle< IMode1dFinder > m_mode1dfinder

Member Function Documentation

◆ getMode() [1/4]

Amg::Vector3D Trk::Mode3dTo1dFinder::getMode ( const double vx,
const double vy,
const std::vector< Amg::Vector3D > & points ) const
finaloverridevirtual

Obtain the 3d-mode (position) from a list of positions (distribution in space)

Parameters
vxPrimary vertex x-coordinate.
vyPrimary vertex y-coordinate.
pointsList of points — unweighted!

Definition at line 73 of file Mode3dTo1dFinder.cxx.

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(allx),
94 m_mode1dfinder->getMode(ally),
95 m_mode1dfinder->getMode(allz));
96 }
Eigen::Matrix< double, 3, 1 > Vector3D

◆ getMode() [2/4]

Amg::Vector3D Trk::Mode3dTo1dFinder::getMode ( const double vx,
const double vy,
const std::vector< Amg::Vector3D > & points,
std::unique_ptr< IMode3dInfo > & info ) const
finaloverridevirtual

Obtain the 3d-mode (position) from a list of positions (distribution in space)

Parameters
vxPrimary vertex x-coordinate.
vyPrimary vertex y-coordinate.
pointsList of points — unweighted!
info[out]Optionally returns an object for retrieving additional information. May be left null if additional information is not available.

Definition at line 100 of file Mode3dTo1dFinder.cxx.

105 {
106 return getMode (vx, vy, myVectorOfPoints);
107 }
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)

◆ getMode() [3/4]

Amg::Vector3D Trk::Mode3dTo1dFinder::getMode ( const double vx,
const double vy,
const std::vector< Trk::PositionAndWeight > & points ) const
finaloverridevirtual

Obtain the 3d-mode (position) from a list of positions (distribution in space)

Parameters
vxPrimary vertex x-coordinate.
vyPrimary vertex y-coordinate.
pointsList of points with weights.

Definition at line 35 of file Mode3dTo1dFinder.cxx.

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 }

◆ getMode() [4/4]

Amg::Vector3D Trk::Mode3dTo1dFinder::getMode ( const double vx,
const double vy,
const std::vector< Trk::PositionAndWeight > & points,
std::unique_ptr< IMode3dInfo > & info ) const
finaloverridevirtual

Obtain the 3d-mode (position) from a list of positions (distribution in space)

Parameters
vxPrimary vertex x-coordinate.
vyPrimary vertex y-coordinate.
pointsList of points with weights.
info[out]Optionally returns an object for retrieving additional information. May be left null if additional information is not available.

Definition at line 62 of file Mode3dTo1dFinder.cxx.

66 {
67 return getMode (vx, vy, myVectorOfPoints);
68 }

◆ initialize()

StatusCode Trk::Mode3dTo1dFinder::initialize ( )
overridevirtual

Definition at line 26 of file Mode3dTo1dFinder.cxx.

27 {
28 ATH_CHECK( AlgTool::initialize() );
29 ATH_CHECK( m_mode1dfinder.retrieve() );
30 return StatusCode::SUCCESS;
31 }
#define ATH_CHECK
Evaluate an expression and check for errors.

Member Data Documentation

◆ m_mode1dfinder

ToolHandle< IMode1dFinder > Trk::Mode3dTo1dFinder::m_mode1dfinder
private

Definition at line 105 of file Mode3dTo1dFinder.h.


The documentation for this class was generated from the following files: