CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
std::vector< CSCALCTDigiALCTDigis () const
 
unsigned short int alctFirmwareVersion () const
 
CSCALCTHeader2006 alctHeader2006 () const
 
CSCALCTHeader2007 alctHeader2007 () 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 21 of file CSCALCTHeader.h.

Member Enumeration Documentation

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 40 of file CSCALCTHeader.h.

Constructor & Destructor Documentation

CSCALCTHeader::CSCALCTHeader ( int  chamberType)
explicit

Definition at line 22 of file CSCALCTHeader.cc.

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

Referenced by CSCALCTHeader().

23 : header2006(chamberType),
24  header2007(chamberType)
25 { //constructor for digi->raw packing based on header2006
26  if (firmwareVersion==2006)
27  {
29  }
30  else if(firmwareVersion==2007)
31  {
33  // assume no virtex or masks or registers
35  theALCTs.resize(header2007.lctBins*2);
36  }
37  else
38  {
39  edm::LogError("CSCALCTHeader|CSCRawToDigi")
40  <<"Cannot construct ALCT header: ALCT firmware version is bad/not defined!" << firmwareVersion;
41  }
42 
43 }
short unsigned int sizeInWords() const
static std::atomic< unsigned short int > firmwareVersion
unsigned short int theOriginalBuffer[116]
CSCALCTHeader2006 header2006
static short unsigned int sizeInWords()
std::vector< CSCALCT > theALCTs
CSCALCTHeader2007 header2007
unsigned short int sizeInWords2007_
size of the 2007 header in words
short unsigned int sizeInWords() const
for packing
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 45 of file CSCALCTHeader.cc.

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

