ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
Muon::MdtCsmContByteStreamTool Class Reference

An AlgTool class to provide conversion from LArRawChannelContainer to ByteStream, and fill it in RawEvent created: Sept 25, 2002, by Hong Ma. More...

#include <MdtCsmContByteStreamTool.h>

Inheritance diagram for Muon::MdtCsmContByteStreamTool:
Collaboration diagram for Muon::MdtCsmContByteStreamTool:

Public Member Functions

 MdtCsmContByteStreamTool (const std::string &type, const std::string &name, const IInterface *parent)
 constructor More...
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
virtual StatusCode convert (const MdtCsmContainer *cont, MsgStream &log) const override
 

Private Attributes

std::unique_ptr< MDT_Hid2RESrcIDm_hid2re
 
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 
ServiceHandle< ByteStreamCnvSvcm_byteStreamCnvSvc {this, "ByteStreamCnvSvc", "ByteStreamCnvSvc"}
 

Detailed Description

An AlgTool class to provide conversion from LArRawChannelContainer to ByteStream, and fill it in RawEvent created: Sept 25, 2002, by Hong Ma.

Adapted for Muons by Ketevi A. Assamagan Jan-14-2003, BNL Conversion of Rpc Pad Container to byte stream

Adapted for MDTs ny Michela Biglietti March 2003, Naples Conversion of a Mdt Csm to ByteStream

Definition at line 36 of file MdtCsmContByteStreamTool.h.

Constructor & Destructor Documentation

◆ MdtCsmContByteStreamTool()

Muon::MdtCsmContByteStreamTool::MdtCsmContByteStreamTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

constructor

Definition at line 14 of file MdtCsmContByteStreamTool.cxx.

14  :
15  base_class(type, name, parent) {}

Member Function Documentation

◆ convert()

StatusCode Muon::MdtCsmContByteStreamTool::convert ( const MdtCsmContainer cont,
MsgStream &  log 
) const
overridevirtual

Definition at line 29 of file MdtCsmContByteStreamTool.cxx.

29  {
30  // Get the event assembler
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 
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 }

◆ finalize()

StatusCode Muon::MdtCsmContByteStreamTool::finalize ( )
overridevirtual

Definition at line 27 of file MdtCsmContByteStreamTool.cxx.

27 { return StatusCode::SUCCESS; }

◆ initialize()

StatusCode Muon::MdtCsmContByteStreamTool::initialize ( )
overridevirtual

Definition at line 17 of file MdtCsmContByteStreamTool.cxx.

17  {
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 }

Member Data Documentation

◆ m_byteStreamCnvSvc

ServiceHandle<ByteStreamCnvSvc> Muon::MdtCsmContByteStreamTool::m_byteStreamCnvSvc {this, "ByteStreamCnvSvc", "ByteStreamCnvSvc"}
private

Definition at line 52 of file MdtCsmContByteStreamTool.h.

◆ m_hid2re

std::unique_ptr<MDT_Hid2RESrcID> Muon::MdtCsmContByteStreamTool::m_hid2re
private

Definition at line 48 of file MdtCsmContByteStreamTool.h.

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> Muon::MdtCsmContByteStreamTool::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 50 of file MdtCsmContByteStreamTool.h.


The documentation for this class was generated from the following files:
Muon::MdtCsmContByteStreamTool::m_hid2re
std::unique_ptr< MDT_Hid2RESrcID > m_hid2re
Definition: MdtCsmContByteStreamTool.h:48
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
FullEventAssembler
Template class for assembling a full atlas raw event from subfragments.
Definition: FullEventAssembler.h:40
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
Muon::MdtCsmContByteStreamTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MdtCsmContByteStreamTool.h:50
IdentifiableContainerMT::size
size_t size() const
Duplicate of fullSize for backwards compatability.
Definition: IdentifiableContainerMT.h:209
MdtCsm
MDT RDOs : Chamber Service Module, container of AmtHits of a single Mdt chamber.
Definition: MdtCsm.h:19
MDT_Hid2RESrcID::set
StatusCode set(const MdtIdHelper *mdtId)
intialize the cabling service
Definition: MDT_Hid2RESrcID.cxx:25
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
FullEventAssembler::idMap
IDMAP_t & idMap()
Return reference to IDMAP.
Muon::MdtCsmContByteStreamTool::m_byteStreamCnvSvc
ServiceHandle< ByteStreamCnvSvc > m_byteStreamCnvSvc
Definition: MdtCsmContByteStreamTool.h:52
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
merge.status
status
Definition: merge.py:17
FullEventAssembler::RODDATA
std::vector< uint32_t > RODDATA
ROD data as a vector of unsigned int.
Definition: FullEventAssembler.h:54
FullEventAssembler::getRodData
RODDATA * getRodData(uint32_t id)
get a block of ROD data