PandaRoot
GFException.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 /* Copyright 2008-2010, Technische Universitaet Muenchen,
14  Authors: Christian Hoeppner & Sebastian Neubert
15 
16  This file is part of GENFIT.
17 
18  GENFIT is free software: you can redistribute it and/or modify
19  it under the terms of the GNU Lesser General Public License as published
20  by the Free Software Foundation, either version 3 of the License, or
21  (at your option) any later version.
22 
23  GENFIT is distributed in the hope that it will be useful,
24  but WITHOUT ANY WARRANTY; without even the implied warranty of
25  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26  GNU Lesser General Public License for more details.
27 
28  You should have received a copy of the GNU Lesser General Public License
29  along with GENFIT. If not, see <http://www.gnu.org/licenses/>.
30 */
34 #ifndef GFEXCEPTION_H
35 #define GFEXCEPTION_H
36 
37 #include <exception>
38 #include <string>
39 #include <vector>
40 #include <iostream>
41 #include <sstream>
42 
43 #include "TMatrixT.h"
44 
56 class GFException : public std::exception {
57  private:
58  static bool fQuiet;
59 
60  std::string fExcString;
61  int fLine;
62  std::string fFile;
63 
64  std::string fErrorMessage;
65 
66  std::string fNumbersLabel;
67  std::string fMatricesLabel;
68  std::vector<double> fNumbers;
69  std::vector<TMatrixT<double>> fMatrices;
70 
71  bool fFatal;
72 
73  public:
82  GFException(std::string, int, std::string);
83  virtual ~GFException() throw();
84 
86  void setFatal(bool b = true) { fFatal = b; }
88  bool isFatal() { return fFatal; }
90  void setNumbers(std::string, const std::vector<double> &);
92  void setMatrices(std::string, const std::vector<TMatrixT<double>> &);
93 
95  void info();
96 
98  virtual const char *what() const throw();
99 
100  std::string getExcString() { return fExcString; }
101 
102  static void quiet(bool b = true) { fQuiet = b; }
103 };
104 
105 #endif
106 
void setMatrices(std::string, const std::vector< TMatrixT< double >> &)
set list of matrices with description
static void quiet(bool b=true)
Definition: GFException.h:102
void setNumbers(std::string, const std::vector< double > &)
set list of numbers with description
virtual ~GFException()
bool isFatal()
get fatal flag.
Definition: GFException.h:88
std::string getExcString()
Definition: GFException.h:100
void info()
print information in the exception object
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
Definition: GFException.h:56
GFException(std::string, int, std::string)
Initializing constructor.
void setFatal(bool b=true)
set fatal flag. if this is true, the fit stops for this current track repr.
Definition: GFException.h:86
virtual const char * what() const
standard error message handling for exceptions. use like "std::cerr << e.what();" ...