50 std::vector<uint32_t> dataWords[8][4];
54 uint32_t buf[2] = {0};
61 digit.getSubdetector(), digit.getSection(), digit.getSector(),
62 digit.getLayer(), digit.getPlane(), digit.getStrip());
65 if (electronicsChannel ==
nullptr)
66 B2FATAL(
"Incomplete KLM electronics map.");
72 int lane = electronicsChannel->
getLane();
73 int plane = electronicsChannel->
getAxis();
76 digit.getCharge(), digit.getCTime(), digit.getTDC(),
77 bword1, bword2, bword3, bword4);
79 buf[0] |= ((bword1 << 16));
81 buf[1] |= ((bword3 << 16));
83 int copper = electronicsChannel->
getCopper() - BKLM_ID - 1;
84 int dataConcentrator = electronicsChannel->
getSlot() - 1;
85 dataWords[copper][dataConcentrator].push_back(buf[0]);
86 dataWords[copper][dataConcentrator].push_back(buf[1]);
88 int copper = electronicsChannel->
getCopper() - EKLM_ID - 1;
89 int dataConcentrator = electronicsChannel->
getSlot() - 1;
90 dataWords[copper + 4][dataConcentrator].push_back(buf[0]);
91 dataWords[copper + 4][dataConcentrator].push_back(buf[1]);
106 for (
int i = 0; i < 8; i++) {
108 packerInfo.
node_id = BKLM_ID + 1 + i;
110 packerInfo.
node_id = EKLM_ID + 1 + i - 4;
112 for (
int j = 0; j < 4; j++) {
113 nWords[j] = dataWords[i][j].size();
114 detectorBuf[j] =
new int[nWords[j] + 1];
115 for (
int k = 0; k < nWords[j]; k++)
116 detectorBuf[j][k] = dataWords[i][j][k];
117 detectorBuf[j][nWords[j]] = 0;
120 detectorBuf[1], nWords[1] + 1,
121 detectorBuf[2], nWords[2] + 1,
122 detectorBuf[3], nWords[3] + 1,
124 for (
int j = 0; j < 4; j++)
125 delete[] detectorBuf[j];
140 uint16_t& bword1, uint16_t& bword2, uint16_t& bword3, uint16_t& bword4)
146 bword1 |= (strip & 0x7F);
147 bword1 |= ((plane & 1) << 7);
148 bword1 |= ((lane & 0x1F) << 8);
149 bword1 |= (flag << 13);
150 bword2 |= (ctime & 0xFFFF);
151 bword3 |= (tdc & 0x3FF);
152 bword4 |= (charge & 0xFFF);
void formatData(int flag, int lane, int plane, int strip, int charge, uint16_t ctime, uint16_t tdc, uint16_t &bword1, uint16_t &bword2, uint16_t &bword3, uint16_t &bword4)
Creation of raw data.
void PackDetectorBuf(int *detector_buf_1st, int nwords_1st, int *detector_buf_2nd, int nwords_2nd, int *detector_buf_3rd, int nwords_3rd, int *detector_buf_4th, int nwords_4th, RawCOPPERPackerInfo rawcprpacker_info)
Packer for RawCOPPER class Pack data (format ver.