18 const std::vector<unsigned int>& tobWords) :
40 std::vector<unsigned int> allTOBs(16,0);
43 for ( ; itRoI != tobs->
end(); ++itRoI) {
44 if ( (*itRoI)->crate() !=
crate || (*itRoI)->cpm() !=
module || (*itRoI)->type() !=
type )
continue;
46 int chip = (*itRoI)->chip();
47 int chipCoord = (*itRoI)->location();
48 int et = (*itRoI)->energy();
49 int isol = (*itRoI)->isolation();
51 int side = (chipCoord >> 2);
52 int lc = chipCoord & 3;
55 unsigned int presence = 2*chip +
side;
59 unsigned int tobdata =
et + (isol<<8) + (
lc<<13);
60 allTOBs[presence] = tobdata;
65 for (
int i = 0;
i < 16; ++
i) {
66 if (allTOBs[
i] == 0 )
continue;
68 unsigned int et = allTOBs[
i] & 0xff;
69 unsigned int isol = (allTOBs[
i] >> 8) & 0x1f;
70 unsigned int lc = (allTOBs[
i] >> 13) & 3;
104 for (
unsigned int word = 0; word < 4; ++word) {
105 unsigned int parity = 1;
106 for (
unsigned int bit = 0; bit < 24; ++bit)
if ( ( (
m_DataWords[word]>>bit) & 1) > 0 ) parity++;
137 unsigned int value = (m_DataWords[0] & 0xffff);
150 std::vector<unsigned int> bits;
153 for (
unsigned int i = 0;
i < 16; ++
i) {
155 if ( (m_DataWords[0] & (1<<
i)) > 0 ) {
157 if (ntob < 5) bits.push_back(
i);
171 std::vector<unsigned int>
data;
174 if ( (m_DataWords[0] & 0xffff) == 0 )
return data;
177 unsigned int ntob = 0;
178 for (
unsigned int i = 0;
i < 16; ++
i) {
180 if ( (m_DataWords[0] & (1<<
i)) > 0 ) {
184 unsigned int word = 0;
185 unsigned int coord = 0;
186 unsigned int isol = 0;
191 coord = (m_DataWords[0] >> 16) & 3;
192 isol = (m_DataWords[0] >> 18) & 0x1f;
193 et = m_DataWords[1] & 0xff;
196 coord = (m_DataWords[1] >> 16) & 3;
197 isol = (m_DataWords[1] >> 18) & 0x1f;
198 et = (m_DataWords[1] >> 8) & 0xff;
201 coord = (m_DataWords[2] >> 16) & 3;
202 isol = (m_DataWords[2] >> 18) & 0x1f;
203 et = m_DataWords[2] & 0xff;
206 coord = (m_DataWords[3] >> 8) & 3;
207 isol = (m_DataWords[3] >> 10) & 0x1f;
208 et = (m_DataWords[2] >> 8) & 0xff;
211 coord = (m_DataWords[3] >> 16) & 3;
212 isol = (m_DataWords[3] >> 18) & 0x1f;
213 et = m_DataWords[3] & 0xff;
216 word =
et + (isol<<8) + (
coord<<13);
217 data.push_back(word);
232 std::vector<unsigned int>
data;
235 if ( (m_DataWords[0] & 0xffff) == 0 )
return data;
238 unsigned int ntob = 0;
239 for (
unsigned int i = 0;
i < 16; ++
i) {
241 if ( (m_DataWords[0] & (1<<
i)) > 0 ) {
245 unsigned int chip =
i/2;
246 unsigned int rl = (
i&1) << 2;
250 unsigned int coord = 0;
251 unsigned int isol = 0;
256 coord = ((m_DataWords[0] >> 16) & 3) +
rl;
257 isol = (m_DataWords[0] >> 18) & 0x1f;
258 et = m_DataWords[1] & 0xff;
261 coord = ((m_DataWords[1] >> 16) & 3) +
rl;
262 isol = (m_DataWords[1] >> 18) & 0x1f;
263 et = (m_DataWords[1] >> 8) & 0xff;
266 coord = ((m_DataWords[2] >> 16) & 3) +
rl;
267 isol = (m_DataWords[2] >> 18) & 0x1f;
268 et = m_DataWords[2] & 0xff;
271 coord = ((m_DataWords[3] >> 8) & 3) +
rl;
272 isol = (m_DataWords[3] >> 10) & 0x1f;
273 et = (m_DataWords[2] >> 8) & 0xff;
276 coord = ((m_DataWords[3] >> 16) & 3) +
rl;
277 isol = (m_DataWords[3] >> 18) & 0x1f;
278 et = m_DataWords[3] & 0xff;
281 word =
et + (isol<<8) + (
coord<<13) + (chip<<16) + (m_module<<19);
282 data.push_back(word);
297 bool overflow =
false;
300 if ( (m_DataWords[0] & 0xffff) == 0 )
return overflow;
304 for (
unsigned int i = 0;
i < 16; ++
i) {
306 if ( (m_DataWords[0] & (1<<
i)) > 0 ) ntob++;
311 if (ntob > 5) overflow =
true;