00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef LWH_Measurement_H
00010 #define LWH_Measurement_H
00011
00012
00013
00014
00015
00016 #include <limits>
00017 #include <cmath>
00018 #include <algorithm>
00019 #include "AIMeasurement.h"
00020
00021 namespace LWH {
00022
00023 using namespace AIDA;
00024
00030 class Measurement: public IMeasurement {
00031
00032 public:
00033
00037 Measurement(double v = 0.0, double ep = 0.0, double em = 0.0)
00038 : val(v), errp(ep), errm(em) {}
00039
00043 Measurement(const Measurement & m)
00044 :IMeasurement(m), val(m.val), errp(m.errp), errm(m.errm) {}
00045
00049 virtual ~Measurement() { ; }
00050
00055 double value() const {
00056 return val;
00057 }
00058
00063 double errorPlus() const {
00064 return errp;
00065 }
00066
00071 double errorMinus() const {
00072 return errm;
00073 }
00074
00080 bool setValue(double v) {
00081 val = v;
00082 return true;
00083 }
00084
00090 bool setErrorPlus(double ep) {
00091 errp = ep;
00092 return ep < 0.0;
00093 }
00094
00100 bool setErrorMinus(double em) {
00101 errm = em;
00102 return em < 0.0;
00103 }
00104
00105 private:
00106
00110 double val;
00111
00115 double errp;
00116
00120 double errm;
00121
00122 };
00123
00124 }
00125
00126 #endif