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 28 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 33 of file KFitError.h.

33 {
35 kNoError = 0,
36
38 kNotFittedYet = 1,
39
41 kOutOfRange = 11,
43 kUnimplemented = 12,
44
46 kBadTrackSize = 21,
48 kBadMatrixSize = 22,
50 kBadCorrelationSize = 23,
52 kBadInitialCHIsq = 24,
53
55 kDivisionByZero = 31,
57 kCannotGetMatrixInverse = 32,
59 kCannotGetARCSIN = 33,
60 };

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 71 of file KFitError.h.

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

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