ATLAS Offline Software
Loading...
Searching...
No Matches
RecVertexPositions.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 RecVertexPositions.cxx - Description
7 -------------------
8 begin : Autumn 2006
9 authors : Giacinto Piacquadio (Freiburg University)
10 email : Giacinto.Piacquadio@physik.uni-freiburg.de
11 comments:
12 changes :
13
14 ***************************************************************************/
15
17#include "GaudiKernel/MsgStream.h"
18#include <iostream>
19#include <sstream>
20#include <cmath>
21
22namespace Trk {
23
28
29
34
35
37 const double ndf, const double chi2,
38 bool isWeightTimesPosition) :
40 m_useWeightTimesPosition=isWeightTimesPosition;
41 }
42
43
44 RecVertexPositions::RecVertexPositions(const Amg::VectorX &pos, const double ndf, const double chi2) :
45 VertexPositions(pos),
46 m_positionError(Amg::MatrixX()),
48
49
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 }
59
60 // Use storing weight matrix * position instead of position
61 // saves you from inverting the weight matrix at every fit iteration
62 // Then transparently, asking the position for the first time,
63 // the m_position will be restored to the correct value of position
64 // (using the invertion of the weight matrix only once...)
69
70 //the finalizePosition() method is used to ask the RecVertexPositions class
71 //to invert the weight matrix and fill the m_position vector with the real
72 //position, in order to finalize the position (and make it available)
79
80 MsgStream& RecVertexPositions::dump(MsgStream& sl) const {
81 sl << "Trk::RecVertexPositions: \n";
82 std::ostringstream oss;
83 dump(oss);
84 sl << oss.str() << endmsg;
85 return sl;
86 }
87
88 std::ostream& RecVertexPositions::dump(std::ostream& sl) const {
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 }
116
118
121
122
125
126
128 m_positionError=newerror;
129 }
130
132 m_fitQuality=newFitQuality;
133 }
134
135
136
137} // end of namespace
#define endmsg
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
Definition FitQuality.h:97
virtual ~RecVertexPositions()
default destructor
RecVertexPositions()
default constructor, if called initializes a RecVertexPositions with all data members set to 0.
Amg::MatrixX const & covariancePosition() const
return the covDeltaV matrix of the vertex fit
void setWeightTimesPosition(const Amg::VectorX &)
const Amg::VectorX & weightTimesPosition()
void setFitQuality(const Trk::FitQuality &)
const Trk::FitQuality & fitQuality() const
Fit quality access method.
Amg::MatrixX m_positionError
cov matrix on vertex position (primary vtx+jet dir+distance)
void setCovariancePosition(const Amg::MatrixX &)
virtual MsgStream & dump(MsgStream &sl) const
Output Method for MsgStream, to be overloaded by child classes.
VertexPositions()
default constructor
Amg::VectorX m_position
vertex position
virtual MsgStream & dump(MsgStream &sl) const
Output Method for MsgStream, to be overloaded by child classes.
double chi2(TH1 *h0, TH1 *h1)
Definition of ATLAS Math & Geometry primitives (Amg).
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Eigen::Matrix< double, Eigen::Dynamic, 1 > VectorX
Dynamic Vector - dynamic allocation.
Ensure that the ATLAS eigen extensions are properly loaded.
@ jet_zv
position x,y,z of primary vertex
-event-from-file