20 #include "Exception.h"
25 bool Exception::quiet_ =
false;
28 excString_(excString), line_(line), file_(file), fatal_(false) {
29 std::ostringstream ErrMsgStream;
30 ErrMsgStream <<
"genfit::Exception thrown with excString:"
31 << std::endl << excString_ << std::endl
32 <<
"in line: " << line_ <<
" in file: " << file_ << std::endl
33 <<
"with fatal flag " << fatal_ << std::endl;
34 errorMessage_ = ErrMsgStream.str();
37 Exception::~Exception() noexcept {
41 const std::vector<double>& _numbers) {
42 numbersLabel_ = _numbersLabel;
47 const std::vector<TMatrixD>& _matrices) {
48 matricesLabel_ = _matricesLabel;
49 matrices_ = _matrices;
53 return errorMessage_.c_str();
58 if(numbers_.empty() && matrices_.empty())
return;
59 debugOut <<
"genfit::Exception Info Output" << std::endl;
60 debugOut <<
"===========================" << std::endl;
61 if(numbersLabel_ !=
"") {
62 debugOut <<
"Numbers Label String:" << std::endl;
63 debugOut << numbersLabel_ << std::endl;
65 if(!numbers_.empty()) {
66 debugOut <<
"---------------------------" << std::endl;
68 for(
unsigned int i=0;i<numbers_.size(); ++i )
debugOut << numbers_[i] << std::endl;
70 if(matricesLabel_ !=
"") {
71 debugOut <<
"---------------------------" << std::endl;
72 debugOut <<
"Matrices Label String:" << std::endl;
73 debugOut << matricesLabel_ << std::endl;
75 if(!matrices_.empty()) {
76 debugOut <<
"---------------------------" << std::endl;
77 debugOut <<
"Matrices:" << std::endl;
78 for(
unsigned int i=0;i<matrices_.size(); ++i ) matrices_[i].Print();
80 debugOut <<
"===========================" << std::endl;
virtual const char * what() const noexcept
Standard error message handling for exceptions. use like "std::cerr << e.what();".
void setMatrices(std::string, const std::vector< TMatrixD > &)
Set list of matrices with description.
Exception(std::string excString, int line, std::string file)
Initializing constructor.
void setNumbers(std::string, const std::vector< double > &)
Set list of numbers with description.
void info()
Print information in the exception object.
Defines for I/O streams used for error and debug printing.
std::ostream debugOut
Default stream for debug output.