ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::RecVertexPositions Class Reference

#include <RecVertexPositions.h>

Inheritance diagram for Trk::RecVertexPositions:
Collaboration diagram for Trk::RecVertexPositions:

Public Member Functions

 RecVertexPositions ()
 default constructor, if called initializes a RecVertexPositions with all data members set to 0.
 RecVertexPositions (const VertexPositions &pos)
 construct a RecVertexPositions from a Vertex.
 RecVertexPositions (const RecVertexPositions &pos)=default
 RecVertexPositions (RecVertexPositions &&pos)=default
RecVertexPositionsoperator= (const RecVertexPositions &pos)=default
RecVertexPositionsoperator= (RecVertexPositions &&pos)=default
 RecVertexPositions (const Amg::VectorX &pos, const Amg::MatrixX &cov, const double ndf=0., const double chi2=0., bool isWeightTimesPosition=false)
 constructs a RecVertexPositions with position, error, ndf, dhi2 and ntrk
 RecVertexPositions (const Amg::VectorX &pos, const double ndf=0., const double chi2=0.)
virtual MsgStream & dump (MsgStream &sl) const
 Output Method for MsgStream, to be overloaded by child classes.
virtual std::ostream & dump (std::ostream &sl) const
 Output Method for std::ostream, to be overloaded by child classes.
virtual ~RecVertexPositions ()
 default destructor
Amg::MatrixX constcovariancePosition () const
 return the covDeltaV matrix of the vertex fit
void setCovariancePosition (const Amg::MatrixX &)
void setFitQuality (const Trk::FitQuality &)
const Trk::FitQualityfitQuality () const
 Fit quality access method.
const Amg::VectorXweightTimesPosition ()
void setWeightTimesPosition (const Amg::VectorX &)
void finalizePosition ()
const Amg::VectorXposition () const
 return position of vertex
void setPosition (const Amg::VectorX &)

Static Public Member Functions

static std::size_t numberOfInstantiations ()

Static Public Attributes

static std::atomic_size_t s_numberOfInstantiations

Protected Attributes

Amg::VectorX m_position
 vertex position
bool m_useWeightTimesPosition

Private Attributes

Amg::MatrixX m_positionError
 cov matrix on vertex position (primary vtx+jet dir+distance)
Trk::FitQuality m_fitQuality

Detailed Description

Definition at line 29 of file RecVertexPositions.h.

Constructor & Destructor Documentation

◆ RecVertexPositions() [1/6]

Trk::RecVertexPositions::RecVertexPositions ( )

default constructor, if called initializes a RecVertexPositions with all data members set to 0.

Definition at line 24 of file RecVertexPositions.cxx.

24 :
27 { m_positionError.setZero();}
Amg::MatrixX m_positionError
cov matrix on vertex position (primary vtx+jet dir+distance)
VertexPositions()
default constructor
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.

◆ RecVertexPositions() [2/6]

Trk::RecVertexPositions::RecVertexPositions ( const VertexPositions & pos)

construct a RecVertexPositions from a Vertex.

ErrorMatrix will be 0,0,0.

Definition at line 30 of file RecVertexPositions.cxx.

30 :
31 VertexPositions(pos),
33 { m_positionError.setZero();}

◆ RecVertexPositions() [3/6]

Trk::RecVertexPositions::RecVertexPositions ( const RecVertexPositions & pos)
default

◆ RecVertexPositions() [4/6]

Trk::RecVertexPositions::RecVertexPositions ( RecVertexPositions && pos)
default

◆ RecVertexPositions() [5/6]

Trk::RecVertexPositions::RecVertexPositions ( const Amg::VectorX & pos,
const Amg::MatrixX & cov,
const double ndf = 0.,
const double chi2 = 0.,
bool isWeightTimesPosition = false )

constructs a RecVertexPositions with position, error, ndf, dhi2 and ntrk

Definition at line 36 of file RecVertexPositions.cxx.

