ATLAS Offline Software
TrigEFBphysContainerCnvTool.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 ),
23  m_cnvTool( "xAODMaker::TrigEFBphysCnvTool/TrigEFBphysCnvTool", this ) {
24 
25 
26  // Declare the interface(s) provided by the tool:
27  declareInterface< ITrigEFBphysContainerCnvTool >( this );
28  }
29 
31 
32  // Retrieve the converter tool:
33  CHECK( m_cnvTool.retrieve() );
34 
35  // Return gracefully:
36  return StatusCode::SUCCESS;
37  }
38 
39 
41  xAOD::TrigBphysContainer* xaod ) const {
42 
43  if (!aod) {
44  ATH_MSG_ERROR( "Null pointer for input containter" );
45  return StatusCode::FAILURE;
46  }
47  if (!xaod) {
48  ATH_MSG_ERROR( "Null pointer for output containter" );
49  return StatusCode::FAILURE;
50  }
51 
52  ATH_MSG_VERBOSE( "Found " << aod->size() << " input elements" );
53 
54  // Fill the xAOD container:
56  TrigEFBphysContainer::const_iterator cit_aodend = aod->end();
57  for (; cit_aod != cit_aodend; ++cit_aod) {
58  const TrigEFBphys * aodObj = *cit_aod;
59  xAOD::TrigBphys* xaodObj = new xAOD::TrigBphys();
60  xaod->push_back( xaodObj );
61  CHECK( m_cnvTool->convert( aodObj, xaodObj ) );
62  }
63  ATH_MSG_VERBOSE( "Output Container has now " << xaod->size() << " elements" );
64 
65 
66  // Return gracefully:
67  return StatusCode::SUCCESS;
68  }
69 
70 
71 } // xAODMaker
72 
xAODMaker::TrigEFBphysContainerCnvTool::TrigEFBphysContainerCnvTool
TrigEFBphysContainerCnvTool(const std::string &type, const std::string &name, const IInterface *parent)
Regular AlgTool constructor.
Definition: TrigEFBphysContainerCnvTool.cxx:19
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
TrigEFBphys
Definition: TrigEFBphys.h:42
xAODMaker::TrigEFBphysContainerCnvTool::m_cnvTool
ToolHandle< ITrigEFBphysCnvTool > m_cnvTool
Definition: TrigEFBphysContainerCnvTool.h:46
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
xAODMaker
Definition: StoreGateSvc.h:72
TrigEFBphysContainer.h
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
TrigBphys.h
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:794
xAODMaker::TrigEFBphysContainerCnvTool::initialize
virtual StatusCode initialize() override
Function initialising the tool.
Definition: TrigEFBphysContainerCnvTool.cxx:30
TrigEFBphysContainerCnvTool.h
TrigEFBphys.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
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
xAOD::TrigBphys
TrigBphys_v1 TrigBphys
Definition: TrigBphys.h:18
AthAlgTool
Definition: AthAlgTool.h:26
TrigEFBphysContainer
Definition: TrigEFBphysContainer.h:34
TrigBphysContainer.h
xAODMaker::TrigEFBphysContainerCnvTool::convert
virtual StatusCode convert(const TrigEFBphysContainer *aod, xAOD::TrigBphysContainer *xaod) const override
Function that fills an existing xAOD::TrigBphysContainer.
Definition: TrigEFBphysContainerCnvTool.cxx:40
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
xAOD::TrigBphys_v1
Class describing a Bphysics online composite object.
Definition: TrigBphys_v1.h:44
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.