ATLAS Offline Software
Event
EventInfoUtils
src
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
6
#include "
EventInfoUtils/EventIDFromStore.h
"
7
8
#include "GaudiKernel/EventContext.h"
9
#include "
AthenaKernel/EventContextClid.h
"
10
#include "
AthenaKernel/IProxyDict.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
() );
20
SG::DataProxy
*
proxy
=
store
->
proxy_exact
(ctxkey);
21
if
(
proxy
&&
proxy
->object() ) {
22
return
& SG::DataProxy_cast<EventContext>(
proxy
)->eventID();
23
}
24
25
// Check for EventInfo
26
proxy
=
store
->
proxy
(
ClassID_traits<EventInfo>::ID
(),
""
);
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
Generated on Sun Dec 22 2024 21:10:16 for ATLAS Offline Software by
1.8.18