thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
Measurement.h
1 // -*- C++ -*-
2 //
3 // Measurement.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2019 Leif Lonnblad
5 //
6 // ThePEG is licenced under version 3 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  Measurement & operator=(const Measurement &) = default;
50 
54  virtual ~Measurement() { /* nop */; }
55 
60  double value() const {
61  return val;
62  }
63 
68  double errorPlus() const {
69  return errp;
70  }
71 
76  double errorMinus() const {
77  return errm;
78  }
79 
85  bool setValue(double v) {
86  val = v;
87  return true;
88  }
89 
95  bool setErrorPlus(double ep) {
96  errp = ep;
97  return ep < 0.0;
98  }
99 
105  bool setErrorMinus(double em) {
106  errm = em;
107  return em < 0.0;
108  }
109 
110 private:
111 
115  double val;
116 
120  double errp;
121 
125  double errm;
126 
127 };
128 
129 }
130 
131 #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:54
double value() const
Get the value of the Measurement.
Definition: Measurement.h:60
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:120
bool setValue(double v)
Set the value of the IMeasurement.
Definition: Measurement.h:85
bool setErrorPlus(double ep)
Set the plus error of the IMeasurement.
Definition: Measurement.h:95
double errorPlus() const
Get the plus error of the IMeasurement.
Definition: Measurement.h:68
double errorMinus() const
Get the minus error of the IMeasurement.
Definition: Measurement.h:76
double errm
The minus error.
Definition: Measurement.h:125
Measurement(const Measurement &m)
Copy constructor.
Definition: Measurement.h:43
bool setErrorMinus(double em)
Set the minus error of the IMeasurement.
Definition: Measurement.h:105
The LWH namespace contains a Light-Weight Histogram package which implements the most rudimentary his...
double val
The value.
Definition: Measurement.h:115