22 if (!
m_mdtIdHelper.retrieve().isSuccess()) {
throw std::runtime_error(
"MdtROD_Encoder -- Failed to initialize the IdHelperSvc"); }
41 using hit_vector = std::vector<const MdtAmtHit*>;
42 using tdc_map = std::map<uint16_t, hit_vector>;
43 using masked_map = std::map<uint16_t, uint32_t>;
50 v.push_back(csmReadOut.makeBOB(lvl1Id));
55 const bool isHPTDC =
m_mdtIdHelper->hasHPTDC(csm->identify());
59 v.push_back(csmReadOut.makeLWC(0));
60 v.push_back(csmReadOut.makeBOL(csm->MrodId(), csm->CsmId()));
62 v.push_back(csmReadOut.makeTLP(0));
71 if (!amt->isMasked()) {
72 tdcMap[tdcNum].push_back(amt);
74 maskedMap[tdcNum] = maskedMap[tdcNum] | (
int)
pow(2, amt->channelId());
80 tdc_map::const_iterator it_tdc = tdcMap.begin();
81 for (; it_tdc != tdcMap.end(); ++it_tdc) {
84 v.push_back((isHPTDC ? hptdcReadOut.makeBOT((*it_tdc).first, 0, 0) : amtReadOut.makeBOT((*it_tdc).first, 0, 0)));
87 uint32_t maskedFlags = maskedMap[(*it_tdc).first];
91 if (maskedFlags != 0) {
92 v.push_back((isHPTDC ? 0 : amtReadOut.makeTMC(jt, maskedFlags)));
98 hit_vector::const_iterator it_amtvec = (*it_tdc).second.begin();
99 for (; it_amtvec != (*it_tdc).second.end(); ++it_amtvec) {
102 uint16_t coarse = (*it_amtvec)->coarse();
103 uint16_t fine = (*it_amtvec)->fine();
105 uint16_t tdcId = (*it_amtvec)->tdcId();
113 (isHPTDC ? hptdcReadOut.makeTCM(tdcId,
chan,
width, coarse, fine) : amtReadOut.makeTCM(jt,
chan,
width, coarse, fine)));
121 v.push_back((isHPTDC ? hptdcReadOut.makeEOT(tdcId, ecnt, wcnt + 2) : amtReadOut.makeEOT(jt, ecnt, wcnt + 2)));
127 v.push_back(csmReadOut.makeTWC(ecnt, ctwc));
135 v.push_back(csmReadOut.makeEOB(mrod_wcnt));