![]() |
ATLAS Offline Software
|
a handle for applying algorithm filter decisions More...
#include <FilterReporterParams.h>
Public Member Functions | |
template<typename T > | |
FilterReporterParams (T *owner, std::string val_filterKey, std::string val_filterDescription) | |
standard constructor More... | |
StatusCode | initialize (bool enabled=true) |
do anything we need to do in initialize More... | |
std::string | summary () |
report the status of filtering More... | |
const std::string & | key () const |
retrieve the key name More... | |
const SG::ReadHandleKey< xAOD::EventInfo > & | eventInfoKey () const |
retrieve the event info read handle key More... | |
ServiceHandle< ICutFlowSvc > & | cutFlowSvc () |
retrieve the CutFlowSvc handle reference More... | |
bool | msgLvl (const MSG::Level lvl) const |
Test the output level of the object. More... | |
MsgStream & | msg () const |
The standard message stream. More... | |
MsgStream & | msg (const MSG::Level lvl) const |
The standard message stream. More... | |
Private Attributes | |
std::function< void(bool, const EventContext *ctx)> | m_setFilterPassed |
the function to call setFilterPassed() on the algorithm More... | |
bool | m_isInitialized {false} |
whether the handle was initialized More... | |
bool | m_isEnabled {false} |
whether the handle was initialized More... | |
std::atomic< unsigned > | m_passed {0} |
the count of passed and total events More... | |
std::atomic< unsigned > | m_total {0} |
std::string | m_filterKey |
output key of the filter More... | |
std::string | m_filterDescription |
description what this filter does More... | |
SG::ReadHandleKey< xAOD::EventInfo > | m_eventInfoKey |
event info read handle key More... | |
CutIdentifier | m_cutID {} |
the CutIdentifier for this filter algorithm More... | |
ServiceHandle< ICutFlowSvc > | m_cutFlowSvc |
the handle to the service holding tables of cut-flows for filtering algs. More... | |
std::function< MsgStream &()> | m_msg |
the message stream we use More... | |
Friends | |
class | FilterReporter |
a handle for applying algorithm filter decisions
This is meant to replace the old/traditional mechanism for recording filter decisions by algorithms, i.e. calling setFilterPassed() on the algorithm base class. This allows to selectively add filter capabilties to algorithms without having to derive from a dedicated algorithm class like AthFilterAlgorithm
.
One of the particular reasons to handle filter decisions through a handle is that it makes it fairly easy to add instrumentation (e.g. reporting to the cut flow service), without having to make changes to the base class or indeed without having any extra code in the base class at all. Also it makes sure that only the actual filter algorithms expose properties related to reporting filter decisions (though that would also be true when using a base class).
This should in principle work with any algorithm (or we should be able to make it work with any algorithm). While there isn't any intrinsic reason one couldn't have more than one filter handle per algorithm, that is currently (02 Mar 20) not supported, but could be added on request.
Currently (02 Mar 20) none of the member functions is marked const
, which is deliberate to prevent them being called from a reentrant algorithm. I suspect if we ever want to use this in AthenaMT, we will add a second set of member functions that is marked const
and will take an event context as an argument.
Definition at line 57 of file FilterReporterParams.h.
|
explicit |
standard constructor
Definition at line 171 of file FilterReporterParams.h.
|
inline |
retrieve the CutFlowSvc handle reference
Definition at line 214 of file FilterReporterParams.h.
|
inline |
retrieve the event info read handle key
Definition at line 206 of file FilterReporterParams.h.
StatusCode FilterReporterParams::initialize | ( | bool | enabled = true | ) |
do anything we need to do in initialize
Definition at line 23 of file FilterReporterParams.cxx.
|
inline |
|
inherited |
The standard message stream.
Definition at line 24 of file AsgMessagingForward.cxx.
|
inherited |
|
inherited |
Test the output level of the object.
lvl | The message level to test against |
true
If messages at level "lvl" will be printed Definition at line 11 of file AsgMessagingForward.cxx.
std::string FilterReporterParams::summary | ( | ) |
report the status of filtering
Definition at line 59 of file FilterReporterParams.cxx.
|
friend |
Definition at line 115 of file FilterReporterParams.h.
|
private |
the handle to the service holding tables of cut-flows for filtering algs.
Definition at line 160 of file FilterReporterParams.h.
|
private |
the CutIdentifier for this filter algorithm
Definition at line 155 of file FilterReporterParams.h.
|
private |
event info read handle key
Definition at line 149 of file FilterReporterParams.h.
|
private |
description what this filter does
Definition at line 145 of file FilterReporterParams.h.
|
private |
output key of the filter
Definition at line 141 of file FilterReporterParams.h.
|
private |
whether the handle was initialized
Definition at line 130 of file FilterReporterParams.h.
|
private |
whether the handle was initialized
Definition at line 126 of file FilterReporterParams.h.
|
privateinherited |
the message stream we use
This used to be a simple pointer to the MsgStream
itself, but in AthenaMT the actual object used is local to the thread. So instead of pointing to it directly we are now using a function to look it up, which will get the thread-local object.
Definition at line 77 of file AsgMessagingForward.h.
|
mutableprivate |
the count of passed and total events
While we currently don't run in multi-threaded mode, this is atomic in case we ever use it with reentrant algorithms.
Definition at line 137 of file FilterReporterParams.h.
|
private |
the function to call setFilterPassed() on the algorithm
This is using a std::function
object, so as to avoid tying this to a particular algorithm class.
Definition at line 122 of file FilterReporterParams.h.
|
private |
Definition at line 137 of file FilterReporterParams.h.