ATLAS Offline Software
JetEtRoICnvAlg.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: JetEtRoICnvAlg.cxx 575028 2013-12-11 14:30:06Z krasznaa $
6 
7 // Gaudi/Athena include(s):
9 
10 // EDM include(s):
12 #include "xAODTrigger/JetEtRoI.h"
14 
15 // Local include(s):
16 #include "JetEtRoICnvAlg.h"
17 
18 namespace xAODMaker {
19 
20  JetEtRoICnvAlg::JetEtRoICnvAlg( const std::string& name,
21  ISvcLocator* svcLoc )
22  : AthAlgorithm( name, svcLoc ),
23  m_cnvTool( "xAODMaker::JetEtRoICnvTool/JetEtRoICnvTool", this ) {
24 
25  declareProperty( "AODKey", m_aodKey = "LVL1_ROI" );
26  declareProperty( "xAODKey", m_xaodKey = "LVL1JetEtRoI" );
27  declareProperty( "CnvTool", m_cnvTool );
28  }
29 
31 
32  // Greet the user:
33  ATH_MSG_INFO( "Initializing" );
34  ATH_MSG_DEBUG( " AOD Key: " << m_aodKey );
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 AOD container:
47  const LVL1_ROI* aod = nullptr;
48  CHECK( evtStore()->retrieve( aod, m_aodKey ) );
49 
50  // Create the xAOD container and its auxiliary store:
52  xAOD::JetEtRoI* xaod = new xAOD::JetEtRoI();
53  xaod->setStore( aux );
54 
55  // Fill the xAOD container:
56  CHECK( m_cnvTool->convert( aod, 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
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::JetEtRoIAuxInfo
JetEtRoIAuxInfo_v1 JetEtRoIAuxInfo
Declare the most recent version of the jet-ET auxiliary info.
Definition: JetEtRoIAuxInfo.h:16
xAODMaker::JetEtRoICnvAlg::m_cnvTool
ToolHandle< IJetEtRoICnvTool > m_cnvTool
Handle to the converter tool.
Definition: JetEtRoICnvAlg.h:52
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::JetEtRoICnvAlg::initialize
virtual StatusCode initialize()
Function initialising the algorithm.
Definition: JetEtRoICnvAlg.cxx:30
JetEtRoIAuxInfo.h
xAODMaker
Definition: StoreGateSvc.h:72
JetEtRoICnvAlg.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
xAOD::JetEtRoIAuxInfo_v1
Auxiliary store for a Jet-ET RoI object.
Definition: JetEtRoIAuxInfo_v1.h:34
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
xAOD::JetEtRoI_v1
Class describing a LVL1 jet-ET "RoI".
Definition: JetEtRoI_v1.h:35
LVL1_ROI.h
xAODMaker::JetEtRoICnvAlg::execute
virtual StatusCode execute()
Function executing the algorithm.
Definition: JetEtRoICnvAlg.cxx:44
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
AthAlgorithm
Definition: AthAlgorithm.h:47
JetEtRoI.h
LVL1_ROI
Top level AOD object storing LVL1 RoIs.
Definition: LVL1_ROI.h:43
xAODMaker::JetEtRoICnvAlg::m_xaodKey
std::string m_xaodKey
StoreGate key for the output container.
Definition: JetEtRoICnvAlg.h:49
xAODMaker::JetEtRoICnvAlg::JetEtRoICnvAlg
JetEtRoICnvAlg(const std::string &name, ISvcLocator *svcLoc)
Regular Algorithm constructor.
Definition: JetEtRoICnvAlg.cxx:20
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
errorcheck.h
Helpers for checking error return status codes and reporting errors.
xAOD::JetEtRoI
JetEtRoI_v1 JetEtRoI
Definition: Event/xAOD/xAODTrigger/xAODTrigger/JetEtRoI.h:15
xAODMaker::JetEtRoICnvAlg::m_aodKey
std::string m_aodKey
StoreGate key of the input container.
Definition: JetEtRoICnvAlg.h:47