BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtValError.hh File Reference
#include <assert.h>
#include <iostream>
#include <math.h>

Go to the source code of this file.

Classes

class  EvtValError

Functions

EvtValError operator* (const EvtValError &x1, const EvtValError &x2)
EvtValError operator/ (const EvtValError &x1, const EvtValError &x2)
EvtValError operator+ (const EvtValError &x1, const EvtValError &x2)
EvtValError operator* (const EvtValError &x, double c)
EvtValError operator* (double c, const EvtValError &x)
std::ostream & operator<< (std::ostream &, const EvtValError &)
template<class InputIterator, class Predicate>
EvtValError accept_reject (InputIterator it, InputIterator end, Predicate pred)

Function Documentation

◆ accept_reject()

template<class InputIterator, class Predicate>
EvtValError accept_reject ( InputIterator it,
InputIterator end,
Predicate pred )

Definition at line 67 of file EvtValError.hh.

67 {
68 int itsTried = 0;
69 int itsPassed = 0;
70 while ( it != end )
71 {
72
73 itsTried++;
74 if ( pred( *it++ ) ) itsPassed++;
75 }
76
77 return EvtValError( ( (double)itsPassed ) / ( (double)itsTried ),
78 sqrt( itsPassed ) / ( (double)itsTried ) );
79}

◆ operator*() [1/3]

EvtValError operator* ( const EvtValError & x,
double c )

Definition at line 115 of file EvtValError.cc.

115 {
116 EvtValError ret( x );
117 ret *= c;
118 return ret;
119}

◆ operator*() [2/3]

EvtValError operator* ( const EvtValError & x1,
const EvtValError & x2 )

Definition at line 97 of file EvtValError.cc.

97 {
98 EvtValError ret( x1 );
99 ret *= x2;
100 return ret;
101}

◆ operator*() [3/3]

EvtValError operator* ( double c,
const EvtValError & x )

Definition at line 121 of file EvtValError.cc.

121 {
122 EvtValError ret( x );
123 ret *= c;
124 return ret;
125}

◆ operator+()

EvtValError operator+ ( const EvtValError & x1,
const EvtValError & x2 )

Definition at line 109 of file EvtValError.cc.

109 {
110 EvtValError ret( x1 );
111 ret += x2;
112 return ret;
113}

◆ operator/()

EvtValError operator/ ( const EvtValError & x1,
const EvtValError & x2 )

Definition at line 103 of file EvtValError.cc.

103 {
104 EvtValError ret( x1 );
105 ret /= x2;
106 return ret;
107}

◆ operator<<()

std::ostream & operator<< ( std::ostream & ,
const EvtValError &  )