49 std::vector<unsigned short int> v16;
58 typedef std::vector<const RpcPad*> receiver;
59 std::map<int, receiver> mapReceiver;
62 int sector = pPad->sector();
63 mapReceiver[sector].push_back(pPad);
74 uint16_t rodId = ((*re).first % 32) / 2;
84 for (;
re != re_end; ++
re) {
88 rxHeader[1] = ((*re).first % 32) % 2 << 3;
93 v16.push_back(receiverHeader);
96 std::vector<const RpcPad*>::const_iterator
it = (*re).second.begin();
97 std::vector<const RpcPad*>::const_iterator it_end = (*re).second.end();
99 for (;
it != it_end; ++
it) {
100 const RpcPad* pad = (*it);
103 unsigned short int padHeader[3];
106 padHeader[2] = pad->
status();
107 v16.push_back(padReadout.
makeHeader(padHeader));
111 for (; it_cma != it_cma_end; ++it_cma) {
113 unsigned short int cmaHeader[3];
116 cmaHeader[2] = cma->
fel1Id();
117 v16.push_back(matrixReadout.
makeHeader(cmaHeader));
121 for (; it_fCh != it_fCh_end; ++it_fCh) {
123 unsigned short int body[5];
125 body[1] = firedChannel->
bcid();
126 body[2] = firedChannel->
time();
127 body[3] = firedChannel->
ijk();
130 body[4] = firedChannel->
channel();
132 body[4] = firedChannel->
thr() | ((firedChannel->
ovl()) << 2);
135 v16.push_back(matrixReadout.
makeBody(body));
142 ubit16 errorCodes[6] = {0, 0, 0, 0, 0, 0};
143 v16.push_back(padReadout.
makeFooter(errorCodes));
150 int n16words = v16.size();
151 if (n16words % 2 == 1) {
164 const unsigned short int nWords = 2;
165 unsigned short int position[nWords] = {0, 16};
166 unsigned short int v16words[nWords] = {0, 0};
167 for (
int i = 0;
i <
n;) {
168 v16words[
i % nWords] = v16[
i];
169 v16words[(
i + 1) % nWords] = v16[
i + 1];
170 v.push_back(
set32bits(v16words, position, nWords));
182 v32 = v32 | (
v <<
p);