CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes
CSCTMBData Class Reference

#include <CSCTMBData.h>

Public Member Functions

std::bitset< 22 > calCRC22 (const std::vector< std::bitset< 16 > > &datain)
 
bool checkSize () const
 sees if the size adds up to the word count More...
 
CSCComparatorDatacomparatorData ()
 
 CSCTMBData ()
 
 CSCTMBData (const CSCTMBData &data)
 
 CSCTMBData (const uint16_t *buf)
 
 CSCTMBData (int firmwareVersion, int firmwareRevision, int ncfebs=5)
 
short unsigned int CWordCnt () const
 
int getCRC () const
 
bool hasRPC () const
 check this before using RPC More...
 
bool hasTMBBlockedCFEB () const
 check this before TMB Block CFEB More...
 
bool hasTMBMiniScope () const
 check this before using TMB mini scope More...
 
bool hasTMBScope () const
 check this before using TMB Scope More...
 
std::bitset< 22 > nextCRC22_D16 (const std::bitset< 16 > &D, const std::bitset< 22 > &C)
 
boost::dynamic_bitset pack ()
 not const because it sets size int TMBTrailer More...
 
CSCRPCDatarpcData ()
 
const unsigned short size () const
 
CSCTMBBlockedCFEBtmbBlockedCFEB () const
 
int TMBCRCcalc ()
 
CSCTMBHeadertmbHeader ()
 
CSCTMBMiniScopetmbMiniScope () const
 
CSCTMBScopetmbScope () const
 
CSCTMBTrailertmbTrailer ()
 
int UnpackTMB (const uint16_t *buf)
 
 ~CSCTMBData ()
 

Static Public Member Functions

static void selfTest ()
 tests packing More...
 
static void setDebug (const bool value)
 

Private Attributes

unsigned short cWordCnt
 
unsigned short size_
 
unsigned theB0CLine
 
bool theBlockedCFEBIsPresent
 
CSCComparatorData theComparatorData
 
unsigned theE0FLine
 
const uint16_t * theOriginalBuffer
 
CSCRPCData theRPCData
 
bool theRPCDataIsPresent
 
CSCTMBBlockedCFEBtheTMBBlockedCFEB
 
CSCTMBHeader theTMBHeader
 
CSCTMBMiniScopetheTMBMiniScope
 
bool theTMBMiniScopeIsPresent
 
CSCTMBScopetheTMBScope
 
bool theTMBScopeIsPresent
 The TMB scope is not present in most of data hence its dynamic. More...
 
CSCTMBTrailer theTMBTrailer
 

Static Private Attributes

static std::atomic< bool > debug {false}
 

Detailed Description

Author
A. Tumanov - Rice

Definition at line 24 of file CSCTMBData.h.

Constructor & Destructor Documentation

◆ CSCTMBData() [1/4]

CSCTMBData::CSCTMBData ( )

Definition at line 21 of file CSCTMBData.cc.

22  : theOriginalBuffer(nullptr),
23  theB0CLine(0),
24  theE0FLine(0),
25  theTMBHeader(2007, 0x50c3),
27  theTMBScopeIsPresent(false),
28  theTMBScope(nullptr),
30  theTMBMiniScope(nullptr),
32  theTMBBlockedCFEB(nullptr),
34  size_(0),
35  cWordCnt(0),
36  theRPCDataIsPresent(false) {}

◆ CSCTMBData() [2/4]

CSCTMBData::CSCTMBData ( int  firmwareVersion,
int  firmwareRevision,
int  ncfebs = 5 
)

◆ ~CSCTMBData()

CSCTMBData::~CSCTMBData ( )

Definition at line 109 of file CSCTMBData.cc.

109  {
110  if (theTMBScopeIsPresent) {
111  delete theTMBScope;
112  theTMBScopeIsPresent = false;
113  }
114 
116  delete theTMBMiniScope;
117  theTMBMiniScopeIsPresent = false;
118  }
119 
121  delete theTMBBlockedCFEB;
122  theBlockedCFEBIsPresent = false;
123  }
124 }

References theBlockedCFEBIsPresent, theTMBBlockedCFEB, theTMBMiniScope, theTMBMiniScopeIsPresent, theTMBScope, and theTMBScopeIsPresent.

◆ CSCTMBData() [3/4]

CSCTMBData::CSCTMBData ( const uint16_t *  buf)

Definition at line 59 of file CSCTMBData.cc.

61  theTMBHeader(2007, 0x50c3),
63  theTMBScopeIsPresent(false),
64  theTMBScope(nullptr),
66  theTMBMiniScope(nullptr),
68  theTMBBlockedCFEB(nullptr),
70  theRPCDataIsPresent(false) {
71  size_ = UnpackTMB(buf);
72 }

