ATLAS Offline Software
Functions
EventIDFromStore.h File Reference
#include "StoreGate/StoreGateSvc.h"
Include dependency graph for EventIDFromStore.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

const EventIDBase * EventIDFromStore (IProxyDict *store)
 Retrieve the EventID from EventContext saved in store STORE. More...
 
const EventIDBase * EventIDFromStore (const ServiceHandle< StoreGateSvc > &storeH)
 
StatusCode EventIDFromStore (IProxyDict *store, const EventIDBase *&evid)
 

Function Documentation

◆ EventIDFromStore() [1/3]

const EventIDBase* EventIDFromStore ( const ServiceHandle< StoreGateSvc > &  storeH)

Definition at line 31 of file EventIDFromStore.h.

32 {
33  return EventIDFromStore( &*storeH );
34 }

◆ EventIDFromStore() [2/3]

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 }

◆ EventIDFromStore() [3/3]

StatusCode EventIDFromStore ( IProxyDict store,
const EventIDBase *&  evid 
)

Definition at line 38 of file EventIDFromStore.h.

39 {
40  evid = EventIDFromStore( store );
41  return evid? StatusCode::SUCCESS : StatusCode::FAILURE;
42 }
store
StoreGateSvc * store
Definition: fbtTestBasics.cxx:71
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:389
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
EventIDFromStore
const EventIDBase * EventIDFromStore(IProxyDict *store)
Retrieve the EventID from EventContext saved in store STORE.
Definition: EventIDFromStore.cxx:15
SG::DataProxy
Definition: DataProxy.h:44