ATLAS Offline Software
MuonRoICnvTool.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 
6 // EDM include(s):
10 #include "xAODTrigger/MuonRoI.h"
11 
12 // Local include(s):
13 #include "MuonRoICnvTool.h"
14 
15 namespace xAODMaker {
16 
17  MuonRoICnvTool::MuonRoICnvTool( const std::string& type,
18  const std::string& name,
19  const IInterface* parent )
20  : AthAlgTool( type, name, parent ) {
21 
22  // Declare the interface(s) provided by the tool:
23  declareInterface< IMuonRoICnvTool >( this );
24  }
25 
26 
37  xAOD::MuonRoIContainer* xaod ) {
38 
39  // A small sanity check. The output container should really be empty...
40  if( !xaod->empty() ) {
41  ATH_MSG_WARNING( "The output xAOD container is not empty (size=="
42  << xaod->size() << ")" );
43  }
44 
45  // Loop over the AOD objects:
46  LVL1_ROI::muons_type::const_iterator aod_itr = aod->getMuonROIs().begin();
47  LVL1_ROI::muons_type::const_iterator aod_end = aod->getMuonROIs().end();
48  for( ; aod_itr != aod_end; ++aod_itr ) {
49 
50  // Add a new muon RoI object to the output:
51  xAOD::MuonRoI* roi = new xAOD::MuonRoI();
52  xaod->push_back( roi );
53 
54  // Now fill it with data:
55  roi->initialize( aod_itr->getROIWord(),
56  aod_itr->getEta(), aod_itr->getPhi(),
57  aod_itr->getThrName(), aod_itr->getThrValue() );
58  }
59 
60  // Return gracefully:
61  return StatusCode::SUCCESS;
62  }
63 
64 } // namespace xAODMaker
LVL1_ROI::getMuonROIs
const muons_type & getMuonROIs() const
Get all the muon RoIs in the event.
Definition: LVL1_ROI.h:63
xAOD::MuonRoI_v1::initialize
void initialize(uint32_t roiword, float eta, float phi, const std::string &thrname, float thrvalue, uint32_t extraword=0u)
Initialise the object with all its properties.
Definition: MuonRoI_v1.cxx:31
Muon_ROI.h
MuonRoIContainer.h
xAODMaker
Definition: StoreGateSvc.h:72
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LVL1_ROI.h
xAOD::MuonRoI_v1
Class describing a LVL1 muon region of interest.
Definition: MuonRoI_v1.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
xAODMaker::MuonRoICnvTool::convert
virtual StatusCode convert(const LVL1_ROI *aod, xAOD::MuonRoIContainer *xaod) override
Function that fills an existing xAOD::MuonRoIContainer.
Definition: MuonRoICnvTool.cxx:36
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
LVL1_ROI
Top level AOD object storing LVL1 RoIs.
Definition: LVL1_ROI.h:43
xAOD::MuonRoI
MuonRoI_v1 MuonRoI
Definition: MuonRoI.h:15
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
MuonRoICnvTool.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
MuonRoI.h
AthAlgTool
Definition: AthAlgTool.h:26
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
xAODMaker::MuonRoICnvTool::MuonRoICnvTool
MuonRoICnvTool(const std::string &type, const std::string &name, const IInterface *parent)
Regular AlgTool constructor.
Definition: MuonRoICnvTool.cxx:17