ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAnalysis
TrigInDetAnalysisUser
Resplot
Resplot
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
namespace
Resplot
{
24
26
27
class
StatVal
{
28
29
public
:
30
31
double
value
;
32
double
error
;
33
34
StatVal
() :
value
(0),
error
(0) { }
35
StatVal
(
double
v) :
value
(v) {
error
=( v>=0 ? sqrt(v) : sqrt(-v) ); }
36
StatVal
(
double
v,
double
e) :
value
(v),
error
(e) { }
37
38
39
// operator for StatVal*=double
40
StatVal
operator*=
(
const
double
& d) {
value
*=d;
error
*=d;
return
(*
this
); }
41
// operator for StatVal*double (for double*StatVal see later)
42
StatVal
operator*
(
const
double
& d)
const
{
return
StatVal
(d*
value
, d*
error
); }
43
// StatVal/double
44
StatVal
operator/
(
const
double
& d)
const
{
return
StatVal
(
value
/d,
error
/d); }
45
46
// can't be bothered with the rest...
47
48
};
49
50
51
// operator for double*StatVal
52
inline
StatVal
operator*
(
double
d,
const
StatVal
& sv) {
return
sv*d; }
53
54
// streamer;
55
inline
std::ostream&
operator<<
(std::ostream& s,
const
StatVal
& sv) {
56
return
s << sv.value <<
"+-"
<< sv.error;
57
}
58
59
60
}
61
62
#endif
/* RESPLOT_STATVAL_H */
63
operator*
ElementConstReference operator*() const
Return a reference to the referenced element.
Resplot::StatVal
simple struct to hold a value and it's associated uncertainty.
Definition
StatVal.h:27
Resplot::StatVal::value
double value
Definition
StatVal.h:31
Resplot::StatVal::operator*=
StatVal operator*=(const double &d)
Definition
StatVal.h:40
Resplot::StatVal::StatVal
StatVal()
Definition
StatVal.h:34
Resplot::StatVal::StatVal
StatVal(double v, double e)
Definition
StatVal.h:36
Resplot::StatVal::operator*
StatVal operator*(const double &d) const
Definition
StatVal.h:42
Resplot::StatVal::operator/
StatVal operator/(const double &d) const
Definition
StatVal.h:44
Resplot::StatVal::StatVal
StatVal(double v)
Definition
StatVal.h:35
Resplot
Definition
Resplot.h:40
Resplot::operator<<
std::ostream & operator<<(std::ostream &s, const StatVal &sv)
Definition
StatVal.h:55
error
Definition
IImpactPoint3dEstimator.h:72
Generated on
for ATLAS Offline Software by
1.17.0