ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCnv
MuonMDT_CnvTools
src
MdtCsmContByteStreamTool.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
#include "
MdtCsmContByteStreamTool.h
"
6
7
#include "
ByteStreamData/RawEvent.h
"
8
#include "
MdtROD_Encoder.h
"
9
#include "
MuonRDO/MdtCsm.h
"
10
#include "
MuonRDO/MdtCsmContainer.h
"
11
#include "
MuonReadoutGeometry/MuonDetectorManager.h
"
12
13
// default constructor
14
Muon::MdtCsmContByteStreamTool::MdtCsmContByteStreamTool
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent) :
15
base_class(
type
, name, parent) {}
16
17
StatusCode
Muon::MdtCsmContByteStreamTool::initialize
() {
18
ATH_CHECK
(
m_idHelperSvc
.retrieve());
19
m_hid2re
= std::make_unique<MDT_Hid2RESrcID>();
20
ATH_CHECK
(
m_hid2re
->set(&
m_idHelperSvc
->mdtIdHelper()));
21
22
ATH_CHECK
(
m_byteStreamCnvSvc
.retrieve());
23
24
return
StatusCode::SUCCESS;
25
}
26
27
StatusCode
Muon::MdtCsmContByteStreamTool::finalize
() {
return
StatusCode::SUCCESS; }
28
29
StatusCode
Muon::MdtCsmContByteStreamTool::convert
(
const
MdtCsmContainer
* cont, MsgStream&
/*log*/
)
const
{
30
// Get the event assembler
31
FullEventAssembler<MDT_Hid2RESrcID>
* fea =
nullptr
;
32
ATH_CHECK
(
m_byteStreamCnvSvc
->getFullEventAssembler(fea,
"MdtCsmContByteStream"
));
33
34
StatusCode status = fea->
idMap
().set(&
m_idHelperSvc
->mdtIdHelper());
35
if
(status.isFailure()) {
36
ATH_MSG_FATAL
(
"Could not initialize MDT mapping !"
);
37
return
StatusCode::FAILURE;
38
}
39
40
FullEventAssembler<MDT_Hid2RESrcID>::RODDATA
* theROD{
nullptr
};
41
42
std::map<uint32_t, MdtROD_Encoder> mapEncoder;
43
44
ATH_MSG_DEBUG
(
" number of collections "
<< cont->
size
());
45
for
(
const
MdtCsm
* csm : *cont) {
46
Identifier
coll_id = csm->identify();
47
uint32_t rodId =
m_hid2re
->getRodID(coll_id);
48
mapEncoder.try_emplace(rodId).first->second.add(csm);
49
}
50
51
// MdtCsm_Encoder has collected all the csm, now can fill the
52
// ROD block data.
53
54
ATH_MSG_DEBUG
(
" start to fill Rod "
);
55
56
for
(
auto
& p : mapEncoder) {
57
theROD = fea->
getRodData
(p.first);
58
p.second.fillROD(*theROD);
59
}
60
61
return
StatusCode::SUCCESS;
62
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x,...)
Definition
AthMsgStreamMacros.h:43
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x,...)
Definition
AthMsgStreamMacros.h:48
MdtCsmContByteStreamTool.h
MdtCsmContainer.h
MdtCsm.h
MdtROD_Encoder.h
MuonDetectorManager.h
RawEvent.h
FullEventAssembler
Template class for assembling a full atlas raw event from subfragments.
Definition
FullEventAssembler.h:38
FullEventAssembler::RODDATA
std::vector< uint32_t > RODDATA
ROD data as a vector of unsigned int.
Definition
FullEventAssembler.h:52
FullEventAssembler::getRodData
RODDATA * getRodData(uint32_t id)
get a block of ROD data
FullEventAssembler::idMap
IDMAP_t & idMap()
Return reference to IDMAP.
IdentifiableContainerMT::size
size_t size() const
Duplicate of fullSize for backwards compatability.
Definition
IdentifiableContainerMT.h:208
MdtCsmContainer
This container provides acces to the MDT RDOs.
Definition
MdtCsmContainer.h:22
MdtCsm
MDT RDOs : Chamber Service Module, container of AmtHits of a single Mdt chamber.
Definition
MdtCsm.h:22
Muon::MdtCsmContByteStreamTool::MdtCsmContByteStreamTool
MdtCsmContByteStreamTool(const std::string &type, const std::string &name, const IInterface *parent)
constructor
Definition
MdtCsmContByteStreamTool.cxx:14
Muon::MdtCsmContByteStreamTool::initialize
virtual StatusCode initialize() override
Definition
MdtCsmContByteStreamTool.cxx:17
Muon::MdtCsmContByteStreamTool::finalize
virtual StatusCode finalize() override
Definition
MdtCsmContByteStreamTool.cxx:27
Muon::MdtCsmContByteStreamTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition
MdtCsmContByteStreamTool.h:50
Muon::MdtCsmContByteStreamTool::m_hid2re
std::unique_ptr< MDT_Hid2RESrcID > m_hid2re
Definition
MdtCsmContByteStreamTool.h:48
Muon::MdtCsmContByteStreamTool::m_byteStreamCnvSvc
ServiceHandle< IByteStreamCnvSvc > m_byteStreamCnvSvc
Definition
MdtCsmContByteStreamTool.h:52
Muon::MdtCsmContByteStreamTool::convert
virtual StatusCode convert(const MdtCsmContainer *cont, MsgStream &log) const override
Definition
MdtCsmContByteStreamTool.cxx:29
Identifier
Definition
IdentifierFieldParser.cxx:14
type
Generated on
for ATLAS Offline Software by
1.17.0