12 : theSize(0), boardNumber_(number), theNumberOfSamples(0) {
17 unsigned maxSamples = 8;
23 if(badSlice->
check()) {
34 if(goodSlice->
check()) {
43 LogTrace (
"CSCCFEBData|CSCRawToDigi")
45 << *(buf+pos+3) <<
" " << *(buf+pos+2) <<
" " << *(buf+pos+1) <<
" "<< *(buf+pos);
59 : boardNumber_(number), theNumberOfSamples(sixteenSamples ? 16 : 8)
65 scaWord.
ts_flag = sixteenSamples;
74 memcpy(pos, &slice, 200);
77 theSize = theNumberOfSamples*100;
85 unsigned channel = (digi.
getStrip()-1) % 16 + 1;
86 unsigned value = scaCounts[itime] & 0xFFF;
176 LogTrace(
"CSCCFEBData|CSCRawToDigi") <<
"nTimeSamples is zero - CFEB data corrupt?";
180 for(
unsigned itime = 0; itime <
nTimeSamples(); ++itime) {
183 if (slice) crcWords[itime] = slice->
get_crc();
187 for(
unsigned i = 0;
i < 16; ++
i)
207 LogTrace(
"CSCCFEBData|CSCRawToDigi") <<
"nTimeSamples in CSCCFEBData::digis = " <<
nTimeSamples();
209 LogTrace(
"CSCCFEBData|CSCRawToDigi") <<
"nTimeSamples is zero - CFEB data corrupt?";
227 for(
unsigned itime = 0; itime <
nTimeSamples(); ++itime) {
234 for(
unsigned ichannel = 1; ichannel <= 16; ++ichannel)
243 for(
unsigned itime = 0; itime <
nTimeSamples(); ++itime)
266 LogTrace(
"CSCCFEBData|CSCRawToDigi") <<
"ADC counts empty - CFEB data corrupt?";
270 if ( me1a ) strip = strip%64;
271 if ( me1a && zplus ) { strip = 17-
strip; }
272 if ( me1b && !zplus) { strip = 65 -
strip;}
273 result.push_back(
CSCStripDigi(strip, sca, overflow, overlap, errorfl));
282 std::vector<CSCStripDigi>
result;
283 uint32_t layer= idlayer;
284 digis(layer, result);
303 os <<
"printing CFEB data sample by sample " << std::endl;
304 for(
unsigned ilayer = 1; ilayer <= 6; ++ilayer)
306 for(
unsigned channel = 1; channel <= 16; ++channel)
309 os <<
"Strip " << strip <<
" ";
310 for(
unsigned timeBin = 0; timeBin < data.
nTimeSamples(); ++timeBin)
312 os << data.
adcCounts(ilayer, channel, timeBin) <<
" " ;
322 std::vector < std::vector<CSCStripDigi> >
result;
323 for (
int layer = 1; layer <= 6; ++layer)
325 result.push_back(
digis(layer));
unsigned adcOverflow(unsigned layer, unsigned channel, unsigned timeBin) const
unsigned overlappedSampleFlag(unsigned layer, unsigned channel, unsigned timeBin) const
unsigned short adcOverflow
CSCCFEBData(unsigned boardNumber, unsigned short *buf)
read from an existing data stream.
std::vector< int > getADCCounts() const
Get ADC readings.
void digis(uint32_t idlayer, std::vector< CSCStripDigi > &result)
faster way to get to digis
unsigned sizeInWords() const
void add(const CSCStripDigi &, int layer)
unsigned adcCounts(unsigned layer, unsigned channel, unsigned timeBin) const
void setControllerWord(const CSCCFEBSCAControllerWord &controllerWord)
unsigned errorstat(unsigned layer, unsigned channel, unsigned timeBin) const
std::vector< std::pair< int, bool > > theSliceStarts
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
bool check() const
makes sure each time slice has a trailer
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 short theData[1600]
unsigned nTimeSamples() const
CSCBadCFEBWord & word(int i)
count from zero
std::vector< std::vector< CSCStripDigi > > stripDigis()
deprecated. Use the above method.
bool sixteenSamples()
whether we keep 8 or 16 time samples
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]
unsigned theNumberOfSamples