All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
StatEntity Class Reference

The basic counter used for Monitoring purposes. More...

#include <GaudiKernel/StatEntity.h>

Public Member Functions

 StatEntity ()
 the default constructor More...
 
 StatEntity (const unsigned long entries, const double flag, const double flag2, const double minFlag, const double maxFlag)
 
 ~StatEntity ()
 destructor More...
 
const unsigned long & nEntries () const
 getters More...
 
const double & sum () const
 accumulated value More...
 
const double & sum2 () const
 accumulated value**2 More...
 
double mean () const
 mean value of counter More...
 
double rms () const
 r.m.s of value More...
 
double meanErr () const
 error in mean value of counter More...
 
const double & min () const
 minimal value More...
 
const double & max () const
 maximal value More...
 
double efficiency () const
 Interpret the counter as some measure of efficiency The efficiency is calculated as the ratio of the weight over the number of entries One gets the correct interpretation in the case of filling the counters only with 0 and 1. More...
 
double efficiencyErr () const
 Interpret the counter as some measure of efficiency and evaluate the uncertainty of this efficiency using binomial estimate. More...
 
double eff () const
 shortcut, More...
 
double effErr () const
 shortcut, More...
 
StatEntityoperator+= (const double f)
 General increment operator for the flag Could be used for easy manipulation with StatEntity object: More...
 
StatEntityoperator++ ()
 Pre-increment operator for the flag Could be used for easy manipulation with StatEntity object: More...
 
StatEntityoperator++ (int)
 Post-increment operator for the flag. More...
 
StatEntityoperator-= (const double f)
 General decrement operator for the flag Could be used for easy manipulation with StatEntity object: More...
 
StatEntityoperator-- ()
 Pre-decrement operator for the flag Could be used for easy manipulation with StatEntity object: More...
 
StatEntityoperator-- (int)
 Post-decrement operator for the flag Could be used for easy manipulation with StatEntity object: More...
 
StatEntityoperator= (const double f)
 Assignment from the flag The action: reset and the general increment Such case could be useful for statistical monitoring. More...
 
StatEntityoperator+= (const StatEntity &other)
 increment with other counter (useful for Monitoring/Adder ) More...
 
bool operator< (const StatEntity &se) const
 comparison More...
 
unsigned long add (const double Flag)
 add a value More...
 
void reset ()
 reset the counters More...
 
void setnEntriesBeforeReset (unsigned long nEntriesBeforeReset)
 DR specify number of entry before reset. More...
 
std::string toString () const
 representation as string More...
 
std::ostream & print (std::ostream &o=std::cout) const
 printout to std::ostream More...
 
std::ostream & fillStream (std::ostream &o) const
 printout to std::ostream More...
 
double Sum () const
 get sum More...
 
double Mean () const
 get mean More...
 
double MeanErr () const
 get error in mean More...
 
double Rms () const
 get rms More...
 
double RMS () const
 get rms More...
 
double Eff () const
 get efficiency More...
 
double Min () const
 get minimal value More...
 
double Max () const
 get maximal value More...
 
double flag () const
 accumulated "flag" More...
 
double flag2 () const
 accumulated "flag squared" More...
 
double flagMean () const
 mean value of flag More...
 
double flagRMS () const
 r.m.s of flag More...
 
double flagMeanErr () const
 error in mean value of flag More...
 
double flagMin () const
 minimal flag More...
 
double flagMax () const
 maximal flag More...
 
unsigned long addFlag (const double Flag)
 add a flag More...
 

Static Public Member Functions

static const std::string & format ()
 the internal format description More...
 
static int size ()
 the actual size of published data More...
 

Private Attributes

unsigned long m_se_nEntries
 number of calls More...
 
double m_se_accumulatedFlag
 accumulated flag More...
 
double m_se_accumulatedFlag2
 
double m_se_minimalFlag
 
double m_se_maximalFlag
 
long m_se_nEntriesBeforeReset
 

Detailed Description

The basic counter used for Monitoring purposes.

It is used as a small helper class for implementation of class ChronoStatSvc but it also could be used in stand-alone mode to perform trivial statistical evaluations. e.g.

Essentially the generic counter could be considered as the trivial 1-bin

