test
Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
PhysicsTools
Heppy
python
physicsobjects
PhysicsObject.py
Go to the documentation of this file.
1
import
copy
2
from
PhysicsTools.Heppy.physicsobjects.Particle
import
Particle
3
4
class
PhysicsObject
(
Particle
):
5
'''Wrapper to particle-like C++ objects.'''
6
7
def
__init__
(self, physObj):
8
self.
physObj
= physObj
9
super(PhysicsObject, self).
__init__
()
10
11
def
__copy__
(self):
12
'''Very dirty trick, the physObj is deepcopied...'''
13
physObj = copy.deepcopy( self.
physObj
)
14
newone = type(self)(physObj)
15
newone.__dict__.update(self.__dict__)
16
newone.physObj = physObj
17
return
newone
18
19
def
scaleEnergy
( self, scale ):
20
p4 = self.physObj.p4()
21
p4 *= scale
22
self.physObj.setP4( p4 )
23
24
25
def
__getattr__
(self,name):
26
'''Makes all attributes and methods of the wrapped physObj
27
directly available.'''
28
return
getattr(self.
physObj
, name)
29
Particle
Definition:
Particle.py:1
PhysicsObject.PhysicsObject.physObj
physObj
Definition:
PhysicsObject.py:8
PhysicsObject.PhysicsObject.__getattr__
def __getattr__
Definition:
PhysicsObject.py:25
PhysicsObject.PhysicsObject.__init__
def __init__
Definition:
PhysicsObject.py:7
PhysicsObject.PhysicsObject.scaleEnergy
def scaleEnergy
Definition:
PhysicsObject.py:19
PhysicsObject.PhysicsObject
Definition:
PhysicsObject.py:4
PhysicsObject.PhysicsObject.__copy__
def __copy__
Definition:
PhysicsObject.py:11
Generated for CMSSW Reference Manual by
1.8.5