27 { m_positionError.setZero();}
30 RecVertexPositions::RecVertexPositions(
const VertexPositions&
pos) :
33 { m_positionError.setZero();}
37 const double ndf,
const double chi2,
38 bool isWeightTimesPosition) :
40 m_useWeightTimesPosition=isWeightTimesPosition;
52 const Amg::VectorX& RecVertexPositions::weightTimesPosition() {
53 if (!m_useWeightTimesPosition && m_positionError.determinant()!=0.0) {
54 m_position=m_positionError.inverse()*m_position;
55 m_useWeightTimesPosition=
true;
57 std::cout <<
"Warning in RecVertexPositions: requested finalization but was already finalized..." << std::endl;
67 void RecVertexPositions::setWeightTimesPosition(
const Amg::VectorX & weightTimesPosition) {
68 m_useWeightTimesPosition=
true;
69 m_position=weightTimesPosition;
75 void RecVertexPositions::finalizePosition() {
76 if (m_useWeightTimesPosition) {
77 m_useWeightTimesPosition=
false;
78 m_position=m_positionError*m_position;
89 VertexPositions::operator=(rhs);
97 sl <<
"Trk::RecVertexPositions: " << std::endl;
100 if (m_useWeightTimesPosition) {
101 sl <<
"Trk::VertexPositions weight times position: (" ;
103 sl <<
"Trk::VertexPositions position: (" ;
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)) <<
", "
110 if (!m_useWeightTimesPosition) {
111 for (
int i=5;
i<m_position.rows();
i++) {
112 sl <<
"dist" <<
i <<
" " << m_position(
i) <<
"+/-" << sqrt(m_positionError(
i,
i))<<
" , ";
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))<<
" , ";
121 sl << m_positionError << std::endl;
122 sl <<
" ndf: " << m_fitQuality.doubleNumberDoF() <<
"\t chi2: " << m_fitQuality.chiSquared() <<
endmsg;
128 if (m_useWeightTimesPosition) {
129 sl <<
"Trk::VertexPositions weight times position: (" ;
131 sl <<
"Trk::VertexPositions position: (" ;
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)) <<
", "
139 if (!m_useWeightTimesPosition) {
140 for (
int i=5;
i<m_position.rows();
i++) {
141 sl <<
"dist" <<
i <<
" " << m_position(
i) <<
"+/-" << sqrt(this->covariancePosition()(
i,
i))<<
" , ";
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))<<
" , ";
151 sl << m_positionError << std::endl;
152 sl <<
" ndf: " << m_fitQuality.doubleNumberDoF() <<
"\t chi2: " << m_fitQuality.chiSquared() << std::endl;
156 RecVertexPositions::~RecVertexPositions() =
default;
159 {
return m_fitQuality;}
162 const Amg::MatrixX& RecVertexPositions::covariancePosition()
const
163 {
return m_positionError; }
166 void RecVertexPositions::setCovariancePosition(
const Amg::MatrixX & newerror) {
167 m_positionError=newerror;
170 void RecVertexPositions::setFitQuality(
const Trk::FitQuality & newFitQuality) {
171 m_fitQuality=newFitQuality;