38 :
39 VertexPositions(pos), m_positionError(cov), m_fitQuality(Trk::FitQuality(chi2,ndf)) {
40 m_useWeightTimesPosition=isWeightTimesPosition;
41 }
double chi2(TH1 *h0, TH1 *h1)

◆ RecVertexPositions() [6/6]

Trk::RecVertexPositions::RecVertexPositions ( const Amg::VectorX & pos,
const double ndf = 0.,
const double chi2 = 0. )

Definition at line 44 of file RecVertexPositions.cxx.

44 :
45 VertexPositions(pos),
47 m_fitQuality(Trk::FitQuality(chi2,ndf)) { m_positionError.setZero();}

◆ ~RecVertexPositions()

Trk::RecVertexPositions::~RecVertexPositions ( )
virtualdefault

default destructor

Member Function Documentation

◆ covariancePosition()

const Amg::MatrixX & Trk::RecVertexPositions::covariancePosition ( ) const

return the covDeltaV matrix of the vertex fit

Definition at line 123 of file RecVertexPositions.cxx.

124 {return m_positionError; }

◆ dump() [1/2]

MsgStream & Trk::RecVertexPositions::dump ( MsgStream & sl) const
virtual

Output Method for MsgStream, to be overloaded by child classes.

Reimplemented from Trk::VertexPositions.

Definition at line 80 of file RecVertexPositions.cxx.

80 {
81 sl << "Trk::RecVertexPositions: \n";
82 std::ostringstream oss;
83 dump(oss);
84 sl << oss.str() << endmsg;
85 return sl;
86 }
#define endmsg
virtual MsgStream & dump(MsgStream &sl) const
Output Method for MsgStream, to be overloaded by child classes.

◆ dump() [2/2]

std::ostream & Trk::RecVertexPositions::dump ( std::ostream & sl) const
virtual

Output Method for std::ostream, to be overloaded by child classes.

Reimplemented from Trk::VertexPositions.

Definition at line 88 of file RecVertexPositions.cxx.

88 {
90 sl << "Trk::VertexPositions weight times position: (" ;
91 } else {
92 sl << "Trk::VertexPositions position: (" ;
93 }
94 sl << "xv " << m_position(jet_xv) << "+/-" <<std::sqrt(this->covariancePosition()(jet_xv,jet_xv)) << " , "
95 << "yv " << m_position(jet_yv) << "+/-" <<std::sqrt(this->covariancePosition()(jet_yv,jet_yv)) <<", "
96 << "zv " << m_position(jet_zv) << "+/-" <<std::sqrt(this->covariancePosition()(jet_zv,jet_zv)) <<", "
97 << "phi " << m_position(jet_phi) << "+/-"<<std::sqrt(this->covariancePosition()(jet_phi,jet_phi)) <<", "
98 << "theta " << m_position(jet_theta)<<"+/-"<<std::sqrt(this->covariancePosition()(jet_theta,jet_theta))
99 << "\n";
101 for (int i=5;i<m_position.rows();i++) {
102 sl << "dist" << i << " " << m_position(i) << "+/-" << std::sqrt(this->covariancePosition()(i,i))<<" , ";
103 }
104 } else {
105 for (int i=5;i<m_position.rows();i++) {
106 sl << "dist corrected" << i << " " << (m_positionError*m_position).eval()(i) << "+/-" << std::sqrt(m_positionError(i,i))<<" , ";
107 }
108 }
109 sl << "\n";
110
112 sl << m_positionError << "\n";
113 sl << " ndf: " << m_fitQuality.doubleNumberDoF() << "\t chi2: " << m_fitQuality.chiSquared() << std::endl;
114 return sl;
115 }
Amg::MatrixX const & covariancePosition() const
return the covDeltaV matrix of the vertex fit
Amg::VectorX m_position
vertex position
virtual MsgStream & dump(MsgStream &sl) const
Output Method for MsgStream, to be overloaded by child classes.
@ jet_zv
position x,y,z of primary vertex