References visDQMUpload::buf, size_, and UnpackTMB().

◆ CSCTMBData() [4/4]

CSCTMBData::CSCTMBData ( const CSCTMBData data)

Definition at line 76 of file CSCTMBData.cc.

77  : theOriginalBuffer(data.theOriginalBuffer),
78  theB0CLine(data.theB0CLine),
79  theE0FLine(data.theE0FLine),
80  theTMBHeader(data.theTMBHeader),
81  theComparatorData(data.theComparatorData),
82  theRPCData(data.theRPCData),
83  theTMBScopeIsPresent(data.theTMBScopeIsPresent),
84  theTMBMiniScopeIsPresent(data.theTMBMiniScopeIsPresent),
85  theBlockedCFEBIsPresent(data.theBlockedCFEBIsPresent),
86  theTMBTrailer(data.theTMBTrailer),
87  size_(data.size_),
88  cWordCnt(data.cWordCnt),
89  theRPCDataIsPresent(data.theRPCDataIsPresent) {
91  theTMBScope = new CSCTMBScope(*(data.theTMBScope));
92  } else {
93  theTMBScope = nullptr;
94  }
95 
97  theTMBMiniScope = new CSCTMBMiniScope(*(data.theTMBMiniScope));
98  } else {
99  theTMBMiniScope = nullptr;
100  }
101 
103  theTMBBlockedCFEB = new CSCTMBBlockedCFEB(*(data.theTMBBlockedCFEB));
104  } else {
105  theTMBBlockedCFEB = nullptr;
106  }
107 }

References data, theBlockedCFEBIsPresent, theTMBBlockedCFEB, theTMBMiniScope, theTMBMiniScopeIsPresent, theTMBScope, and theTMBScopeIsPresent.

Member Function Documentation

◆ calCRC22()

std::bitset< 22 > CSCTMBData::calCRC22 ( const std::vector< std::bitset< 16 > > &  datain)

Definition at line 339 of file CSCTMBData.cc.

339  {
340  std::bitset<22> CRC;
341  CRC.reset();
342  for (unsigned int i = 0; i < datain.size() - 3; ++i) {
343  CRC = nextCRC22_D16(datain[i], CRC);
344  }
345  return CRC;
346 }

References RawDataTask_cfi::CRC, mps_fire::i, and nextCRC22_D16().

Referenced by pack(), and TMBCRCcalc().

◆ checkSize()

bool CSCTMBData::checkSize ( ) const

sees if the size adds up to the word count

Definition at line 334 of file CSCTMBData.cc.

334  {
335  // sum up all the components and see if they have the size indicated in the TMBTrailer
336  return true;
337 }

Referenced by UnpackTMB().

◆ comparatorData()

CSCComparatorData* CSCTMBData::comparatorData ( )
inline

Definition at line 40 of file CSCTMBData.h.

40 { return &theComparatorData; }

References theComparatorData.

Referenced by CSCEventData::add(), CSCEventData::comparatorData(), and pack().

◆ CWordCnt()

short unsigned int CSCTMBData::CWordCnt ( ) const
inline

Definition at line 35 of file CSCTMBData.h.

35 { return cWordCnt; }

References cWordCnt.

◆ getCRC()

int CSCTMBData::getCRC ( ) const
inline

Definition at line 36 of file CSCTMBData.h.

36 { return theTMBTrailer.crc22(); }

References CSCTMBTrailer::crc22(), and theTMBTrailer.

◆ hasRPC()

bool CSCTMBData::hasRPC ( ) const
inline

check this before using RPC

Definition at line 52 of file CSCTMBData.h.

52 { return theRPCDataIsPresent; }

References theRPCDataIsPresent.

◆ hasTMBBlockedCFEB()

bool CSCTMBData::hasTMBBlockedCFEB ( ) const
inline

check this before TMB Block CFEB

Definition at line 48 of file CSCTMBData.h.

48 { return theBlockedCFEBIsPresent; }

References theBlockedCFEBIsPresent.

◆ hasTMBMiniScope()

bool CSCTMBData::hasTMBMiniScope ( ) const
inline

check this before using TMB mini scope

Definition at line 45 of file CSCTMBData.h.

45 { return theTMBMiniScopeIsPresent; }

References theTMBMiniScopeIsPresent.

◆ hasTMBScope()

bool CSCTMBData::hasTMBScope ( ) const
inline

check this before using TMB Scope

Definition at line 42 of file CSCTMBData.h.

42 { return theTMBScopeIsPresent; }

References theTMBScopeIsPresent.

◆ nextCRC22_D16()

std::bitset< 22 > CSCTMBData::nextCRC22_D16 ( const std::bitset< 16 > &  D,
const std::bitset< 22 > &  C 
)

