| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Public Attributes | Friends | List of all members
StatEntity::se Struct Reference

## Public Member Functions
se & | operator+= (const struct se &other)
unsigned long | add (double Flag)
double | mean () const
double | rms () const
double | meanErr () const
double | efficiency () const
double | efficiencyErr () const

## Public Attributes
unsigned long | nEntries = 0
| number of calls More...
double | accumulatedFlag = 0
| accumulated flag More...
double | accumulatedFlag2 = 0
double | minimalFlag = std::numeric_limits<double>::max()
double | maximalFlag = -1 * std::numeric_limits<double>::max()
long | nEntriesBeforeReset = -1

## Friends
bool | operator< (const struct se &lhs, const struct se &rhs)

## Detailed Description

Definition at line 446 of file StatEntity.h.

## Member Function Documentation

unsigned long StatEntity::se::add | ( | double | Flag | ) |

accumulate the flag

evaluate min/max

Definition at line 83 of file StatEntity.cpp.

84 {
85 if ( 0 < nEntriesBeforeReset ) {
86 --nEntriesBeforeReset;
87 } else if ( 0 == nEntriesBeforeReset ) {
88 *this = {};
89 }
90 accumulatedFlag += Flag; // accumulate the flag
93 minimalFlag = std::min( minimalFlag, Flag ); // evaluate min/max
94 maximalFlag = std::max( maximalFlag, Flag ); // evaluate min/max
95 // accumulate statistics, but avoid FPE for small flags...
96 static double s_min1 = 2 * ::sqrt( std::numeric_limits<double>::min() );
97 if ( s_min1 < Flag || -s_min1 > Flag ) {
98 accumulatedFlag2 += Flag * Flag;
99 } // accumulate statistics:
100 //
101 return ++nEntries;
102 }
StatEntity::se::nEntriesBeforeReset
long nEntriesBeforeReset
Definition: StatEntity.h:455
StatEntity::se::accumulatedFlag
double accumulatedFlag
accumulated flag
Definition: StatEntity.h:450
StatEntity::se::minimalFlag
double minimalFlag
Definition: StatEntity.h:452
std::min
T min(T...args)
StatEntity::se::maximalFlag
double maximalFlag
Definition: StatEntity.h:453
std::max
T max(T...args)
StatEntity::se::accumulatedFlag2
double accumulatedFlag2
Definition: StatEntity.h:451
StatEntity::se::nEntries
unsigned long nEntries
number of calls
Definition: StatEntity.h:448
std::numeric_limits

double StatEntity::se::efficiency | ( |  | ) | const

Definition at line 149 of file StatEntity.cpp.

150 {
151 if ( 1 > nEntries || 0 > accumulatedFlag || accumulatedFlag > nEntries ) {
152 return -1;
153 }
154 const long double fMin = minimalFlag;
155 if ( 0 != fMin && 1 != fMin ) {
156 return -1;
157 }
158 const long double fMax = maximalFlag;
159 if ( 0 != fMax && 1 != fMax ) {
160 return -1;
161 }
162 return mean();
163 }
StatEntity::se::mean
double mean() const
Definition: StatEntity.cpp:106
StatEntity::se::accumulatedFlag
double accumulatedFlag
accumulated flag
Definition: StatEntity.h:450
StatEntity::se::minimalFlag
double minimalFlag
Definition: StatEntity.h:452
StatEntity::se::maximalFlag
double maximalFlag
Definition: StatEntity.h:453
StatEntity::se::nEntries
unsigned long nEntries
number of calls
Definition: StatEntity.h:448

double StatEntity::se::efficiencyErr | ( |  | ) | const

Definition at line 167 of file StatEntity.cpp.

168 {
169 if ( 0 > efficiency() ) {
170 return -1;
171 }
172 //
173 long double n1 = accumulatedFlag;
174 // treat properly the bins with eff=0
175 if ( 0 == n1 ) {
176 n1 = 1;
177 }
178 const long double n3 = nEntries;
179 long double n2 = n3 - accumulatedFlag;
180 // treat properly the bins with eff=100%
181 if ( 1 > fabsl( n2 ) ) {
182 n2 = 1;
183 }
184 //
185 return ::sqrtl( n1 * n2 / n3 ) / n3;
186 }
StatEntity::se::accumulatedFlag
double accumulatedFlag
accumulated flag
Definition: StatEntity.h:450
StatEntity::se::efficiency
double efficiency() const
Definition: StatEntity.cpp:149
StatEntity::se::nEntries
unsigned long nEntries
number of calls
Definition: StatEntity.h:448

double StatEntity::se::mean | ( |  | ) | const

Definition at line 106 of file StatEntity.cpp.

