ATLAS Offline Software
Functions
EventIDFromStore.cxx File Reference
#include "EventInfoUtils/EventIDFromStore.h"
#include "GaudiKernel/EventContext.h"
#include "AthenaKernel/EventContextClid.h"
#include "AthenaKernel/IProxyDict.h"
#include "SGTools/DataProxy.h"
#include "EventInfo/EventID.h"
#include "EventInfo/EventInfo.h"
Include dependency graph for EventIDFromStore.cxx:

Go to the source code of this file.

Functions

const EventIDBase * EventIDFromStore (IProxyDict *store)
 Retrieve the EventID from EventContext saved in store STORE. More...
 

Function Documentation

◆ EventIDFromStore()

const EventIDBase* EventIDFromStore ( IProxyDict store)

Retrieve the EventID from EventContext saved in store STORE.

Parameters
storeThe store from which to retrieve the EventID, or nullptr.

If there is no context recorded in the store, return nullptr

Definition at line 15 of file EventIDFromStore.cxx.

16 {
17  if( store ) {
18  //MN: FIX: is this OK to have it static in case of multiple Stores?
19  static const SG::sgkey_t ctxkey = store->stringToKey( "EventContext", ClassID_traits<EventContext>::ID() );
21  if( proxy && proxy->object() ) {
22  return & SG::DataProxy_cast<EventContext>( proxy )->eventID();
23  }
24 
25  // Check for EventInfo
27  if( proxy && proxy->object() ) {
28  return SG::DataProxy_cast<EventInfo>( proxy )->event_ID();
29  }
30 
31  }
32  return nullptr;
33 }
store
StoreGateSvc * store
Definition: fbtTestBasics.cxx:69
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
StoreGateSvc::proxy_exact
virtual SG::DataProxy * proxy_exact(SG::sgkey_t sgkey) const override final
Get proxy given a hashed key+clid.
StoreGateSvc::stringToKey
virtual sgkey_t stringToKey(const std::string &str, CLID clid) override final
Find the key for a string/CLID pair.
Definition: StoreGateSvc.cxx:400
StoreGateSvc::proxy
virtual SG::DataProxy * proxy(const void *const pTransient) const override final
get proxy for a given data object address in memory
SG::sgkey_t
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
Definition: CxxUtils/CxxUtils/sgkey_t.h:32
SG::DataProxy
Definition: DataProxy.h:44