ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAnalysis
TrigInDetAnalysisUser
Resplot
src
StatVal.h
Go to the documentation of this file.
1
/* emacs: this is -*- c++ -*- */
14
15
16
#ifndef RESPLOT_STATVAL_H
17
#define RESPLOT_STATVAL_H
18
19
#include <iostream>
20
#include <iomanip>
21
#include <cmath>
22
23
25
26
class
StatVal
{
27
28
public
:
29
30
double
value
;
31
double
error
;
32
33
StatVal
() :
value
(0),
error
(0) { }
34
StatVal
(
double
v) :
value
(v) {
error
=( v>=0 ? sqrt(v) : sqrt(-v) ); }
35
StatVal
(
double
v,
double
e) :
value
(v),
error
(e) { }
36
37
38
// operator for StatVal*=double
39
StatVal
operator*=
(
const
double
& d) {
value
*=d;
error
*=d;
return
(*
this
); }
40
// operator for StatVal*double (for double*StatVal see later)
41
StatVal
operator*
(
const
double
& d)
const
{
return
StatVal
(d*
value
, d*
error
); }
42
// StatVal/double
43
StatVal
operator/
(
const
double
& d)
const
{
return
StatVal
(
value
/d,
error
/d); }
44
45
// can't be bothered with the rest...
46
47
};
48
49
50
// operator for double*StatVal
51
inline
StatVal
operator*
(
double
d,
const
StatVal
& sv) {
return
sv*d; }
52
53
// streamer;
54
inline
std::ostream&
operator<<
(std::ostream& s,
const
StatVal
& sv) {
55
return
s << sv.value <<
"+-"
<< sv.error;
56
}
57
58
59
60
61
#endif
/* RESPLOT_STATVAL_H */
62
operator*
ElementConstReference operator*() const
Return a reference to the referenced element.
operator<<
std::ostream & operator<<(std::ostream &s, const StatVal &sv)
Definition
StatVal.h:54
StatVal
simple struct to hold a value and it's associated uncertainty.
Definition
StatVal.h:26
StatVal::StatVal
StatVal(double v)
Definition
StatVal.h:34
StatVal::operator*
StatVal operator*(const double &d) const
Definition
StatVal.h:41
StatVal::StatVal
StatVal(double v, double e)
Definition
StatVal.h:35
StatVal::operator/
StatVal operator/(const double &d) const
Definition
StatVal.h:43
StatVal::value
double value
Definition
StatVal.h:30
StatVal::StatVal
StatVal()
Definition
StatVal.h:33
StatVal::operator*=
StatVal operator*=(const double &d)
Definition
StatVal.h:39
error
Definition
IImpactPoint3dEstimator.h:72
Generated on
for ATLAS Offline Software by
1.17.0