ATLAS Offline Software
RpcRDO_Decoder.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "RpcRDO_Decoder.h"
6 
10 
11 Muon::RpcRDO_Decoder::RpcRDO_Decoder(const std::string& type, const std::string& name, const IInterface* parent) :
12  base_class(type, name, parent) {}
13 
15  ATH_MSG_DEBUG("initialize");
16  ATH_CHECK(m_idHelperSvc.retrieve());
17  return StatusCode::SUCCESS;
18 }
19 
20 std::vector<std::unique_ptr<RpcDigit>> Muon::RpcRDO_Decoder::getDigit(const RpcFiredChannel* fChan, uint16_t& sectorID, uint16_t& padId, uint16_t& cmaId,
21  const RpcCablingCondData* rpcCab) const {
22  std::vector<std::unique_ptr<RpcDigit>> rpcDigitVec{};
23 
24  uint16_t side = (sectorID < 32) ? 0 : 1;
25  uint16_t slogic = sectorID - side * 32;
26  uint16_t ijk = fChan->ijk();
27  uint16_t channel = fChan->channel();
28 
29  float time = (fChan->bcid() - m_bczero) * 25 + (fChan->time() + 0.5 - 2) * 3.125;
30 
31  // skip the trigger hits
32  if (ijk == 7) { return rpcDigitVec; }
33 
34  // Get the list of offline channels corresponding to the
35  // online identifier
36  std::list<Identifier> idList = rpcCab->give_strip_id(side, slogic, padId, cmaId, ijk, channel, &m_idHelperSvc->rpcIdHelper());
37 
38  rpcDigitVec.reserve(idList.size());
39  for (const Identifier& stripOfflineId: idList) {
40  // and add the digit to the collection
41  std::unique_ptr<RpcDigit> rpcDigit = std::make_unique<RpcDigit>(stripOfflineId, time, -1., false);
42  rpcDigitVec.push_back(std::move(rpcDigit));
43  }
44 
45  return rpcDigitVec;
46 }
47 
48 std::vector<Identifier> Muon::RpcRDO_Decoder::getOfflineData(const RpcFiredChannel* fChan, uint16_t& sectorID, uint16_t& padId,
49  uint16_t& cmaId, double& time, const RpcCablingCondData* rpcCab) const {
50  std::vector<Identifier> rpcIdVec{};
51 
52  uint16_t side = (sectorID < 32) ? 0 : 1;
53  uint16_t slogic = sectorID - side * 32;
54  uint16_t ijk = fChan->ijk();
55  uint16_t channel = fChan->channel();
56 
57  time = (fChan->bcid() - m_bczero) * 25 + (fChan->time() + 0.5 - 2) * 3.125;
58 
59  // skip the trigger hits
60  if (ijk == 7) { return rpcIdVec; }
61 
62  // Get the list of offline channels corresponding to the
63  // online identifier
64  std::list<Identifier> idList = rpcCab->give_strip_id(side, slogic, padId, cmaId, ijk, channel, &m_idHelperSvc->rpcIdHelper());
65 
66  rpcIdVec.assign(idList.begin(), idList.end());
67 
68  return rpcIdVec;
69 }
RpcFiredChannel::ijk
ubit16 ijk() const
Definition: RpcFiredChannel.h:56
RpcFiredChannel::time
ubit16 time() const
Definition: RpcFiredChannel.h:54
RpcCablingCondData::give_strip_id
std::list< Identifier > give_strip_id(unsigned short int SubsystemId, unsigned short int SectorId, unsigned short int PADId, unsigned short int CMAId, unsigned short ijk, unsigned short int Channel, const RpcIdHelper *rpcId) const
Definition: RpcCablingCondData.cxx:269
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
RpcFiredChannel::channel
ubit16 channel() const
Definition: RpcFiredChannel.h:58
Muon::RpcRDO_Decoder::RpcRDO_Decoder
RpcRDO_Decoder(const std::string &type, const std::string &name, const IInterface *parent)
Definition: RpcRDO_Decoder.cxx:11
Muon::RpcRDO_Decoder::initialize
virtual StatusCode initialize() override
Definition: RpcRDO_Decoder.cxx:14
RpcFiredChannel.h
RpcFiredChannel
Definition: RpcFiredChannel.h:20
RpcCablingCondData
Definition: RpcCablingCondData.h:21
TRT::Hit::side
@ side
Definition: HitInfo.h:83
RpcDigit.h
Muon::RpcRDO_Decoder::getOfflineData
virtual std::vector< Identifier > getOfflineData(const RpcFiredChannel *fChan, uint16_t &sectorID, uint16_t &padId, uint16_t &cmaId, double &time, const RpcCablingCondData *rpcCab) const override
Definition: RpcRDO_Decoder.cxx:48
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
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
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
RpcRDO_Decoder.h
RpcFiredChannel::bcid
ubit16 bcid() const
Definition: RpcFiredChannel.h:52
Muon::RpcRDO_Decoder::getDigit
virtual std::vector< std::unique_ptr< RpcDigit > > getDigit(const RpcFiredChannel *fChan, uint16_t &sectorID, uint16_t &padId, uint16_t &cmaId, const RpcCablingCondData *rpcCab) const override
Definition: RpcRDO_Decoder.cxx:20
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
RpcReadoutElement.h
Identifier
Definition: IdentifierFieldParser.cxx:14