Definition at line 366 of file CSCTMBData.cc.

366  {
367  std::bitset<22> NewCRC;
368 
369  NewCRC[0] = D[0] ^ C[6];
370  NewCRC[1] = D[1] ^ D[0] ^ C[6] ^ C[7];
371  NewCRC[2] = D[2] ^ D[1] ^ C[7] ^ C[8];
372  NewCRC[3] = D[3] ^ D[2] ^ C[8] ^ C[9];
373  NewCRC[4] = D[4] ^ D[3] ^ C[9] ^ C[10];
374  NewCRC[5] = D[5] ^ D[4] ^ C[10] ^ C[11];
375  NewCRC[6] = D[6] ^ D[5] ^ C[11] ^ C[12];
376  NewCRC[7] = D[7] ^ D[6] ^ C[12] ^ C[13];
377  NewCRC[8] = D[8] ^ D[7] ^ C[13] ^ C[14];
378  NewCRC[9] = D[9] ^ D[8] ^ C[14] ^ C[15];
379  NewCRC[10] = D[10] ^ D[9] ^ C[15] ^ C[16];
380  NewCRC[11] = D[11] ^ D[10] ^ C[16] ^ C[17];
381  NewCRC[12] = D[12] ^ D[11] ^ C[17] ^ C[18];
382  NewCRC[13] = D[13] ^ D[12] ^ C[18] ^ C[19];
383  NewCRC[14] = D[14] ^ D[13] ^ C[19] ^ C[20];
384  NewCRC[15] = D[15] ^ D[14] ^ C[20] ^ C[21];
385  NewCRC[16] = D[15] ^ C[0] ^ C[21];
386  NewCRC[17] = C[1];
387  NewCRC[18] = C[2];
388  NewCRC[19] = C[3];
389  NewCRC[20] = C[4];
390  NewCRC[21] = C[5];
391 
392  return NewCRC;
393 }

References gen::C.

Referenced by calCRC22().

◆ pack()

boost::dynamic_bitset CSCTMBData::pack ( )

not const because it sets size int TMBTrailer

this method is for digi2raw

Definition at line 395 of file CSCTMBData.cc.

395  {
396  boost::dynamic_bitset<> result =
398  boost::dynamic_bitset<> comparatorData =
401  boost::dynamic_bitset<> newResult = result;
402  // theTMBTrailer.setCRC(TMBCRCcalc());
403 
404  boost::dynamic_bitset<> tmbTrailer =
407 
408  // now convert to a vector<bitset<16>>, so we can calculate the crc
409  std::vector<std::bitset<16> > wordVector;
410  // try to tune so it stops before the e0f line
411  for (unsigned pos = 0; pos < result.size() - 16; pos += 16) {
412  std::bitset<16> word;
413  for (int i = 0; i < 16; ++i) {
414  word[i] = result[pos + i];
415  }
416  wordVector.push_back(word);
417  }
418  theTMBTrailer.setCRC(calCRC22(wordVector).to_ulong());
420  newResult = bitset_utilities::append(newResult, tmbTrailer);
421 
422  return newResult;
423 }

References bitset_utilities::append(), calCRC22(), comparatorData(), CSCComparatorData::data(), CSCTMBTrailer::data(), CSCTMBHeader::data(), mps_fire::i, mps_fire::result, CSCTMBTrailer::setCRC(), CSCComparatorData::sizeInWords(), CSCTMBTrailer::sizeInWords(), CSCTMBHeader::sizeInWords(), theComparatorData, theTMBHeader, theTMBTrailer, tmbTrailer(), and bitset_utilities::ushortToBitset().

Referenced by CSCEventData::pack().

◆ rpcData()

CSCRPCData* CSCTMBData::rpcData ( )
inline

Definition at line 53 of file CSCTMBData.h.

53 { return &theRPCData; }

References theRPCData.

◆ selfTest()

void CSCTMBData::selfTest ( )
static

tests packing

Definition at line 425 of file CSCTMBData.cc.

425  {
426  CSCTMBData tmbData;
427  cscClassPackerCompare(tmbData);
428 }

References cscClassPackerCompare().

◆ setDebug()

static void CSCTMBData::setDebug ( const bool  value)
inlinestatic

Definition at line 34 of file CSCTMBData.h.

34 { debug = value; }

References debug, and relativeConstraints::value.

Referenced by CSCDCCUnpacker::CSCDCCUnpacker().

◆ size()

const unsigned short CSCTMBData::size ( void  ) const
inline

◆ tmbBlockedCFEB()

CSCTMBBlockedCFEB & CSCTMBData::tmbBlockedCFEB ( ) const

Definition at line 360 of file CSCTMBData.cc.

