ATLAS Offline Software
Loading...
Searching...
No Matches
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
18namespace 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
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Top level AOD object storing LVL1 RoIs.
Definition LVL1_ROI.h:43
void setStore(const SG::IConstAuxStore *store)
Set the store associated with this object.
ToolHandle< IEnergySumRoICnvTool > m_cnvTool
Handle to the converter tool.
virtual StatusCode initialize()
Function initialising the algorithm.
std::string m_aodKey
StoreGate key of the input container.
virtual StatusCode execute()
Function executing the algorithm.
std::string m_xaodKey
StoreGate key for the output container.
EnergySumRoICnvAlg(const std::string &name, ISvcLocator *svcLoc)
Regular Algorithm constructor.
EnergySumRoIAuxInfo_v2 EnergySumRoIAuxInfo
Declare the most recent version of the energy-sum auxiliary info.
EnergySumRoI_v2 EnergySumRoI