ATLAS Offline Software
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 
17 namespace 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 
38  xAOD::L2IsoMuonContainer* xaod ) {
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:
53  IsoMuonFeatureContainer::const_iterator cit_aodend = aod->end();
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
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
xAODMaker
Definition: StoreGateSvc.h:72
IsoMuonFeatureContainer
Definition: IsoMuonFeatureContainer.h:14
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
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
xAODMaker::IsoMuonFeatureContainerCnvTool::convert
virtual StatusCode convert(const IsoMuonFeatureContainer *aod, xAOD::L2IsoMuonContainer *xaod)
Function that fills an existing xAOD::TrigMuonContainer.
Definition: IsoMuonFeatureContainerCnvTool.cxx:37
IsoMuonFeature.h
xAOD::L2IsoMuon
L2IsoMuon_v1 L2IsoMuon
Define the latest version of the muon Iso class.
Definition: L2IsoMuon.h:15
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
L2IsoMuonContainer.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
IsoMuonFeatureContainerCnvTool.h
IsoMuonFeature
Class with isolation variables for TrigmuIso algorithm.
Definition: IsoMuonFeature.h:41
xAOD::L2IsoMuon_v1
Class describing isolation info for muons reconstructed in the LVL2 trigger.
Definition: L2IsoMuon_v1.h:33
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAODMaker::IsoMuonFeatureContainerCnvTool::m_cnvTool
ToolHandle< IIsoMuonFeatureCnvTool > m_cnvTool
Definition: IsoMuonFeatureContainerCnvTool.h:46
xAODMaker::IsoMuonFeatureContainerCnvTool::IsoMuonFeatureContainerCnvTool
IsoMuonFeatureContainerCnvTool(const std::string &type, const std::string &name, const IInterface *parent)
Regular AlgTool constructor.
Definition: IsoMuonFeatureContainerCnvTool.cxx:19
xAODMaker::IsoMuonFeatureContainerCnvTool::initialize
virtual StatusCode initialize()
Function initialising the tool.
Definition: IsoMuonFeatureContainerCnvTool.cxx:27
L2IsoMuon.h
AthAlgTool
Definition: AthAlgTool.h:26
IsoMuonFeatureContainer.h
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.