24 const unsigned int word1,
25 const unsigned int word2,
26 const unsigned int word3,
27 const unsigned int word0p,
28 const unsigned int word1p,
29 const unsigned int word2p,
30 const unsigned int word3p,
31 const unsigned int word0n,
32 const unsigned int word1n,
33 const unsigned int word2n,
34 const unsigned int word3n,
35 const unsigned int status) :
70 unsigned int size = data_block.size();
91 else if (
size == 13) {
110 else std::cout <<
" ERROR! LUCID_RawData::LUCID_RawData, unexpected datablock size: " <<
size << std::endl;
119 if (tubeNumber < 16) {
121 int bit = tubeNumber;
126 else { std::cout <<
" ERROR! LUCID_RawData::isTubeFired, unknown operation for bxID: " << bxID << std::endl;
return 0; }
128 else if (tubeNumber < 20) {
130 int bit = tubeNumber - 16;
135 else { std::cout <<
" ERROR! LUCID_RawData::isTubeFired, unknown operation for bxID: " << bxID << std::endl;
return 0; }
137 else if (tubeNumber < 36) {
139 int bit = tubeNumber - 20;
144 else { std::cout <<
" ERROR! LUCID_RawData::isTubeFired, unknown operation for bxID: " << bxID << std::endl;
return 0; }
146 else if (tubeNumber < 40) {
148 int bit = tubeNumber - 36;
153 else { std::cout <<
" ERROR! LUCID_RawData::isTubeFired, unknown operation for bxID: " << bxID << std::endl;
return 0; }
155 else { std::cout <<
" ERROR! LUCID_RawData::isTubeFired, unknown operation for tubeNumber: " << tubeNumber << std::endl;
return 0; }
162 if (tubeNumber == 0)
return 13;
163 else if (tubeNumber == 1)
return 0;
164 else if (tubeNumber == 2)
return 1;
165 else if (tubeNumber == 3)
return 5;
166 else if (tubeNumber == 4)
return 6;
167 else if (tubeNumber == 5)
return 8;
168 else if (tubeNumber == 6)
return 9;
169 else if (tubeNumber == 7)
return 14;
170 else if (tubeNumber == 8)
return 15;
171 else if (tubeNumber == 9)
return 2;
172 else if (tubeNumber == 10)
return 3;
173 else if (tubeNumber == 11)
return 4;
174 else if (tubeNumber == 12)
return 7;
175 else if (tubeNumber == 13)
return 10;
176 else if (tubeNumber == 14)
return 11;
177 else if (tubeNumber == 15)
return 12;
178 else if (tubeNumber == 16)
return 0;
179 else if (tubeNumber == 17)
return 1;
180 else if (tubeNumber == 18)
return 2;
181 else if (tubeNumber == 19)
return 3;
182 else if (tubeNumber == 20)
return 21;
183 else if (tubeNumber == 21)
return 16;
184 else if (tubeNumber == 22)
return 17;
185 else if (tubeNumber == 23)
return 13;
186 else if (tubeNumber == 24)
return 14;
187 else if (tubeNumber == 25)
return 8;
188 else if (tubeNumber == 26)
return 9;
189 else if (tubeNumber == 27)
return 22;
190 else if (tubeNumber == 28)
return 23;
191 else if (tubeNumber == 29)
return 18;
192 else if (tubeNumber == 30)
return 19;
193 else if (tubeNumber == 31)
return 20;
194 else if (tubeNumber == 32)
return 15;
195 else if (tubeNumber == 33)
return 10;
196 else if (tubeNumber == 34)
return 11;
197 else if (tubeNumber == 35)
return 12;
198 else if (tubeNumber == 36)
return 0;
199 else if (tubeNumber == 37)
return 1;
200 else if (tubeNumber == 38)
return 2;
201 else if (tubeNumber == 39)
return 3;
202 else { std::cout <<
" ERROR! LUCID_RawData::getLumatBitPosition, unknown operation for tubeNumber: " << tubeNumber << std::endl;
return -1; }
224 int hitcounter0p = 0;
225 int hitcounter1p = 0;
226 int hitcounter2p = 0;
227 int hitcounter3p = 0;
228 int hitcounter0n = 0;
229 int hitcounter1n = 0;
230 int hitcounter2n = 0;
231 int hitcounter3n = 0;
233 for (
int tubeID=0; tubeID<40; tubeID++) {
241 isHit = (
m_word0 >>bit)&1;
if (isHit) { data_word0 |= (1 << tubeID); hitcounter0++; }
242 isHit = (
m_word0p>>bit)&1;
if (isHit) { data_word0p |= (1 << tubeID); hitcounter0p++; }
243 isHit = (
m_word0n>>bit)&1;
if (isHit) { data_word0n |= (1 << tubeID); hitcounter0n++; }
245 else if (tubeID < 20) {
247 isHit = (
m_word2 >>bit)&1;
if (isHit) { data_word2 |= (1 << (tubeID-16)); hitcounter2++; }
248 isHit = (
m_word2p>>bit)&1;
if (isHit) { data_word2p |= (1 << (tubeID-16)); hitcounter2p++; }
249 isHit = (
m_word2n>>bit)&1;
if (isHit) { data_word2n |= (1 << (tubeID-16)); hitcounter2n++; }
251 else if (tubeID < 36) {
253 isHit = (
m_word1 >>bit)&1;
if (isHit) { data_word1 |= (1 << (tubeID-20)); hitcounter1++; }
254 isHit = (
m_word1p>>bit)&1;
if (isHit) { data_word1p |= (1 << (tubeID-20)); hitcounter1p++; }
255 isHit = (
m_word1n>>bit)&1;
if (isHit) { data_word1n |= (1 << (tubeID-20)); hitcounter1n++; }
259 isHit = (
m_word3 >>bit)&1;
if (isHit) { data_word3 |= (1 << (tubeID-36)); hitcounter3++; }
260 isHit = (
m_word3p>>bit)&1;
if (isHit) { data_word3p |= (1 << (tubeID-36)); hitcounter3p++; }
261 isHit = (
m_word3n>>bit)&1;
if (isHit) { data_word3n |= (1 << (tubeID-36)); hitcounter3n++; }
265 setWord0(data_word0 |= (hitcounter0 << 24));
266 setWord1(data_word1 |= (hitcounter1 << 24));
267 setWord2(data_word2 |= (hitcounter2 << 24));
268 setWord3(data_word3 |= (hitcounter3 << 24));
270 setWord0p(data_word0p |= (hitcounter0p << 24));
271 setWord1p(data_word1p |= (hitcounter1p << 24));
272 setWord2p(data_word2p |= (hitcounter2p << 24));
273 setWord3p(data_word3p |= (hitcounter3p << 24));
275 setWord0n(data_word0n |= (hitcounter0n << 24));
276 setWord1n(data_word1n |= (hitcounter1n << 24));
277 setWord2n(data_word2n |= (hitcounter2n << 24));
278 setWord3n(data_word3n |= (hitcounter3n << 24));
293 std::cout << std::hex
294 <<
" m_word0: " <<
m_word0 << std::endl
295 <<
" m_word1: " <<
m_word1 << std::endl
296 <<
" m_word2: " <<
m_word2 << std::endl
297 <<
" m_word3: " <<
m_word3 << std::endl
300 for (
int tubeID=0; tubeID<40; tubeID++) {
306 if (tubeID < 16) { data_word0 |= (1 << bit); hitcounter0++; }
307 else if (tubeID < 20) { data_word2 |= (1 << bit); hitcounter2++; }
308 else if (tubeID < 36) { data_word1 |= (1 << bit); hitcounter1++; }
309 else { data_word3 |= (1 << bit); hitcounter3++; }
312 std::cout <<
" hitcounter0: " << std::setw(10) << hitcounter0 << std::endl
313 <<
" hitcounter1: " << std::setw(10) << hitcounter1 << std::endl
314 <<
" hitcounter2: " << std::setw(10) << hitcounter2 << std::endl
315 <<
" hitcounter3: " << std::setw(10) << hitcounter3 << std::endl;
317 data_word0 |= (hitcounter0 << 24);
318 data_word1 |= (hitcounter1 << 24);
319 data_word2 |= (hitcounter2 << 24);
320 data_word3 |= (hitcounter3 << 24);
322 std::cout << std::hex
323 <<
" data_word0: " << data_word0 << std::endl
324 <<
" data_word1: " << data_word1 << std::endl
325 <<
" data_word2: " << data_word2 << std::endl
326 <<
" data_word3: " << data_word3 << std::endl