ATLAS Offline Software
EventIDFromStore.cxx
Go to the documentation of this file.
1 
2 /*
3  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
4 */
5 
7 
8 #include "GaudiKernel/EventContext.h"
11 #include "SGTools/DataProxy.h"
12 #include "EventInfo/EventID.h"
13 #include "EventInfo/EventInfo.h"
14 
15 const EventIDBase* EventIDFromStore( IProxyDict* store )
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 }
34 
SGTest::store
TestStore store
Definition: TestStore.cxx:23
EventIDFromStore.h
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
IProxyDict
A proxy dictionary.
Definition: AthenaKernel/AthenaKernel/IProxyDict.h:47
EventContextClid.h
Assign a CLID to EventContext.
SGTest::TestStore::proxy
virtual SG::DataProxy * proxy(const void *const pTransient) const override
Definition: TestStore.cxx:104
EventID.h
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
IProxyDict.h
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:45
DataProxy.h