ATLAS Offline Software
CombinedMuonFeatureContainerCnvTool.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 // EDM include(s):
9 
11 
12 // Local include(s):
14 
15 
16 namespace xAODMaker {
17 
19  const std::string& name,
20  const IInterface* parent )
21  : AthAlgTool( type, name, parent ),
22  m_cnvTool( "xAODMaker::CombinedMuonFeatureCnvTool/CombinedMuonFeatureCnvTool", this ) {
23 
24 
25  // Declare the interface(s) provided by the tool:
26  declareInterface< ICombinedMuonFeatureContainerCnvTool >( this );
27  }
28 
30 
31  // Retrieve the converter tool:
32  CHECK( m_cnvTool.retrieve() );
33 
34  // Return gracefully:
35  return StatusCode::SUCCESS;
36  }
37 
38 
40  xAOD::L2CombinedMuonContainer* xaod ) const {
41 
42  if (!aod) {
43  ATH_MSG_ERROR( "Null pointer for input containter" );
44  return StatusCode::FAILURE;
45  }
46  if (!xaod) {
47  ATH_MSG_ERROR( "Null pointer for output containter" );
48  return StatusCode::FAILURE;
49  }
50 
51  ATH_MSG_VERBOSE( "Found " << aod->size() << " input elements" );
52 
53  // Fill the xAOD container:
56  for (; cit_aod != cit_aodend; ++cit_aod) {
57  const CombinedMuonFeature * aodObj = *cit_aod;
59  xaod->push_back( xaodObj );
60  CHECK( m_cnvTool->convert( aodObj, xaodObj ) );
61  }
62  ATH_MSG_VERBOSE( "Output Container has now " << xaod->size() << " elements" );
63 
64 
65  // Return gracefully:
66  return StatusCode::SUCCESS;
67  }
68 
69 
70 } // xAODMaker
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
L2CombinedMuon.h
L2CombinedMuonContainer.h
CombinedMuonFeatureContainer
Definition: CombinedMuonFeatureContainer.h:14
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
xAODMaker
Definition: StoreGateSvc.h:72
CombinedMuonFeature.h
xAOD::L2CombinedMuon_v1
Class describing combined muon reconstructed in the LVL2 trigger.
Definition: L2CombinedMuon_v1.h:41
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
xAODMaker::CombinedMuonFeatureContainerCnvTool::m_cnvTool
ToolHandle< ICombinedMuonFeatureCnvTool > m_cnvTool
Definition: CombinedMuonFeatureContainerCnvTool.h:46
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
CombinedMuonFeature
Definition: CombinedMuonFeature.h:30
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
xAOD::L2CombinedMuon
L2CombinedMuon_v1 L2CombinedMuon
Define the latest version of the muon CB class.
Definition: L2CombinedMuon.h:15
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
xAODMaker::CombinedMuonFeatureContainerCnvTool::initialize
virtual StatusCode initialize() override
Function initialising the tool.
Definition: CombinedMuonFeatureContainerCnvTool.cxx:29
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAODMaker::CombinedMuonFeatureContainerCnvTool::CombinedMuonFeatureContainerCnvTool
CombinedMuonFeatureContainerCnvTool(const std::string &type, const std::string &name, const IInterface *parent)
Regular AlgTool constructor.
Definition: CombinedMuonFeatureContainerCnvTool.cxx:18
CombinedMuonFeatureContainerCnvTool.h
AthAlgTool
Definition: AthAlgTool.h:26
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
xAODMaker::CombinedMuonFeatureContainerCnvTool::convert
virtual StatusCode convert(const CombinedMuonFeatureContainer *aod, xAOD::L2CombinedMuonContainer *xaod) const override
Function that fills an existing xAOD::TrigMuonContainer.
Definition: CombinedMuonFeatureContainerCnvTool.cxx:39
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.