ATLAS Offline Software
RpcPadContByteStreamTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 #include <map>
8 
10 #include "GaudiKernel/MsgStream.h"
11 #include "MuonRDO/RpcPad.h"
13 #include "RPC_Hid2RESrcID.h"
14 #include "RpcROD_Encoder.h"
15 
16 static const InterfaceID IID_IRpcPadContByteStreamTool("Muon::RpcPadContByteStreamTool", 1, 0);
17 
18 const InterfaceID& Muon::RpcPadContByteStreamTool::interfaceID() { return IID_IRpcPadContByteStreamTool; }
19 
20 Muon::RpcPadContByteStreamTool::RpcPadContByteStreamTool(const std::string& type, const std::string& name, const IInterface* parent) :
22  declareInterface<IRPC_RDOtoByteStreamTool>(this);
23 }
24 
27  ATH_CHECK(m_readKey.initialize());
28  ATH_CHECK(m_idHelperSvc.retrieve());
29  m_hid2re.set(&m_idHelperSvc->rpcIdHelper());
30 
31  ATH_CHECK(m_byteStreamCnvSvc.retrieve());
32 
33  return StatusCode::SUCCESS;
34 }
35 
38  ATH_CHECK(m_byteStreamCnvSvc->getFullEventAssembler(fea, "RpcRdoContByteStream"));
39 
40  fea->idMap().set(&m_idHelperSvc->rpcIdHelper());
41 
43 
44  RpcPadContainer::const_iterator it_coll = cont->begin();
45  RpcPadContainer::const_iterator it_coll_end = cont->end();
46 
47  std::map<uint32_t, RpcROD_Encoder> mapEncoder;
48 
49  for (; it_coll != it_coll_end; ++it_coll) {
50  const RpcPad* coll = (*it_coll);
51 
52  int sector = coll->sector();
53  uint32_t rodId = m_hid2re.getRodID(sector);
54  mapEncoder[rodId].add(coll);
55  }
56 
58  std::map<uint32_t, RpcROD_Encoder>::iterator it_end = mapEncoder.end();
59 
60  // RpcROD_Encoder has collected all the pads, now can fill the
61  // ROD block data.
62  for (; it != it_end; ++it) {
63  theROD = fea->getRodData((*it).first);
64  ((*it).second).set(&m_hid2re);
65  ((*it).second).fillROD(*theROD);
66  }
67 
68  return StatusCode::SUCCESS;
69 }
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
RPC_Hid2RESrcID.h
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
FullEventAssembler
Template class for assembling a full atlas raw event from subfragments.
Definition: FullEventAssembler.h:40
RpcROD_Encoder.h
Muon::RpcPadContByteStreamTool::initialize
virtual StatusCode initialize() override
Definition: RpcPadContByteStreamTool.cxx:25
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
initialize
void initialize()
Definition: run_EoverP.cxx:894
skel.it
it
Definition: skel.GENtoEVGEN.py:396
RpcPad.h
Muon::RpcPadContByteStreamTool::convert
virtual StatusCode convert(RpcPadContainer *cont) const override
Conversion method, which takes the RDO container and converts it into raw data, filled into RawEventW...
Definition: RpcPadContByteStreamTool.cxx:36
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
RPC_Hid2RESrcID::set
void set(const RpcIdHelper *rpdId)
Definition: RPC_Hid2RESrcID.cxx:22
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
IdentifiableContainerMT::end
const_iterator end() const
return const_iterator for end of container
Definition: IdentifiableContainerMT.h:239
IdentifiableContainerMT::const_iterator
Definition: IdentifiableContainerMT.h:79
IdentifiableContainerMT::begin
const_iterator begin() const
return const_iterator for first entry
Definition: IdentifiableContainerMT.h:233
FullEventAssembler::idMap
IDMAP_t & idMap()
Return reference to IDMAP.
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
RpcPad
Definition: RpcPad.h:21
RpcPad::sector
int sector() const
Definition: RpcPad.h:112
Muon::RpcPadContByteStreamTool::RpcPadContByteStreamTool
RpcPadContByteStreamTool(const std::string &type, const std::string &name, const IInterface *parent)
constructor
Definition: RpcPadContByteStreamTool.cxx:20
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Muon::RpcPadContByteStreamTool::interfaceID
static const InterfaceID & interfaceID()
AlgTool InterfaceID.
Definition: RpcPadContByteStreamTool.cxx:18
RpcPadContainer.h
FullEventAssembler::RODDATA
std::vector< uint32_t > RODDATA
ROD data as a vector of unsigned int.
Definition: FullEventAssembler.h:54
AthAlgTool
Definition: AthAlgTool.h:26
RpcPadContByteStreamTool.h
FullEventAssembler::getRodData
RODDATA * getRodData(uint32_t id)
get a block of ROD data
RpcPadContainer
Use IdentifiableContainer with RpcPad.
Definition: RpcPadContainer.h:23