ATLAS Offline Software
Loading...
Searching...
No Matches
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
16namespace 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
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define CHECK(...)
Evaluate an expression and check for errors.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
CombinedMuonFeatureContainerCnvTool(const std::string &type, const std::string &name, const IInterface *parent)
Regular AlgTool constructor.
virtual StatusCode initialize() override
Function initialising the tool.
virtual StatusCode convert(const CombinedMuonFeatureContainer *aod, xAOD::L2CombinedMuonContainer *xaod) const override
Function that fills an existing xAOD::TrigMuonContainer.
L2CombinedMuon_v1 L2CombinedMuon
Define the latest version of the muon CB class.
L2CombinedMuonContainer_v1 L2CombinedMuonContainer
Define the latest version of the muon CB container.