// get all tracks
const Tracks* tracks = ... ;
// create the counter
StatEntity chi2 ;
// make a loop over all tracks:
for ( Tracks::const_iterator itrack = tracks->begin() ;
tracks->end() != itrack ; ++itrack )
{
const Track* track = *itrack ;
// use the counters to accumulate information:
chi2 += track -> chi2 () ;
} ;
// Extract the information from the counter:
// get number of entries (== number of tracks)
int nEntries = chi2.nEntries() ;
// get the minimal value of chi2
double chi2Min = chi2.flagMin() ;
// get the average value of chi2:
double meanChi2 = chi2.flagMean() ;
// get R.M.S. for chi2-distribution:
double rmsChi2 = chi2.flagRMS() ;
.. etc...
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@l.nosp@m.app..nosp@m.in2p3.nosp@m..fr
Date
26/11/1999
2005-08-02

Definition at line 68 of file StatEntity.h.

Constructor & Destructor Documentation

StatEntity::StatEntity ( )
inline

the default constructor

Definition at line 73 of file StatEntity.h.

73 { reset() ; }
void reset()
reset the counters
Definition: StatEntity.cpp:209
StatEntity::StatEntity ( const unsigned long  entries,
const double  flag,
const double  flag2,
const double  minFlag,
const double  maxFlag 
)

Definition at line 48 of file StatEntity.cpp.

53  : m_se_nEntries ( entries )
56  , m_se_minimalFlag ( minFlag )
57  , m_se_maximalFlag ( maxFlag )
59 {}
unsigned long m_se_nEntries
number of calls
Definition: StatEntity.h:438
double m_se_minimalFlag
Definition: StatEntity.h:442
long m_se_nEntriesBeforeReset
Definition: StatEntity.h:445
double m_se_accumulatedFlag
accumulated flag
Definition: StatEntity.h:440
double m_se_maximalFlag
Definition: StatEntity.h:443
double flag2() const
accumulated "flag squared"
Definition: StatEntity.h:401
double flag() const
accumulated "flag"
Definition: StatEntity.h:399
double m_se_accumulatedFlag2
Definition: StatEntity.h:441
StatEntity::~StatEntity ( )
inline

destructor

Definition at line 91 of file StatEntity.h.

91 {}

Member Function Documentation

unsigned long StatEntity::add ( const double  Flag)

add a value

Parameters
Flagvalue to be added
Returns
number of entries

accumulate the flag

evaluate min/max

Definition at line 189 of file StatEntity.cpp.

190 {
191  //
193  else if ( 0 == m_se_nEntriesBeforeReset ) { reset(); }
194  m_se_accumulatedFlag += Flag ; // accumulate the flag
197  m_se_minimalFlag = std::min ( m_se_minimalFlag , Flag ) ; // evaluate min/max
198  m_se_maximalFlag = std::max ( m_se_maximalFlag , Flag ) ; // evaluate min/max
199  // accumulate statistics, but avoid FPE for small flags...
200  static const double s_min1 = 2 * ::sqrt ( std::numeric_limits<double>::min() ) ;
201  if ( s_min1 < Flag || -s_min1 > Flag )
202  { m_se_accumulatedFlag2 += Flag * Flag ; }// accumulate statistics:
203  //
204  return ++m_se_nEntries ;
205 }
unsigned long m_se_nEntries
number of calls
Definition: StatEntity.h:438
double m_se_minimalFlag
Definition: StatEntity.h:442
void reset()
reset the counters
Definition: StatEntity.cpp:209
long m_se_nEntriesBeforeReset
Definition: StatEntity.h:445
double m_se_accumulatedFlag
accumulated flag
Definition: StatEntity.h:440
#define min(a, b)
double m_se_maximalFlag
Definition: StatEntity.h:443
double m_se_accumulatedFlag2
Definition: StatEntity.h:441
unsigned long StatEntity::addFlag ( const double  Flag)
inline

add a flag

Parameters
Flagvalue to be added
Returns
number of entries

Definition at line 416 of file StatEntity.h.

416 { return add ( Flag ) ; }
unsigned long add(const double Flag)
add a value
Definition: StatEntity.cpp:189
double StatEntity::eff ( ) const
inline

shortcut,

See also
StatEntity::efficiency

Definition at line 185 of file StatEntity.h.

