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 __eq__
 
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 23 of file value.py.

23 
24  def __add__(self, other):
25  new = copy.deepcopy(self)
26  new += other
27  return new
def __add__
Definition: value.py:23
def value.Value.__div__ (   self,
  other 
)

Definition at line 44 of file value.py.

44 
45  def __div__(self, other):
46  new = copy.deepcopy(self)
47  new /= other
48  return new
def __div__
Definition: value.py:44
def value.Value.__eq__ (   self,
  other 
)

Definition at line 15 of file value.py.

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

15 
16  def __eq__(self, other):
17  return self.val == other.val and self.err == other.err
def __eq__
Definition: value.py:15
def value.Value.__iadd__ (   self,
  other 
)

Definition at line 18 of file value.py.

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

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

Definition at line 38 of file value.py.

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

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

Definition at line 28 of file value.py.

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

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

Definition at line 49 of file value.py.

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

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

Definition at line 33 of file value.py.

33 
34  def __sub__(self, other):
35  new = copy.deepcopy(self)
36  new -= other
37  return new
def __sub__
Definition: value.py:33
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, edm::helpers::KeyVal< K, V >.val, and modGains.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.__eq__(), 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.__eq__(), value.Value.__iadd__(), value.Value.__idiv__(), value.Value.__isub__(), value.Value.__str__(), and value.Value.relerr().