12 : theSize(0), boardNumber_(number), theNumberOfSamples(0), theFormatVersion(format_version), fDCFEB(f_dcfeb) {
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), theFormatVersion(format_version), fDCFEB(f_dcfeb)
65 scaWord.
ts_flag = sixteenSamples;
73 unsigned short * pos =
theData+
i*100;
74 memcpy(pos, &slice, 200);
77 theSize = theNumberOfSamples*100;
85 unsigned channel = (digi.
getStrip()-1) % 16 + 1;
86 unsigned value = scaCounts[itime] & 0xFFF;
192 LogTrace(
"CSCCFEBData|CSCRawToDigi") <<
"nTimeSamples is zero - CFEB data corrupt?";
196 for(
unsigned itime = 0; itime <
nTimeSamples(); ++itime) {
199 if (slice) crcWords[itime] = slice->
get_crc();
203 for(
unsigned i = 0;
i < 16; ++
i)
223 LogTrace(
"CSCCFEBData|CSCRawToDigi") <<
"nTimeSamples in CSCCFEBData::digis = " <<
nTimeSamples();
225 LogTrace(
"CSCCFEBData|CSCRawToDigi") <<
"nTimeSamples is zero - CFEB data corrupt?";
243 for(
unsigned itime = 0; itime <
nTimeSamples(); ++itime) {
250 for(
unsigned ichannel = 1; ichannel <= 16; ++ichannel)
259 for(
unsigned itime = 0; itime <
nTimeSamples(); ++itime)
282 LogTrace(
"CSCCFEBData|CSCRawToDigi") <<
"ADC counts empty - CFEB data corrupt?";
289 if ( me1a ) strip = strip%64;
290 if ( me1a && zplus ) { strip = 49 - strip; }
291 if ( me1b && !zplus) { strip = 65 - strip;}
295 if ( me1a ) strip = strip%64;
296 if ( me1a && zplus ) { strip = 17 - strip; }
297 if ( me1b && !zplus) { strip = 65 - strip;}
299 result.push_back(
CSCStripDigi(strip, sca, overflow, overlap, errorfl));
308 std::vector<CSCStripDigi>
result;
309 uint32_t layer= idlayer;
310 digis(layer, result);
329 os <<
"printing CFEB data sample by sample " << std::endl;
330 for(
unsigned ilayer = 1; ilayer <= 6; ++ilayer)
332 for(
unsigned channel = 1; channel <= 16; ++channel)
335 os <<
"Strip " << strip <<
" ";
336 for(
unsigned timeBin = 0; timeBin < data.
nTimeSamples(); ++timeBin)
338 os << data.
adcCounts(ilayer, channel, timeBin) <<
" " ;
348 std::vector < std::vector<CSCStripDigi> >
result;
349 for (
int layer = 1; layer <= 6; ++layer)
351 result.push_back(
digis(layer));
tuple start
Check for commandline option errors.
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