28 produces<std::vector<uint32_t>>(
"FillerWordEventNumber1");
29 produces<std::vector<uint32_t>>(
"FillerWordEventNumber2");
31 produces<std::vector<uint32_t>>(
"SaveFillerWord");
33 consumes<FEDRawDataCollection>(
label);
40 unsigned int Filler1 = (totword)&0x000000ff;
41 unsigned int Filler2 = ((totword)&0x0000ff00) >> 8;
42 unsigned int Filler3 = ((totword)&0x00ff0000) >> 16;
43 unsigned int Filler4 = ((totword)&0xffff0000) >> 16;
44 unsigned int maskFiller4 = ((totword)&0xff000000) >> 16;
45 unsigned int Filler14 = (Filler1 & maskFiller4);
46 unsigned int Filler24 = (Filler2 & maskFiller4);
47 unsigned int CalibFiller1 = 0;
48 unsigned int CalibFiller2 = 0;
49 bool BoolStat =
false;
53 CalibFiller1 = Filler1;
55 CalibFiller2 = Filler14;
59 CalibFiller1 = Filler2;
61 CalibFiller2 = Filler24;
65 CalibFiller1 = Filler3;
67 CalibFiller2 = Filler4;
71 CalibFiller2 = Filler4;
74 if ((Filler1 == Filler2) && (Filler1 == Filler3) && (Filler2 == Filler3)) {
75 CalibFiller1 = Filler1;
78 CalibFiller2 = Filler4;
82 <<
"Status: " <<
status <<
"Event ID in Filler words don't match" <<
'\t' <<
"Filler1: " << (Filler1 % 256)
83 <<
'\t' <<
"Filler2: " << (Filler2 % 256) <<
'\t' <<
"Filler3: " << (Filler3 % 256) << std::endl;
87 if (Filler1 == Filler2) {
88 CalibFiller1 = Filler1;
91 CalibFiller2 = Filler14;
95 <<
"Status: " <<
status <<
"Event ID in Filler words don't match" <<
'\t' <<
"Filler1: " << (Filler1 % 256)
96 <<
'\t' <<
"Filler2: " << (Filler2 % 256) << std::endl;
100 if (Filler1 == Filler3) {
101 CalibFiller1 = Filler1;
104 CalibFiller2 = Filler4;
108 <<
"Status: " <<
status <<
"Event ID in Filler words don't match" <<
'\t' <<
"Filler1: " << (Filler1 % 256)
109 <<
'\t' <<
"Filler3: " << (Filler3 % 256) << std::endl;
113 if (Filler2 == Filler3) {
114 CalibFiller1 = Filler2;
117 CalibFiller2 = Filler4;
121 <<
"Status: " <<
status <<
"Event ID Filler words don't match" <<
'\t' <<
"Filler2: " << (Filler2 % 256)
122 <<
'\t' <<
"Filler3: " << (Filler3 % 256) << std::endl;
127 unsigned int CalibEvtNum = ((
EventNum - 1) / 10);
128 if ((CalibFiller1 != 0) && (CalibEvtNum != CalibFiller1)) {
129 edm::LogError(
"AnazrFedFillerWords") <<
"Error, Event ID Numbers Don't match---->"
130 <<
"Filler1 Event ID: " << CalibFiller1 <<
'\t'
131 <<
"Run Event ID: " << CalibEvtNum <<
'\t' << std::endl;
132 }
else if ((CalibFiller1 != 0) && (CalibEvtNum == CalibFiller1)) {
134 edm::LogInfo(
"AnazrFedFillerWords") <<
"Filler1 Event ID: " << (CalibFiller1 % 256) << std::endl;
135 }
else if ((CalibFiller2 != 0) && (BoolStat ==
true)) {
137 edm::LogInfo(
"AnazrFedFillerWords") <<
"Filler2 Event ID:" << (((CalibFiller2 % 65536) & (0xff00)) >> 8)
139 }
else if ((CalibFiller2 != 0) && (BoolStat ==
false)) {
143 <<
"Filler2 Event ID:" << (((CalibFiller2 % 65536) & (0xff00)) >> 8) << std::endl;
144 }
else if (
status == 0x8) {
146 <<
"Status: " <<
status <<
" No Filler1 found, is not possible get any Event ID Number" << std::endl;
154 edm::LogInfo(
"FedFillerWords") <<
"Begin of data" << std::endl;
156 if ((ldata[0] & 0xf000000000000000LL) != 0x5000000000000000LL)
174 const uint32_t rocmsk = 0x3e00000;
175 const uint32_t chnlmsk = 0xfc000000;
177 for (
int jk = 0; jk < 8; jk++)
179 for (
int jk = 0; jk < 8; jk++)
183 for (
int kk = 1;
kk < length - 1;
kk++) {
185 if ((((ldata[
kk] & 0xff00000000000000LL) >> 32) == 0xa0000000) &&
186 (((ldata[
kk] & 0xffffff00000000LL) >> 32) == (
uint64_t)(
kk + 1))) {
190 word2 = (uint32_t)ldata[
kk];
191 word1 = (uint32_t)(ldata[
kk] >> 32);
195 chan = ((word1 & chnlmsk) >> 26);
196 roc = ((word1 & rocmsk) >> 21);
203 if ((
chan < 5) && (fifcnt != 1)) {
204 edm::LogError(
"FedFillerWords") <<
" error in fifo counting!" << std::endl;
206 if ((
chan > 4) && (
chan < 10) && (fifcnt != 2)) {
210 if ((
chan > 9) && (
chan < 14) && (fifcnt != 3)) {
214 if ((
chan > 13) && (
chan < 19) && (fifcnt != 4)) {
218 if ((
chan > 18) && (
chan < 23) && (fifcnt != 5)) {
222 if ((
chan > 22) && (
chan < 28) && (fifcnt != 6)) {
226 if ((
chan > 27) && (
chan < 32) && (fifcnt != 7)) {
230 if ((
chan > 31) && (fifcnt != 8)) {
238 gap[fifcnt - 1] = (0x1000 + (word1 & 0xff));
242 if ((
roc == 27) && ((fif2cnt + dumcnt) < 6)) {
243 dum[fifcnt - 1] = (0x1000 + (word1 & 0xff));
245 }
else if ((
roc == 27) && ((fif2cnt + dumcnt) > 6)) {
253 chan = ((word2 & chnlmsk) >> 26);
254 roc = ((word2 & rocmsk) >> 21);
259 edm::LogInfo(
"FedFillerWords") <<
" ***Stale dummy!" << std::endl;
261 if ((
chan < 5) && (fifcnt != 1)) {
262 edm::LogError(
"FedFillerWords") <<
" error in fifo counting!" << std::endl;
264 if ((
chan > 4) && (
chan < 10) && (fifcnt != 2)) {
268 if ((
chan > 9) && (
chan < 14) && (fifcnt != 3)) {
272 if ((
chan > 13) && (
chan < 19) && (fifcnt != 4)) {
276 if ((
chan > 18) && (
chan < 23) && (fifcnt != 5)) {
280 if ((
chan > 22) && (
chan < 28) && (fifcnt != 6)) {
284 if ((
chan > 27) && (
chan < 32) && (fifcnt != 7)) {
288 if ((
chan > 31) && (fifcnt != 8)) {
295 gap[fifcnt - 1] = (0x1000 + (word2 & 0xff));
298 if ((
roc == 27) && ((fif2cnt + dumcnt) < 6)) {
299 dum[fifcnt - 1] = (0x1000 + (word1 & 0xff));
301 }
else if ((
roc == 27) && ((fif2cnt + dumcnt) > 6)) {
308 if (((fif2cnt + dumcnt) == 6) && (dumcnt > 0)) {
313 if ((gapcnt > 0) && ((dumcnt + fif2cnt) > 5)) {
318 }
else if ((gapcnt > 0) && ((dumcnt + fif2cnt) < 6)) {
327 totword = (
gap[0] & 0xff);
329 }
else if (
gap[1] > 0) {
330 totword = (
gap[1] & 0xff);
332 }
else if (dum[0] > 0) {
333 totword = (dum[0] & 0xff);
335 }
else if (dum[1] > 0) {
336 totword = (dum[1] & 0xff);
341 totword = totword | ((
gap[2] & 0xff) << 8);
343 }
else if (
gap[3] > 0) {
344 totword = totword | ((
gap[3] & 0xff) << 8);
346 }
else if (dum[2] > 0) {
347 totword = totword | ((dum[2] & 0xff) << 8);
349 }
else if (dum[3] > 0) {
350 totword = totword | ((dum[3] & 0xff) << 8);
355 totword = totword | ((
gap[4] & 0xff) << 16);
357 }
else if (
gap[5] > 0) {
358 totword = totword | ((
gap[5] & 0xff) << 16);
360 }
else if (dum[4] > 0) {
361 totword = totword | ((dum[4] & 0xff) << 16);
363 }
else if (dum[5] > 0) {
364 totword = totword | ((dum[5] & 0xff) << 16);
369 totword = totword | ((
gap[6] & 0xff) << 24);
371 }
else if (
gap[7] > 0) {
372 totword = totword | ((
gap[7] & 0xff) << 24);
374 }
else if (dum[6] > 0) {
375 totword = totword | ((dum[6] & 0xff) << 24);
377 }
else if (dum[7] > 0) {
378 totword = totword | ((dum[7] & 0xff) << 24);
385 edm::LogInfo(
"FedFillerWords") <<
"total word = 0x" << std::hex << totword << std::hex <<
" Status = 0x" <<
status
394 auto FillerWordEventNumbers1 = std::make_unique<std::vector<uint32_t>>();
395 auto FillerWordEventNumbers2 = std::make_unique<std::vector<uint32_t>>();
396 auto SaveFillerWords = std::make_unique<std::vector<uint32_t>>();
398 std::pair<int, int>
fedIds;
417 edm::LogWarning(
"FedFillerWords") <<
"========= Filler Words Vector is empty! ==========" << std::endl;
433 iEvent.put(
std::move(FillerWordEventNumbers1),
"FillerWordEventNumber1");
434 iEvent.put(
std::move(FillerWordEventNumbers2),
"FillerWordEventNumber2");