12 : theSize(0), boardNumber_(
number), theNumberOfSamples(0), theFormatVersion(format_version), fDCFEB(f_dcfeb) {
22 if (badSlice->
check()) {
31 if (goodSlice->
check()) {
61 theNumberOfSamples(sixteenSamples ? 16 : 8),
62 theFormatVersion(format_version),
68 scaWord.
ts_flag = sixteenSamples;
72 slice.setControllerWord(scaWord);
85 unsigned channel = (digi.
getStrip() - 1) % 16 + 1;
86 unsigned value = scaCounts[itime] & 0xFFF;
100 return start.second ? reinterpret_cast<const CSCCFEBTimeSlice *>(
theData +
start.first) :
nullptr;
107 return start.second ? reinterpret_cast<CSCCFEBTimeSlice *>(
theData +
start.first) :
nullptr;
138 result =
slice->timeSample((ugchan - 1) * 6 + uglay - 1)->controllerData;
169 (reinterpret_cast<CSCCFEBTimeSlice *>(
theData +
start.first))->set_L1Anumber(l1a);
182 LogTrace(
"CSCCFEBData|CSCRawToDigi") <<
"nTimeSamples is zero - CFEB data corrupt?";
184 for (
unsigned itime = 0; itime <
nTimeSamples(); ++itime) {
188 crcWords[itime] =
slice->get_crc();
191 for (
unsigned i = 0;
i < 16; ++
i) {
192 contrWords[itime] |=
slice->timeSample(
i * 6 +
layer - 1)->controllerData <<
i;
203 LogTrace(
"CSCCFEBData|CSCRawToDigi") <<
"nTimeSamples in CSCCFEBData::digis = " <<
nTimeSamples();
205 LogTrace(
"CSCCFEBData|CSCRawToDigi") <<
"nTimeSamples is zero - CFEB data corrupt?";
223 for (
unsigned itime = 0; itime <
nTimeSamples(); ++itime) {
225 LogTrace(
"CSCCFEBData|CSCRawToDigi") <<
CSCDetId(idlayer) <<
" time sample " << itime + 1
227 LogTrace(
"CSCCFEBData|CSCRawToDigi") <<
CSCDetId(idlayer) <<
" time sample " << itime + 1
229 LogTrace(
"CSCCFEBData|CSCRawToDigi") <<
CSCDetId(idlayer) <<
" time sample " << itime + 1
233 for (
unsigned ichannel = 1; ichannel <= 16; ++ichannel) {
241 for (
unsigned itime = 0; itime <
nTimeSamples(); ++itime) {
247 sca[itime] =
word->adcCounts;
248 overflow[itime] =
word->adcOverflow;
250 errorfl[itime] =
word->errorstat;
255 overlap[itime] = ((l1a_phase[itime] & 0x1) << 8) | (
word->overlappedSampleFlag & 0x1);
260 LogTrace(
"CSCCFEBData|CSCRawToDigi") <<
"ADC counts empty - CFEB data corrupt?";
272 if (me1b && !
zplus) {
283 if (me1b && !
zplus) {
292 std::vector<CSCStripDigi>
result;
293 uint32_t
layer = idlayer;
309 os <<
"printing CFEB data sample by sample " << std::endl;
311 for (
unsigned channel = 1; channel <= 16; ++channel) {
312 unsigned strip = channel +
data.boardNumber_ * 16;
313 os <<
"Strip " <<
strip <<
" ";
314 for (
unsigned timeBin = 0; timeBin <
data.nTimeSamples(); ++timeBin) {
315 os <<
data.adcCounts(ilayer, channel, timeBin) <<
" ";
324 std::vector<std::vector<CSCStripDigi> >
result;