185 { return efficiency () ; }
double efficiency() const
Interpret the counter as some measure of efficiency The efficiency is calculated as the ratio of the ...
Definition: StatEntity.cpp:123
double StatEntity::Eff ( ) const
inline

get efficiency

Definition at line 390 of file StatEntity.h.

390 { return eff () ; } // get efficiency
double eff() const
shortcut,
Definition: StatEntity.h:185
double StatEntity::effErr ( ) const
inline

shortcut,

See also
StatEntity::efficiencyErr

Definition at line 187 of file StatEntity.h.

187 { return efficiencyErr () ; }
double efficiencyErr() const
Interpret the counter as some measure of efficiency and evaluate the uncertainty of this efficiency u...
Definition: StatEntity.cpp:135
double StatEntity::efficiency ( ) const

Interpret the counter as some measure of efficiency The efficiency is calculated as the ratio of the weight over the number of entries One gets the correct interpretation in the case of filling the counters only with 0 and 1.

Some checks are performed:

  • number of counts must be positive
  • "flag" must be non-negative
  • "flag" does not exceed the overall number of counts

If these conditions are not satisfied the method returns -1, otherwise it returns the value of "flagMean"

StatEntity& stat = ... ;
for ( TRACKS::iterator itrack = tracks.begin() ;
tracks.end() != itrack ; itrack )
{
const bool good = PT( *itrack ) > 1 * Gaudi::Units::GeV ;
stat += good ;
}
std::cout << " Efficiency of PT-cut is "
<< stat.efficiency() << std::endl ;
See also
StatEntity::flagMean
StatEntity::eff
StatEntity::efficiencyErr

Definition at line 123 of file StatEntity.cpp.

124 {
125  if ( 1 > nEntries () || 0 > sum() || sum() > nEntries() ) { return -1 ; }
126  const long double fMin = min () ;
127  if ( 0 != fMin && 1 != fMin ) { return -1 ; }
128  const long double fMax = max () ;
129  if ( 0 != fMax && 1 != fMax ) { return -1 ; }
130  return mean() ;
131 }
const double & max() const
maximal value
Definition: StatEntity.h:110
const unsigned long & nEntries() const
getters
Definition: StatEntity.h:96
const double & sum() const
accumulated value
Definition: StatEntity.h:98
double mean() const
mean value of counter
Definition: StatEntity.cpp:85
const double & min() const
minimal value
Definition: StatEntity.h:108
double StatEntity::efficiencyErr ( ) const

Interpret the counter as some measure of efficiency and evaluate the uncertainty of this efficiency using binomial estimate.

The efficiency is calculated as the ratio of the weight over the number of entries One gets the correct interpretation in the case of filling the counters only with 0 and 1. Some checks are performed:

  • number of counts must be positive
  • "flag" must be non-negative
  • "flag" does not exceed the overall number of counts

If these conditions are not satisfied the method returns -1.

Attention
The action of this method is DIFFERENT from the action of the method StatEntity::flagMeanErr
StatEntity& stat = ... ;
for ( TRACKS::iterator itrack = tracks.begin() ;
tracks.end() != itrack ; itrack )
{
const bool good = PT( *itrack ) > 1 * Gaudi::Units::GeV ;
stat += good ;
}
std::cout << " Efficiency of PT-cut is "
<< stat.efficiency () << "+-"
<< stat.efficiencyErr () << std::endl ;
See also
StatEntity::efficiency
StatEntity::effErr
StatEntity::flagMeanErr

Definition at line 135 of file StatEntity.cpp.

136 {
137  if ( 0 > efficiency() ) { return -1 ; }
138  //
139  long double n1 = sum () ;
140  // treat properly the bins with eff=0
141  if ( 0 == n1 ) { n1 = 1 ; }
142  const long double n3 = nEntries () ;
143  long double n2 = n3 - flag () ;
144  // treat properly the bins with eff=100%
145  if ( 1 > fabsl( n2 ) ) { n2 = 1 ; }
146  //
147  return ::sqrtl( n1 * n2 / n3 ) / n3 ;
148 }
const unsigned long & nEntries() const
getters
Definition: StatEntity.h:96
double efficiency() const
Interpret the counter as some measure of efficiency The efficiency is calculated as the ratio of the ...
Definition: StatEntity.cpp:123
const double & sum() const
accumulated value
Definition: StatEntity.h:98
double flag() const
accumulated "flag"
Definition: StatEntity.h:399
std::ostream& StatEntity::fillStream ( std::ostream &  o) const
inline

