Package madgraph :: Package core :: Module base_objects :: Class PhysicsObject
[hide private]
[frames] | no frames]

Class PhysicsObject

source code

object --+    
         |    
      dict --+
             |
            PhysicsObject
Known Subclasses:

A parent class for all physics objects.

Nested Classes [hide private]
  PhysicsObjectError
Exception raised if an error occurs in the definition or the execution of a physics object.
Instance Methods [hide private]
new empty dictionary

__init__(self, init_dict={})
Creates a new particle object.
source code
 
__getitem__(self, name)
force the check that the property exist before returning the value associated to value.
source code
 
default_setup(self)
Function called to create and setup default values for all object properties
source code
 
is_valid_prop(self, name)
Check if a given property name is valid
source code
D[k] if k in D, else d
get(self, name)
Get the value of the property name.
source code
 
set(self, name, value, force=False)
Set the value of the property name.
source code
 
filter(self, name, value)
Checks if the proposed value is valid for a given property name.
source code
 
get_sorted_keys(self)
Returns the object keys sorted in a certain way.
source code
 
__str__(self)
String representation of the object.
source code
 
__repr__(self)
String representation of the object.
source code

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __gt__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __setitem__, __sizeof__, clear, copy, fromkeys, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __subclasshook__

Class Variables [hide private]

Inherited from dict: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, init_dict={})
(Constructor)

source code 

Creates a new particle object. If a dictionary is given, tries to use it to give values to properties.

Returns:
new empty dictionary

Overrides: object.__init__

__getitem__(self, name)
(Indexing operator)

source code 

force the check that the property exist before returning the value associated to value. This ensure that the correct error is always raise

Overrides: dict.__getitem__

get(self, name)

source code 

Get the value of the property name.

Returns: D[k] if k in D, else d
Overrides: dict.get

set(self, name, value, force=False)

source code 

Set the value of the property name. First check if value is a valid value for the considered property. Return True if the value has been correctly set, False otherwise.

filter(self, name, value)

source code 

Checks if the proposed value is valid for a given property name. Returns True if OK. Raises an error otherwise.

get_sorted_keys(self)

source code 

Returns the object keys sorted in a certain way. By default, alphabetical.

__str__(self)
(Informal representation operator)

source code 

String representation of the object. Outputs valid Python with improved format.

Overrides: object.__str__

__repr__(self)
(Representation operator)

source code 

String representation of the object. Outputs valid Python with improved format.

Overrides: object.__repr__