CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
value.Value Class Reference
Inheritance diagram for value.Value:

Public Member Functions

def __add__
 
def __div__
 
def __iadd__
 
def __idiv__
 
def __init__
 
def __isub__
 
def __str__
 
def __sub__
 
def relerr
 

Public Attributes

 err
 
 val
 

Detailed Description

Definition at line 7 of file value.py.

Constructor & Destructor Documentation

def value.Value.__init__ (   self,
  val,
  err 
)

Definition at line 8 of file value.py.

8 
9  def __init__(self, val, err):
10  self.val = val
11  self.err = err
def __init__
Definition: value.py:8

Member Function Documentation

def value.Value.__add__ (   self,
  other 
)

Definition at line 20 of file value.py.

20 
21  def __add__(self, other):
22  new = copy.deepcopy(self)
23  new += other
24  return new
def __add__
Definition: value.py:20
def value.Value.__div__ (   self,
  other 
)

Definition at line 41 of file value.py.

41 
42  def __div__(self, other):
43  new = copy.deepcopy(self)
44  new /= other
45  return new
def __div__
Definition: value.py:41
def value.Value.__iadd__ (   self,
  other 
)

Definition at line 15 of file value.py.

References value.Value.err, value.Value.val, TPNFit.val, TMCReader.val, TMatacq.val, and edm::helpers::KeyVal< K, V >.val.

15 
16  def __iadd__(self, other):
17  self.val += other.val
18  self.err = math.sqrt( self.err*self.err + other.err*other.err)
19  return self
def __iadd__
Definition: value.py:15
def value.Value.__idiv__ (   self,
  other 
)

Definition at line 35 of file value.py.

References value.Value.err, value.Value.relerr(), value.Value.val, TPNFit.val, TMatacq.val, TMCReader.val, and edm::helpers::KeyVal< K, V >.val.

35 
36  def __idiv__(self, other):
37  relerr = math.sqrt( self.relerr()*self.relerr() + other.relerr()*other.relerr())
38  self.val /= other.val
39  self.err = relerr * self.val
40  return self
def __idiv__
Definition: value.py:35
def relerr
Definition: value.py:12
def value.Value.__isub__ (   self,
  other 
)

Definition at line 25 of file value.py.

References value.Value.err, value.Value.val, TPNFit.val, TMCReader.val, TMatacq.val, and edm::helpers::KeyVal< K, V >.val.

25 
26  def __isub__(self, other):
27  self.val -= other.val
28  self.err = math.sqrt( self.err*self.err + other.err*other.err)
29  return self
def __isub__
Definition: value.py:25
def value.Value.__str__ (   self)

Definition at line 46 of file value.py.

References value.Value.err, value.Value.relerr(), value.Value.val, TPNFit.val, TMCReader.val, TMatacq.val, and edm::helpers::KeyVal< K, V >.val.

46 
47  def __str__(self):
48  return '{val:10.3f} +- {err:8.3f} ({relerr:5.2f}%)'.format(val=self.val,
49  err=self.err,
50  relerr=self.relerr()*100)
def __str__
Definition: value.py:46
def relerr
Definition: value.py:12
def value.Value.__sub__ (   self,
  other 
)

Definition at line 30 of file value.py.

30 
31  def __sub__(self, other):
32  new = copy.deepcopy(self)
33  new -= other
34  return new
def __sub__
Definition: value.py:30
def value.Value.relerr (   self)

Definition at line 12 of file value.py.

References funct.abs(), value.Value.err, value.Value.val, TPNFit.val, TMCReader.val, TMatacq.val, and edm::helpers::KeyVal< K, V >.val.

Referenced by value.Value.__idiv__(), and value.Value.__str__().

12 
13  def relerr(self):
14  return abs(self.err / self.val)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
def relerr
Definition: value.py:12

Member Data Documentation

value.Value.err

Definition at line 10 of file value.py.

Referenced by value.Value.__iadd__(), value.Value.__idiv__(), value.Value.__isub__(), value.Value.__str__(), and value.Value.relerr().

value.Value.val

Definition at line 9 of file value.py.

Referenced by value.Value.__iadd__(), value.Value.__idiv__(), value.Value.__isub__(), value.Value.__str__(), and value.Value.relerr().