printout to std::ostream

Parameters
sthe reference to the output stream

Definition at line 375 of file StatEntity.h.

375 { return print ( o ) ; }
std::ostream & print(std::ostream &o=std::cout) const
printout to std::ostream
Definition: StatEntity.cpp:236
double StatEntity::flag ( ) const
inline

accumulated "flag"

Definition at line 399 of file StatEntity.h.

399 { return sum () ; }
const double & sum() const
accumulated value
Definition: StatEntity.h:98
double StatEntity::flag2 ( ) const
inline

accumulated "flag squared"

Definition at line 401 of file StatEntity.h.

401 { return sum2 () ; }
const double & sum2() const
accumulated value**2
Definition: StatEntity.h:100
double StatEntity::flagMax ( ) const
inline

maximal flag

Definition at line 411 of file StatEntity.h.

411 { return max () ; }
const double & max() const
maximal value
Definition: StatEntity.h:110
double StatEntity::flagMean ( ) const
inline

mean value of flag

Definition at line 403 of file StatEntity.h.

403 { return mean () ; }
double mean() const
mean value of counter
Definition: StatEntity.cpp:85
double StatEntity::flagMeanErr ( ) const
inline

error in mean value of flag

Definition at line 407 of file StatEntity.h.

407 { return meanErr () ; }
double meanErr() const
error in mean value of counter
Definition: StatEntity.cpp:108
double StatEntity::flagMin ( ) const
inline

minimal flag

Definition at line 409 of file StatEntity.h.

409 { return min () ; }
const double & min() const
minimal value
Definition: StatEntity.h:108
double StatEntity::flagRMS ( ) const
inline

r.m.s of flag

Definition at line 405 of file StatEntity.h.

405 { return rms () ; }
double rms() const
r.m.s of value
Definition: StatEntity.cpp:95
const std::string & StatEntity::format ( )
static

the internal format description

Attention
: it needs to be coherent with the actual class structure! It is useful for DIM publishing
See also
StatEntity::size

< check for "D"

Definition at line 63 of file StatEntity.cpp.

64 {
65  // check for "X" or "L"
66  BOOST_STATIC_ASSERT(((sizeof(unsigned long)==4)||(sizeof(unsigned long)==8)));
67  // check for "D"
68  BOOST_STATIC_ASSERT((sizeof(double)==8)) ;
69  //
70  static const std::string s_fmt =
71  ( ( 8 == sizeof(unsigned long) ) ?"X:1;" : "L:1;" ) + std::string("D:4") ;
72  return s_fmt ;
73 }
const double& StatEntity::max ( ) const
inline

maximal value

Definition at line 110 of file StatEntity.h.

110 { return m_se_maximalFlag ; }
double m_se_maximalFlag
Definition: StatEntity.h:443
double StatEntity::Max ( ) const
inline

get maximal value

Definition at line 394 of file StatEntity.h.

394 { return max () ; } // get maximal value
const double & max() const
maximal value
Definition: StatEntity.h:110
double StatEntity::mean ( ) const

mean value of counter

Definition at line 85 of file StatEntity.cpp.

86 {
87  if ( 0 >= nEntries() ) { return 0 ;}
88  const long double f1 = m_se_accumulatedFlag ;
89  const long double f2 = m_se_nEntries ;
90  return f1 / f2 ;
91 }
unsigned long m_se_nEntries
number of calls
Definition: StatEntity.h:438
const unsigned long & nEntries() const
getters
Definition: StatEntity.h:96
double m_se_accumulatedFlag
accumulated flag
Definition: StatEntity.h:440
double StatEntity::Mean ( ) const
inline

get mean

Definition at line 382 of file StatEntity.h.

382 { return mean () ; } // get mean
double mean() const
mean value of counter
Definition: StatEntity.cpp:85
double StatEntity::meanErr ( ) const

error in mean value of counter

Definition at line 108 of file StatEntity.cpp.

109 {
110  if ( 0 >= nEntries () ) { return 0 ; }
111  const long double f1 = m_se_accumulatedFlag ;
112  const long double f2 = f1 / nEntries () ;
113  const long double f3 = m_se_accumulatedFlag2 ;
114  const long double f4 = f3 / nEntries () ;
115  const long double result = f4 - f2 * f2 ;
116  if ( 0 > result ) { return 0 ; }
117  //
118  return ::sqrtl ( result / nEntries () ) ;
119 }
const unsigned long & nEntries() const
getters
Definition: StatEntity.h:96
double m_se_accumulatedFlag
accumulated flag
Definition: StatEntity.h:440
double m_se_accumulatedFlag2
Definition: StatEntity.h:441
double StatEntity::MeanErr ( ) const
inline

get error in mean

Definition at line 384 of file StatEntity.h.

384 { return meanErr () ; } // get error in mean
double meanErr() const
error in mean value of counter
Definition: StatEntity.cpp:108
const double& StatEntity::min ( ) const
inline

minimal value

Definition at line 108 of file StatEntity.h.

108 { return m_se_minimalFlag ; }
double m_se_minimalFlag
Definition: StatEntity.h:442
double StatEntity::Min ( ) const
inline

get minimal value

Definition at line 392 of file StatEntity.h.

392 { return min () ; } // get minimal value
const double & min() const
minimal value
Definition: StatEntity.h:108
const unsigned long& StatEntity::nEntries ( ) const
inline

getters

Definition at line 96 of file StatEntity.h.

96 { return m_se_nEntries ; }
unsigned long m_se_nEntries
number of calls
Definition: StatEntity.h:438
StatEntity& StatEntity::operator++ ( )
inline

Pre-increment operator for the flag Could be used for easy manipulation with StatEntity object:

StatEntity stat ;
for ( int i = ... )
{
double eTotal = .... ;
// increment the counter
if ( eTotal > 1 * TeV ) { ++stat ; } ;
}

Definition at line 232 of file StatEntity.h.

232 { return (*this)+= 1 ; }
StatEntity& StatEntity::operator++ ( int  )
inline

Post-increment operator for the flag.

Actually it is the same as pre-increment. Could be used for easy manipulation with StatEntity object:

StatEntity stat ;
for ( int i = ... )
{
double eTotal = .... ;
// increment the counter
if ( eTotal > 1 * TeV ) { stat++ ; } ;
}

Definition at line 251 of file StatEntity.h.

251 { return ++(*this) ; }
StatEntity& StatEntity::operator+= ( const double  f)
inline

General increment operator for the flag Could be used for easy manipulation with StatEntity object:

StatEntity stat ;
for ( int i = ... )
{
double eTotal = .... ;
// increment the counter
stat += eTotal ;
}
Parameters
fcounter increment

Definition at line 210 of file StatEntity.h.

211  {
212  addFlag ( f ) ;
213  return *this ;
214  }
unsigned long addFlag(const double Flag)
add a flag
Definition: StatEntity.h:416
StatEntity & StatEntity::operator+= ( const StatEntity other)

increment with other counter (useful for Monitoring/Adder )

const StatEntity second = ... ;
StatEntity first = ... ;
first += second ;
Parameters
othercounter to be added
Returns
self-reference

Definition at line 152 of file StatEntity.cpp.

153 {
154  m_se_nEntries += other.m_se_nEntries ;
158  m_se_maximalFlag = std::max ( m_se_maximalFlag , other.m_se_maximalFlag ) ;
159  //
160  return *this ;
161 }
unsigned long m_se_nEntries
number of calls
Definition: StatEntity.h:438
double m_se_minimalFlag
Definition: StatEntity.h:442
double m_se_accumulatedFlag
accumulated flag
Definition: StatEntity.h:440
#define min(a, b)
double m_se_maximalFlag
Definition: StatEntity.h:443
double m_se_accumulatedFlag2
Definition: StatEntity.h:441
StatEntity& StatEntity::operator-- ( )
inline

Pre-decrement operator for the flag Could be used for easy manipulation with StatEntity object:

StatEntity stat ;
for ( int i = ... )
{
double eTotal = .... ;
// increment the counter
if ( eTotal > 1 * TeV ) { --stat ; } ;
}

Definition at line 293 of file StatEntity.h.