45  {
50  constexpr unsigned short int collisionMaskWordcount[7] = { 8, 8,12,16,16,24,28};
51  constexpr unsigned short int hotChannelMaskWordcount[7] = {18,18,24,36,36,48,60};
52 
54  if (buf[0]==0xDB0A) {
55  firmwareVersion=2007;
56  }
57  else if ( (buf[0]&0xF800)==0x6000 ) {
58  firmwareVersion=2006;
59  }
60  else {
61  edm::LogError("CSCALCTHeader|CSCRawToDigi") << "failed to determine ALCT firmware version!!";
62  }
63 
64  LogTrace("CSCALCTHeader|CSCRawToDigi") << "firmware version - " << firmwareVersion;
65 
67 #ifdef LOCAL_UNPACK
68  switch (firmwareVersion) {
69 #else
70  switch (firmwareVersion.load()) {
71 #endif
72  case 2006:
73  memcpy(&header2006, buf, header2006.sizeInWords()*2);
74  buf +=header2006.sizeInWords();
75  memcpy(&alcts2006, buf, alcts2006.sizeInWords()*2);
76  buf +=alcts2006.sizeInWords();
77  break;
78 
79  case 2007:
80  memcpy(&header2007, buf, header2007.sizeInWords()*2);
81  buf +=header2007.sizeInWords();
84  if (header2007.configPresent==1) {
85  memcpy(&virtexID, buf, virtexID.sizeInWords()*2);
86  buf +=virtexID.sizeInWords();
88  memcpy(&configRegister, buf, configRegister.sizeInWords()*2);
91 
92  collisionMasks.resize(collisionMaskWordcount[header2007.boardType]);
93  for (unsigned int i=0; i<collisionMaskWordcount[header2007.boardType]; ++i){
94  memcpy(&collisionMasks[i], buf, collisionMasks[i].sizeInWords()*2);
95  buf += collisionMasks[i].sizeInWords();
96  sizeInWords2007_ += collisionMasks[i].sizeInWords();
97  }
98 
99  hotChannelMasks.resize(hotChannelMaskWordcount[header2007.boardType]);
100  for (unsigned int i=0; i<hotChannelMaskWordcount[header2007.boardType]; ++i) {
101  memcpy(&hotChannelMasks[i], buf, hotChannelMasks[i].sizeInWords()*2);
102  buf += hotChannelMasks[i].sizeInWords();
103  sizeInWords2007_ += hotChannelMasks[i].sizeInWords();
104  }
105  }
106 
107  theALCTs.resize(header2007.lctBins*2);
108  for (int i=0; i<header2007.lctBins*2; ++i) {
109  memcpy(&theALCTs[i], buf, theALCTs[i].sizeInWords()*2);
110  buf += theALCTs[i].sizeInWords();
111  sizeInWords2007_ += theALCTs[i].sizeInWords();
112  }
113 
114  ALCTDigis();
115  break;
116 
117  default:
118  edm::LogError("CSCALCTHeader|CSCRawToDigi")
119  <<"couldn't construct: ALCT firmware version is bad/not defined!";
120  break;
121  }
122 
124  if ((firmwareVersion==2006)||(firmwareVersion==2007))
125  memcpy(theOriginalBuffer, buf-sizeInWords(), sizeInWords()*2);
126 
127 }
int i
Definition: DBlmapReader.cc:9
std::vector< CSCHotChannelMask > hotChannelMasks
std::vector< CSCCollisionMask > collisionMasks
CSCVirtexID virtexID
short unsigned int sizeInWords() const
short unsigned int sizeInWords() const
short unsigned int sizeInWords() const
CSCConfigurationRegister configRegister
CSCALCTs2006 alcts2006
static std::atomic< unsigned short int > firmwareVersion
#define constexpr
short unsigned int sizeInWords() const
unsigned short int theOriginalBuffer[116]
CSCALCTHeader2006 header2006
std::vector< CSCALCT > theALCTs
CSCALCTHeader2007 header2007
#define LogTrace(id)
unsigned short int sizeInWords2007_
size of the 2007 header in words
int sizeInWords()
in 16-bit words
std::vector< CSCALCTDigi > ALCTDigis() const
short unsigned int sizeInWords() const
for packing
CSCALCTHeader::CSCALCTHeader ( const CSCALCTStatusDigi digi)

Definition at line 130 of file CSCALCTHeader.cc.

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

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

Member Function Documentation

unsigned short int CSCALCTHeader::ActiveFEBs ( ) const
inline

Definition at line 135 of file CSCALCTHeader.h.

References CSCALCTHeader2006::activeFEBs, and header2006.

135 {return header2006.activeFEBs;}
CSCALCTHeader2006 header2006
unsigned activeFEBs
LCT chips with ADB hits.
void CSCALCTHeader::add ( const std::vector< CSCALCTDigi > &  digis)

Definition at line 207 of file CSCALCTHeader.cc.

References CSCALCTs2006::add(), alcts2006, firmwareVersion, header2007, i, CSCALCTHeader2007::lctBins, q1, q2, theALCTs, and TrackValidation_HighPurity_cff::valid.

Referenced by CSCEventData::add(), check(), counter.Counter::register(), and selfTest().

208 {
209  if(firmwareVersion == 2006) {
210  alcts2006.add(digis);
211  }
212  else if(firmwareVersion == 2007) {
213  if(theALCTs.empty())
214  {
215  theALCTs.resize(header2007.lctBins*2);
216  }
217  for(std::vector<CSCALCTDigi>::const_iterator digi = digis.begin();
218  digi != digis.end(); ++digi)
219  {
220  int bx = digi->getBX();
221  if(bx < (int)header2007.lctBins)
222  {
223  // 2 ALCTs per bx
224  int i = bx*2;
225  int q1 = theALCTs[i].quality;
226  int q2 = theALCTs[i+1].quality;
227  // see if it's non=blank
228  if(!theALCTs[i].valid)
229  {
230  theALCTs[i] = CSCALCT(*digi);
231  }
232  // new best LCT
233  else if(digi->getQuality() > q1)
234  {
235  theALCTs[i+1] = theALCTs[i];
236  theALCTs[i] = CSCALCT(*digi);
237  }
238  // new second best
239  else if(!theALCTs[i+1].valid || (digi->getQuality() > q2))
240  {
241  theALCTs[i+1] = CSCALCT(*digi);
242  }
243  }
244  }
245  }
246 }
int i
Definition: DBlmapReader.cc:9
CSCALCTs2006 alcts2006
static std::atomic< unsigned short int > firmwareVersion
double q2[4]
Definition: TauolaWrapper.h:88
std::vector< CSCALCT > theALCTs
CSCALCTHeader2007 header2007
double q1[4]
Definition: TauolaWrapper.h:87
void add(const std::vector< CSCALCTDigi > &digis)
should try to sort, but doesn&#39;t for now
std::vector< CSCALCTDigi > CSCALCTHeader::ALCTDigis ( ) const

loop over all alct words

Definition at line 172 of file CSCALCTHeader.cc.

References CSCALCTs2006::ALCTDigis(), alcts2006, BXNCount(), firmwareVersion, i, listBenchmarks::pattern, HLT_25ns14e33_v1_cff::quality, query::result, theALCTs, and TrackValidation_HighPurity_cff::valid.

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

173 {
174  std::vector<CSCALCTDigi> result;
175 
176 #ifdef LOCAL_UNPACK
177  switch (firmwareVersion) {
178 #else
179  switch (firmwareVersion.load()) {
180 #endif
181  case 2006:
182  {
183  result = alcts2006.ALCTDigis();
184  break;
185  }
186  case 2007:
187  {
188  result.reserve(theALCTs.size());
189  for (unsigned int i=0; i<theALCTs.size(); ++i) {
191  theALCTs[i].keyWire, (int)i/2, i%2+1);
192  result.push_back(digi);
193  }
194  break;
195  }
196  default:
197  edm::LogError("CSCALCTHeader|CSCRawToDigi")
198  <<"Empty Digis: ALCT firmware version is bad/not defined!" << firmwareVersion;
199  break;
200  }
201  for(unsigned i = 0; i < result.size(); ++i) {result[i].setFullBX(BXNCount());}
202  return result;
203 
204 }
int i
Definition: DBlmapReader.cc:9
CSCALCTs2006 alcts2006
static std::atomic< unsigned short int > firmwareVersion
tuple result
Definition: query.py:137
std::vector< CSCALCT > theALCTs
std::vector< CSCALCTDigi > ALCTDigis() const
unsigned short int BXNCount() const
Definition: CSCALCTHeader.h:61
unsigned short int CSCALCTHeader::alctFirmwareVersion ( ) const
inline

Definition at line 139 of file CSCALCTHeader.h.

References firmwareVersion.

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

139 {return firmwareVersion;}
static std::atomic< unsigned short int > firmwareVersion
CSCALCTHeader2006 CSCALCTHeader::alctHeader2006 ( ) const
inline

Definition at line 146 of file CSCALCTHeader.h.

References header2006.

146 {return header2006;}
CSCALCTHeader2006 header2006
CSCALCTHeader2007 CSCALCTHeader::alctHeader2007 ( ) const
inline

Definition at line 145 of file CSCALCTHeader.h.

References header2007.

Referenced by CSCAnodeData2007::init().

145 {return header2007;}
CSCALCTHeader2007 header2007
unsigned short int CSCALCTHeader::BoardID ( ) const
inline

Definition at line 58 of file CSCALCTHeader.h.

References CSCALCTHeader2006::boardID, and header2006.

58 {return header2006.boardID;}
CSCALCTHeader2006 header2006
unsigned boardID
ALCT2000 board ID.
unsigned short int CSCALCTHeader::BXNCount ( ) const
inline

Definition at line 61 of file CSCALCTHeader.h.

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

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

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

Definition at line 168 of file CSCALCTHeader.h.

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

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

168  {
169 #ifdef LOCAL_UNPACK
170  switch (firmwareVersion) {
171 #else
172  switch (firmwareVersion.load()) {
173 #endif
174  case 2006:
175  return header2006.flag_0 == 0xC;
176  case 2007:
177  return header2007.flag1 == 0xDB0A;
178  default:
179  edm::LogError("CSCALCTHeader|CSCRawToDigi")
180  <<"check(): ALCT firmware version is bad/not defined!";
181  return 0;
182  }
183  }
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
unsigned short int CSCALCTHeader::CSCID ( ) const
inline

Definition at line 60 of file CSCALCTHeader.h.

References CSCALCTHeader2006::cscID, and header2006.

Referenced by operator<<().

60 {return header2006.cscID;}
CSCALCTHeader2006 header2006
unsigned cscID
chamber ID number
unsigned short int* CSCALCTHeader::data ( )
inline

Definition at line 148 of file CSCALCTHeader.h.

References theOriginalBuffer.

Referenced by cuy.FindIssue::__init__(), CSCEventData::pack(), pack(), and CSCEventData::unpack_data().

148 {return theOriginalBuffer;}
unsigned short int theOriginalBuffer[116]
unsigned short int CSCALCTHeader::ExtTrig ( ) const
inline

Definition at line 59 of file CSCALCTHeader.h.

References CSCALCTHeader2006::extTrig, and header2006.

59 {return header2006.extTrig;}
unsigned extTrig
trigger source was external
CSCALCTHeader2006 header2006
unsigned short int CSCALCTHeader::FIFOMode ( ) const
inline

Definition at line 41 of file CSCALCTHeader.h.

References CSCALCTHeader2006::fifoMode, and header2006.

41 {return header2006.fifoMode;}
unsigned fifoMode
see the FIFO_MODE enum
CSCALCTHeader2006 header2006
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 operator<<(), and 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  }
static std::atomic< unsigned short int > firmwareVersion
CSCALCTHeader2006 header2006
CSCALCTHeader2007 header2007
unsigned l1Acc
l1 accept counter
unsigned short int CSCALCTHeader::L1AMatch ( ) const
inline

Definition at line 134 of file CSCALCTHeader.h.

References header2006, and CSCALCTHeader2006::l1aMatch.

134 {return header2006.l1aMatch;}
CSCALCTHeader2006 header2006
unsigned l1aMatch
exteran L1A arrived in L1A window
unsigned short int CSCALCTHeader::LCTChipRead ( ) const
inline

Definition at line 138 of file CSCALCTHeader.h.

References header2006, and CSCALCTHeader2006::lctChipRead.

138 {return header2006.lctChipRead;}
CSCALCTHeader2006 header2006
unsigned lctChipRead
LCT chips read out in raw hit dump.
unsigned short CSCALCTHeader::nLCTChipRead ( ) const

for packing

header2006 method

Definition at line 158 of file CSCALCTHeader.cc.

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

158  {
159  if(firmwareVersion == 2006) {
160  return header2006.nLCTChipRead();
161  }
162  else {
163  // nLCTChip obsolete in ALCT2007 format (email Andrey K. & Victor B., 20.10.2008)
164  // and we don't think anyone makes uses of this call.
165  // edm::LogError("CSCALCTHeader|CSCRawToDigi")
166  // <<"How is nLCTChipRead() supposed to work for ALCTHeader2007?";
167  }
168  return 0;
169 }
static std::atomic< unsigned short int > firmwareVersion
CSCALCTHeader2006 header2006
unsigned short nLCTChipRead() const
unsigned short int CSCALCTHeader::NTBins ( ) const
inline

Definition at line 42 of file CSCALCTHeader.h.

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

Referenced by operator<<().

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

Definition at line 249 of file CSCALCTHeader.cc.

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

Referenced by check(), pyrootRender.interactiveRender::draw(), and CSCEventData::pack().

250 {
251  boost::dynamic_bitset<> result;
252  if(firmwareVersion == 2006)
253  {
254  boost::dynamic_bitset<> header
256  (unsigned short *) &header2006);
257  boost::dynamic_bitset<> alcts
259  (unsigned short *) &alcts2006);
260  result = bitset_utilities::append(header, alcts);
261 
262  bitset_utilities::bitsetToChar(result, (unsigned char *) data());
263  }
264 
265  else if(firmwareVersion == 2007)
266  {
268  (unsigned short *) &header2007);
269 
270  for (unsigned i = 0; i < theALCTs.size(); ++i)
271  {
272  boost::dynamic_bitset<> alct
274  (unsigned short *) &theALCTs[i]);
275  result = bitset_utilities::append(result, alct);
276  }
277 
278  bitset_utilities::bitsetToChar(result, (unsigned char *) data());
279 
280  }
281  return result;
282 }
int i
Definition: DBlmapReader.cc:9
short unsigned int sizeInWords() const
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 ...
short unsigned int sizeInWords() const
CSCALCTs2006 alcts2006
static std::atomic< unsigned short int > firmwareVersion
CSCALCTHeader2006 header2006
tuple result
Definition: query.py:137
std::vector< CSCALCT > theALCTs
CSCALCTHeader2007 header2007
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()
unsigned short int CSCALCTHeader::Promote1 ( ) const
inline

Definition at line 136 of file CSCALCTHeader.h.

References header2006, and CSCALCTHeader2006::promote1.

136 {return header2006.promote1;}
unsigned promote1
promotion bit for 1st LCT pattern
CSCALCTHeader2006 header2006
unsigned short int CSCALCTHeader::Promote2 ( ) const
inline

Definition at line 137 of file CSCALCTHeader.h.

References header2006, and CSCALCTHeader2006::promote2.

137 {return header2006.promote2;}
CSCALCTHeader2006 header2006
unsigned promote2
promotion bit for 2nd LCT pattern
void CSCALCTHeader::selfTest ( int  firmware)
static

tests that we unpack what we packed

Definition at line 286 of file CSCALCTHeader.cc.

References add(), assert(), firmwareVersion, CSCDetId::iChamberType(), and relativeConstraints::station.

Referenced by check().

287 {
288  firmwareVersion = firmware;
289  CSCALCTDigi alct0(true, 1, 1, 1, 10, 6, 1);
290  CSCALCTDigi alct1(true, 1, 1, 0, 11, 6, 2);
291 
292  // tests packing and unpacking
293  for(int station = 1; station <= 4; ++station)
294  {
295  CSCDetId detId(1, station, 1, 1, 0);
296 
297  std::vector<CSCALCTDigi> oldAlcts;
298  oldAlcts.push_back(alct0);
299  oldAlcts.push_back(alct1);
300  CSCALCTHeader alctHeader(detId.iChamberType());
301 
302  alctHeader.add(oldAlcts);
303 
304  std::vector<CSCALCTDigi> alcts = alctHeader.ALCTDigis();
305  // pick out the valid ones
306  std::vector<CSCALCTDigi> validALCTs;
307  for(std::vector<CSCALCTDigi>::const_iterator alctItr = alcts.begin();
308  alctItr != alcts.end(); ++ alctItr)
309  {
310  if(alctItr->isValid())
311  {
312  validALCTs.push_back(*alctItr);
313  }
314  }
315  assert(validALCTs[0] == alct0);
316  assert(validALCTs[1] == alct1);
317  //cscClassPackerCompare(alctHeader);
318  }
319 }
assert(m_qm.get())
static std::atomic< unsigned short int > firmwareVersion
void add(const std::vector< CSCALCTDigi > &digis)
void CSCALCTHeader::setBXNCount ( unsigned int  bxn)
inline

Definition at line 78 of file CSCALCTHeader.h.

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

Referenced by CSCEventData::add().

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

Definition at line 140 of file CSCALCTHeader.h.

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

Referenced by CSCEventData::add().

140  {
141  if(firmwareVersion == 2006) {
142  header2006.setDAV((wireGroup-1)/16);
143  }
144  }
static std::atomic< unsigned short int > firmwareVersion
CSCALCTHeader2006 header2006
void setDAV(int afebBoard)
for packing
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 30 of file CSCALCTHeader.h.

References debug, and relativeConstraints::value.

Referenced by CSCDCCUnpacker::CSCDCCUnpacker().

30 {debug = value;};
static std::atomic< bool > debug
void CSCALCTHeader::setEventInformation ( const CSCDMBHeader dmb)

Definition at line 134 of file CSCALCTHeader.cc.

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

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

134  {
135 #ifdef LOCAL_UNPACK
136  switch (firmwareVersion) {
137 #else
138  switch (firmwareVersion.load()) {
139 #endif
140  case 2006:
141  {
143  break;
144  }
145  case 2007:
146  {
148  break;
149  }
150  default:
151  edm::LogError("CSCALCTHeader|CSCRawToDigi")
152  <<"setEventInformation: ALCT firmware version is bad/not defined!" << firmwareVersion;
153  break;
154  }
155 }
static std::atomic< unsigned short int > firmwareVersion
void setEventInformation(const CSCDMBHeader &)
CSCALCTHeader2006 header2006
CSCALCTHeader2007 header2007
void setEventInformation(const CSCDMBHeader &)
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")
129  <<"trying to set L1Acc: ALCT firmware version is bad/not defined!";
130  break;
131  }
132  }
static std::atomic< unsigned short int > firmwareVersion
CSCALCTHeader2006 header2006
CSCALCTHeader2007 header2007
unsigned l1Acc
l1 accept counter
int CSCALCTHeader::sizeInWords ( )
inline

in 16-bit words

Definition at line 151 of file CSCALCTHeader.h.

References firmwareVersion, and sizeInWords2007_.

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

151  {
152 #ifdef LOCAL_UNPACK
153  switch (firmwareVersion) {
154 #else
155  switch (firmwareVersion.load()) {
156 #endif
157  case 2006:
158  return 8;
159  case 2007:
160  return sizeInWords2007_;
161  default:
162  edm::LogError("CSCALCTHeader|CSCRawToDigi")
163  <<"SizeInWords(): ALCT firmware version is bad/not defined!";
164  return 0;
165  }
166  }
static std::atomic< unsigned short int > firmwareVersion
unsigned short int sizeInWords2007_
size of the 2007 header in words

Member Data Documentation

CSCALCTs2006 CSCALCTHeader::alcts2006
private

Definition at line 196 of file CSCALCTHeader.h.

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

unsigned short int CSCALCTHeader::bxn0
private

Definition at line 215 of file CSCALCTHeader.h.

unsigned short int CSCALCTHeader::bxn1
private

Definition at line 215 of file CSCALCTHeader.h.

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

Definition at line 199 of file CSCALCTHeader.h.

Referenced by CSCALCTHeader().

CSCConfigurationRegister CSCALCTHeader::configRegister
private

Definition at line 198 of file CSCALCTHeader.h.

Referenced by CSCALCTHeader().

std::atomic< bool > CSCALCTHeader::debug {false}
staticprivate
std::atomic< short unsigned int > CSCALCTHeader::firmwareVersion {2007}
staticprivate
CSCALCTHeader2006 CSCALCTHeader::header2006
private
CSCALCTHeader2007 CSCALCTHeader::header2007
private
std::vector<CSCHotChannelMask> CSCALCTHeader::hotChannelMasks
private

Definition at line 200 of file CSCALCTHeader.h.

Referenced by CSCALCTHeader().

unsigned short int CSCALCTHeader::sizeInWords2007_
private

size of the 2007 header in words

Definition at line 215 of file CSCALCTHeader.h.

Referenced by CSCALCTHeader(), and sizeInWords().

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

Definition at line 195 of file CSCALCTHeader.h.

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

unsigned short int CSCALCTHeader::theOriginalBuffer[116]
private

Definition at line 204 of file CSCALCTHeader.h.

Referenced by CSCALCTHeader(), and data().

CSCVirtexID CSCALCTHeader::virtexID
private

Definition at line 197 of file CSCALCTHeader.h.

Referenced by CSCALCTHeader().