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 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.)
 RecVertexPositions (const RecVertexPositions &)
 copy constructor
RecVertexPositionsoperator= (const RecVertexPositions &)
 Assignement operator.
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 const & covariancePosition () 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 25 of file RecVertexPositions.h.

Constructor & Destructor Documentation

◆ RecVertexPositions() [1/5]

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/5]

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/5]

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() [4/5]

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() [5/5]

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

copy constructor

◆ ~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 162 of file RecVertexPositions.cxx.

163 {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 96 of file RecVertexPositions.cxx.

96 {
97 sl << "Trk::RecVertexPositions: " << std::endl;
98 //VertexOnJetAxis::dump(sl);
99
101 sl << "Trk::VertexPositions weight times position: (" ;
102 } else {
103 sl << "Trk::VertexPositions position: (" ;
104 }
105 sl << "xv " << m_position(jet_xv) << "+/-" << sqrt(m_positionError(jet_xv,jet_xv)) << " , "
106 << "yv " << m_position(jet_yv) << "+/-" << sqrt(m_positionError(jet_yv,jet_yv)) <<", "
107 << "zv " << m_position(jet_zv) << "+/-" << sqrt(m_positionError(jet_zv,jet_zv)) <<", "
108 << "phi " << m_position(jet_phi) << "+/-" << sqrt(m_positionError(jet_phi,jet_phi)) <<", "
109 << "theta " << m_position(jet_theta) << "+/-" << sqrt(m_positionError(jet_theta,jet_theta)) << endmsg;
111 for (int i=5;i<m_position.rows();i++) {
112 sl << "dist" << i << " " << m_position(i) << "+/-" << sqrt(m_positionError(i,i))<<" , ";
113 }
114 } else {
115 for (int i=5;i<m_position.rows();i++) {
116 sl << "dist corrected" << i << " " << (m_positionError*m_position).eval()(i) << "+/-" << sqrt(m_positionError(i,i))<<" , ";
117 }
118 }
119 sl << endmsg;
120
121 sl << m_positionError << std::endl;
122 sl << " ndf: " << m_fitQuality.doubleNumberDoF() << "\t chi2: " << m_fitQuality.chiSquared() << endmsg;
123 return sl;
124 }
#define endmsg
Amg::VectorX m_position
vertex position
@ jet_zv
position x,y,z of primary vertex

◆ 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 126 of file RecVertexPositions.cxx.

126 {
127 // sl << "Trk::RecVertexPositions: " << std::endl;
129 sl << "Trk::VertexPositions weight times position: (" ;
130 } else {
131 sl << "Trk::VertexPositions position: (" ;
132 }
133 sl << "xv " << m_position(jet_xv) << "+/-" <<sqrt(this->covariancePosition()(jet_xv,jet_xv)) << " , "
134 << "yv " << m_position(jet_yv) << "+/-" <<sqrt(this->covariancePosition()(jet_yv,jet_yv)) <<", "
135 << "zv " << m_position(jet_zv) << "+/-" <<sqrt(this->covariancePosition()(jet_zv,jet_zv)) <<", "
136 << "phi " << m_position(jet_phi) << "+/-"<<sqrt(this->covariancePosition()(jet_phi,jet_phi)) <<", "
137 << "theta " << m_position(jet_theta)<<"+/-"<<sqrt(this->covariancePosition()(jet_theta,jet_theta))
138 << std::endl;
140 for (int i=5;i<m_position.rows();i++) {
141 sl << "dist" << i << " " << m_position(i) << "+/-" << sqrt(this->covariancePosition()(i,i))<<" , ";
142 }
143 } else {
144 for (int i=5;i<m_position.rows();i++) {
145 sl << "dist corrected" << i << " " << (m_positionError*m_position).eval()(i) << "+/-" << sqrt(m_positionError(i,i))<<" , ";
146 }
147 }
148 sl << std::endl;
149
151 sl << m_positionError << std::endl;
152 sl << " ndf: " << m_fitQuality.doubleNumberDoF() << "\t chi2: " << m_fitQuality.chiSquared() << std::endl;
153 return sl;
154 }
Amg::MatrixX const & covariancePosition() const
return the covDeltaV matrix of the vertex fit
virtual MsgStream & dump(MsgStream &sl) const
Output Method for MsgStream, to be overloaded by child classes.

◆ finalizePosition()

void Trk::RecVertexPositions::finalizePosition ( )

Definition at line 75 of file RecVertexPositions.cxx.

◆ fitQuality()

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

Fit quality access method.

Definition at line 158 of file RecVertexPositions.cxx.

159 {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=()

RecVertexPositions & Trk::RecVertexPositions::operator= ( const RecVertexPositions & rhs)

Assignement operator.

Definition at line 84 of file RecVertexPositions.cxx.

85 {
86 if (this!=&rhs)
87 {
88 // you need to call the base class assignment operator
90 m_positionError = rhs.m_positionError;
91 m_fitQuality = rhs.m_fitQuality;
92 }
93 return *this;
94 }
VertexPositions & operator=(const VertexPositions &)=default
Assignment operator.

◆ 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 166 of file RecVertexPositions.cxx.

166 {
167 m_positionError=newerror;
168 }

◆ setFitQuality()

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

Definition at line 170 of file RecVertexPositions.cxx.

170 {
171 m_fitQuality=newFitQuality;
172 }

◆ 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 67 of file RecVertexPositions.cxx.

◆ weightTimesPosition()

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

Definition at line 52 of file RecVertexPositions.cxx.

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

Member Data Documentation

◆ m_fitQuality

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

Definition at line 72 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 71 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: