ATLAS Offline Software
Loading...
Searching...
No Matches
python.PyKernel._SetEventCounter Class Reference
Collaboration diagram for python.PyKernel._SetEventCounter:

Public Member Functions

 __init__ (self, methodName)
 __call__ (self, *var)

Public Attributes

 methodObj = getattr(theApp,methodName)

Detailed Description

Function object to set event counter in ROOT stream.
This class is used to patch, e.g., theApp.nextEvent(), run() ...

:param methodObj: reference to method to be patched

Definition at line 82 of file PyKernel.py.

Constructor & Destructor Documentation

◆ __init__()

python.PyKernel._SetEventCounter.__init__ ( self,
methodName )

Definition at line 89 of file PyKernel.py.

89 def __init__(self,methodName):
90 self.methodObj = getattr(theApp,methodName)

Member Function Documentation

◆ __call__()

python.PyKernel._SetEventCounter.__call__ ( self,
* var )

Definition at line 92 of file PyKernel.py.

92 def __call__ (self,*var):
93 global curEvent
94 # set event counter. For pre-process internal curEvent is used
95 if eventLoopType != _PreProcess:
96 curEvent = theApp.curEvent()
97 # get ROOT entry
98 if eventLoopType != _NormalProcess and rootStream:
99 rootStream.GetEntry(curEvent)
100 # return if pre-process
101 if eventLoopType == _PreProcess:
102 # increment event counter
103 curEvent = curEvent+1
104 return GNS.StatusCode(1)
105 # call original method
106 return self.methodObj(var)
107
108
109# retrieve object from StoreGate

Member Data Documentation

◆ methodObj

python.PyKernel._SetEventCounter.methodObj = getattr(theApp,methodName)

Definition at line 90 of file PyKernel.py.


The documentation for this class was generated from the following file: