|
def | __init__ (self, name="HephaestusAuditor", mode='leak-check', **kw) |
|
def | initialize (self) |
|
def | finalize (self) |
|
def | before (self, evt_name, comp_name) |
|
def | after (self, evt_name, comp_name, sc) |
|
def | __getstate__ (self) |
|
def | __setstate__ (self, dct) |
|
virtual StatusCode | initialize () override |
| Gaudi Aud Implementation. More...
|
|
virtual StatusCode | sysInitialize () override |
|
virtual StatusCode | finalize () override |
|
virtual const char * | typeName () const override |
| return the std::type_info name of the underlying py-component This is used by concrete implementations to connect a python component to its C++ counter-part More...
|
|
virtual void | before (const std::string &evt, const std::string &name, const EventContext &ctx) override |
| Auditor interface More...
|
|
virtual void | after (const std::string &evt, const std::string &name, const EventContext &ctx, const StatusCode &sc) override |
|
virtual PyObject * | self () override |
| return associated python object. More...
|
|
| DeclareInterfaceID (IPyComponent, 1, 0) |
|
Definition at line 13 of file Auditor.py.
◆ __init__()
def python.Auditor.HephaestusAuditor.__init__ |
( |
|
self, |
|
|
|
name = "HephaestusAuditor" , |
|
|
|
mode = 'leak-check' , |
|
|
** |
kw |
|
) |
| |
Definition at line 14 of file Auditor.py.
14 def __init__( self, name = "HephaestusAuditor", mode = 'leak-check', **kw ):
16 super( HephaestusAuditor, self ).
__init__( **kw )
23 self.auditOn = kw[
'auditOn' ]
25 self.auditOn = [
'execute' ]
29 self.topSequenceName = kw[
'topSequenceName' ]
31 self.topSequenceName =
'AthMasterSeq'
33 self.__setupMemoryTracker( mode,
True )
◆ __getstate__()
def python.Auditor.HephaestusAuditor.__getstate__ |
( |
|
self | ) |
|
Definition at line 92 of file Auditor.py.
92 def __getstate__( self ):
95 if self._memtrack.start != self._start:
99 mtmod = self._memtrack
101 dct = super( HephaestusAuditor, self ).__getstate__()
105 self._memtrack = mtmod
111 dct[
'GlobalSettings' ] = GlobalSettings
117 dct[
'pid' ] = os.getpid()
◆ __setstate__()
def python.Auditor.HephaestusAuditor.__setstate__ |
( |
|
self, |
|
|
|
dct |
|
) |
| |
Definition at line 121 of file Auditor.py.
121 def __setstate__( self, dct ):
122 super( HephaestusAuditor, self ).__setstate__( dct )
126 global GlobalSettings
127 for k,v
in dct[
'GlobalSettings' ].
items():
128 GlobalSettings[ k ] = v
131 self.__setupMemoryTracker( dct[
'mode' ], dct[
'pid' ] != os.getpid() )
134 if dct[
'pid' ] == os.getpid():
135 self._evt = dct[
'_evt' ]
◆ __setupMemoryTracker()
def python.Auditor.HephaestusAuditor.__setupMemoryTracker |
( |
|
self, |
|
|
|
mode, |
|
|
|
startup = True |
|
) |
| |
|
private |
Definition at line 35 of file Auditor.py.
35 def __setupMemoryTracker( self, mode, startup = True ):
38 self._memtrack = MemoryTracker
40 if mode ==
'leak-check':
41 self._start = self._memtrack.start
42 self._stop = self._memtrack.stop
44 if startup
or 'full' in self.auditOn:
46 self._memtrack.install()
48 elif mode ==
'delete-check':
50 self._start = DeleteChecker.start
51 self._stop = DeleteChecker.stop
54 raise RuntimeError(
'unknown mode: %s (expected leak-check or delete-check)' % mode )
57 if 'full' in self.auditOn:
◆ after() [1/2]
void PyAthena::Aud::after |
( |
const std::string & |
evt, |
|
|
const std::string & |
name, |
|
|
const EventContext & |
ctx, |
|
|
const StatusCode & |
sc |
|
) |
| |
|
overridevirtualinherited |
◆ after() [2/2]
def python.Auditor.HephaestusAuditor.after |
( |
|
self, |
|
|
|
evt_name, |
|
|
|
comp_name, |
|
|
|
sc |
|
) |
| |
Definition at line 86 of file Auditor.py.
86 def after( self, evt_name, comp_name, sc ):
87 if not self.auditOn
or evt_name.lower()
in self.auditOn:
◆ before() [1/2]
void PyAthena::Aud::before |
( |
const std::string & |
evt, |
|
|
const std::string & |
name, |
|
|
const EventContext & |
ctx |
|
) |
| |
|
overridevirtualinherited |
◆ before() [2/2]
def python.Auditor.HephaestusAuditor.before |
( |
|
self, |
|
|
|
evt_name, |
|
|
|
comp_name |
|
) |
| |
Definition at line 76 of file Auditor.py.
76 def before( self, evt_name, comp_name ):
77 if not self.auditOn
or evt_name.lower()
in self.auditOn:
78 if (self._memtrack.
configure() & self._memtrack.PROFILE):
79 if GlobalSettings[
'event-based' ]
and evt_name.lower() ==
'execute'\
80 and comp_name == self.topSequenceName:
82 self._memtrack._profname( GlobalSettings[
'label' ] +
'_execute.%d' % self._evt )
◆ DeclareInterfaceID()
◆ finalize() [1/2]
StatusCode PyAthena::Aud::finalize |
( |
| ) |
|
|
overridevirtualinherited |
◆ finalize() [2/2]
def python.Auditor.HephaestusAuditor.finalize |
( |
|
self | ) |
|
Definition at line 70 of file Auditor.py.
71 if 'full-athena' in self.auditOn:
74 return PyAthena.StatusCode.Success
◆ initialize() [1/2]
StatusCode PyAthena::Aud::initialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ initialize() [2/2]
def python.Auditor.HephaestusAuditor.initialize |
( |
|
self | ) |
|
Definition at line 60 of file Auditor.py.
61 if 'full-athena' in self.auditOn:
64 if (self._memtrack.
configure() & self._memtrack.PROFILE):
65 if not GlobalSettings[
'event-based' ]:
66 self._memtrack._profname( GlobalSettings[
'label' ] )
68 return PyAthena.StatusCode.Success
◆ self()
virtual PyObject* PyAthena::Aud::self |
( |
| ) |
|
|
inlineoverridevirtualinherited |
◆ setPyAttr()
bool PyAthena::Aud::setPyAttr |
( |
PyObject * |
pyobj | ) |
|
|
overrideprotectedvirtualinherited |
attach the C++ component to its python cousin
Implements IPyComponent.
Definition at line 130 of file PyAthenaAud.cxx.
134 PyObject* pyobj = TPython::CPPInstance_FromVoidPtr
139 pyobj = TPython::CPPInstance_FromVoidPtr ((
void*)
this,
"PyAthena::Aud");
142 <<
"could not dyncast component [" <<
name() <<
"] to a python "
143 <<
"object of type [" << this->
typeName() <<
"] (probably a missing "
144 <<
"dictionary)" <<
endmsg
145 <<
"fallback to [PyAthena::Aud]..."
151 msg << MSG::WARNING <<
"Could not dyncast component ["
152 <<
name() <<
"] to a pyobject of type ["
156 if ( -1 == PyObject_SetAttrString(o,
"_cppHandle", pyobj) ) {
160 <<
"Could not attach C++ handle [" <<
name() <<
"] to its python "
163 if ( -1 == PyObject_SetAttrString(o,
"_cppHandle", Py_None) ) {
166 <<
"could not attach a dummy C++ handle [" <<
name() <<
"] to its "
◆ sysInitialize()
StatusCode PyAthena::Aud::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
Definition at line 67 of file PyAthenaAud.cxx.
70 (
"PyAthena::PyComponentMgr/PyComponentMgr",
name() );
71 if ( !pyMgr.retrieve().isSuccess() ) {
72 return StatusCode::FAILURE;
76 m_self = pyMgr->pyObject(
this );
79 return StatusCode::FAILURE;
83 return Gaudi::Auditor::sysInitialize();
◆ typeName()
const char * PyAthena::Aud::typeName |
( |
| ) |
const |
|
overridevirtualinherited |
return the std::type_info
name of the underlying py-component This is used by concrete implementations to connect a python component to its C++ counter-part
Implements IPyComponent.
Definition at line 97 of file PyAthenaAud.cxx.
100 return tname.c_str();
◆ _evt
python.Auditor.HephaestusAuditor._evt |
|
private |
◆ _memtrack
python.Auditor.HephaestusAuditor._memtrack |
|
private |
◆ _start
python.Auditor.HephaestusAuditor._start |
|
private |
◆ _stop
python.Auditor.HephaestusAuditor._stop |
|
private |
◆ auditOn
python.Auditor.HephaestusAuditor.auditOn |
◆ m_self
Pointer to self (from the python world)
Definition at line 90 of file PyAthenaAud.h.
◆ topSequenceName
python.Auditor.HephaestusAuditor.topSequenceName |
The documentation for this class was generated from the following file:
bool configure(asg::AnaToolHandle< ITrigGlobalEfficiencyCorrectionTool > &tool, ToolHandleArray< IAsgElectronEfficiencyCorrectionTool > &electronEffToolsHandles, ToolHandleArray< IAsgElectronEfficiencyCorrectionTool > &electronSFToolsHandles, ToolHandleArray< CP::IMuonTriggerScaleFactors > &muonToolsHandles, ToolHandleArray< IAsgPhotonEfficiencyCorrectionTool > &photonEffToolsHandles, ToolHandleArray< IAsgPhotonEfficiencyCorrectionTool > &photonSFToolsHandles, const std::string &triggers, const std::map< std::string, std::string > &legsPerTool, unsigned long nToys, bool debug)