CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
value.Value Class Reference
Inheritance diagram for value.Value:

Public Member Functions

def __add__ (self, other)
 
def __div__ (self, other)
 
def __eq__ (self, other)
 
def __iadd__ (self, other)
 
def __idiv__ (self, other)
 
def __init__ (self, val, err)
 
def __isub__ (self, other)
 
def __str__ (self)
 
def __sub__ (self, other)
 
def relerr (self)
 

Public Attributes

 err
 
 val
 

Detailed Description

Definition at line 7 of file value.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 8 of file value.py.

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

Member Function Documentation

◆ __add__()

def value.Value.__add__ (   self,
  other 
)

Definition at line 23 of file value.py.

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

◆ __div__()

def value.Value.__div__ (   self,
  other 
)

Definition at line 44 of file value.py.

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

◆ __eq__()

def value.Value.__eq__ (   self,
  other 
)

Definition at line 15 of file value.py.

15  def __eq__(self, other):
16  return self.val == other.val and self.err == other.err
17 

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

◆ __iadd__()

def value.Value.__iadd__ (   self,
  other 
)

Definition at line 18 of file value.py.

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

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

◆ __idiv__()

def value.Value.__idiv__ (   self,
  other 
)

Definition at line 38 of file value.py.

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

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

◆ __isub__()

def value.Value.__isub__ (   self,
  other 
)

Definition at line 28 of file value.py.

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

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

◆ __str__()

def value.Value.__str__ (   self)

Definition at line 49 of file value.py.

49  def __str__(self):
50  return '{val:10.3f} +- {err:8.3f} ({relerr:5.2f}%)'.format(val=self.val,
51  err=self.err,
52  relerr=self.relerr()*100)

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

◆ __sub__()

def value.Value.__sub__ (   self,
  other 
)

Definition at line 33 of file value.py.

33  def __sub__(self, other):
34  new = copy.deepcopy(self)
35  new -= other
36  return new
37 

◆ relerr()

def value.Value.relerr (   self)

Definition at line 12 of file value.py.

12  def relerr(self):
13  return abs(self.err / self.val)
14 

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

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

Member Data Documentation

◆ err

value.Value.err

◆ val

value.Value.val
TriggerAnalyzer.__str__
def __str__(self)
Definition: TriggerAnalyzer.py:103
format
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22