ATLAS Offline Software
MdtRDO_Decoder.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "MdtRDO_Decoder.h"
6 
7 using namespace Muon;
8 
9 MdtRDO_Decoder::MdtRDO_Decoder(const std::string& type, const std::string& name, const IInterface* parent) :
11  declareInterface<IMDT_RDO_Decoder>(this);
12 }
13 
15  ATH_CHECK(m_idHelperSvc.retrieve());
17  return StatusCode::SUCCESS;
18 }
19 
20 std::unique_ptr<MdtDigit> MdtRDO_Decoder::getDigit(const EventContext&ctx,
21  const MdtAmtHit& amtHit,
22  uint16_t subdetId, uint16_t mrodId, uint16_t csmId) const {
24  const MuonMDT_CablingMap* readCdo{*readHandle};
25  if (!readCdo) {
26  ATH_MSG_ERROR("Null pointer to the read conditions object");
27  return nullptr;
28  }
30  cabling_data.tdcId = amtHit.tdcId();
31  cabling_data.channelId = amtHit.channelId();
32  cabling_data.subdetectorId = subdetId;
33  cabling_data.mrod = mrodId;
34  cabling_data.csm = csmId;
35 
36  uint16_t coarse = amtHit.coarse();
37  uint16_t fine = amtHit.fine();
38  int width = static_cast<int>(amtHit.width());
39 
40  if (!readCdo->getOfflineId(cabling_data, msgStream())) return nullptr;
41  Identifier chanId;
42  if (!readCdo->convert(cabling_data, chanId, false)) return nullptr;
43  int tdcCounts = coarse * 32 + fine;
44  return std::make_unique<MdtDigit>(chanId, tdcCounts, width, amtHit.isMasked());
45 }
46 
MdtAmtHit::isMasked
bool isMasked() const
Definition: MdtAmtHit.h:76
Muon::MdtRDO_Decoder::initialize
StatusCode initialize() override final
Definition: MdtRDO_Decoder.cxx:14
MdtAmtHit
MDT RDO's : data from a single channel of an AMT Atlas Muon TDC.
Definition: MdtAmtHit.h:20
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
MdtRDO_Decoder.h
MdtAmtHit::tdcId
uint16_t tdcId() const
Definition: MdtAmtHit.h:70
createCablingJSON.cabling_data
dictionary cabling_data
Definition: createCablingJSON.py:46
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
Muon::MdtRDO_Decoder::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MdtRDO_Decoder.h:38
MuonMDT_CablingMap
Definition: MuonMDT_CablingMap.h:28
MdtAmtHit::width
uint16_t width() const
Definition: MdtAmtHit.h:74
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
Muon::MdtRDO_Decoder::getDigit
std::unique_ptr< MdtDigit > getDigit(const EventContext &ctx, const MdtAmtHit &amtHit, uint16_t subdetId, uint16_t mrodId, uint16_t csmId) const override final
Definition: MdtRDO_Decoder.cxx:20
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MdtAmtHit::fine
uint16_t fine() const
Definition: MdtAmtHit.h:73
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MdtCablingData
Definition: MdtCablingData.h:82
Muon::MdtRDO_Decoder::m_readKey
SG::ReadCondHandleKey< MuonMDT_CablingMap > m_readKey
Definition: MdtRDO_Decoder.h:39
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
Muon::MdtRDO_Decoder::MdtRDO_Decoder
MdtRDO_Decoder(const std::string &type, const std::string &name, const IInterface *parent)
Definition: MdtRDO_Decoder.cxx:9
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AthAlgTool
Definition: AthAlgTool.h:26
MdtAmtHit::channelId
uint16_t channelId() const
Definition: MdtAmtHit.h:71
Identifier
Definition: IdentifierFieldParser.cxx:14
MdtAmtHit::coarse
uint16_t coarse() const
Definition: MdtAmtHit.h:72