ThePEG  1.8.0
Measurement.h
1 // -*- C++ -*-
2 //
3 // Measurement.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2011 Leif Lonnblad
5 //
6 // ThePEG is licenced under version 2 of the GPL, see COPYING for details.
7 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
8 //
9 #ifndef LWH_Measurement_H
10 #define LWH_Measurement_H
11 //
12 // This is the declaration of the Measurement class representing
13 //
14 
15 
16 #include <limits>
17 #include <cmath>
18 #include <algorithm>
19 #include "AIMeasurement.h"
20 
21 namespace LWH {
22 
23 using namespace AIDA;
24 
30 class Measurement: public IMeasurement {
31 
32 public:
33 
37  Measurement(double v = 0.0, double ep = 0.0, double em = 0.0)
38  : val(v), errp(ep), errm(em) {}
39 
44  :IMeasurement(m), val(m.val), errp(m.errp), errm(m.errm) {}
45 
49  virtual ~Measurement() { /* nop */; }
50 
55  double value() const {
56  return val;
57  }
58 
63  double errorPlus() const {
64  return errp;
65  }
66 
71  double errorMinus() const {
72  return errm;
73  }
74 
80  bool setValue(double v) {
81  val = v;
82  return true;
83  }
84 
90  bool setErrorPlus(double ep) {
91  errp = ep;
92  return ep < 0.0;
93  }
94 
100  bool setErrorMinus(double em) {
101  errm = em;
102  return em < 0.0;
103  }
104 
105 private:
106 
110  double val;
111 
115  double errp;
116 
120  double errm;
121 
122 };
123 
124 }
125 
126 #endif /* LWH_Measurement_H */
Basic user-level interface class for holding a single "measurement" with positive and negative errors...
Definition: Measurement.h:30
virtual ~Measurement()
Destructor.
Definition: Measurement.h:49
double errorPlus() const
Get the plus error of the IMeasurement.
Definition: Measurement.h:63
Measurement(double v=0.0, double ep=0.0, double em=0.0)
Standard constructor.
Definition: Measurement.h:37
double errp
The plus error.
Definition: Measurement.h:115
bool setValue(double v)
Set the value of the IMeasurement.
Definition: Measurement.h:80
bool setErrorPlus(double ep)
Set the plus error of the IMeasurement.
Definition: Measurement.h:90
double errm
The minus error.
Definition: Measurement.h:120
double value() const
Get the value of the Measurement.
Definition: Measurement.h:55
Measurement(const Measurement &m)
Copy constructor.
Definition: Measurement.h:43
bool setErrorMinus(double em)
Set the minus error of the IMeasurement.
Definition: Measurement.h:100
The LWH namespace contains a Light-Weight Histogram package which implements the most rudimentary his...
double errorMinus() const
Get the minus error of the IMeasurement.
Definition: Measurement.h:71
double val
The value.
Definition: Measurement.h:110