360  {
362  throw("No TMB Blocked CFEB in this chamber");
363  return *theTMBBlockedCFEB;
364 }

References theBlockedCFEBIsPresent, and theTMBBlockedCFEB.

◆ TMBCRCcalc()

int CSCTMBData::TMBCRCcalc ( )

Definition at line 137 of file CSCTMBData.cc.

137  {
138  std::vector<std::bitset<16> > theTotalTMBData(theE0FLine + 1 - theB0CLine);
139  unsigned i = 0;
140  for (unsigned int line = theB0CLine; line < theE0FLine + 1; ++line) {
141  theTotalTMBData[i] = std::bitset<16>(theOriginalBuffer[line]);
142  ++i;
143  }
144  if (!theTotalTMBData.empty()) {
145  std::bitset<22> CRC = calCRC22(theTotalTMBData);
146  LogTrace("CSCTMBData|CSCRawToDigi") << " Test here " << CRC.to_ulong();
147  return CRC.to_ulong();
148  } else {
149  LogTrace("CSCTMBData|CSCRawToDigi") << "theTotalTMBData doesn't exist";
150  return 0;
151  }
152 }

References calCRC22(), RawDataTask_cfi::CRC, mps_fire::i, mps_splice::line, LogTrace, theB0CLine, theE0FLine, and theOriginalBuffer.

◆ tmbHeader()

CSCTMBHeader* CSCTMBData::tmbHeader ( )
inline

◆ tmbMiniScope()

CSCTMBMiniScope & CSCTMBData::tmbMiniScope ( ) const

Definition at line 354 of file CSCTMBData.cc.

354  {
356  throw("No TMBScope in this chamber");
357  return *theTMBMiniScope;
358 }

References theTMBMiniScope, and theTMBMiniScopeIsPresent.

◆ tmbScope()

CSCTMBScope & CSCTMBData::tmbScope ( ) const

Definition at line 348 of file CSCTMBData.cc.

348  {
350  throw("No TMBScope in this chamber");
351  return *theTMBScope;
352 }

References theTMBScope, and theTMBScopeIsPresent.

◆ tmbTrailer()

CSCTMBTrailer* CSCTMBData::tmbTrailer ( )
inline

Definition at line 50 of file CSCTMBData.h.

50 { return &theTMBTrailer; }

References theTMBTrailer.

Referenced by pack(), and cscdqm::EventProcessor::processCSC().

◆ UnpackTMB()

int CSCTMBData::UnpackTMB ( const uint16_t *  buf)

determine 2007 or 2006 version

assumes that buf starts at the tmb data this is not true if something is wrong in the data before TMB - then we skip the whole event

Now Find the miniscope

end for the mini scope

Now Find the blocked CFEB DiStrips List Format

end for the blocked CFEB DiStrips List Format

Definition at line 154 of file CSCTMBData.cc.

