12 : theSize(0), boardNumber_(number), theNumberOfSamples(0), theFormatVersion(format_version), fDCFEB(f_dcfeb) {
23 if(badSlice->
check()) {
34 if(goodSlice->
check()) {
48 LogTrace (
"CSCCFEBData|CSCRawToDigi")
50 << *(buf+pos+3) <<
" " << *(buf+pos+2) <<
" " << *(buf+pos+1) <<
" "<< *(buf+pos);
64 : boardNumber_(number), theNumberOfSamples(sixteenSamples ? 16 : 8), theFormatVersion(format_version), fDCFEB(f_dcfeb)
70 scaWord.
ts_flag = sixteenSamples;
78 unsigned short * pos =
theData+
i*100;
79 memcpy(pos, &slice, 200);
82 theSize = theNumberOfSamples*100;
90 unsigned channel = (digi.
getStrip()-1) % 16 + 1;
91 unsigned value = scaCounts[itime] & 0xFFF;
197 LogTrace(
"CSCCFEBData|CSCRawToDigi") <<
"nTimeSamples is zero - CFEB data corrupt?";
201 for(
unsigned itime = 0; itime <
nTimeSamples(); ++itime) {
204 if (slice) crcWords[itime] = slice->
get_crc();
208 for(
unsigned i = 0;
i < 16; ++
i)
228 LogTrace(
"CSCCFEBData|CSCRawToDigi") <<
"nTimeSamples in CSCCFEBData::digis = " <<
nTimeSamples();
230 LogTrace(
"CSCCFEBData|CSCRawToDigi") <<
"nTimeSamples is zero - CFEB data corrupt?";
248 for(
unsigned itime = 0; itime <
nTimeSamples(); ++itime) {
255 for(
unsigned ichannel = 1; ichannel <= 16; ++ichannel)
264 for(
unsigned itime = 0; itime <
nTimeSamples(); ++itime)
287 LogTrace(
"CSCCFEBData|CSCRawToDigi") <<
"ADC counts empty - CFEB data corrupt?";
294 if ( me1a ) strip = strip%64;
295 if ( me1a && zplus ) { strip = 49 - strip; }
296 if ( me1b && !zplus) { strip = 65 - strip;}
300 if ( me1a ) strip = strip%64;
301 if ( me1a && zplus ) { strip = 17 - strip; }
302 if ( me1b && !zplus) { strip = 65 - strip;}
304 result.push_back(
CSCStripDigi(strip, sca, overflow, overlap, errorfl));
313 std::vector<CSCStripDigi>
result;
314 uint32_t layer= idlayer;
315 digis(layer, result);
334 os <<
"printing CFEB data sample by sample " << std::endl;
335 for(
unsigned ilayer = 1; ilayer <= 6; ++ilayer)
337 for(
unsigned channel = 1; channel <= 16; ++channel)
340 os <<
"Strip " << strip <<
" ";
341 for(
unsigned timeBin = 0; timeBin < data.
nTimeSamples(); ++timeBin)
343 os << data.
adcCounts(ilayer, channel, timeBin) <<
" " ;
353 std::vector < std::vector<CSCStripDigi> >
result;
354 for (
int layer = 1; layer <= 6; ++layer)
356 result.push_back(
digis(layer));
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
void digis(uint32_t idlayer, std::vector< CSCStripDigi > &result)
faster way to get to digis
unsigned sizeInWords() const
void add(const CSCStripDigi &, int layer)
void setL1A(unsigned l1a)
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
CSCCFEBData(unsigned boardNumber, unsigned short *buf, uint16_t theFormatVersion=2005, bool fDCFEB=false)
read from an existing data stream.
char data[epos_bytes_allocation]
uint16_t theFormatVersion
unsigned theNumberOfSamples