Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:11:34

0001 // ----------------------------------------------------------------------
0002 //
0003 // Measurement.hh
0004 // author:  Mark Fischler
0005 // ----------------------------------------------------------------------
0006 #ifndef MEASUREMENT_HH
0007 #define MEASUREMENT_HH
0008 
0009 namespace HepPDT {
0010 
0011 //! The Measurement class defines a value with its error
0012 
0013 ///
0014 /// \class Measurement
0015 /// \author Mark Fischler
0016 ///
0017 /// Contain a value with associated errors.
0018 /// Provide simple comparisons.
0019 ///
0020 class Measurement {
0021 public:
0022   inline Measurement ();  
0023   inline Measurement ( double value, double sigma );
0024 
0025   inline Measurement ( const Measurement &m );
0026   inline void swap( Measurement & other );
0027   inline Measurement& operator = ( Measurement const & rhs );
0028 
0029   /// compare the value, ignore the error
0030   inline bool  operator <  ( Measurement const & other ) const;
0031   /// compare the value, ignore the error
0032   inline bool  operator == ( Measurement const & other ) const;
0033 
0034   inline double   value()  const;
0035   inline double   sigma()  const;
0036   inline operator double() const;
0037 
0038 private:  
0039   double val;
0040   double sig;
0041 
0042 };  // Measurement
0043 
0044 inline
0045 void swap( Measurement & first, Measurement & second ) { first.swap( second ); }
0046 
0047 }      // end of namespace HepPDT
0048 
0049 #include "HepPDT/Measurement.icc"
0050 
0051 #endif // end of codeguard MEASUREMENT_HH