BPException.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // BPException.cxx
4 // Exception handler for track reconstruction failures specific to
5 // BreaPointFitter.
6 // author: mbaird42@fnal.gov
7 //
8 ////////////////////////////////////////////////////////////////////////
10 
11 namespace bpfit {
12  //--------------------------------------------------------------------
13  BPException::BPException(const char* file, unsigned int line,
14  unsigned int flag, double value) :
15  fFile(file),
16  fLine(line),
17  fFlag(flag),
18  fValue(value)
19  { }
20 
21  //--------------------------------------------------------------------
23  {
24  std::cout << "\nBPException ";
25 
26  switch(fFlag) {
27  case kBAD_KE:
28  std::cout << "bad KE";
29  break;
30  case kBAD_RADL:
31  std::cout << "bad radiation length";
32  break;
33  case kNn:
34  std::cout << "num scat surf <= num measurements";
35  break;
36  case kINDEX:
37  std::cout << "index problem";
38  break;
39  case kNAN:
40  std::cout << "nan encountered";
41  break;
42  case kSIGX:
43  std::cout << "bad sigx";
44  break;
45  case kSIGSJ:
46  std::cout << "bad sigSJ";
47  break;
48  case kBAD_P:
49  std::cout << "bad value for p";
50  break;
51  case kBAD_BETA:
52  std::cout << "bad value for beta";
53  break;
54  case kBAD_NDOF:
55  std::cout << "track NDOF is too small";
56  break;
57  case kNPLANES:
58  std::cout << "too few planes in one view";
59  break;
60  case kBAD_TRACK:
61  std::cout << "tracking failure";
62  break;
63  default:
64  std::cout << "UNKNOWN";
65  }
66 
67  std::cout << " with value = " << fValue
68  << " found in " << fFile
69  << " at line " << fLine << "."
70  << std::endl;
71  }
72 
73 }
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
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
OStream cout
Definition: OStream.cxx:6
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