ATLAS Offline Software
Loading...
Searching...
No Matches
MuonFeatureCnvAlg.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):
17
18// Local include(s):
19#include "MuonFeatureCnvAlg.h"
20
21
22namespace xAODMaker {
23
24 MuonFeatureCnvAlg::MuonFeatureCnvAlg( const std::string& name, ISvcLocator* svcLoc ) :
25 AthAlgorithm( name, svcLoc ),
26 m_converterTool( "MuonFeatureCnvTool/MuonFeatureCnvTool")
27 {
28 declareProperty( "AODMuonFeatureContainerName", m_mfName = "HLT" );
29 declareProperty( "AODMuonFeatureDetailsContainerName", m_mfdName = "HLT" );
30 declareProperty( "xAODL2StandAloneMuonContainerName", m_xaodName = "L2StandAloneMuon" );
31 declareProperty( "ConverterTool", m_converterTool );
32 }
33
35
36 // Greet the user:
37 ATH_MSG_INFO( "Initializing" );
38 ATH_MSG_INFO( "AOD MuonFeatureContainer Name: " << m_mfName );
39 ATH_MSG_INFO( "AOD MuonFeatureDetailsContainer Name: " << m_mfdName );
40 ATH_MSG_INFO( "xAOD L2StandAloneMuonContainer Name: " << m_xaodName );
41 ATH_MSG_INFO( "ConverterTool = " << m_converterTool.typeAndName());
42
43 // Retrieve the converter tool:
44 ATH_CHECK( m_converterTool.retrieve() );
45
46 // Return gracefully:
47 return StatusCode::SUCCESS;
48 }
49
51
52 // Retrieve the AOD container:
53 // MuonFeature
54 const MuonFeatureContainer* aod_mf = nullptr;
55 if (evtStore()->retrieve( aod_mf, m_mfName ).isFailure()) {
56 ATH_MSG_WARNING("Requesting in Alg: MuonFeatureCnvAlg to convert AOD MuonFeatureContainer name: " << m_mfName <<
57 " into xAOD " << m_xaodName << ". Input container not found or incorrect type");
58 return StatusCode::SUCCESS;
59 }
60
61 // MuonFeatureDetails
62 const MuonFeatureDetailsContainer* aod_mfd = nullptr;
63 if (evtStore()->retrieve( aod_mfd, m_mfName ).isFailure()) {
64 ATH_MSG_WARNING("Requesting in Alg: MuonFeatureCnvAlg to convert AOD MuonFeatureDetailsContainer name: " << m_mfdName <<
65 " into xAOD " << m_xaodName << ". Input container not found or incorrect type");
66 return StatusCode::SUCCESS;
67 }
68
71
72 xaod->setStore( aux );
73
74 CHECK( m_converterTool->convertMuonFeatureContainer(aod_mf, aod_mfd, xaod) );
75
76 // Record the xAOD containers:
77 CHECK( evtStore()->record( xaod, m_xaodName ) );
78 CHECK( evtStore()->record( aux, m_xaodName + "Aux" ) );
79
80 // Return gracefully:
81 return StatusCode::SUCCESS;
82 }
83
84} // namespace xAODMaker
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(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)
std::string m_mfName
StoreGate key of the input container.
std::string m_xaodName
StoreGate key for the output container.
MuonFeatureCnvAlg(const std::string &name, ISvcLocator *svcLoc)
Regular Algorithm constructor.
virtual StatusCode execute()
Function executing the algorithm.
virtual StatusCode initialize()
Function initialising the algorithm.
ToolHandle< IMuonFeatureCnvTool > m_converterTool
Handle to the converter tool.
L2StandAloneMuonAuxContainer_v2 L2StandAloneMuonAuxContainer
Define the latest version of the muon SA auxiliary container.
L2StandAloneMuonContainer_v2 L2StandAloneMuonContainer
Define the latest version of the muon SA container.