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
store
StoreGateSvc * store
Definition:
fbtTestBasics.cxx:69
EventIDFromStore.h
StateLessPT_NewConfig.proxy
proxy
Definition:
StateLessPT_NewConfig.py:392
IProxyDict
A proxy dictionary.
Definition:
AthenaKernel/AthenaKernel/IProxyDict.h:51
EventContextClid.h
Assign a CLID to EventContext.
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
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
IProxyDict.h
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
DataProxy.h
Generated on Tue Jul 2 2024 21:15:18 for ATLAS Offline Software by
1.8.18