12 : theSize(0), boardNumber_(number), theNumberOfSamples(0), theFormatVersion(format_version), fDCFEB(f_dcfeb) {
22 if (badSlice->
check()) {
31 if (goodSlice->
check()) {
46 <<
"CORRUPT CFEB DATA slice " <<
theNumberOfSamples << std::hex <<
" " << *(buf + pos + 3) <<
" "
47 << *(buf + pos + 2) <<
" " << *(buf + pos + 1) <<
" " << *(buf + pos);
60 : boardNumber_(number),
61 theNumberOfSamples(sixteenSamples ? 16 : 8),
62 theFormatVersion(format_version),
68 scaWord.
ts_flag = sixteenSamples;
75 unsigned short *pos =
theData +
i * 100;
76 memcpy(pos, &slice, 200);
79 theSize = theNumberOfSamples * 100;
85 unsigned channel = (digi.
getStrip() - 1) % 16 + 1;
86 unsigned value = scaCounts[itime] & 0xFFF;
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) {
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) {
260 LogTrace(
"CSCCFEBData|CSCRawToDigi") <<
"ADC counts empty - CFEB data corrupt?";
272 if (me1b && !zplus) {
283 if (me1b && !zplus) {
287 result.push_back(
CSCStripDigi(strip, sca, overflow, overlap, errorfl));
292 std::vector<CSCStripDigi>
result;
293 uint32_t
layer = idlayer;
294 digis(layer, result);
309 os <<
"printing CFEB data sample by sample " << std::endl;
311 for (
unsigned channel = 1; channel <= 16; ++channel) {
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;
unsigned adcOverflow(unsigned layer, unsigned channel, unsigned timeBin) const
unsigned overlappedSampleFlag(unsigned layer, unsigned channel, unsigned timeBin) const
std::vector< int > const & getADCCounts() const
Get ADC readings.
unsigned short adcOverflow
unsigned sizeInWords() const
void add(const CSCStripDigi &, int layer)
void setL1A(unsigned l1a)
bool sixteenSamples() const
whether we keep 8 or 16 time samples
unsigned adcCounts(unsigned layer, unsigned channel, unsigned timeBin) const
void setControllerWord(const CSCCFEBSCAControllerWord &controllerWord)
unsigned errorstat(unsigned layer, unsigned channel, unsigned timeBin) const
CSCCFEBStatusDigi statusDigi() const
returns one status digi per cfeb
std::ostream & operator<<(std::ostream &out, const ALILine &li)
unsigned get_crc() const
accessors for words 97, 98 and 99
unsigned sizeInWords() const
std::vector< std::pair< int, bool > > theSliceStarts
bool check() const
makes sure each time slice has a trailer
constexpr std::array< uint8_t, layerIndexSize > layer
unsigned controllerData(unsigned uglay, unsigned ugchan, unsigned timeBin) const
bool overlap(const reco::Muon &muon1, const reco::Muon &muon2, double pullX=1.0, double pullY=1.0, bool checkAdjacentChambers=false)
const CSCCFEBTimeSlice * timeSlice(unsigned i) const
count from 0. User should check if it's a bad slice
unsigned nTimeSamples() const
void digis(uint32_t idlayer, std::vector< CSCStripDigi > &result) const
faster way to get to digis
std::vector< std::vector< CSCStripDigi > > stripDigis()
deprecated. Use the above method.
CSCCFEBDataWord * timeSample(int index) const
input from 0 to 95
unsigned short overlappedSampleFlag
std::vector< uint16_t > bWords
unsigned short controllerData
combined from all 16 strips to make a word
char data[epos_bytes_allocation]
uint16_t theFormatVersion
const CSCBadCFEBWord & word(int i) const
count from zero
CSCCFEBData(unsigned boardNumber, const uint16_t *buf, uint16_t theFormatVersion=2005, bool fDCFEB=false)
read from an existing data stream.
void setCRC()
=VB= Set calculated CRC value for simulated CFEB Time Slice data
unsigned theNumberOfSamples