BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Ext_err_valid.cxx File Reference
#include "CLHEP/Matrix/SymMatrix.h"
#include <iostream>

Go to the source code of this file.

Functions

bool Ext_err_valid (bool msg, HepSymMatrix &error, const int dimension)
bool Ext_err_valid (bool msg, const HepSymMatrix &error, const int dimension)

Function Documentation

◆ Ext_err_valid() [1/2]

bool Ext_err_valid ( bool msg,
const HepSymMatrix & error,
const int dimension )

Definition at line 96 of file Ext_err_valid.cxx.

96 {
97 bool valid( 1 );
98 double trace( 0 );
99
100 for ( int i = 1; i <= dimension; i++ )
101 {
102 double elem( error( i, i ) );
103 trace += elem;
104 if ( elem < 0.0 )
105 {
106 valid = 0;
107 if ( msg )
108 {
109 std::cout << "%ERROR detected at Ext_err_valid: error matrix: error(" << i << "," << i
110 << ")= " << elem << " < 0.0." << std::endl;
111 }
112 }
113 else if ( elem > Large )
114 {
115 valid = 0;
116 if ( msg )
117 {
118 std::cout << "%ERROR detected at Ext_err_valid: error matrix: error(" << i << "," << i
119 << ")= " << elem << " > " << Large << std::endl;
120 }
121 }
122 }
123 if ( !trace ) valid = 0;
124 return ( valid );
125}

◆ Ext_err_valid() [2/2]

bool Ext_err_valid ( bool msg,
HepSymMatrix & error,
const int dimension )

Definition at line 58 of file Ext_err_valid.cxx.

58 {
59 bool valid( 1 );
60 double trace( 0 );
61
62 for ( int i = 1; i <= dimension; i++ )
63 {
64 double elem( error( i, i ) );
65 trace += elem;
66 if ( elem < 0.0 )
67 {
68 valid = 0;
69 if ( msg )
70 {
71 std::cout << "%ERROR detected at Ext_err_valid: error(" << i << "," << i
72 << ") = " << elem << " < 0.0. "
73 << "Force to 0.0." << std::endl;
74 }
75 error( i, i ) = 0.0;
76 }
77 else if ( elem > Large )
78 {
79 valid = 0;
80 if ( msg )
81 {
82 std::cout << "%ERROR detected at Ext_err_valid: error(" << i << "," << i
83 << ") = " << elem << " > " << Large << ". Force to " << Large << std::endl;
84 }
85 error( i, i ) = Large;
86 }
87 }
88 if ( !trace ) valid = 0;
89 return ( valid );
90}

Referenced by Ext_errmx::valid().