ATLAS Offline Software
Loading...
Searching...
No Matches
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"
10
11Muon::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
20std::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
48std::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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
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
RpcRDO_Decoder(const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize() override
virtual std::vector< Identifier > getOfflineData(const RpcFiredChannel *fChan, uint16_t &sectorID, uint16_t &padId, uint16_t &cmaId, double &time, const RpcCablingCondData *rpcCab) const override
Gaudi::Property< int > m_bczero
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
ubit16 bcid() const
ubit16 channel() const
ubit16 ijk() const
ubit16 time() const