ATLAS Offline Software
Loading...
Searching...
No Matches
IsoMuonFeatureContainerCnvTool.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
12
13// Local include(s):
15
16
17namespace xAODMaker {
18
20 const std::string& name,
21 const IInterface* parent )
22 : AthAlgTool( type, name, parent ), m_cnvTool( "xAODMaker::IsoMuonFeatureCnvTool/IsoMuonFeatureCnvTool", this ) {
23 // Declare the interface(s) provided by the tool:
24 declareInterface< IIsoMuonFeatureContainerCnvTool >( this );
25 }
26
28
29 // Retrieve the converter tool:
30 CHECK( m_cnvTool.retrieve() );
31
32 // Return gracefully:
33 return StatusCode::SUCCESS;
34 }
35
36
39
40 if (!aod) {
41 ATH_MSG_ERROR( "Null pointer for input containter" );
42 return StatusCode::FAILURE;
43 }
44 if (!xaod) {
45 ATH_MSG_ERROR( "Null pointer for output containter" );
46 return StatusCode::FAILURE;
47 }
48
49 ATH_MSG_VERBOSE( "Found " << aod->size() << " input elements" );
50
51 // Fill the xAOD container:
54 for (; cit_aod != cit_aodend; ++cit_aod) {
55 const IsoMuonFeature * aodObj = *cit_aod;
56 xAOD::L2IsoMuon* xaodObj = new xAOD::L2IsoMuon();
57 xaod->push_back( xaodObj );
58 CHECK( m_cnvTool->convert( aodObj, xaodObj ) );
59 }
60 ATH_MSG_VERBOSE( "Output Container has now " << xaod->size() << " elements" );
61
62
63 // Return gracefully:
64 return StatusCode::SUCCESS;
65 }
66
67
68} // 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.
Class with isolation variables for TrigmuIso algorithm.
IsoMuonFeatureContainerCnvTool(const std::string &type, const std::string &name, const IInterface *parent)
Regular AlgTool constructor.
virtual StatusCode convert(const IsoMuonFeatureContainer *aod, xAOD::L2IsoMuonContainer *xaod)
Function that fills an existing xAOD::TrigMuonContainer.
virtual StatusCode initialize()
Function initialising the tool.
L2IsoMuonContainer_v1 L2IsoMuonContainer
Define the latest version of the muon Iso container.
L2IsoMuon_v1 L2IsoMuon
Define the latest version of the muon Iso class.
Definition L2IsoMuon.h:15