BPException.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // BPException.h
4 // Exception handler for track reconstruction failures specific to
5 // BreaPointFitter.
6 // author: mbaird42@fnal.gov
7 //
8 ////////////////////////////////////////////////////////////////////////
9 #ifndef BPF_BPEXCEPTION_H
10 #define BPF_BPEXCEPTION_H
11 
12 #include <iostream>
13 #include <exception>
14 
15 namespace bpfit {
16 
17  // Exception types:
18  const unsigned int kBAD_KE = 1; ///< negative KE value < tol
19  const unsigned int kBAD_RADL = 2; ///< non-positive radiation length
20  const unsigned int kNn = 3; ///< number of scat surf >= number of measurements
21  const unsigned int kINDEX = 4; ///< index problem
22  const unsigned int kNAN = 5; ///< nan encountered
23  const unsigned int kSIGX = 6; ///< non-positive value of sigx
24  const unsigned int kSIGSJ = 7; ///< non-positive value of sigSJ
25  const unsigned int kBAD_P = 8; ///< negative value for p
26  const unsigned int kBAD_BETA = 9; ///< negative value for beta
27  const unsigned int kBAD_NDOF = 10; ///< too few hits used to make the track
28  const unsigned int kNPLANES = 11; ///< too few planes in one (or both) views
29  const unsigned int kBAD_TRACK= 12; ///< a generic catch-all category for tracking failures
30 
31  class BPException : public std::exception {
32  public:
33  BPException(const char* file, unsigned int line,
34  unsigned int flag, double value = 0.0);
36 
37  void Print();
38 
39  const char* fFile; ///< Name of file that threw the exception.
40  unsigned int fLine; ///< Line number where exception was thrown.
41  unsigned int fFlag; ///< Exception code thrown.
42  double fValue; ///< (optional) Value of bad variable that caused the exception.
43 
44  };
45 }
46 
47 #endif
48 ////////////////////////////////////////////////////////////////////////
const unsigned int kSIGX
non-positive value of sigx
Definition: BPException.h:23
const unsigned int kBAD_KE
negative KE value < tol
Definition: BPException.h:18
const unsigned int kBAD_P
negative value for p
Definition: BPException.h:25
const unsigned int kNAN
nan encountered
Definition: BPException.h:22
::xsd::cxx::tree::exception< char > exception
Definition: Database.h:225
const unsigned int kNn
number of scat surf >= number of measurements
Definition: BPException.h:20
const XML_Char int const XML_Char * value
Definition: expat.h:331
const char * fFile
Name of file that threw the exception.
Definition: BPException.h:39
BPException(const char *file, unsigned int line, unsigned int flag, double value=0.0)
Definition: BPException.cxx:13
const unsigned int kNPLANES
too few planes in one (or both) views
Definition: BPException.h:28
unsigned int fLine
Line number where exception was thrown.
Definition: BPException.h:40
const unsigned int kINDEX
index problem
Definition: BPException.h:21
const unsigned int kBAD_NDOF
too few hits used to make the track
Definition: BPException.h:27
const unsigned int kSIGSJ
non-positive value of sigSJ
Definition: BPException.h:24
unsigned int fFlag
Exception code thrown.
Definition: BPException.h:41
double fValue
(optional) Value of bad variable that caused the exception.
Definition: BPException.h:42
TFile * file
Definition: cellShifts.C:17
const unsigned int kBAD_RADL
non-positive radiation length
Definition: BPException.h:19
const unsigned int kBAD_TRACK
a generic catch-all category for tracking failures
Definition: BPException.h:29
const unsigned int kBAD_BETA
negative value for beta
Definition: BPException.h:26