154  {
156  unsigned short int firmwareVersion = 0;
157  int Ntbins = 0;
158  int NRPCtbins = 0; // =VB= number of RPC tbins
159 
160  int b0cLine = 0;
161 
164  if (buf[b0cLine] == 0xdb0c) {
165  firmwareVersion = 2007;
166  Ntbins = buf[b0cLine + 19] & 0xF8;
167  NRPCtbins = (buf[b0cLine + 36] >> 5) & 0x1F; // =VB= get RPC tbins
168  } else if (buf[b0cLine] == 0x6b0c) {
169  firmwareVersion = 2006;
170  Ntbins = buf[b0cLine + 1] & 0x1f;
171  NRPCtbins = Ntbins;
172  } else {
173  LogTrace("CSCTMBData|CSCRawToDigi") << "+++ Can't find b0C flag";
174  }
175 
176  if ((firmwareVersion == 2007) &&
177  (!(((buf[b0cLine] & 0xFFFF) == 0xDB0C) && ((buf[b0cLine + 1] & 0xf000) == 0xD000) &&
178  ((buf[b0cLine + 2] & 0xf000) == 0xD000) && ((buf[b0cLine + 3] & 0xf000) == 0xD000)))) {
179  LogTrace("CSCTMBData|CSCRawToDigi") << "+++ CSCTMBData warning: error in header in 2007 format!";
180  }
181 
182  int MaxSizeRPC = 1 + NRPCtbins * 2 * 4 + 1;
183  //int MaxSizeScope = 5;
184  int e0bLine = -1;
185  switch (firmwareVersion) {
186  case 2007:
187  e0bLine = 42; //last word of header2007
188  break;
189  case 2006:
190  e0bLine = 26; //last word of header in 2006 format
191  break;
192  default:
193  edm::LogError("CSCTMBData|CSCRawToDigi") << "+++ undetermined firmware format - cant find e0bLine";
194  }
195 
197 
198  if (!theTMBHeader.check()) {
199  LogTrace("CSCTMBData|CSCRawToDigi") << "+++ CSCTMBData warning: Bad TMB header e0bLine=" << std::hex
200  << buf[e0bLine];
201  return 0;
202  }
203 
204  int currentPosition = theTMBHeader.sizeInWords();
205  int theFirmwareVersion = theTMBHeader.FirmwareVersion();
206 
208  CSCComparatorData(theTMBHeader.NCFEBs(), theTMBHeader.NTBins(), buf + e0bLine + 1, theFirmwareVersion);
209 
210  if (!theComparatorData.check()) {
211  LogTrace("CSCTMBData|CSCRawToDigi") << "+++ CSCTMBData warning: Bad CLCT data";
212  } else {
213  currentPosition += theComparatorData.sizeInWords();
214  }
215 
216  //int i = currentPosition-1;
217  //printf ( "%04x %04x %04x %04x\n",buf[i+3],buf[i+2],buf[i+1],buf[i] ) ;
218 
219  // look for RPC
220  int b04Line = currentPosition;
221 
222  if (buf[b04Line] == 0x6b04) {
223  // we need an e04 line to calculate the size
224  int e04Line = findLine(buf, 0x6e04, currentPosition, currentPosition + MaxSizeRPC);
225  if (e04Line != -1) {
226  theRPCDataIsPresent = true;
227  theRPCData = CSCRPCData(buf + b04Line, e04Line - b04Line + 1);
228  currentPosition += theRPCData.sizeInWords();
229  } else {
230  LogTrace("CSCTMBData|CSCRawToDigi") << "CSCTMBData::corrupt RPC data! Failed to find end! ";
231  return 0;
232  }
233  }
234 
235  int TotTMBReadout = 0;
236  switch (firmwareVersion) {
237  case 2007:
238  TotTMBReadout = 43 + Ntbins * 6 * 5 + 1 + NRPCtbins * 2 * 4 + 2 + 8 * 256 + 8;
239  break;
240  case 2006:
241  TotTMBReadout =
242  27 + Ntbins * 6 * 5 + 1 + NRPCtbins * 2 * 4 + 2 + 8 * 256 + 8; //see tmb2004 manual (version v2p06) page54.
243  break;
244  default:
245  edm::LogError("CSCTMBData|CSCRawToDigi") << "can't find TotTMBReadout - unknown firmware version!";
246  break;
247  }
248 
249  //std::cout << " !!!TMB Scope!!! " << std::endl;
250  if (buf[currentPosition] == 0x6b05) {
251  int b05Line = currentPosition;
252  LogTrace("CSCTMBData|CSCRawToDigi") << "found scope!";
253  int e05Line = findLine(buf, 0x6e05, currentPosition, TotTMBReadout - currentPosition);
254  if (e05Line != -1) {
255  theTMBScopeIsPresent = true;
256  theTMBScope = new CSCTMBScope(buf, b05Line, e05Line);
257  // The size of the TMB scope data can vary, and I see no good reasons
258  // not to determine it dynamically. -SV, 5 Nov 2008.
259  //currentPosition+=theTMBScope->sizeInWords();
260  currentPosition += (e05Line - b05Line + 1);
261  } else {
262  LogTrace("CSCTMBData|CSCRawToDigi") << "+++ CSCTMBData warning: found 0x6b05 line, but not 0x6e05! +++";
263  }
264  }
265 
267  if (buf[currentPosition] == 0x6b07) {
268  int Line6b07 = currentPosition;
269  LogTrace("CSCTMBData") << " TMBData ---> Begin of MiniScope found ";
270  int Line6E07 = findLine(buf, 0x6E07, currentPosition, TotTMBReadout - currentPosition);
271  if (Line6E07 != -1) {
272  LogTrace("CSCTMBData") << " TMBData --> End of MiniScope found " << Line6E07 - Line6b07 + 1 << " words ";
274  theTMBMiniScope = new CSCTMBMiniScope(buf, Line6b07, Line6E07);
275  currentPosition += (Line6E07 - Line6b07 + 1);
276  } else {
277  LogTrace("CSCTMBData") << "+++ CSCTMBData warning MiniScope!: found 0x6b07 line, but not 0x6e07! +++";
278  }
279  }
281 
283  if (buf[currentPosition] == 0x6BCB) {
284  int Line6BCB = currentPosition;
285  LogTrace("CSCTMBData") << " TMBData ---> Begin of Blocked CFEB found ";
286  int Line6ECB = findLine(buf, 0x6ECB, currentPosition, TotTMBReadout - currentPosition);
287  if (Line6ECB != -1) {
288  LogTrace("CSCTMBData") << " TMBData --> End of Blocked CFEB found " << Line6ECB - Line6BCB + 1 << " words ";
290  theTMBBlockedCFEB = new CSCTMBBlockedCFEB(buf, Line6BCB, Line6ECB);
291  currentPosition += (Line6ECB - Line6BCB + 1);
292  } else {
293  LogTrace("CSCTMBData") << "+++ CSCTMBData warning Blocked CFEB!: found 0x6BCB line, but not 0x6ECB! +++";
294  }
295  }
297 
298  int maxLine = findLine(buf, 0xde0f, currentPosition, TotTMBReadout - currentPosition);
299  if (maxLine == -1) {
300  LogTrace("CSCTMBData|CSCRawToDigi") << "+++ CSCTMBData warning: No e0f line!";
301  return 0;
302  }
303 
304  //Now for CRC check put this information into bitset
305 
306  theB0CLine = b0cLine;
307  theE0FLine = maxLine;
308 
309  // finally, the trailer
310  int e0cLine = findLine(buf, 0x6e0c, currentPosition, maxLine);
311  if (e0cLine == -1) {
312  LogTrace("CSCTMBData|CSCRawToDigi") << "+++ CSCTMBData warning: No e0c line!";
313  } else {
315  LogTrace("CSCTMBData|CSCRawToDigi") << "TMB trailer size: " << theTMBTrailer.sizeInWords();
316  }
317 
318  checkSize();
319 
320  // Dump of TMB; format proposed by JK.
321 #ifdef TMBDUMP
322  LogTrace("CSCTMBData") << "Dump of TMB data:";
323  for (int line = b0cLine; line <= maxLine + 3; line++) {
324  LogTrace("CSCTMBData") << "Adr= " << std::setw(4) << line << " Data= " << std::setfill('0') << std::setw(5)
325  << std::uppercase << std::hex << buf[line] << std::dec << std::endl;
326  }
327 #endif
328 
329  // size, since we count from 0 and have one more trailer word
330  // there are sometimes multiple "de0f" lines in trailer, so key on "6e0c"
331  return e0cLine - b0cLine + theTMBTrailer.sizeInWords();
332 } //UnpackTMB

