ATLAS Offline Software
Static Public Member Functions | List of all members
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. More...
 

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 }

The documentation for this class was generated from the following files:
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
AlgorithmIdentifier
Small structure to hold an algorithm's name and store, plus some details on its EventView....
Definition: AlgorithmIdentifier.h:21
AlgorithmIdentifier::s_noView
static constexpr int16_t s_noView
Constant value used to express an Algorithm which is not running in a View.
Definition: AlgorithmIdentifier.h:38
Atlas::hasExtendedEventContext
bool hasExtendedEventContext(const EventContext &ctx)
Test whether a context object has an extended context installed.
Definition: ExtendedEventContext.cxx:23
IProxyDict
A proxy dictionary.
Definition: AthenaKernel/AthenaKernel/IProxyDict.h:47
xAOD::int16_t
setScaleOne setStatusOne setSaturated int16_t
Definition: gFexGlobalRoI_v1.cxx:55
Atlas::getExtendedEventContext
const ExtendedEventContext & getExtendedEventContext(const EventContext &ctx)
Retrieve an extended context from a context object.
Definition: ExtendedEventContext.cxx:32
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
SG::View
Definition: View.h:25
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
drawFromPickle.view
view
Definition: drawFromPickle.py:294