CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtValError.hh File Reference
#include <iostream>
#include <assert.h>
#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 65 of file EvtValError.hh.

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

◆ operator*() [1/3]

EvtValError operator* ( const EvtValError x,
double  c 
)

Definition at line 138 of file EvtValError.cc.

139{
140 EvtValError ret(x);
141 ret*=c;
142 return ret;
143}

◆ operator*() [2/3]

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

Definition at line 115 of file EvtValError.cc.

116{
117 EvtValError ret(x1);
118 ret *= x2;
119 return ret;
120}

◆ operator*() [3/3]

EvtValError operator* ( double  c,
const EvtValError x 
)

Definition at line 146 of file EvtValError.cc.

147{
148 EvtValError ret(x);
149 ret*=c;
150 return ret;
151}

◆ operator+()

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

Definition at line 130 of file EvtValError.cc.

131{
132 EvtValError ret(x1);
133 ret += x2;
134 return ret;
135}

◆ operator/()

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

Definition at line 122 of file EvtValError.cc.

123{
124 EvtValError ret(x1);
125 ret /= x2;
126 return ret;
127}

◆ operator<<()

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