ATLAS Offline Software
EnergySumRoICnvAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // $Id: EnergySumRoICnvAlg.cxx 575028 2013-12-11 14:30:06Z krasznaa $
6 
7 // Gaudi/Athena include(s):
9 
10 // EDM include(s):
14 
15 // Local include(s):
16 #include "EnergySumRoICnvAlg.h"
17 
18 namespace xAODMaker {
19 
21  ISvcLocator* svcLoc )
22  : AthAlgorithm( name, svcLoc ),
23  m_cnvTool( "xAODMaker::EnergySumRoICnvTool/EnergySumRoICnvTool",
24  this ) {
25 
26  declareProperty( "AODKey", m_aodKey = "LVL1_ROI" );
27  declareProperty( "xAODKey", m_xaodKey = "LVL1EnergySumRoI" );
28  declareProperty( "CnvTool", m_cnvTool );
29  }
30 
32 
33  // Greet the user:
34  ATH_MSG_INFO( "Initializing" );
35  ATH_MSG_DEBUG( " AOD Key: " << m_aodKey );
36  ATH_MSG_DEBUG( "xAOD Key: " << m_xaodKey );
37 
38  // Retrieve the converter tool:
39  CHECK( m_cnvTool.retrieve() );
40 
41  // Return gracefully:
42  return StatusCode::SUCCESS;
43  }
44 
46 
47  // Retrieve the AOD container:
48  const LVL1_ROI* aod = nullptr;
49  CHECK( evtStore()->retrieve( aod, m_aodKey ) );
50 
51  // Create the xAOD container and its auxiliary store:
54  xaod->setStore( aux );
55 
56  // Fill the xAOD container:
57  CHECK( m_cnvTool->convert( aod, xaod ) );
58 
59  // Record the xAOD containers:
60  CHECK( evtStore()->record( aux, m_xaodKey + "Aux." ) );
61  CHECK( evtStore()->record( xaod, m_xaodKey ) );
62 
63  // Return gracefully:
64  return StatusCode::SUCCESS;
65  }
66 
67 } // namespace xAODMaker
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
xAODMaker::EnergySumRoICnvAlg::execute
virtual StatusCode execute()
Function executing the algorithm.
Definition: EnergySumRoICnvAlg.cxx:45
xAODMaker::EnergySumRoICnvAlg::initialize
virtual StatusCode initialize()
Function initialising the algorithm.
Definition: EnergySumRoICnvAlg.cxx:31
EnergySumRoIAuxInfo.h
xAODMaker::EnergySumRoICnvAlg::EnergySumRoICnvAlg
EnergySumRoICnvAlg(const std::string &name, ISvcLocator *svcLoc)
Regular Algorithm constructor.
Definition: EnergySumRoICnvAlg.cxx:20
xAODMaker
Definition: StoreGateSvc.h:72
xAOD::EnergySumRoIAuxInfo
EnergySumRoIAuxInfo_v2 EnergySumRoIAuxInfo
Declare the most recent version of the energy-sum auxiliary info.
Definition: EnergySumRoIAuxInfo.h:17
xAOD::EnergySumRoIAuxInfo_v2
Auxiliary store for an EnergySum RoI object.
Definition: EnergySumRoIAuxInfo_v2.h:34
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
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
xAODMaker::EnergySumRoICnvAlg::m_aodKey
std::string m_aodKey
StoreGate key of the input container.
Definition: EnergySumRoICnvAlg.h:47
EnergySumRoICnvAlg.h
LVL1_ROI.h
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
AthAlgorithm
Definition: AthAlgorithm.h:47
LVL1_ROI
Top level AOD object storing LVL1 RoIs.
Definition: LVL1_ROI.h:43
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
errorcheck.h
Helpers for checking error return status codes and reporting errors.
xAODMaker::EnergySumRoICnvAlg::m_cnvTool
ToolHandle< IEnergySumRoICnvTool > m_cnvTool
Handle to the converter tool.
Definition: EnergySumRoICnvAlg.h:52
xAOD::EnergySumRoI
EnergySumRoI_v2 EnergySumRoI
Definition: EnergySumRoI.h:16
xAOD::EnergySumRoI_v2
Class describing a LVL1 energy-sum "RoI".
Definition: EnergySumRoI_v2.h:35
xAODMaker::EnergySumRoICnvAlg::m_xaodKey
std::string m_xaodKey
StoreGate key for the output container.
Definition: EnergySumRoICnvAlg.h:49
EnergySumRoI.h