References visDQMUpload::buf, CSCComparatorData::check(), CSCTMBHeader::check(), checkSize(), TauDecayModes::dec, findLine(), simCaloStage2Layer1Digis_cfi::firmwareVersion, CSCTMBHeader::FirmwareVersion(), mps_splice::line, LogTrace, CSCTMBHeader::NCFEBs(), CSCTMBHeader::NTBins(), CSCRPCData::sizeInWords(), CSCComparatorData::sizeInWords(), CSCTMBTrailer::sizeInWords(), CSCTMBHeader::sizeInWords(), theB0CLine, theBlockedCFEBIsPresent, theComparatorData, theE0FLine, theRPCData, theRPCDataIsPresent, theTMBBlockedCFEB, theTMBHeader, theTMBMiniScope, theTMBMiniScopeIsPresent, theTMBScope, theTMBScopeIsPresent, and theTMBTrailer.

Referenced by CSCTMBData().

Member Data Documentation

◆ cWordCnt

unsigned short CSCTMBData::cWordCnt
private

Definition at line 98 of file CSCTMBData.h.

Referenced by CWordCnt().

◆ debug

std::atomic< bool > CSCTMBData::debug {false}
staticprivate

◆ size_

unsigned short CSCTMBData::size_
private

Definition at line 97 of file CSCTMBData.h.

Referenced by CSCTMBData(), and size().

◆ theB0CLine

unsigned CSCTMBData::theB0CLine
private

CRC calc needs to know where 0x6B0C and 0x6E0F lines were we want to put off CRC calc until needed

Definition at line 73 of file CSCTMBData.h.

Referenced by TMBCRCcalc(), and UnpackTMB().

◆ theBlockedCFEBIsPresent

bool CSCTMBData::theBlockedCFEBIsPresent
private

Definition at line 88 of file CSCTMBData.h.

Referenced by CSCTMBData(), hasTMBBlockedCFEB(), tmbBlockedCFEB(), UnpackTMB(), and ~CSCTMBData().

◆ theComparatorData

CSCComparatorData CSCTMBData::theComparatorData
private

Definition at line 77 of file CSCTMBData.h.

Referenced by comparatorData(), CSCTMBData(), pack(), and UnpackTMB().

◆ theE0FLine

unsigned CSCTMBData::theE0FLine
private

Definition at line 74 of file CSCTMBData.h.

Referenced by TMBCRCcalc(), and UnpackTMB().

◆ theOriginalBuffer

const uint16_t* CSCTMBData::theOriginalBuffer
private

@ not sure what this means for simulation. I keep this around so we can calculate CRCs

