BOSS 7.0.1
BESIII Offline Software System
Loading...
Searching...
No Matches
BesError.cxx File Reference
#include <stdio.h>
#include <assert.h>
#include <ctype.h>
#include "MdcRecoUtil/BesError.h"
#include "CLHEP/Matrix/Matrix.h"

Go to the source code of this file.

Functions

ostream & operator<< (ostream &out, const BesError &mat)
 
istream & operator>> (istream &in, BesError &mat)
 
BesError operator* (double t, const BesError &m1)
 
BesError operator* (const BesError &m1, double t)
 
BesError operator/ (double t, const BesError &m1)
 
BesError operator/ (const BesError &m1, double t)
 
BesError operator+ (const BesError &m1, const BesError &m2)
 
BesError operator- (const BesError &m1, const BesError &m2)
 

Function Documentation

◆ operator*() [1/2]

BesError operator* ( const BesError m1,
double  t 
)

Definition at line 162 of file BesError.cxx.

163 {
164 BesError mret = m1;
165 mret *= t;
166 return mret;
167 }
int t()
Definition: t.c:1

◆ operator*() [2/2]

BesError operator* ( double  t,
const BesError m1 
)

Definition at line 155 of file BesError.cxx.

156 {
157 BesError mret = m1;
158 mret *= t;
159 return mret;
160 }

◆ operator+()

BesError operator+ ( const BesError m1,
const BesError m2 
)

Definition at line 183 of file BesError.cxx.

184 {
185 BesError mret = m1;
186 mret += m2;
187 return mret;
188 }

◆ operator-()

BesError operator- ( const BesError m1,
const BesError m2 
)

Definition at line 190 of file BesError.cxx.

191 {
192 BesError mret = m1;
193 mret -= m2;
194 return mret;
195 }

◆ operator/() [1/2]

BesError operator/ ( const BesError m1,
double  t 
)

Definition at line 176 of file BesError.cxx.

177 {
178 BesError mret = m1;
179 mret /= t;
180 return mret;
181 }

◆ operator/() [2/2]

BesError operator/ ( double  t,
const BesError m1 
)

Definition at line 169 of file BesError.cxx.

170 {
171 BesError mret = m1;
172 mret /= t;
173 return mret;
174 }

◆ operator<<()

ostream & operator<< ( ostream &  out,
const BesError mat 
)

Definition at line 122 of file BesError.cxx.

123{
124 out << "Bes Covariance Matrix:";
125 out << (HepSymMatrix&) mat;
126 return out;
127}

◆ operator>>()

istream & operator>> ( istream &  in,
BesError mat 
)

Definition at line 129 of file BesError.cxx.

129 {
130 // Peek at the next non-space character:
131 char nextChar = ' ';
132 while (isspace(nextChar)){
133 nextChar = in.get();
134 }
135 in.putback(nextChar);
136
137 if (EOF != nextChar){
138 if (!isdigit(nextChar)){
139 // Remove the "Bes Covariance Matrix:" line:
140 const int DUMMY_SIZE = 1000;
141 char dummy[DUMMY_SIZE];
142 in.getline(dummy, DUMMY_SIZE);
143 }
144 // Read in the matrix:
145 for (int row = 1; row <= mat.num_row(); ++row){
146 for (int col = 1; col <= mat.num_col(); ++col){
147 in >> mat(row, col);
148 }
149 }
150 }
151 return in;
152}