293 { return (*this)-=1 ; }
StatEntity& StatEntity::operator-- ( int  )
inline

Post-decrement operator for the flag Could be used for easy manipulation with StatEntity object:

StatEntity stat ;
for ( int i = ... )
{
double eTotal = .... ;
// increment the counter
if ( eTotal > 1 * TeV ) { stat-- ; } ;
}

Definition at line 311 of file StatEntity.h.

311 { return --(*this) ; }
StatEntity& StatEntity::operator-= ( const double  f)
inline

General decrement operator for the flag Could be used for easy manipulation with StatEntity object:

StatEntity stat ;
for ( int i = ... )
{
double eTotal = .... ;
// decrement the counter
stat -= eTotal ;
}
Parameters
fcounter increment

Definition at line 271 of file StatEntity.h.

272  {
273  addFlag ( -f ) ;
274  return *this ;
275  }
unsigned long addFlag(const double Flag)
add a flag
Definition: StatEntity.h:416
bool StatEntity::operator< ( const StatEntity se) const

comparison

Definition at line 165 of file StatEntity.cpp.

166 {
167  if ( &se == this ) { return false ; }
168  else if ( nEntries () < se.nEntries () ) { return true ; }
169  else if ( nEntries () == se.nEntries () &&
170  sum () < se.sum () ) { return true ; }
171  else if ( nEntries () == se.nEntries () &&
172  sum () == se.sum () &&
173  min () < se.min () ) { return true ; }
174  else if ( nEntries () == se.nEntries () &&
175  sum () == se.sum () &&
176  min () == se.min () &&
177  max () < se.max () ) { return true ; }
178  else if ( nEntries () == se.nEntries () &&
179  sum () == se.flag () &&
180  min () == se.min () &&
181  max () == se.max () &&
182  sum2 () < se.sum2 () ) { return true ; }
184  return false;
185 }
const double & max() const
maximal value
Definition: StatEntity.h:110
const unsigned long & nEntries() const
getters
Definition: StatEntity.h:96
const double & sum2() const
accumulated value**2
Definition: StatEntity.h:100
const double & sum() const
accumulated value
Definition: StatEntity.h:98
const double & min() const
minimal value
Definition: StatEntity.h:108
double flag() const
accumulated "flag"
Definition: StatEntity.h:399
StatEntity& StatEntity::operator= ( const double  f)
inline

Assignment from the flag The action: reset and the general increment Such case could be useful for statistical monitoring.

const long numberOfHits = ... ;
StatEntity& stat = ... ;
stat = numberOfHits ;
Parameters
fnew value of the counter
Returns
self-reference

< reset the statistics

< use the regular increment

Definition at line 329 of file StatEntity.h.

330  {
331  // reset the statistics
332  reset() ;
333  // use the regular increment
334  return ((*this)+=f);
335  }
void reset()
reset the counters
Definition: StatEntity.cpp:209
std::ostream & StatEntity::print ( std::ostream &  o = std::cout) const

printout to std::ostream

Parameters
sthe reference to the output stream

Definition at line 236 of file StatEntity.cpp.

237 {
238  boost::format fmt1 ("#=%|-7lu| Sum=%|-11.5g|" ) ;
239  o << fmt1 % nEntries() % sum() ;
240  boost::format fmt2 ( " Mean=%|#10.4g| +- %|-#10.5g| Min/Max=%|#10.4g|/%|-#10.4g|" ) ;
241  o << fmt2 % mean() % rms() % min() % max() ;
242  return o ;
243 }
const double & max() const
maximal value
Definition: StatEntity.h:110
const unsigned long & nEntries() const
getters
Definition: StatEntity.h:96
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:133
const double & sum() const
accumulated value
Definition: StatEntity.h:98
double mean() const
mean value of counter
Definition: StatEntity.cpp:85
const double & min() const
minimal value
Definition: StatEntity.h:108
double rms() const
r.m.s of value
Definition: StatEntity.cpp:95
void StatEntity::reset ( )

reset the counters

Definition at line 209 of file StatEntity.cpp.

