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);
70 scaWord.
ts_flag = sixteenSamples;
79 memcpy(pos, &slice, 200);
82 theSize = theNumberOfSamples*100;
90 unsigned channel = (digi.
getStrip()-1) % 16 + 1;
91 unsigned value = scaCounts[itime] & 0xFFF;
94 assert(slice !=
nullptr);
195 LogTrace(
"CSCCFEBData|CSCRawToDigi") <<
"nTimeSamples is zero - CFEB data corrupt?";
199 for(
unsigned itime = 0; itime <
nTimeSamples(); ++itime) {
202 if (slice) crcWords[itime] = slice->
get_crc();
206 for(
unsigned i = 0;
i < 16; ++
i)
226 LogTrace(
"CSCCFEBData|CSCRawToDigi") <<
"nTimeSamples in CSCCFEBData::digis = " <<
nTimeSamples();
228 LogTrace(
"CSCCFEBData|CSCRawToDigi") <<
"nTimeSamples is zero - CFEB data corrupt?";
246 for(
unsigned itime = 0; itime <
nTimeSamples(); ++itime) {
253 for(
unsigned ichannel = 1; ichannel <= 16; ++ichannel)
262 for(
unsigned itime = 0; itime <
nTimeSamples(); ++itime)
285 LogTrace(
"CSCCFEBData|CSCRawToDigi") <<
"ADC counts empty - CFEB data corrupt?";
292 if ( me1a ) strip = strip%64;
293 if ( me1a && zplus ) { strip = 49 -
strip; }
294 if ( me1b && !zplus) { strip = 65 -
strip;}
298 if ( me1a ) strip = strip%64;
299 if ( me1a && zplus ) { strip = 17 -
strip; }
300 if ( me1b && !zplus) { strip = 65 -
strip;}
302 result.push_back(
CSCStripDigi(strip, sca, overflow, overlap, errorfl));
311 std::vector<CSCStripDigi>
result;
312 uint32_t layer= idlayer;
313 digis(layer, result);
332 os <<
"printing CFEB data sample by sample " << std::endl;
333 for(
unsigned ilayer = 1; ilayer <= 6; ++ilayer)
335 for(
unsigned channel = 1; channel <= 16; ++channel)
338 os <<
"Strip " << strip <<
" ";
339 for(
unsigned timeBin = 0; timeBin < data.
nTimeSamples(); ++timeBin)
341 os << data.
adcCounts(ilayer, channel, timeBin) <<
" " ;
351 std::vector < std::vector<CSCStripDigi> >
result;
352 for (
int layer = 1; layer <= 6; ++layer)
354 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
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
std::vector< std::pair< int, bool > > theSliceStarts
CSCCFEBStatusDigi statusDigi() const
returns one status digi per cfeb
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 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
friend std::ostream & operator<<(std::ostream &os, const CSCCFEBData &)
unsigned short controllerData
combined from all 16 strips to make a word
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