46 uint32_t
word[2] = {0, 0};
50 const uint32_t rocmsk = 0x3e00000;
51 const uint32_t chnlmsk = 0xfc000000;
53 for (
int jk = 1; jk < 9; jk++)
55 for (
int jk = 1; jk < 9; jk++)
63 for (
size_t iw = 0; iw < 2; iw++) {
65 roc = ((
word[iw] & rocmsk) >> 21);
69 if ((
chan > 4) && (
chan < 10) && (fifcnt != 2)) {
73 if ((
chan > 9) && (
chan < 14) && (fifcnt != 3)) {
77 if ((
chan > 13) && (
chan < 19) && (fifcnt != 4)) {
81 if ((
chan > 18) && (
chan < 23) && (fifcnt != 5)) {
85 if ((
chan > 22) && (
chan < 28) && (fifcnt != 6)) {
89 if ((
chan > 27) && (
chan < 32) && (fifcnt != 7)) {
93 if ((
chan > 31) && (fifcnt != 8)) {
100 gap[fifcnt] = (0x1000 + (
word[iw] & 0xff));
104 if ((
roc == 27) && ((fif2cnt + dumcnt) < 6)) {
106 dum[fifcnt] = (0x1000 + (
word[iw] & 0xff));
107 }
else if ((
roc == 27) && ((fif2cnt + dumcnt) > 6)) {
115 if (((fif2cnt + dumcnt) == 6) && (dumcnt > 0))
121 if ((gapcnt > 0) && ((dumcnt + fif2cnt) > 5))
127 }
else if ((gapcnt > 0) && ((dumcnt + fif2cnt) < 6))
135 totword = (
gap[1] & 0xff);
137 }
else if (
gap[2] > 0) {
138 totword = (
gap[2] & 0xff);
140 }
else if (dum[1] > 0) {
141 totword = (dum[1] & 0xff);
143 }
else if (dum[2] > 0) {
144 totword = (dum[2] & 0xff);
149 totword = totword | ((
gap[3] & 0xff) << 8);
151 }
else if (
gap[4] > 0) {
152 totword = totword | ((
gap[4] & 0xff) << 8);
154 }
else if (dum[3] > 0) {
155 totword = totword | ((dum[3] & 0xff) << 8);
157 }
else if (dum[4] > 0) {
158 totword = totword | ((dum[4] & 0xff) << 8);
163 totword = totword | ((
gap[5] & 0xff) << 16);
165 }
else if (
gap[6] > 0) {
166 totword = totword | ((
gap[6] & 0xff) << 16);
168 }
else if (dum[5] > 0) {
169 totword = totword | ((dum[5] & 0xff) << 16);
171 }
else if (dum[6] > 0) {
172 totword = totword | ((dum[6] & 0xff) << 16);
177 totword = totword | ((
gap[7] & 0xff) << 24);
179 }
else if (
gap[8] > 0) {
180 totword = totword | ((
gap[8] & 0xff) << 24);
182 }
else if (dum[7] > 0) {
183 totword = totword | ((dum[7] & 0xff) << 24);
185 }
else if (dum[8] > 0) {
186 totword = totword | ((dum[8] & 0xff) << 24);
196 m_fedid(
pset.getUntrackedParameter<
int>(
"fedid")),
198 m_runnumber(
pset.getUntrackedParameter<
int>(
"runNumber", -1)),
199 m_currenteventnumber(0),
200 m_currenttriggernumber(0),
201 m_eventnumber_shift(0) {
202 produces<FEDRawDataCollection>();
205 edm::LogInfo(
"") <<
"no more file to read " << std::endl;
209 edm::LogInfo(
"") <<
"now examining file " << currentfilename;
216 <<
" unsigned long int size = " <<
sizeof(
unsigned long int)
217 <<
"\n unsigned long size = " <<
sizeof(
unsigned long)
218 <<
"\n unsigned long long size = " <<
sizeof(
unsigned long long) <<
"\n uint32_t size = " <<
sizeof(uint32_t)
219 <<
"\n uint64_t size = " <<
sizeof(
uint64_t) << std::endl;
223 edm::LogInfo(
"PixelSLinkDataInputSource") <<
"file size " <<
size << std::endl;
226 edm::LogInfo(
"") <<
"file " << currentfilename <<
" cannot be found.";
238 if ((
m_data >> 60) != 0x5) {
241 edm::LogInfo(
"") <<
"WARNING: observed run number encoded in S-Link dump. Overwriting "
242 "run number as defined in .cfg file!!! Run number now set to "
262 uint32_t eventnumber = (
m_data >> 32) & 0x00ffffff;
265 std::vector<uint64_t>
buffer;
268 eventnumber = (
m_data >> 32) & 0x00ffffff;
272 <<
"**** event number = " << eventnumber <<
" global event number " <<
m_currenteventnumber <<
" data "
274 while ((
m_data >> 60) != 0x5) {
299 uint16_t fed_id = (
m_data >> 8) & 0xfff;
306 }
while ((
m_data >> 60) != 0xa);
309 auto rawData = std::make_unique<FEDRawData>(8 *
buffer.size());
311 unsigned char *dataptr =
rawData->data();
313 for (uint16_t
i = 0;
i <
buffer.size();
i++) {
316 uint32_t thetriggernumber = 0;
319 if (nfillwords > 0) {
320 LogInfo(
"") <<
"n fill words = " << nfillwords <<
", trigger numbers: " << thetriggernumber <<
","
335 LogError(
"PixelSLinkDataInputSource")
336 <<
" error, the previous event number (" << eventnumber <<
") is LARGER than the next event number ("