ATLAS Offline Software
CMMRoICnvAlg.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: CMMRoICnvAlg.cxx 576052 2013-12-18 09:13:50Z morrisj $
6 
7 // Gaudi/Athena include(s):
9 
10 // EDM include(s):
11 #include "TrigT1CaloEvent/CMMRoI.h"
12 #include "xAODTrigL1Calo/CMMRoI.h"
14 
15 // Local include(s):
16 #include "CMMRoICnvAlg.h"
17 
18 namespace xAODMaker {
19 
20  CMMRoICnvAlg::CMMRoICnvAlg( const std::string& name,
21  ISvcLocator* svcLoc )
22  : AthAlgorithm( name, svcLoc ),
23  m_cnvTool( "xAODMaker::CMMRoICnvTool/CMMRoICnvTool", this ) {
24 
25  declareProperty( "ESDKey" , m_esdKey = "CMMRoIs" );
26  declareProperty( "xAODKey", m_xaodKey = "CMMRoIs" );
27  declareProperty( "CnvTool", m_cnvTool );
28  }
29 
31 
32  // Greet the user:
33  ATH_MSG_INFO( "Initializing" );
34  ATH_MSG_DEBUG( " ESD Key: " << m_esdKey );
35  ATH_MSG_DEBUG( "xAOD Key: " << m_xaodKey );
36 
37  // Retrieve the converter tool:
38  CHECK( m_cnvTool.retrieve() );
39 
40  // Return gracefully:
41  return StatusCode::SUCCESS;
42  }
43 
45 
46  // Retrieve the ESD container:
47  const LVL1::CMMRoI* esd = nullptr;
48  CHECK( evtStore()->retrieve( esd, m_esdKey ) );
49 
50  // Create the xAOD container and its auxiliary store:
52  xAOD::CMMRoI* xaod = new xAOD::CMMRoI();
53  xaod->setStore( aux );
54 
55  // Fill the xAOD container:
56  CHECK( m_cnvTool->convert( esd, xaod ) );
57 
58  // Record the xAOD containers:
59  CHECK( evtStore()->record( aux, m_xaodKey + "Aux." ) );
60  CHECK( evtStore()->record( xaod, m_xaodKey ) );
61 
62  // Return gracefully:
63  return StatusCode::SUCCESS;
64  }
65 
66 } // namespace xAODMaker
xAODMaker::CMMRoICnvAlg::m_cnvTool
ToolHandle< ICMMRoICnvTool > m_cnvTool
Handle to the converter tool.
Definition: CMMRoICnvAlg.h:51
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::CMMRoI_v1
Description of CMMRoI_v1.
Definition: CMMRoI_v1.h:27
xAOD::CMMRoI
CMMRoI_v1 CMMRoI
Define the latest version of the CMMRoI class.
Definition: Event/xAOD/xAODTrigL1Calo/xAODTrigL1Calo/CMMRoI.h:14
CMMRoI.h
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::CMMRoICnvAlg::initialize
virtual StatusCode initialize()
Function initialising the algorithm.
Definition: CMMRoICnvAlg.cxx:30
xAODMaker
Definition: StoreGateSvc.h:72
CMMRoIAuxInfo.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
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::CMMRoICnvAlg::CMMRoICnvAlg
CMMRoICnvAlg(const std::string &name, ISvcLocator *svcLoc)
Regular Algorithm constructor.
Definition: CMMRoICnvAlg.cxx:20
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
AthAlgorithm
Definition: AthAlgorithm.h:47
xAODMaker::CMMRoICnvAlg::execute
virtual StatusCode execute()
Function executing the algorithm.
Definition: CMMRoICnvAlg.cxx:44
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
errorcheck.h
Helpers for checking error return status codes and reporting errors.
xAODMaker::CMMRoICnvAlg::m_esdKey
std::string m_esdKey
StoreGate key of the input container.
Definition: CMMRoICnvAlg.h:46
xAOD::CMMRoIAuxInfo_v1
AuxInfo for CMMRoI_v1.
Definition: CMMRoIAuxInfo_v1.h:29
CMMRoI.h
CMMRoICnvAlg.h
xAOD::CMMRoIAuxInfo
CMMRoIAuxInfo_v1 CMMRoIAuxInfo
Define the latest version of the CMMRoI auxiliary info.
Definition: CMMRoIAuxInfo.h:13
LVL1::CMMRoI
CMM RoI data.
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMMRoI.h:21
xAODMaker::CMMRoICnvAlg::m_xaodKey
std::string m_xaodKey
StoreGate key for the output container.
Definition: CMMRoICnvAlg.h:48