Belle II Software development
KFitError Class Reference

KFitError is a container of error codes and a macro function. More...

#include <KFitError.h>

Public Types

enum  ECode {
  kNoError = 0 ,
  kNotFittedYet = 1 ,
  kOutOfRange = 11 ,
  kUnimplemented = 12 ,
  kBadTrackSize = 21 ,
  kBadMatrixSize = 22 ,
  kBadCorrelationSize = 23 ,
  kBadInitialCHIsq = 24 ,
  kDivisionByZero = 31 ,
  kCannotGetMatrixInverse = 32 ,
  kCannotGetARCSIN = 33
}
 ECode is a error code enumerate. More...
 

Static Public Member Functions

static void displayError (const char *file, const int line, const char *func, const enum ECode code)
 Display a description of error and its location.
 

Detailed Description

KFitError is a container of error codes and a macro function.

Definition at line 29 of file KFitError.h.

Member Enumeration Documentation

◆ ECode

enum ECode

ECode is a error code enumerate.

Enumerator
kNoError 

No error.

kNotFittedYet 

Not fitted yet.

kOutOfRange 

Specified track-id out of range.

kUnimplemented 

Unprepared.

kBadTrackSize 

Track count too small to perform fit.

kBadMatrixSize 

Wrong correlation matrix size.

kBadCorrelationSize 

Wrong correlation matrix size (internal error)

kBadInitialCHIsq 

Bad initial chi-square (internal error)

kDivisionByZero 

Division by zero (bad track property or internal error)

kCannotGetMatrixInverse 

Cannot calculate matrix inverse (bad track property or internal error)

kCannotGetARCSIN 

Cannot get arcsin (bad track property or internal error)

Definition at line 34 of file KFitError.h.

34 {
36 kNoError = 0,
37
39 kNotFittedYet = 1,
40
42 kOutOfRange = 11,
44 kUnimplemented = 12,
45
47 kBadTrackSize = 21,
49 kBadMatrixSize = 22,
54
56 kDivisionByZero = 31,
61 };
@ kCannotGetARCSIN
Cannot get arcsin (bad track property or internal error)
Definition: KFitError.h:60
@ kUnimplemented
Unprepared.
Definition: KFitError.h:44
@ kCannotGetMatrixInverse
Cannot calculate matrix inverse (bad track property or internal error)
Definition: KFitError.h:58
@ kOutOfRange
Specified track-id out of range.
Definition: KFitError.h:42
@ kNotFittedYet
Not fitted yet.
Definition: KFitError.h:39
@ kDivisionByZero
Division by zero (bad track property or internal error)
Definition: KFitError.h:56
@ kBadInitialCHIsq
Bad initial chi-square (internal error)
Definition: KFitError.h:53
@ kBadTrackSize
Track count too small to perform fit.
Definition: KFitError.h:47
@ kBadMatrixSize
Wrong correlation matrix size.
Definition: KFitError.h:49
@ kBadCorrelationSize
Wrong correlation matrix size (internal error)
Definition: KFitError.h:51

Member Function Documentation

◆ displayError()

static void displayError ( const char *  file,
const int  line,
const char *  func,
const enum ECode  code 
)
inlinestatic

Display a description of error and its location.

Parameters
filefile name where the error takes place
lineline number in the file
funcfunction name in the file
codeerror code

Definition at line 72 of file KFitError.h.

73 {
74 const char* str_error =
75 code == kNoError ? "No error" :
76 code == kNotFittedYet ? "Not fitted yet" :
77 code == kOutOfRange ? "Out of range" :
78 code == kBadTrackSize ? "Bad track count" :
79 code == kBadMatrixSize ? "Bad matrix size" :
80 code == kBadCorrelationSize ? "Bad correlation size" :
81 code == kBadInitialCHIsq ? "Bad initial chisq" :
82 code == kDivisionByZero ? "Division by zero" :
83 code == kCannotGetMatrixInverse ? "Cannot calculate matrix inverse" :
84 code == kCannotGetARCSIN ? "Cannot calculate arcsin" :
85 "Unknown error";
86
87 char buf[1024];
88 sprintf(buf, "%s:%d:%s(): %s", file, line, func, str_error);
89 B2WARNING(buf);
90 }

The documentation for this class was generated from the following file: