File indexing completed on 2025-08-05 08:18:21
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #include "Exception.h"
0021 #include "IO.h"
0022
0023 namespace genfit {
0024
0025 bool Exception::quiet_ = false;
0026
0027 Exception::Exception(std::string excString, int line, std::string file) :
0028 excString_(excString), line_(line), file_(file), fatal_(false) {
0029 std::ostringstream ErrMsgStream;
0030 ErrMsgStream << "genfit::Exception thrown with excString:"
0031 << std::endl << excString_ << std::endl
0032 << "in line: " << line_ << " in file: " << file_ << std::endl
0033 << "with fatal flag " << fatal_ << std::endl;
0034 errorMessage_ = ErrMsgStream.str();
0035 }
0036
0037 Exception::~Exception() noexcept {
0038 }
0039
0040 void Exception::setNumbers(std::string _numbersLabel,
0041 const std::vector<double>& _numbers) {
0042 numbersLabel_ = _numbersLabel;
0043 numbers_ = _numbers;
0044 }
0045
0046 void Exception::setMatrices(std::string _matricesLabel,
0047 const std::vector<TMatrixD>& _matrices) {
0048 matricesLabel_ = _matricesLabel;
0049 matrices_ = _matrices;
0050 }
0051
0052 const char* Exception::what() const noexcept{
0053 return errorMessage_.c_str();
0054 }
0055
0056 void Exception::info() {
0057 if(quiet_) return;
0058 if(numbers_.empty() && matrices_.empty()) return;
0059 debugOut << "genfit::Exception Info Output" << std::endl;
0060 debugOut << "===========================" << std::endl;
0061 if(numbersLabel_ != "") {
0062 debugOut << "Numbers Label String:" << std::endl;
0063 debugOut << numbersLabel_ << std::endl;
0064 }
0065 if(!numbers_.empty()) {
0066 debugOut << "---------------------------" << std::endl;
0067 debugOut << "Numbers:" << std::endl;
0068 for(unsigned int i=0;i<numbers_.size(); ++i ) debugOut << numbers_[i] << std::endl;
0069 }
0070 if(matricesLabel_ != "") {
0071 debugOut << "---------------------------" << std::endl;
0072 debugOut << "Matrices Label String:" << std::endl;
0073 debugOut << matricesLabel_ << std::endl;
0074 }
0075 if(!matrices_.empty()) {
0076 debugOut << "---------------------------" << std::endl;
0077 debugOut << "Matrices:" << std::endl;
0078 for(unsigned int i=0;i<matrices_.size(); ++i ) matrices_[i].Print();
0079 }
0080 debugOut << "===========================" << std::endl;
0081 }
0082
0083 }
0084