Definition at line 70 of file CSCTMBData.h.

Referenced by TMBCRCcalc().

◆ theRPCData

CSCRPCData CSCTMBData::theRPCData
private

Definition at line 78 of file CSCTMBData.h.

Referenced by rpcData(), and UnpackTMB().

◆ theRPCDataIsPresent

bool CSCTMBData::theRPCDataIsPresent
private

Definition at line 99 of file CSCTMBData.h.

Referenced by hasRPC(), and UnpackTMB().

◆ theTMBBlockedCFEB

CSCTMBBlockedCFEB* CSCTMBData::theTMBBlockedCFEB
private

Definition at line 89 of file CSCTMBData.h.

Referenced by CSCTMBData(), tmbBlockedCFEB(), UnpackTMB(), and ~CSCTMBData().

◆ theTMBHeader

CSCTMBHeader CSCTMBData::theTMBHeader
private

Definition at line 76 of file CSCTMBData.h.

Referenced by CSCTMBData(), pack(), tmbHeader(), and UnpackTMB().

◆ theTMBMiniScope

CSCTMBMiniScope* CSCTMBData::theTMBMiniScope
private

Definition at line 86 of file CSCTMBData.h.

Referenced by CSCTMBData(), tmbMiniScope(), UnpackTMB(), and ~CSCTMBData().

◆ theTMBMiniScopeIsPresent

bool CSCTMBData::theTMBMiniScopeIsPresent
private

The TMB MiniScope must presen in every event, hovewer make it dynamic as for the main scope

Definition at line 85 of file CSCTMBData.h.

Referenced by CSCTMBData(), hasTMBMiniScope(), tmbMiniScope(), UnpackTMB(), and ~CSCTMBData().

◆ theTMBScope

CSCTMBScope* CSCTMBData::theTMBScope
private

Definition at line 81 of file CSCTMBData.h.

Referenced by CSCTMBData(), tmbScope(), UnpackTMB(), and ~CSCTMBData().

◆ theTMBScopeIsPresent

bool CSCTMBData::theTMBScopeIsPresent
private

The TMB scope is not present in most of data hence its dynamic.

Definition at line 80 of file CSCTMBData.h.

Referenced by CSCTMBData(), hasTMBScope(), tmbScope(), UnpackTMB(), and ~CSCTMBData().

◆ theTMBTrailer

CSCTMBTrailer CSCTMBData::theTMBTrailer
private

Definition at line 91 of file CSCTMBData.h.

Referenced by CSCTMBData(), getCRC(), pack(), tmbTrailer(), and UnpackTMB().

