ATLAS Offline Software
Loading...
Searching...
No Matches
AlgorithmIdentifierMaker Class Reference

Simple factory class to construct an AlgorithmIdentifier from an algorithm name and context. More...

#include <AlgorithmIdentifier.h>

Collaboration diagram for AlgorithmIdentifierMaker:

Static Public Member Functions

static AlgorithmIdentifier make (const EventContext &context, const std::string &caller, MsgStream &msg, const int16_t slotOverride=-1)
 Construct an AlgorithmIdentifier.

Detailed Description

Simple factory class to construct an AlgorithmIdentifier from an algorithm name and context.

Definition at line 45 of file AlgorithmIdentifier.h.

Member Function Documentation

◆ make()

AlgorithmIdentifier AlgorithmIdentifierMaker::make ( const EventContext & context,
const std::string & caller,
MsgStream & msg,
const int16_t slotOverride = -1 )
static

Construct an AlgorithmIdentifier.

Parameters
[in]contextThe event context
[in]callerThe name of the algorithm
[in]msga reference to the msgstream for printing
Returns
Constructed AlgorithmIdentifier on the stack

Definition at line 84 of file AlgorithmIdentifier.cxx.

84 {
85 const SG::View* view = nullptr;
86 const IProxyDict* proxy = nullptr;
87 if (Atlas::hasExtendedEventContext(context)) {
88 proxy = Atlas::getExtendedEventContext(context).proxy();
89 if (proxy) view = dynamic_cast<const SG::View*>(proxy);
90 }
91 if (!proxy) {
92 msg << MSG::ERROR << "Unable to obtain IProxyDict from Atlas::ExtendedEventContext" << endmsg;
93 return AlgorithmIdentifier(); // Return a default constructed, invalid, identifier
94 }
95 const int16_t viewID = (view == nullptr ? AlgorithmIdentifier::s_noView : view->viewID());
96 const size_t saveSlot = (slotOverride >= 0 ? slotOverride : context.slot());
97 return AlgorithmIdentifier(context.slot(), saveSlot, caller, proxy->name(), viewID);
98}
#define endmsg
const ExtendedEventContext & getExtendedEventContext(const EventContext &ctx)
Retrieve an extended context from a context object.
bool hasExtendedEventContext(const EventContext &ctx)
Test whether a context object has an extended context installed.
setScaleOne setStatusOne setSaturated int16_t
static constexpr int16_t s_noView
Constant value used to express an Algorithm which is not running in a View.
MsgStream & msg
Definition testRead.cxx:32

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