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 }
SGTest::store
TestStore store
Definition: TestStore.cxx:23
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
SGTest::TestStore::proxy_exact
virtual SG::DataProxy * proxy_exact(SG::sgkey_t sgkey) const override
Definition: TestStore.cxx:140
SGTest::TestStore::stringToKey
virtual sgkey_t stringToKey(const std::string &str, CLID clid) override
Definition: TestStore.cxx:150
SGTest::TestStore::proxy
virtual SG::DataProxy * proxy(const void *const pTransient) const override
Definition: TestStore.cxx:104
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
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:45