◆ finalizePosition()

void Trk::RecVertexPositions::finalizePosition ( )

Definition at line 73 of file RecVertexPositions.cxx.

◆ fitQuality()

const Trk::FitQuality & Trk::RecVertexPositions::fitQuality ( ) const

Fit quality access method.

Definition at line 119 of file RecVertexPositions.cxx.

120 {return m_fitQuality;}

◆ numberOfInstantiations()

std::size_t Trk::ObjectCounter< Trk::VertexPositions >::numberOfInstantiations ( )
inlinestaticinherited

Definition at line 25 of file TrkObjectCounter.h.

26 {
27#ifndef NDEBUG
28 return s_numberOfInstantiations.load();
29#endif
30 return 0;
31 }
Helper to enable counting number of instantiations in debug builds.

◆ operator=() [1/2]

RecVertexPositions & Trk::RecVertexPositions::operator= ( const RecVertexPositions & pos)
default

◆ operator=() [2/2]

RecVertexPositions & Trk::RecVertexPositions::operator= ( RecVertexPositions && pos)
default

◆ position()

const Amg::VectorX & Trk::VertexPositions::position ( ) const
inherited

return position of vertex

Definition at line 86 of file VertexPositions.cxx.

87{
89 return m_position;
90 }
91 std::cout << "FATAL: VertexPositions is not able to return a valid position "
92 << " as a const object: need to go from Update to Use mode. "
93 "Unrecovered Bug!"
94 << std::endl;
95 std::abort();
96 // return m_position;
97}

◆ setCovariancePosition()

void Trk::RecVertexPositions::setCovariancePosition ( const Amg::MatrixX & newerror)

Definition at line 127 of file RecVertexPositions.cxx.

127 {
128 m_positionError=newerror;
129 }

◆ setFitQuality()

void Trk::RecVertexPositions::setFitQuality ( const Trk::FitQuality & newFitQuality)

Definition at line 131 of file RecVertexPositions.cxx.

131 {
132 m_fitQuality=newFitQuality;
133 }

◆ setPosition()

void Trk::VertexPositions::setPosition ( const Amg::VectorX & newposition)
inherited

Definition at line 100 of file VertexPositions.cxx.

101{
102 m_position = newposition;
103}

◆ setWeightTimesPosition()

void Trk::RecVertexPositions::setWeightTimesPosition ( const Amg::VectorX & weightTimesPosition)

Definition at line 65 of file RecVertexPositions.cxx.

◆ weightTimesPosition()

const Amg::VectorX & Trk::RecVertexPositions::weightTimesPosition ( )

Definition at line 50 of file RecVertexPositions.cxx.

50 {
51 if (!m_useWeightTimesPosition && m_positionError.determinant()!=0.0) {
54 } else {
55 std::cout << "Warning in RecVertexPositions: requested finalization but was already finalized..." << std::endl;
56 }
57 return m_position;
58 }

Member Data Documentation

◆ m_fitQuality

Trk::FitQuality Trk::RecVertexPositions::m_fitQuality
private

Definition at line 78 of file RecVertexPositions.h.

◆ m_position

Amg::VectorX Trk::VertexPositions::m_position
protectedinherited

vertex position

Definition at line 48 of file VertexPositions.h.

◆ m_positionError

Amg::MatrixX Trk::RecVertexPositions::m_positionError
private

cov matrix on vertex position (primary vtx+jet dir+distance)

Definition at line 77 of file RecVertexPositions.h.

◆ m_useWeightTimesPosition

bool Trk::VertexPositions::m_useWeightTimesPosition
protectedinherited

Definition at line 49 of file VertexPositions.h.

◆ s_numberOfInstantiations

std::atomic_size_t Trk::ObjectCounter< Trk::VertexPositions >::s_numberOfInstantiations
inlinestaticinherited

Definition at line 22 of file TrkObjectCounter.h.


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