|
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 | py_before (IAuditor::StandardEventType, const std::string &) |
| Audit the start of a standard "event". More...
|
|
virtual void | py_before (IAuditor::CustomEventTypeRef, const std::string &) |
| Audit the start of a custom "event". More...
|
|
virtual void | py_after (IAuditor::StandardEventType, const std::string &, const StatusCode &) |
| Audit the end of a standard "event". More...
|
|
virtual void | py_after (IAuditor::CustomEventTypeRef, const std::string &, const StatusCode &) |
| Audit the end of a custom "event". More...
|
|
virtual PyObject * | self () override |
| return associated python object. More...
|
|
| DeclareInterfaceID (IPyComponent, 1, 0) |
|
|
virtual bool | setPyAttr (PyObject *pyobj) override |
| attach the C++ component to its python cousin More...
|
|
virtual void | before (StandardEventType, INamedInterface *) override |
| Auditor interface More...
|
|
virtual void | before (StandardEventType, const std::string &) override |
|
virtual void | before (CustomEventTypeRef, INamedInterface *) override |
|
virtual void | before (CustomEventTypeRef, const std::string &) override |
|
virtual void | after (StandardEventType, INamedInterface *, const StatusCode &) override |
|
virtual void | after (StandardEventType, const std::string &, const StatusCode &) override |
|
virtual void | after (CustomEventTypeRef, INamedInterface *, const StatusCode &) override |
|
virtual void | after (CustomEventTypeRef, const std::string &, const StatusCode &) override |
|
virtual void | beforeInitialize (INamedInterface *) override |
|
virtual void | afterInitialize (INamedInterface *) override |
|
virtual void | beforeReinitialize (INamedInterface *) override |
|
virtual void | afterReinitialize (INamedInterface *) override |
|
virtual void | beforeExecute (INamedInterface *) override |
|
virtual void | afterExecute (INamedInterface *, const StatusCode &) override |
|
virtual void | beforeFinalize (INamedInterface *) override |
|
virtual void | afterFinalize (INamedInterface *) override |
|
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/5]
void PyAthena::Aud::after |
( |
CustomEventTypeRef |
evt, |
|
|
const std::string & |
comp, |
|
|
const StatusCode & |
sc |
|
) |
| |
|
overrideprotectedvirtualinherited |
◆ after() [2/5]
void PyAthena::Aud::after |
( |
CustomEventTypeRef |
evt, |
|
|
INamedInterface * |
comp, |
|
|
const StatusCode & |
sc |
|
) |
| |
|
overrideprotectedvirtualinherited |
◆ after() [3/5]
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:
◆ after() [4/5]
void PyAthena::Aud::after |
( |
StandardEventType |
evt, |
|
|
const std::string & |
comp, |
|
|
const StatusCode & |
sc |
|
) |
| |
|
overrideprotectedvirtualinherited |
◆ after() [5/5]
void PyAthena::Aud::after |
( |
StandardEventType |
evt, |
|
|
INamedInterface * |
comp, |
|
|
const StatusCode & |
sc |
|
) |
| |
|
overrideprotectedvirtualinherited |
◆ afterExecute()
void PyAthena::Aud::afterExecute |
( |
INamedInterface * |
comp, |
|
|
const StatusCode & |
sc |
|
) |
| |
|
overrideprotectedvirtualinherited |
◆ afterFinalize()
void PyAthena::Aud::afterFinalize |
( |
INamedInterface * |
comp | ) |
|
|
overrideprotectedvirtualinherited |
◆ afterInitialize()
void PyAthena::Aud::afterInitialize |
( |
INamedInterface * |
comp | ) |
|
|
overrideprotectedvirtualinherited |
◆ afterReinitialize()
void PyAthena::Aud::afterReinitialize |
( |
INamedInterface * |
comp | ) |
|
|
overrideprotectedvirtualinherited |
◆ before() [1/5]
void PyAthena::Aud::before |
( |
CustomEventTypeRef |
evt, |
|
|
const std::string & |
comp |
|
) |
| |
|
overrideprotectedvirtualinherited |
◆ before() [2/5]
void PyAthena::Aud::before |
( |
CustomEventTypeRef |
evt, |
|
|
INamedInterface * |
comp |
|
) |
| |
|
overrideprotectedvirtualinherited |
◆ before() [3/5]
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 )
◆ before() [4/5]
void PyAthena::Aud::before |
( |
StandardEventType |
evt, |
|
|
const std::string & |
comp |
|
) |
| |
|
overrideprotectedvirtualinherited |
◆ before() [5/5]
void PyAthena::Aud::before |
( |
StandardEventType |
evt, |
|
|
INamedInterface * |
comp |
|
) |
| |
|
overrideprotectedvirtualinherited |
◆ beforeExecute()
void PyAthena::Aud::beforeExecute |
( |
INamedInterface * |
comp | ) |
|
|
overrideprotectedvirtualinherited |
◆ beforeFinalize()
void PyAthena::Aud::beforeFinalize |
( |
INamedInterface * |
comp | ) |
|
|
overrideprotectedvirtualinherited |
◆ beforeInitialize()
void PyAthena::Aud::beforeInitialize |
( |
INamedInterface * |
comp | ) |
|
|
overrideprotectedvirtualinherited |
◆ beforeReinitialize()
void PyAthena::Aud::beforeReinitialize |
( |
INamedInterface * |
comp | ) |
|
|
overrideprotectedvirtualinherited |
◆ 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
◆ py_after() [1/2]
void PyAthena::Aud::py_after |
( |
IAuditor::CustomEventTypeRef |
evt, |
|
|
const std::string & |
component, |
|
|
const StatusCode & |
sc |
|
) |
| |
|
virtualinherited |
Audit the end of a custom "event".
Definition at line 246 of file PyAthenaAud.cxx.
250 return PyAthena::pyAudit (
m_self,
251 "after",
evt.c_str(), component.c_str(),
sc);
◆ py_after() [2/2]
void PyAthena::Aud::py_after |
( |
IAuditor::StandardEventType |
evt, |
|
|
const std::string & |
component, |
|
|
const StatusCode & |
sc |
|
) |
| |
|
virtualinherited |
Audit the end of a standard "event".
Definition at line 228 of file PyAthenaAud.cxx.
232 const char* evtname = 0;
234 case Initialize: evtname =
"initialize";
break;
235 case ReInitialize: evtname =
"reinitialize";
break;
236 case Execute: evtname =
"execute";
break;
237 case Finalize: evtname =
"finalize";
break;
238 case Start: evtname =
"start";
break;
239 case Stop: evtname =
"stop";
break;
240 case ReStart: evtname =
"restart";
break;
242 return PyAthena::pyAudit (
m_self,
"after", evtname, component.c_str(),
sc);
◆ py_before() [1/2]
void PyAthena::Aud::py_before |
( |
IAuditor::CustomEventTypeRef |
evt, |
|
|
const std::string & |
component |
|
) |
| |
|
virtualinherited |
Audit the start of a custom "event".
Definition at line 222 of file PyAthenaAud.cxx.
224 return PyAthena::pyAudit (
m_self,
"before",
evt.c_str(), component.c_str());
◆ py_before() [2/2]
void PyAthena::Aud::py_before |
( |
IAuditor::StandardEventType |
evt, |
|
|
const std::string & |
component |
|
) |
| |
|
virtualinherited |
Audit the start of a standard "event".
Definition at line 206 of file PyAthenaAud.cxx.
208 const char* evtname = 0;
210 case Initialize: evtname =
"initialize";
break;
211 case ReInitialize: evtname =
"reinitialize";
break;
212 case Execute: evtname =
"execute";
break;
213 case Finalize: evtname =
"finalize";
break;
214 case Start: evtname =
"start";
break;
215 case Stop: evtname =
"stop";
break;
216 case ReStart: evtname =
"restart";
break;
218 return PyAthena::pyAudit (
m_self,
"before", evtname, component.c_str());
◆ 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 260 of file PyAthenaAud.cxx.
264 PyObject* pyobj = TPython::CPPInstance_FromVoidPtr
269 pyobj = TPython::CPPInstance_FromVoidPtr ((
void*)
this,
"PyAthena::Aud");
272 <<
"could not dyncast component [" <<
name() <<
"] to a python "
273 <<
"object of type [" << this->
typeName() <<
"] (probably a missing "
274 <<
"dictionary)" <<
endmsg
275 <<
"fallback to [PyAthena::Aud]..."
281 msg << MSG::WARNING <<
"Could not dyncast component ["
282 <<
name() <<
"] to a pyobject of type ["
286 if ( -1 == PyObject_SetAttrString(o,
"_cppHandle", pyobj) ) {
290 <<
"Could not attach C++ handle [" <<
name() <<
"] to its python "
293 if ( -1 == PyObject_SetAttrString(o,
"_cppHandle", Py_None) ) {
296 <<
"could not attach a dummy C++ handle [" <<
name() <<
"] to its "
◆ sysInitialize()
StatusCode PyAthena::Aud::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
Definition at line 66 of file PyAthenaAud.cxx.
69 (
"PyAthena::PyComponentMgr/PyComponentMgr",
name() );
70 if ( !pyMgr.retrieve().isSuccess() ) {
71 return StatusCode::FAILURE;
75 m_self = pyMgr->pyObject(
this );
78 return StatusCode::FAILURE;
82 return ::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 96 of file PyAthenaAud.cxx.
◆ _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 123 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)