ATLAS Offline Software
EventInfoUnlocker.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "EventInfoUnlocker.h"
8 //================ Constructor =================================================
9 
10 EventInfoUnlocker::EventInfoUnlocker(const std::string& name, ISvcLocator* pSvcLocator)
11  :
12  AthAlgorithm(name,pSvcLocator)
13 {
14 
15 }
16 
17 //================ Initialisation =================================================
18 
20 {
21  ATH_MSG_DEBUG( "initialize: Setting up EventInfo Unlocker - **ONLY needed ror running on ESD!**");
22 
23  return StatusCode::SUCCESS;
24 }
25 
27 {
28 
29  const SG::DataProxy* proxy =
31  "EventInfo");
32  if (!proxy) {
33  ATH_MSG_WARNING( "No xAOD::EventInfoContainer "
34  << "with key EventInfo found" );
35  return StatusCode::SUCCESS;
36  }
37 
38  if (proxy->isConst()) {
39  const xAOD::EventInfo* ccoll = nullptr;
40  const xAOD::EventAuxInfo* cauxcoll = nullptr;
41  ATH_CHECK( evtStore()->retrieve (ccoll,
42  "EventInfo") );
43  ATH_CHECK( evtStore()->retrieve (cauxcoll,
44  "EventInfoAux.") );
45 
46  xAOD::EventInfo * eventInfo = new xAOD::EventInfo;
48 
49  eventInfo->setStore(store);
50  *eventInfo = *ccoll;
51 
52  CHECK( evtStore()->overwrite (eventInfo,
53  "EventInfo",
54  true, false) );
55  CHECK( evtStore()->overwrite (store,
56  "EventInfoAux.",
57  true, false) );
58 
59 
60 
61 
62  }
63 
64  return StatusCode::SUCCESS;
65 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
store
StoreGateSvc * store
Definition: fbtTestBasics.cxx:69
EventInfoUnlocker::EventInfoUnlocker
EventInfoUnlocker(const std::string &name, ISvcLocator *pSvcLocator)
Standard Athena-Algorithm Constructor.
Definition: EventInfoUnlocker.cxx:10
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
xAOD::EventInfo
EventInfo_v1 EventInfo
Definition of the latest event info version.
Definition: IEventInfoCnvTool.h:17
xAOD::EventAuxInfo_v3
Auxiliary information about the event.
Definition: EventAuxInfo_v3.h:28
EventInfoUnlocker::execute
StatusCode execute()
standard Athena-Algorithm method
Definition: EventInfoUnlocker.cxx:26
EventInfoUnlocker.h
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
EventInfoUnlocker::initialize
StatusCode initialize()
standard Athena-Algorithm method
Definition: EventInfoUnlocker.cxx:19
SG::AuxElement::setStore
void setStore(const SG::IConstAuxStore *store)
Set the store associated with this object.
Definition: AuxElement.cxx:221
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
AthAlgorithm
Definition: AthAlgorithm.h:47
xAOD::EventAuxInfo
EventAuxInfo_v3 EventAuxInfo
Definition of the latest event auxiliary info version.
Definition: EventAuxInfo.h:15
EventAuxInfo.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
EventInfo.h
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
SG::DataProxy
Definition: DataProxy.h:44