thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
ThePEG::OUnitErr< T, UT > Struct Template Reference

OUnitErr is used to write out unitful numbers with an error estimate on a standard ostream. More...

#include <UnitIO.h>

Public Member Functions

 OUnitErr (const T &t, const T &dt, const UT &u)
 Constructor given an object to be written assuming the given unit.
 

Public Attributes

double x
 The number to be written.
 
double dx
 The estimated error of the number to be written.
 

Detailed Description

template<typename T, typename UT>
struct ThePEG::OUnitErr< T, UT >

OUnitErr is used to write out unitful numbers with an error estimate on a standard ostream.

using the helper function ouniterr an energy e with an error estimate de can be written out as eg. cout << ouniterr(e, de, GeV);. The result will be presented in scientific format (with the exponent divisible by three) with the relevant number of significant digits with a single digit in parenthesis indicating the error in the least significant digit, eg. 1.23(2)e+03.

Definition at line 146 of file UnitIO.h.

Constructor & Destructor Documentation

◆ OUnitErr()

template<typename T , typename UT >
ThePEG::OUnitErr< T, UT >::OUnitErr ( const T &  t,
const T &  dt,
const UT &  u 
)
inline

Constructor given an object to be written assuming the given unit.

Definition at line 150 of file UnitIO.h.

Member Data Documentation

◆ dx

template<typename T , typename UT >
double ThePEG::OUnitErr< T, UT >::dx

The estimated error of the number to be written.

Definition at line 156 of file UnitIO.h.

◆ x

template<typename T , typename UT >
double ThePEG::OUnitErr< T, UT >::x

The number to be written.

Definition at line 153 of file UnitIO.h.


The documentation for this struct was generated from the following file: