CMS 3D CMS Logo

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

#include <CSCALCTHeader.h>

Public Types

enum  FIFO_MODE { NO_DUMP, FULL_DUMP, LOCAL_DUMP }
 

Public Member Functions

unsigned short int ActiveFEBs () const
 
void add (const std::vector< CSCALCTDigi > &digis)
 
void addShower (const std::vector< CSCShowerDigi > &digis)
 Add Run3 ALCT HMT shower bits. More...
 
std::vector< CSCALCTDigiALCTDigis () const
 
unsigned short int alctFirmwareRevision () const
 
unsigned short int alctFirmwareVersion () const
 
CSCALCTHeader2006 alctHeader2006 () const
 
CSCALCTHeader2007 alctHeader2007 () const
 
std::vector< unsigned short int > alctHMTs () const
 
std::vector< CSCShowerDigialctShowerDigis () const
 
unsigned short int BoardID () const
 
unsigned short int BXNCount () const
 
bool check () const
 
 CSCALCTHeader (int chamberType)
 
 CSCALCTHeader (const unsigned short *buf)
 for packing More...
 
 CSCALCTHeader (const CSCALCTStatusDigi &digi)
 
unsigned short int CSCID () const
 
unsigned short int * data ()
 
unsigned short int ExtTrig () const
 
unsigned short int FIFOMode () const
 
unsigned short int L1Acc () const
 
unsigned short int L1AMatch () const
 
unsigned short int LCTChipRead () const
 
unsigned short int nLCTChipRead () const
 for packing More...
 
unsigned short int NTBins () const
 
boost::dynamic_bitset pack ()
 
unsigned short int Promote1 () const
 
unsigned short int Promote2 () const
 
void setBXNCount (unsigned int bxn)
 
void setDAVForChannel (int wireGroup)
 
void setEventInformation (const CSCDMBHeader &)
 
void setL1Acc (unsigned int l1a)
 
int sizeInWords ()
 in 16-bit words More...
 

Static Public Member Functions

static void selfTest (int firmware)
 tests that we unpack what we packed More...
 
static void setDebug (bool value)
 to access data by via status digis More...
 

Private Attributes

CSCALCTs2006 alcts2006
 
unsigned short int bxn0
 
unsigned short int bxn1
 
std::vector< CSCCollisionMaskcollisionMasks
 
CSCConfigurationRegister configRegister
 
CSCALCTHeader2006 header2006
 
CSCALCTHeader2007 header2007
 
std::vector< CSCHotChannelMaskhotChannelMasks
 
unsigned short int sizeInWords2007_
 size of the 2007 header in words More...
 
std::vector< CSCALCTtheALCTs
 
unsigned short int theOriginalBuffer [116]
 
CSCVirtexID virtexID
 

Static Private Attributes

static std::atomic< bool > debug {false}
 
static std::atomic< unsigned short int > firmwareVersion {2007}
 

Detailed Description

documented in flags http://www.phys.ufl.edu/~madorsky/alctv/alct2000_spec.PDF

Definition at line 22 of file CSCALCTHeader.h.

Member Enumeration Documentation

◆ FIFO_MODE

some accessors here are only applicable to 2006 header some to both 2006 and 2007

Enumerator
NO_DUMP 
FULL_DUMP 
LOCAL_DUMP 

Definition at line 41 of file CSCALCTHeader.h.

Constructor & Destructor Documentation

◆ CSCALCTHeader() [1/3]

CSCALCTHeader::CSCALCTHeader ( int  chamberType)
explicit

Definition at line 22 of file CSCALCTHeader.cc.

References firmwareVersion, header2006, header2007, CSCALCTHeader2007::lctBins, CSCALCTHeader2006::sizeInWords(), CSCALCT::sizeInWords(), CSCALCTHeader2007::sizeInWords(), sizeInWords2007_, theALCTs, and theOriginalBuffer.

Referenced by CSCALCTHeader().

23  : header2006(chamberType), header2007(chamberType) { //constructor for digi->raw packing based on header2006
24  if (firmwareVersion == 2006) {
26  } else if (firmwareVersion == 2007) {
28  // assume no virtex or masks or registers
30  theALCTs.resize(header2007.lctBins * 2);
31  } else {
32  edm::LogError("CSCALCTHeader|CSCRawToDigi")
33  << "Cannot construct ALCT header: ALCT firmware version is bad/not defined!" << firmwareVersion;
34  }
35 }
Log< level::Error, false > LogError
static std::atomic< unsigned short int > firmwareVersion
unsigned short int theOriginalBuffer[116]
CSCALCTHeader2006 header2006
static short unsigned int sizeInWords()
std::vector< CSCALCT > theALCTs
short unsigned int sizeInWords() const
CSCALCTHeader2007 header2007
unsigned short int sizeInWords2007_
size of the 2007 header in words
short unsigned int sizeInWords() const
for packing

◆ CSCALCTHeader() [2/3]

CSCALCTHeader::CSCALCTHeader ( const unsigned short *  buf)
explicit

for packing

collision and hot channel masks are variable sized the sizes vary depending on type of the ALCT board number of words for various alct board types: 1 2 3 5 6







first determine the correct format

Now fill data

the header part

the alct0 and alct1

the fixed sized header part

now come the variable parts

2007 has LCTbins * 2 alct words

also store raw data buffer too; it is later returned by data() method

Definition at line 37 of file CSCALCTHeader.cc.

References ALCTDigis(), alcts2006, CSCALCTHeader2007::boardType, visDQMUpload::buf, collisionMasks, CSCALCTHeader2007::configPresent, configRegister, firmwareVersion, header2006, header2007, hotChannelMasks, mps_fire::i, CSCALCTHeader2007::lctBins, LogTrace, CSCALCTHeader2006::setFromBuffer(), CSCALCTHeader2007::setFromBuffer(), CSCALCTs2006::setFromBuffer(), CSCVirtexID::setFromBuffer(), CSCConfigurationRegister::setFromBuffer(), CSCALCTHeader2006::sizeInWords(), CSCALCTHeader2007::sizeInWords(), CSCALCTs2006::sizeInWords(), CSCVirtexID::sizeInWords(), CSCConfigurationRegister::sizeInWords(), sizeInWords(), sizeInWords2007_, theALCTs, theOriginalBuffer, and virtexID.

37  {
42  constexpr unsigned short int collisionMaskWordcount[7] = {8, 8, 12, 16, 16, 24, 28};
43  constexpr unsigned short int hotChannelMaskWordcount[7] = {18, 18, 24, 36, 36, 48, 60};
44 
46  if (buf[0] == 0xDB0A) {
47  firmwareVersion = 2007;
48  } else if ((buf[0] & 0xF800) == 0x6000) {
49  firmwareVersion = 2006;
50  } else {
51  edm::LogError("CSCALCTHeader|CSCRawToDigi") << "failed to determine ALCT firmware version!!";
52  }
53 
54  LogTrace("CSCALCTHeader|CSCRawToDigi") << "firmware version - " << firmwareVersion;
55 
57 #ifdef LOCAL_UNPACK
58  switch (firmwareVersion) {
59 #else
60  switch (firmwareVersion.load()) {
61 #endif
62  case 2006:
67  break;
68 
69  case 2007:
74  if (header2007.configPresent == 1) {
81 
82  collisionMasks.resize(collisionMaskWordcount[header2007.boardType]);
83  for (unsigned int i = 0; i < collisionMaskWordcount[header2007.boardType]; ++i) {
84  collisionMasks[i].setFromBuffer(buf);
85  buf += collisionMasks[i].sizeInWords();
86  sizeInWords2007_ += collisionMasks[i].sizeInWords();
87  }
88 
89  hotChannelMasks.resize(hotChannelMaskWordcount[header2007.boardType]);
90  for (unsigned int i = 0; i < hotChannelMaskWordcount[header2007.boardType]; ++i) {
91  hotChannelMasks[i].setFromBuffer(buf);
92  buf += hotChannelMasks[i].sizeInWords();
93  sizeInWords2007_ += hotChannelMasks[i].sizeInWords();
94  }
95  }
96 
97  theALCTs.resize(header2007.lctBins * 2);
98  for (int i = 0; i < header2007.lctBins * 2; ++i) {
99  theALCTs[i].setFromBuffer(buf);
100  buf += theALCTs[i].sizeInWords();
101  sizeInWords2007_ += theALCTs[i].sizeInWords();
102  }
103 
104  ALCTDigis();
105  break;
106 
107  default:
108  edm::LogError("CSCALCTHeader|CSCRawToDigi") << "couldn't construct: ALCT firmware version is bad/not defined!";
109  break;
110  }
111 
113  if ((firmwareVersion == 2006) || (firmwareVersion == 2007))
114  memcpy(theOriginalBuffer, buf - sizeInWords(), sizeInWords() * 2);
115 }
std::vector< CSCHotChannelMask > hotChannelMasks
std::vector< CSCCollisionMask > collisionMasks
CSCVirtexID virtexID
CSCConfigurationRegister configRegister
CSCALCTs2006 alcts2006
Log< level::Error, false > LogError
void setFromBuffer(unsigned short const *buf)
static std::atomic< unsigned short int > firmwareVersion
#define LogTrace(id)
unsigned short int theOriginalBuffer[116]
CSCALCTHeader2006 header2006
void setFromBuffer(unsigned short const *buf)
std::vector< CSCALCT > theALCTs
short unsigned int sizeInWords() const
CSCALCTHeader2007 header2007
void setFromBuffer(unsigned short const *buf)
short unsigned int sizeInWords() const
unsigned short int sizeInWords2007_
size of the 2007 header in words
int sizeInWords()
in 16-bit words
void setFromBuffer(unsigned short const *buf)
std::vector< CSCALCTDigi > ALCTDigis() const
short unsigned int sizeInWords() const
short unsigned int sizeInWords() const
for packing
void setFromBuffer(unsigned short const *buf)
short unsigned int sizeInWords() const

◆ CSCALCTHeader() [3/3]

CSCALCTHeader::CSCALCTHeader ( const CSCALCTStatusDigi digi)

Definition at line 117 of file CSCALCTHeader.cc.

References CSCALCTHeader(), and CSCALCTStatusDigi::header().

117 { CSCALCTHeader(digi.header()); }
CSCALCTHeader(int chamberType)
const uint16_t * header() const
Data Accessors.

Member Function Documentation

◆ ActiveFEBs()

unsigned short int CSCALCTHeader::ActiveFEBs ( ) const
inline

Definition at line 134 of file CSCALCTHeader.h.

References CSCALCTHeader2006::activeFEBs, and header2006.

134 { return header2006.activeFEBs; }
CSCALCTHeader2006 header2006
unsigned activeFEBs
LCT chips with ADB hits.

◆ add()

void CSCALCTHeader::add ( const std::vector< CSCALCTDigi > &  digis)

Definition at line 189 of file CSCALCTHeader.cc.

References CSCALCTs2006::add(), alcts2006, simKBmtfDigis_cfi::bx, firmwareVersion, header2007, mps_fire::i, CSCALCTHeader2007::lctBins, theALCTs, and validateGeometry_cfg::valid.

Referenced by CSCEventData::add(), check(), counter.Counter::register(), SequenceTypes._TaskBase::remove(), SequenceTypes._TaskBase::replace(), and selfTest().

189  {
190  if (firmwareVersion == 2006) {
191  alcts2006.add(digis);
192  } else if (firmwareVersion == 2007) {
193  if (theALCTs.empty()) {
194  theALCTs.resize(header2007.lctBins * 2);
195  }
196  for (std::vector<CSCALCTDigi>::const_iterator digi = digis.begin(); digi != digis.end(); ++digi) {
197  int bx = digi->getBX();
198  if (bx < (int)header2007.lctBins) {
199  // 2 ALCTs per bx
200  int i = bx * 2;
201  int q1 = theALCTs[i].quality;
202  int q2 = theALCTs[i + 1].quality;
203  // see if it's non=blank
204  if (!theALCTs[i].valid) {
205  theALCTs[i] = CSCALCT(*digi);
206  }
207  // new best LCT
208  else if (digi->getQuality() > q1) {
209  theALCTs[i + 1] = theALCTs[i];
210  theALCTs[i] = CSCALCT(*digi);
211  }
212  // new second best
213  else if (!theALCTs[i + 1].valid || (digi->getQuality() > q2)) {
214  theALCTs[i + 1] = CSCALCT(*digi);
215  }
216  }
217  }
218  }
219 }
CSCALCTs2006 alcts2006
static std::atomic< unsigned short int > firmwareVersion
std::vector< CSCALCT > theALCTs
CSCALCTHeader2007 header2007
void add(const std::vector< CSCALCTDigi > &digis)
should try to sort, but doesn&#39;t for now

◆ addShower()

void CSCALCTHeader::addShower ( const std::vector< CSCShowerDigi > &  digis)

Add Run3 ALCT HMT shower bits.

Add ALCT anodes HMT shower bits per ALCT BX.

Definition at line 222 of file CSCALCTHeader.cc.

References CSCShowerDigi::bitsInTime(), simKBmtfDigis_cfi::bx, firmwareVersion, header2007, mps_fire::i, CSCShowerDigi::isValid(), CSCALCTHeader2007::lctBins, and theALCTs.

Referenced by CSCEventData::addAnodeALCTShower(), and check().

222  {
223  if (firmwareVersion == 2007) {
224  if (theALCTs.empty()) {
225  theALCTs.resize(header2007.lctBins * 2);
226  }
227  for (std::vector<CSCShowerDigi>::const_iterator digi = digis.begin(); digi != digis.end(); ++digi) {
228  int bx = digi - digis.begin();
229  if (bx < (int)header2007.lctBins) {
230  const CSCShowerDigi &digi = digis[bx];
231  int i = bx * 2;
232  unsigned hmt_bits = digi.isValid() ? digi.bitsInTime() : 0;
233  theALCTs[i].reserved = hmt_bits & 0x3;
234  theALCTs[i + 1].reserved = hmt_bits & 0x3;
235  }
236  }
237  }
238 }
bool isValid() const
data
static std::atomic< unsigned short int > firmwareVersion
std::vector< CSCALCT > theALCTs
CSCALCTHeader2007 header2007
uint16_t bitsInTime() const
Definition: CSCShowerDigi.h:48

◆ ALCTDigis()

std::vector< CSCALCTDigi > CSCALCTHeader::ALCTDigis ( ) const

loop over all alct words

Definition at line 152 of file CSCALCTHeader.cc.

References CSCALCTs2006::ALCTDigis(), alcts2006, BXNCount(), firmwareVersion, mps_fire::i, topSingleLeptonDQM_PU_cfi::pattern, quality, mps_fire::result, theALCTs, and validateGeometry_cfg::valid.

Referenced by CSCALCTHeader(), cscdqm::EventProcessor::processCSC(), and CSCEventData::unpack_data().

152  {
153  std::vector<CSCALCTDigi> result;
154 
155 #ifdef LOCAL_UNPACK
156  switch (firmwareVersion) {
157 #else
158  switch (firmwareVersion.load()) {
159 #endif
160  case 2006: {
162  break;
163  }
164  case 2007: {
165  result.reserve(theALCTs.size());
166  for (unsigned int i = 0; i < theALCTs.size(); ++i) {
167  CSCALCTDigi digi(theALCTs[i].valid,
168  theALCTs[i].quality,
169  theALCTs[i].accel,
170  theALCTs[i].pattern,
171  theALCTs[i].keyWire,
172  (int)i / 2,
173  i % 2 + 1);
174  result.push_back(digi);
175  }
176  break;
177  }
178  default:
179  edm::LogError("CSCALCTHeader|CSCRawToDigi")
180  << "Empty Digis: ALCT firmware version is bad/not defined!" << firmwareVersion;
181  break;
182  }
183  for (unsigned i = 0; i < result.size(); ++i) {
184  result[i].setFullBX(BXNCount());
185  }
186  return result;
187 }
CSCALCTs2006 alcts2006
Log< level::Error, false > LogError
static std::atomic< unsigned short int > firmwareVersion
string quality
std::vector< CSCALCT > theALCTs
std::vector< CSCALCTDigi > ALCTDigis() const
unsigned short int BXNCount() const
Definition: CSCALCTHeader.h:62

◆ alctFirmwareRevision()

unsigned short int CSCALCTHeader::alctFirmwareRevision ( ) const
inline

Definition at line 139 of file CSCALCTHeader.h.

References CSCALCTHeader2007::firmwareVersion, firmwareVersion, and header2007.

Referenced by cscdqm::EventProcessor::processCSC().

139  {
140 #ifdef LOCAL_UNPACK
141  switch (firmwareVersion) {
142 #else
143  switch (firmwareVersion.load()) {
144 #endif
145  case 2006:
146  return 0;
147  case 2007:
149  default:
150  edm::LogError("CSCALCTHeader|CSCRawToDigi")
151  << "trying to access ALCT firmware revision bits: ALCT firmware version is bad/not defined!";
152  return 0;
153  }
154  }
Log< level::Error, false > LogError
static std::atomic< unsigned short int > firmwareVersion
CSCALCTHeader2007 header2007

◆ alctFirmwareVersion()

unsigned short int CSCALCTHeader::alctFirmwareVersion ( ) const
inline

Definition at line 138 of file CSCALCTHeader.h.

References firmwareVersion.

Referenced by CSCEventData::checkALCTClasses(), and cscdqm::EventProcessor::processCSC().

138 { return firmwareVersion; }
static std::atomic< unsigned short int > firmwareVersion

◆ alctHeader2006()

CSCALCTHeader2006 CSCALCTHeader::alctHeader2006 ( ) const
inline

Definition at line 222 of file CSCALCTHeader.h.

References header2006.

222 { return header2006; }
CSCALCTHeader2006 header2006

◆ alctHeader2007()

CSCALCTHeader2007 CSCALCTHeader::alctHeader2007 ( ) const
inline

Definition at line 221 of file CSCALCTHeader.h.

References header2007.

221 { return header2007; }
CSCALCTHeader2007 header2007

◆ alctHMTs()

std::vector<unsigned short int> CSCALCTHeader::alctHMTs ( ) const
inline

Definition at line 187 of file CSCALCTHeader.h.

References simKBmtfDigis_cfi::bx, firmwareVersion, header2007, CSCALCTHeader2007::lctBins, mysort::results, and theALCTs.

187  {
188  std::vector<unsigned short int> results;
189  results.clear();
190 #ifdef LOCAL_UNPACK
191  switch (firmwareVersion) {
192 #else
193  switch (firmwareVersion.load()) {
194 #endif
195  case 2006:
196  return results;
197  case 2007:
198  // if (alctFirmwareRevision() >= 0) // TODO: Need ALCT Run3 firmware revision to properly detect presense of HMT bits in data format
199  // {
200  if ((!theALCTs.empty()) && (theALCTs.size() == unsigned(header2007.lctBins * 2))) {
201  for (unsigned bx = 0; bx < header2007.lctBins; bx++) {
202  results.push_back(theALCTs[bx * 2].reserved & 0x3);
203  }
204  return results;
205  } else
206  return results;
207  // } else return results;
208  default:
209  edm::LogError("CSCALCTHeader|CSCRawToDigi")
210  << "trying to access ALCT HMT bits: ALCT firmware version is bad/not defined!";
211  return results;
212  }
213  }
Log< level::Error, false > LogError
static std::atomic< unsigned short int > firmwareVersion
std::vector< CSCALCT > theALCTs
CSCALCTHeader2007 header2007
results
Definition: mysort.py:8

◆ alctShowerDigis()

std::vector<CSCShowerDigi> CSCALCTHeader::alctShowerDigis ( ) const
inline

Definition at line 156 of file CSCALCTHeader.h.

References simKBmtfDigis_cfi::bx, firmwareVersion, header2007, CSCALCTHeader2007::lctBins, mysort::results, and theALCTs.

Referenced by cscdqm::EventProcessor::processCSC().

156  {
157  std::vector<CSCShowerDigi> results;
158  results.clear();
159 #ifdef LOCAL_UNPACK
160  switch (firmwareVersion) {
161 #else
162  switch (firmwareVersion.load()) {
163 #endif
164  case 2006:
165  return results;
166  case 2007:
167  // if (alctFirmwareRevision() >= 0) // TODO: Need ALCT Run3 firmware revision to properly detect presense of HMT bits in data format
168  // {
169  if ((!theALCTs.empty()) && (theALCTs.size() == unsigned(header2007.lctBins * 2))) {
170  for (unsigned bx = 0; bx < header2007.lctBins; bx++) {
171  //CSCID is set to be 0
172  //ALCTshower, showerType_= 1, wireNHits and ComparatorNHits are not available in data
173  results.push_back(
174  CSCShowerDigi(theALCTs[bx * 2].reserved & 0x3, 0, 0, bx, CSCShowerDigi::ShowerType::kALCTShower, 0, 0));
175  }
176  return results;
177  } else
178  return results;
179  // } else return results;
180  default:
181  edm::LogError("CSCALCTHeader|CSCRawToDigi")
182  << "trying to access ALCT HMT Shower Digis bits: ALCT firmware version is bad/not defined!";
183  return results;
184  }
185  }
Log< level::Error, false > LogError
static std::atomic< unsigned short int > firmwareVersion
std::vector< CSCALCT > theALCTs
CSCALCTHeader2007 header2007
results
Definition: mysort.py:8

◆ BoardID()

unsigned short int CSCALCTHeader::BoardID ( ) const
inline

Definition at line 59 of file CSCALCTHeader.h.

References CSCALCTHeader2006::boardID, and header2006.

59 { return header2006.boardID; }
CSCALCTHeader2006 header2006
unsigned boardID
ALCT2000 board ID.

◆ BXNCount()

unsigned short int CSCALCTHeader::BXNCount ( ) const
inline

Definition at line 62 of file CSCALCTHeader.h.

References CSCALCTHeader2007::bxnCount, CSCALCTHeader2006::bxnCount, firmwareVersion, header2006, and header2007.

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

62  {
63 #ifdef LOCAL_UNPACK
64  switch (firmwareVersion) {
65 #else
66  switch (firmwareVersion.load()) {
67 #endif
68  case 2006:
69  return header2006.bxnCount;
70  case 2007:
71  return header2007.bxnCount;
72  default:
73  edm::LogError("CSCALCTHeader|CSCRawToDigi")
74  << "trying to access BXNcount: ALCT firmware version is bad/not defined!";
75  return 0;
76  }
77  }
unsigned bxnCount
full bunch crossing number
Log< level::Error, false > LogError
static std::atomic< unsigned short int > firmwareVersion
CSCALCTHeader2006 header2006
CSCALCTHeader2007 header2007

◆ check()

bool CSCALCTHeader::check ( ) const
inline

Definition at line 243 of file CSCALCTHeader.h.

References add(), addShower(), simCaloStage2Digis_cfi::firmware, firmwareVersion, CSCALCTHeader2007::flag1, CSCALCTHeader2006::flag_0, header2006, header2007, pack(), and selfTest().

Referenced by CSCEventData::unpack_data().

243  {
244 #ifdef LOCAL_UNPACK
245  switch (firmwareVersion) {
246 #else
247  switch (firmwareVersion.load()) {
248 #endif
249  case 2006:
250  return header2006.flag_0 == 0xC;
251  case 2007:
252  return header2007.flag1 == 0xDB0A;
253  default:
254  edm::LogError("CSCALCTHeader|CSCRawToDigi") << "check(): ALCT firmware version is bad/not defined!";
255  return false;
256  }
257  }
Log< level::Error, false > LogError
static std::atomic< unsigned short int > firmwareVersion
CSCALCTHeader2006 header2006
CSCALCTHeader2007 header2007
unsigned flag_0
should be &#39;01100&#39;, so it&#39;ll be a 6xxx in the ASCII dump

◆ CSCID()

unsigned short int CSCALCTHeader::CSCID ( ) const
inline

Definition at line 61 of file CSCALCTHeader.h.

References CSCALCTHeader2006::cscID, and header2006.

61 { return header2006.cscID; }
CSCALCTHeader2006 header2006
unsigned cscID
chamber ID number

◆ data()

unsigned short int* CSCALCTHeader::data ( )
inline

Definition at line 224 of file CSCALCTHeader.h.

References theOriginalBuffer.

Referenced by CSCEventData::pack(), pack(), and CSCEventData::unpack_data().

224 { return theOriginalBuffer; }
unsigned short int theOriginalBuffer[116]

◆ ExtTrig()

unsigned short int CSCALCTHeader::ExtTrig ( ) const
inline

Definition at line 60 of file CSCALCTHeader.h.

References CSCALCTHeader2006::extTrig, and header2006.

60 { return header2006.extTrig; }
unsigned extTrig
trigger source was external
CSCALCTHeader2006 header2006

◆ FIFOMode()

unsigned short int CSCALCTHeader::FIFOMode ( ) const
inline

Definition at line 42 of file CSCALCTHeader.h.

References CSCALCTHeader2006::fifoMode, and header2006.

42 { return header2006.fifoMode; }
unsigned fifoMode
see the FIFO_MODE enum
CSCALCTHeader2006 header2006

◆ L1Acc()

unsigned short int CSCALCTHeader::L1Acc ( ) const
inline

Definition at line 98 of file CSCALCTHeader.h.

References firmwareVersion, header2006, header2007, CSCALCTHeader2006::l1Acc, and CSCALCTHeader2007::l1aCounter.

Referenced by cscdqm::EventProcessor::processCSC().

98  {
99 #ifdef LOCAL_UNPACK
100  switch (firmwareVersion) {
101 #else
102  switch (firmwareVersion.load()) {
103 #endif
104  case 2006:
105  return header2006.l1Acc;
106  case 2007:
107  return header2007.l1aCounter;
108  default:
109  edm::LogError("CSCALCTHeader|CSCRawToDigi")
110  << "trying to access L1Acc: ALCT firmware version is bad/not defined!";
111  return 0;
112  }
113  }
Log< level::Error, false > LogError
static std::atomic< unsigned short int > firmwareVersion
CSCALCTHeader2006 header2006
CSCALCTHeader2007 header2007
unsigned l1Acc
l1 accept counter

◆ L1AMatch()

unsigned short int CSCALCTHeader::L1AMatch ( ) const
inline

Definition at line 133 of file CSCALCTHeader.h.

References header2006, and CSCALCTHeader2006::l1aMatch.

133 { return header2006.l1aMatch; }
CSCALCTHeader2006 header2006
unsigned l1aMatch
exteran L1A arrived in L1A window

◆ LCTChipRead()

unsigned short int CSCALCTHeader::LCTChipRead ( ) const
inline

Definition at line 137 of file CSCALCTHeader.h.

References header2006, and CSCALCTHeader2006::lctChipRead.

137 { return header2006.lctChipRead; }
CSCALCTHeader2006 header2006
unsigned lctChipRead
LCT chips read out in raw hit dump.

◆ nLCTChipRead()

unsigned short CSCALCTHeader::nLCTChipRead ( ) const

for packing

header2006 method

Definition at line 140 of file CSCALCTHeader.cc.

References firmwareVersion, header2006, and CSCALCTHeader2006::nLCTChipRead().

140  {
141  if (firmwareVersion == 2006) {
142  return header2006.nLCTChipRead();
143  } else {
144  // nLCTChip obsolete in ALCT2007 format (email Andrey K. & Victor B., 20.10.2008)
145  // and we don't think anyone makes uses of this call.
146  // edm::LogError("CSCALCTHeader|CSCRawToDigi")
147  // <<"How is nLCTChipRead() supposed to work for ALCTHeader2007?";
148  }
149  return 0;
150 }
static std::atomic< unsigned short int > firmwareVersion
unsigned short nLCTChipRead() const
CSCALCTHeader2006 header2006

◆ NTBins()

unsigned short int CSCALCTHeader::NTBins ( ) const
inline

Definition at line 43 of file CSCALCTHeader.h.

References firmwareVersion, header2006, header2007, CSCALCTHeader2006::nTBins, and CSCALCTHeader2007::rawBins.

43  {
44 #ifdef LOCAL_UNPACK
45  switch (firmwareVersion) {
46 #else
47  switch (firmwareVersion.load()) {
48 #endif
49  case 2006:
50  return header2006.nTBins;
51  case 2007:
52  return header2007.rawBins;
53  default:
54  edm::LogError("CSCALCTHeader|CSCRawToDigi")
55  << "trying to access NTBINs: ALCT firmware version is bad/not defined!";
56  return 0;
57  }
58  }
Log< level::Error, false > LogError
static std::atomic< unsigned short int > firmwareVersion
CSCALCTHeader2006 header2006
CSCALCTHeader2007 header2007
unsigned nTBins
of 25 ns time bins in the raw dump

◆ pack()

boost::dynamic_bitset CSCALCTHeader::pack ( )

Definition at line 240 of file CSCALCTHeader.cc.

References alcts2006, bitset_utilities::append(), bitset_utilities::bitsetToChar(), data(), firmwareVersion, RecoTauValidation_cfi::header, header2006, header2007, mps_fire::i, mps_fire::result, CSCALCTHeader2006::sizeInWords(), CSCALCTHeader2007::sizeInWords(), CSCALCTs2006::sizeInWords(), sizeInWords(), theALCTs, and bitset_utilities::ushortToBitset().

Referenced by check(), and CSCEventData::pack().

240  {
241  boost::dynamic_bitset<> result;
242  if (firmwareVersion == 2006) {
243  boost::dynamic_bitset<> header =
245  boost::dynamic_bitset<> alcts =
248 
249  bitset_utilities::bitsetToChar(result, (unsigned char *)data());
250  }
251 
252  else if (firmwareVersion == 2007) {
254 
255  for (unsigned i = 0; i < theALCTs.size(); ++i) {
256  boost::dynamic_bitset<> alct =
257  bitset_utilities::ushortToBitset(theALCTs[i].sizeInWords() * 16, (unsigned short *)&theALCTs[i]);
259  }
260 
261  bitset_utilities::bitsetToChar(result, (unsigned char *)data());
262  }
263  return result;
264 }
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 ...
CSCALCTs2006 alcts2006
static std::atomic< unsigned short int > firmwareVersion
CSCALCTHeader2006 header2006
std::vector< CSCALCT > theALCTs
short unsigned int sizeInWords() const
CSCALCTHeader2007 header2007
short unsigned int sizeInWords() const
int sizeInWords()
in 16-bit words
void bitsetToChar(const boost::dynamic_bitset<> &bs, unsigned char *result)
this method takes bitset obj and returns char * array
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...
short unsigned int sizeInWords() const
for packing
unsigned short int * data()

◆ Promote1()

unsigned short int CSCALCTHeader::Promote1 ( ) const
inline

Definition at line 135 of file CSCALCTHeader.h.

References header2006, and CSCALCTHeader2006::promote1.

135 { return header2006.promote1; }
unsigned promote1
promotion bit for 1st LCT pattern
CSCALCTHeader2006 header2006

◆ Promote2()

unsigned short int CSCALCTHeader::Promote2 ( ) const
inline

Definition at line 136 of file CSCALCTHeader.h.

References header2006, and CSCALCTHeader2006::promote2.

136 { return header2006.promote2; }
CSCALCTHeader2006 header2006
unsigned promote2
promotion bit for 2nd LCT pattern

◆ selfTest()

void CSCALCTHeader::selfTest ( int  firmware)
static

tests that we unpack what we packed

Definition at line 266 of file CSCALCTHeader.cc.

References add(), cms::cuda::assert(), simCaloStage2Digis_cfi::firmware, firmwareVersion, CSCDetId::iChamberType(), and relativeConstraints::station.

Referenced by check().

266  {
268  CSCALCTDigi alct0(true, 1, 1, 1, 10, 6, 1);
269  CSCALCTDigi alct1(true, 1, 1, 0, 11, 6, 2);
270 
271  // tests packing and unpacking
272  for (int station = 1; station <= 4; ++station) {
273  CSCDetId detId(1, station, 1, 1, 0);
274 
275  std::vector<CSCALCTDigi> oldAlcts;
276  oldAlcts.push_back(alct0);
277  oldAlcts.push_back(alct1);
278  CSCALCTHeader alctHeader(detId.iChamberType());
279 
280  alctHeader.add(oldAlcts);
281 
282  std::vector<CSCALCTDigi> alcts = alctHeader.ALCTDigis();
283  // pick out the valid ones
284  std::vector<CSCALCTDigi> validALCTs;
285  for (std::vector<CSCALCTDigi>::const_iterator alctItr = alcts.begin(); alctItr != alcts.end(); ++alctItr) {
286  if (alctItr->isValid()) {
287  validALCTs.push_back(*alctItr);
288  }
289  }
290  assert(validALCTs[0] == alct0);
291  assert(validALCTs[1] == alct1);
292  //cscClassPackerCompare(alctHeader);
293  }
294 }
assert(be >=bs)
static std::atomic< unsigned short int > firmwareVersion
void add(const std::vector< CSCALCTDigi > &digis)

◆ setBXNCount()

void CSCALCTHeader::setBXNCount ( unsigned int  bxn)
inline

Definition at line 79 of file CSCALCTHeader.h.

References CSCALCTHeader2007::bxnCount, CSCALCTHeader2006::bxnCount, firmwareVersion, header2006, and header2007.

Referenced by CSCEventData::add().

79  {
80 #ifdef LOCAL_UNPACK
81  switch (firmwareVersion) {
82 #else
83  switch (firmwareVersion.load()) {
84 #endif
85  case 2006:
86  header2006.bxnCount = bxn % 0xFFF;
87  break;
88  case 2007:
89  header2007.bxnCount = bxn % 0xFFF;
90  break;
91  default:
92  edm::LogError("CSCALCTHeader|CSCRawToDigi")
93  << "trying to set BXNcount: ALCT firmware version is bad/not defined!";
94  break;
95  }
96  }
unsigned bxnCount
full bunch crossing number
Log< level::Error, false > LogError
static std::atomic< unsigned short int > firmwareVersion
CSCALCTHeader2006 header2006
CSCALCTHeader2007 header2007

◆ setDAVForChannel()

void CSCALCTHeader::setDAVForChannel ( int  wireGroup)
inline

Definition at line 215 of file CSCALCTHeader.h.

References firmwareVersion, header2006, and CSCALCTHeader2006::setDAV().

Referenced by CSCEventData::add().

215  {
216  if (firmwareVersion == 2006) {
217  header2006.setDAV((wireGroup - 1) / 16);
218  }
219  }
static std::atomic< unsigned short int > firmwareVersion
CSCALCTHeader2006 header2006
void setDAV(int afebBoard)
for packing

◆ setDebug()

static void CSCALCTHeader::setDebug ( bool  value)
inlinestatic

to access data by via status digis

turns on the debug flag for this class

Definition at line 31 of file CSCALCTHeader.h.

References debug, and relativeConstraints::value.

Referenced by CSCDCCUnpacker::CSCDCCUnpacker().

31 { debug = value; };
static std::atomic< bool > debug

◆ setEventInformation()

void CSCALCTHeader::setEventInformation ( const CSCDMBHeader dmb)

Definition at line 119 of file CSCALCTHeader.cc.

References firmwareVersion, header2006, header2007, CSCALCTHeader2006::setEventInformation(), and CSCALCTHeader2007::setEventInformation().

Referenced by CSCEventData::checkALCTClasses(), and CSCEventData::setEventInformation().

119  {
120 #ifdef LOCAL_UNPACK
121  switch (firmwareVersion) {
122 #else
123  switch (firmwareVersion.load()) {
124 #endif
125  case 2006: {
127  break;
128  }
129  case 2007: {
131  break;
132  }
133  default:
134  edm::LogError("CSCALCTHeader|CSCRawToDigi")
135  << "setEventInformation: ALCT firmware version is bad/not defined!" << firmwareVersion;
136  break;
137  }
138 }
Log< level::Error, false > LogError
static std::atomic< unsigned short int > firmwareVersion
void setEventInformation(const CSCDMBHeader &)
CSCALCTHeader2006 header2006
CSCALCTHeader2007 header2007
void setEventInformation(const CSCDMBHeader &)

◆ setL1Acc()

void CSCALCTHeader::setL1Acc ( unsigned int  l1a)
inline

Definition at line 115 of file CSCALCTHeader.h.

References firmwareVersion, header2006, header2007, CSCALCTHeader2006::l1Acc, and CSCALCTHeader2007::l1aCounter.

115  {
116 #ifdef LOCAL_UNPACK
117  switch (firmwareVersion) {
118 #else
119  switch (firmwareVersion.load()) {
120 #endif
121  case 2006:
122  header2006.l1Acc = l1a % 0xF;
123  break;
124  case 2007:
125  header2007.l1aCounter = l1a % 0xFFF;
126  break;
127  default:
128  edm::LogError("CSCALCTHeader|CSCRawToDigi") << "trying to set L1Acc: ALCT firmware version is bad/not defined!";
129  break;
130  }
131  }
Log< level::Error, false > LogError
static std::atomic< unsigned short int > firmwareVersion
CSCALCTHeader2006 header2006
CSCALCTHeader2007 header2007
unsigned l1Acc
l1 accept counter

◆ sizeInWords()

int CSCALCTHeader::sizeInWords ( )
inline

in 16-bit words

Definition at line 227 of file CSCALCTHeader.h.

References firmwareVersion, and sizeInWords2007_.

Referenced by CSCEventData::checkALCTClasses(), CSCALCTHeader(), CSCEventData::pack(), pack(), and CSCEventData::unpack_data().

227  {
228 #ifdef LOCAL_UNPACK
229  switch (firmwareVersion) {
230 #else
231  switch (firmwareVersion.load()) {
232 #endif
233  case 2006:
234  return 8;
235  case 2007:
236  return sizeInWords2007_;
237  default:
238  edm::LogError("CSCALCTHeader|CSCRawToDigi") << "SizeInWords(): ALCT firmware version is bad/not defined!";
239  return 0;
240  }
241  }
Log< level::Error, false > LogError
static std::atomic< unsigned short int > firmwareVersion
unsigned short int sizeInWords2007_
size of the 2007 header in words

Member Data Documentation

◆ alcts2006

CSCALCTs2006 CSCALCTHeader::alcts2006
private

Definition at line 272 of file CSCALCTHeader.h.

Referenced by add(), ALCTDigis(), CSCALCTHeader(), and pack().

◆ bxn0

unsigned short int CSCALCTHeader::bxn0
private

Definition at line 291 of file CSCALCTHeader.h.

◆ bxn1

unsigned short int CSCALCTHeader::bxn1
private

Definition at line 291 of file CSCALCTHeader.h.

◆ collisionMasks

std::vector<CSCCollisionMask> CSCALCTHeader::collisionMasks
private

Definition at line 275 of file CSCALCTHeader.h.

Referenced by CSCALCTHeader().

◆ configRegister

CSCConfigurationRegister CSCALCTHeader::configRegister
private

Definition at line 274 of file CSCALCTHeader.h.

Referenced by CSCALCTHeader().

◆ debug

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

◆ firmwareVersion

std::atomic< short unsigned int > CSCALCTHeader::firmwareVersion {2007}
staticprivate

◆ header2006

CSCALCTHeader2006 CSCALCTHeader::header2006
private

◆ header2007

CSCALCTHeader2007 CSCALCTHeader::header2007
private

◆ hotChannelMasks

std::vector<CSCHotChannelMask> CSCALCTHeader::hotChannelMasks
private

Definition at line 276 of file CSCALCTHeader.h.

Referenced by CSCALCTHeader().

◆ sizeInWords2007_

unsigned short int CSCALCTHeader::sizeInWords2007_
private

size of the 2007 header in words

Definition at line 291 of file CSCALCTHeader.h.

Referenced by CSCALCTHeader(), and sizeInWords().

◆ theALCTs

std::vector<CSCALCT> CSCALCTHeader::theALCTs
private

Definition at line 271 of file CSCALCTHeader.h.

Referenced by add(), addShower(), ALCTDigis(), alctHMTs(), alctShowerDigis(), CSCALCTHeader(), and pack().

◆ theOriginalBuffer

unsigned short int CSCALCTHeader::theOriginalBuffer[116]
private

Definition at line 280 of file CSCALCTHeader.h.

Referenced by CSCALCTHeader(), and data().

◆ virtexID

CSCVirtexID CSCALCTHeader::virtexID
private

Definition at line 273 of file CSCALCTHeader.h.

Referenced by CSCALCTHeader().