ATLAS Offline Software
Loading...
Searching...
No Matches
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
15namespace xAODMaker {
16
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
36 StatusCode MuonRoICnvTool::convert( const LVL1_ROI* aod,
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
#define ATH_MSG_WARNING(x)
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
bool empty() const noexcept
Returns true if the collection is empty.
Top level AOD object storing LVL1 RoIs.
Definition LVL1_ROI.h:43
const muons_type & getMuonROIs() const
Get all the muon RoIs in the event.
Definition LVL1_ROI.h:63
virtual StatusCode convert(const LVL1_ROI *aod, xAOD::MuonRoIContainer *xaod) override
Function that fills an existing xAOD::MuonRoIContainer.
MuonRoICnvTool(const std::string &type, const std::string &name, const IInterface *parent)
Regular AlgTool constructor.
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.
MuonRoIContainer_v1 MuonRoIContainer
MuonRoI_v1 MuonRoI
Definition MuonRoI.h:15