210 {
211  //
212  m_se_nEntries = 0 ;
213  m_se_accumulatedFlag = 0 ;
214  m_se_minimalFlag = std::numeric_limits<double>::max() ;
215  m_se_maximalFlag = -1 * std::numeric_limits<double>::max() ;
217  m_se_nEntriesBeforeReset = -1 ; // ?
218 }
unsigned long m_se_nEntries
number of calls
Definition: StatEntity.h:438
double m_se_minimalFlag
Definition: StatEntity.h:442
long m_se_nEntriesBeforeReset
Definition: StatEntity.h:445
double m_se_accumulatedFlag
accumulated flag
Definition: StatEntity.h:440
double m_se_maximalFlag
Definition: StatEntity.h:443
double m_se_accumulatedFlag2
Definition: StatEntity.h:441
double StatEntity::rms ( ) const

r.m.s of value

Definition at line 95 of file StatEntity.cpp.

96 {
97  if ( 0 >= nEntries() ) { return 0 ; }
98  const long double f1 = m_se_accumulatedFlag ;
99  const long double f2 = f1 / nEntries () ;
100  const long double f3 = m_se_accumulatedFlag2 ;
101  const long double f4 = f3 / nEntries () ;
102  const long double result = f4 - f2 * f2 ;
103  return ( 0 > result ) ? 0 : ::sqrtl ( result ) ;
104 }
const unsigned long & nEntries() const
getters
Definition: StatEntity.h:96
double m_se_accumulatedFlag
accumulated flag
Definition: StatEntity.h:440
double m_se_accumulatedFlag2
Definition: StatEntity.h:441
double StatEntity::Rms ( ) const
inline

get rms

Definition at line 386 of file StatEntity.h.

386 { return rms () ; } // get rms
double rms() const
r.m.s of value
Definition: StatEntity.cpp:95
double StatEntity::RMS ( ) const
inline

get rms

Definition at line 388 of file StatEntity.h.

388 { return rms () ; } // get rms
double rms() const
r.m.s of value
Definition: StatEntity.cpp:95
void StatEntity::setnEntriesBeforeReset ( unsigned long  nEntriesBeforeReset)

DR specify number of entry before reset.

Definition at line 222 of file StatEntity.cpp.

223 { m_se_nEntriesBeforeReset = nEntriesBeforeReset; }
long m_se_nEntriesBeforeReset
Definition: StatEntity.h:445
int StatEntity::size ( )
static

the actual size of published data

Attention
: it needs to be coherent with the actual class structure! It is useful for DIM publishing
See also
StatEntity::format

Definition at line 77 of file StatEntity.cpp.

78 {
79  static const int s_size = sizeof(unsigned long) + 4 * sizeof(double) ;
80  return s_size ;
81 }
const double& StatEntity::sum ( ) const
inline

accumulated value

Definition at line 98 of file StatEntity.h.

98 { return m_se_accumulatedFlag ; }
double m_se_accumulatedFlag
accumulated flag
Definition: StatEntity.h:440
double StatEntity::Sum ( ) const
inline

get sum

Definition at line 380 of file StatEntity.h.

380 { return sum () ; } // get sum
const double & sum() const
accumulated value
Definition: StatEntity.h:98
const double& StatEntity::sum2 ( ) const
inline

accumulated value**2

Definition at line 100 of file StatEntity.h.

100 { return m_se_accumulatedFlag2 ; }
double m_se_accumulatedFlag2
Definition: StatEntity.h:441
std::string StatEntity::toString ( ) const

representation as string

Definition at line 227 of file StatEntity.cpp.

228 {
229  std::ostringstream ost ;
230  print ( ost ) ;
231  return ost.str () ;
232 }
std::ostream & print(std::ostream &o=std::cout) const
printout to std::ostream
Definition: StatEntity.cpp:236

Member Data Documentation

double StatEntity::m_se_accumulatedFlag
private

accumulated flag

Definition at line 440 of file StatEntity.h.

double StatEntity::m_se_accumulatedFlag2
private

Definition at line 441 of file StatEntity.h.

double StatEntity::m_se_maximalFlag
private

Definition at line 443 of file StatEntity.h.

double StatEntity::m_se_minimalFlag
private

Definition at line 442 of file StatEntity.h.

unsigned long StatEntity::m_se_nEntries
private

number of calls

Definition at line 438 of file StatEntity.h.

long StatEntity::m_se_nEntriesBeforeReset
private

Definition at line 445 of file StatEntity.h.


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