1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
#ifndef _COMMONDET_MEASUREMENT1D_H_
#define _COMMONDET_MEASUREMENT1D_H_
#include <string>
/** A class that combines a value and it's associated uncertainty,
* or error, together. Provides a more explicit interface than
* a pair<double,double>. If you don't like the name, propose a better one!
*/
class Measurement1D {
public:
// construct
Measurement1D() : theValue(0.), theError(0.) {}
Measurement1D(const double& aValue) : theValue(aValue), theError(0.) {}
Measurement1D(const double& aValue, const double& aError) : theValue(aValue), theError(aError) {}
//destruct
~Measurement1D() {}
double value() const { return theValue; }
double error() const { return theError; }
double significance() const {
if (theError == 0)
return 0;
else
return theValue / theError;
}
private:
double theValue;
double theError;
};
#endif
|