ATLAS Offline Software
CombinedMuonFeatureCnvAlg.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:$ //
6 
7 // Gaudi/Athena include(s):
9 
10 // EDM include(s):
15 
16 // Local include(s):
18 
19 
20 namespace xAODMaker {
21 
23  ISvcLocator* svcLoc )
24  : AthAlgorithm( name, svcLoc ),
25  m_cnvTool( "xAODMaker::CombinedMuonFeatureContainerCnvTool/CombinedMuonFeatureContainerCnvTool", this ) {
26 
27  declareProperty( "AODKey", m_aodKey = "CombinedMuonFeature" );
28  declareProperty( "xAODKey", m_xaodKey = "L2CombinedMuon" );
29  declareProperty( "CnvTool", m_cnvTool );
30  }
31 
32 
34 
35  // Greet the user:
36  ATH_MSG_INFO( "Initializing" );
37  ATH_MSG_INFO( " AOD Key: " << m_aodKey );
38  ATH_MSG_INFO( "xAOD Key: " << m_xaodKey );
39 
40  // Retrieve the converter tool:
41  CHECK( m_cnvTool.retrieve() );
42 
43  // Return gracefully:
44  return StatusCode::SUCCESS;
45  }
46 
48 
49  // Retrieve the AOD container:
50  const CombinedMuonFeatureContainer* aod = nullptr;
51  if (evtStore()->retrieve( aod, m_aodKey ).isFailure()) {
52  ATH_MSG_WARNING("Requesting in Alg: CombinedMuonFeatureCnvAlg to convert AOD Key: " << m_aodKey <<
53  " into xAOD " << m_xaodKey << ". Input container not found or incorrect type");
54  return StatusCode::SUCCESS;
55  }
56 
59  xaod->setStore( aux );
60 
61  CHECK( m_cnvTool->convert(aod, xaod) );
62 
63 
64  // Record the xAOD containers:
65  CHECK( evtStore()->record( aux, m_xaodKey + "Aux" ) );
66  CHECK( evtStore()->record( xaod, m_xaodKey ) );
67 
68  // Return gracefully:
69  return StatusCode::SUCCESS;
70  }
71 
72 } // namespace xAODMaker
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
L2CombinedMuonAuxContainer.h
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAODMaker::CombinedMuonFeatureCnvAlg::CombinedMuonFeatureCnvAlg
CombinedMuonFeatureCnvAlg(const std::string &name, ISvcLocator *svcLoc)
Regular Algorithm constructor.
Definition: CombinedMuonFeatureCnvAlg.cxx:22
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
L2CombinedMuonContainer.h
CombinedMuonFeatureContainer
Definition: CombinedMuonFeatureContainer.h:14
xAODMaker
Definition: StoreGateSvc.h:72
CombinedMuonFeature.h
CombinedMuonFeatureContainer.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
xAODMaker::CombinedMuonFeatureCnvAlg::execute
virtual StatusCode execute()
Function executing the algorithm.
Definition: CombinedMuonFeatureCnvAlg.cxx:47
xAODMaker::CombinedMuonFeatureCnvAlg::m_aodKey
std::string m_aodKey
StoreGate key of the input container.
Definition: CombinedMuonFeatureCnvAlg.h:41
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
xAOD::L2CombinedMuonAuxContainer_v1
Auxiliary container for CB muon containers.
Definition: L2CombinedMuonAuxContainer_v1.h:34
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
CombinedMuonFeatureCnvAlg.h
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
AthAlgorithm
Definition: AthAlgorithm.h:47
xAODMaker::CombinedMuonFeatureCnvAlg::m_xaodKey
std::string m_xaodKey
StoreGate key for the output container.
Definition: CombinedMuonFeatureCnvAlg.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::CombinedMuonFeatureCnvAlg::initialize
virtual StatusCode initialize()
Function initialising the algorithm.
Definition: CombinedMuonFeatureCnvAlg.cxx:33
xAOD::L2CombinedMuonContainer
L2CombinedMuonContainer_v1 L2CombinedMuonContainer
Define the latest version of the muon CB container.
Definition: L2CombinedMuonContainer.h:15
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
xAODMaker::CombinedMuonFeatureCnvAlg::m_cnvTool
ToolHandle< ICombinedMuonFeatureContainerCnvTool > m_cnvTool
Handle to the converter tool.
Definition: CombinedMuonFeatureCnvAlg.h:46
xAOD::L2CombinedMuonAuxContainer
L2CombinedMuonAuxContainer_v1 L2CombinedMuonAuxContainer
Define the latest version of the muon CB auxiliary container.
Definition: L2CombinedMuonAuxContainer.h:14