CSCTMBBlockedCFEB
Definition: CSCTMBBlockedCFEB.h:13
CSCTMBData::theTMBTrailer
CSCTMBTrailer theTMBTrailer
Definition: CSCTMBData.h:91
mps_fire.i
i
Definition: mps_fire.py:428
CSCTMBHeader::FirmwareVersion
int FirmwareVersion() const
Definition: CSCTMBHeader.h:35
CSCTMBData::size_
unsigned short size_
Definition: CSCTMBData.h:97
CSCComparatorData::sizeInWords
int sizeInWords() const
in 16-bit words
Definition: CSCComparatorData.h:41
CSCTMBData::theTMBScope
CSCTMBScope * theTMBScope
Definition: CSCTMBData.h:81
CSCTMBData::checkSize
bool checkSize() const
sees if the size adds up to the word count
Definition: CSCTMBData.cc:334
pos
Definition: PixelAliasList.h:18
CSCTMBScope
Definition: CSCTMBScope.h:15
CSCTMBData::theBlockedCFEBIsPresent
bool theBlockedCFEBIsPresent
Definition: CSCTMBData.h:88
bitset_utilities::append
boost::dynamic_bitset append(const boost::dynamic_bitset<> &bs1, const boost::dynamic_bitset<> &bs2)
this method takes two bitsets bs1 and bs2 and returns result of bs2 appended to the end of bs1
Definition: bitset_append.cc:10
CSCTMBData::tmbTrailer
CSCTMBTrailer * tmbTrailer()
Definition: CSCTMBData.h:50
CSCTMBData::theTMBMiniScopeIsPresent
bool theTMBMiniScopeIsPresent
Definition: CSCTMBData.h:85
CSCTMBData::theRPCDataIsPresent
bool theRPCDataIsPresent
Definition: CSCTMBData.h:99
CSCTMBData::theTMBHeader
CSCTMBHeader theTMBHeader
Definition: CSCTMBData.h:76
CSCTMBData::calCRC22
std::bitset< 22 > calCRC22(const std::vector< std::bitset< 16 > > &datain)
Definition: CSCTMBData.cc:339
word
uint64_t word
Definition: CTPPSTotemDataFormatter.cc:29
simCaloStage2Layer1Digis_cfi.firmwareVersion
firmwareVersion
Definition: simCaloStage2Layer1Digis_cfi.py:21
CSCTMBTrailer::data
unsigned short * data()
Definition: CSCTMBTrailer.h:43
CSCTMBData::cWordCnt
unsigned short cWordCnt
Definition: CSCTMBData.h:98
CSCTMBData::theTMBBlockedCFEB
CSCTMBBlockedCFEB * theTMBBlockedCFEB
Definition: CSCTMBData.h:89
CSCTMBData::nextCRC22_D16
std::bitset< 22 > nextCRC22_D16(const std::bitset< 16 > &D, const std::bitset< 22 > &C)
Definition: CSCTMBData.cc:366
CSCComparatorData::check
bool check() const
Definition: CSCComparatorData.cc:296
CSCTMBHeader::NTBins
uint16_t NTBins() const
Definition: CSCTMBHeader.h:57
CSCTMBData::theTMBMiniScope
CSCTMBMiniScope * theTMBMiniScope
Definition: CSCTMBData.h:86
CSCTMBHeader::NCFEBs
uint16_t NCFEBs() const
Definition: CSCTMBHeader.h:58
CSCTMBData::theTMBScopeIsPresent
bool theTMBScopeIsPresent
The TMB scope is not present in most of data hence its dynamic.
Definition: CSCTMBData.h:80
CSCTMBData::comparatorData
CSCComparatorData * comparatorData()
Definition: CSCTMBData.h:40
CSCTMBTrailer
Definition: CSCTMBTrailer.h:28
findLine
int findLine(const uint16_t *buf, uint16_t marker, int first, int maxToDo)
Definition: CSCTMBData.cc:128
CSCTMBData::theComparatorData
CSCComparatorData theComparatorData
Definition: CSCTMBData.h:77
CSCTMBData
Definition: CSCTMBData.h:24
RawDataTask_cfi.CRC
CRC
Definition: RawDataTask_cfi.py:59
CSCTMBData::UnpackTMB
int UnpackTMB(const uint16_t *buf)
Definition: CSCTMBData.cc:154
CSCTMBHeader::check
bool check() const
Definition: CSCTMBHeader.h:86
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
CSCTMBData::theOriginalBuffer
const uint16_t * theOriginalBuffer
Definition: CSCTMBData.h:70
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
CSCTMBMiniScope
Definition: CSCTMBMiniScope.h:14
CSCTMBHeader
Definition: CSCTMBHeader.h:26
funct::D
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
gen::C
C
Definition: PomwigHadronizer.cc:78
CSCTMBTrailer::crc22
unsigned int crc22() const
Definition: CSCTMBTrailer.cc:51
bitset_utilities::ushortToBitset
boost::dynamic_bitset ushortToBitset(const unsigned int numberOfBits, unsigned short *buf)
this method takes numberOfBits bits from unsigned short * array and returns them in the bitset obj.
Definition: bitset_append.cc:23
relativeConstraints.value
value
Definition: relativeConstraints.py:53
CSCComparatorData::data
unsigned short * data()
Definition: CSCComparatorData.h:39
CSCTMBTrailer::setCRC
void setCRC(int crc)
Definition: CSCTMBTrailer.cc:55
cscClassPackerCompare
bool cscClassPackerCompare(T &t)
Definition: cscPackerCompare.h:31
CSCTMBHeader::setNCFEBs
void setNCFEBs(uint16_t ncfebs)
Definition: CSCTMBHeader.h:65
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
CSCTMBData::theB0CLine
unsigned theB0CLine
Definition: CSCTMBData.h:73
mps_fire.result
result
Definition: mps_fire.py:311
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
CSCRPCData::sizeInWords
int sizeInWords()
Definition: CSCRPCData.h:21
CSCTMBHeader::sizeInWords
unsigned short int sizeInWords() const
Definition: CSCTMBHeader.h:77
mps_splice.line
line
Definition: mps_splice.py:76
CSCTMBHeader::data
unsigned short * data()
Definition: CSCTMBHeader.h:81
CSCTMBData::theE0FLine
unsigned theE0FLine
Definition: CSCTMBData.h:74
CSCTMBTrailer::sizeInWords
int sizeInWords() const
in 16-bit frames
Definition: CSCTMBTrailer.h:42
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
CSCTMBData::theRPCData
CSCRPCData theRPCData
Definition: CSCTMBData.h:78
CSCTMBData::debug
static std::atomic< bool > debug
Definition: CSCTMBData.h:95
CSCRPCData
Definition: CSCRPCData.h:11
CSCComparatorData
Definition: CSCComparatorData.h:24