107 {
108 const long double f1 = accumulatedFlag;
109 const long double f2 = nEntries;
110 return nEntries > 0 ? f1 / f2 : 0;
111 }
StatEntity::se::accumulatedFlag
double accumulatedFlag
accumulated flag
Definition: StatEntity.h:450
StatEntity::se::nEntries
unsigned long nEntries
number of calls
Definition: StatEntity.h:448

double StatEntity::se::meanErr | ( |  | ) | const

Definition at line 130 of file StatEntity.cpp.

131 {
132 if ( 0 >= nEntries ) {
133 return 0;
134 }
135 const long double f1 = accumulatedFlag;
136 const long double f2 = f1 / nEntries;
137 const long double f3 = accumulatedFlag2;
138 const long double f4 = f3 / nEntries;
139 const long double result = f4 - f2 * f2;
140 if ( 0 > result ) {
141 return 0;
142 }
143 //
144 return ::sqrtl( result / nEntries );
145 }
StatEntity::se::accumulatedFlag
double accumulatedFlag
accumulated flag
Definition: StatEntity.h:450
StatEntity::se::accumulatedFlag2
double accumulatedFlag2
Definition: StatEntity.h:451
StatEntity::se::nEntries
unsigned long nEntries
number of calls
Definition: StatEntity.h:448

se& StatEntity::se::operator+= | ( | const struct se & | other | ) |
| inline

Definition at line 457 of file StatEntity.h.

458 {
459 nEntries += other.nEntries;
460 accumulatedFlag += other.accumulatedFlag;
461 accumulatedFlag2 += other.accumulatedFlag2;
462 minimalFlag = std::min( minimalFlag, other.minimalFlag );
463 maximalFlag = std::max( maximalFlag, other.maximalFlag );
464 return *this;
465 }
StatEntity::se::accumulatedFlag
double accumulatedFlag
accumulated flag
Definition: StatEntity.h:450
StatEntity::se::minimalFlag
double minimalFlag
Definition: StatEntity.h:452
std::min
T min(T...args)
StatEntity::se::maximalFlag
double maximalFlag
Definition: StatEntity.h:453
std::max
T max(T...args)
StatEntity::se::accumulatedFlag2
double accumulatedFlag2
Definition: StatEntity.h:451
StatEntity::se::nEntries
unsigned long nEntries
number of calls
Definition: StatEntity.h:448

double StatEntity::se::rms | ( |  | ) | const

Definition at line 115 of file StatEntity.cpp.

116 {
117 if ( 0 >= nEntries ) {
118 return 0;
119 }
120 const long double f1 = accumulatedFlag;
121 const long double f2 = f1 / nEntries;
122 const long double f3 = accumulatedFlag2;
123 const long double f4 = f3 / nEntries;
124 const long double result = f4 - f2 * f2;
125 return ( 0 > result ) ? 0 : ::sqrtl( result );
126 }
StatEntity::se::accumulatedFlag
double accumulatedFlag
accumulated flag
Definition: StatEntity.h:450
StatEntity::se::accumulatedFlag2
double accumulatedFlag2
Definition: StatEntity.h:451
StatEntity::se::nEntries
unsigned long nEntries
number of calls
Definition: StatEntity.h:448

## Friends And Related Function Documentation

bool operator< | ( | const struct se & | lhs,
|  | const struct se & | rhs
| ) |  |
| friend

Definition at line 474 of file StatEntity.h.

475 {
476 auto order = []( const auto& s ) {
477 return std::tie( s.nEntries, s.accumulatedFlag, s.minimalFlag, s.maximalFlag, s.accumulatedFlag2 );
478 };
479 return order( lhs ) < order( rhs );
480 };
std::tie
T tie(T...args)
gaudirun.s
string s
Definition: gaudirun.py:253

## Member Data Documentation

double StatEntity::se::accumulatedFlag = 0

accumulated flag

Definition at line 450 of file StatEntity.h.

double StatEntity::se::accumulatedFlag2 = 0

Definition at line 451 of file StatEntity.h.

double StatEntity::se::maximalFlag = -1 * std::numeric_limits<double>::max()

Definition at line 453 of file StatEntity.h.

double StatEntity::se::minimalFlag = std::numeric_limits<double>::max()

Definition at line 452 of file StatEntity.h.

unsigned long StatEntity::se::nEntries = 0

number of calls

Definition at line 448 of file StatEntity.h.

long StatEntity::se::nEntriesBeforeReset = -1

Definition at line 455 of file StatEntity.h.

The documentation for this struct was generated from the following files:

- GaudiKernel/GaudiKernel/StatEntity.h
- GaudiKernel/src/Lib/StatEntity.cpp