CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes
CSCALCTTrailer Class Reference

#include <CSCALCTTrailer.h>

Public Member Functions

unsigned alctCRCCheck () const
 
CSCALCTTrailer2006 alctTrailer2006 ()
 
CSCALCTTrailer2007 alctTrailer2007 ()
 
bool check () const
 
 CSCALCTTrailer (int size, int firmVersion)
 needed for packing More...
 
 CSCALCTTrailer (const unsigned short *buf)
 
 CSCALCTTrailer (const CSCALCTStatusDigi &digi)
 
unsigned short * data ()
 
unsigned FrameCount () const
 
int getCRC ()
 
int wordCount () const
 

Static Public Member Functions

static void setDebug (bool debugValue)
 
static int sizeInWords ()
 in 16-bit frames More...
 

Private Attributes

unsigned short int theOriginalBuffer [4]
 
CSCALCTTrailer2006 trailer2006
 
CSCALCTTrailer2007 trailer2007
 

Static Private Attributes

static bool debug =false
 
static unsigned short int firmwareVersion =2006
 

Detailed Description

Definition at line 38 of file CSCALCTTrailer.h.

Constructor & Destructor Documentation

CSCALCTTrailer::CSCALCTTrailer ( int  size,
int  firmVersion 
)

needed for packing

needed for packing

Definition at line 33 of file CSCALCTTrailer.cc.

References firmwareVersion, CSCALCTTrailer2006::setSize(), CSCALCTTrailer2007::setSize(), trailer2006, and trailer2007.

Referenced by CSCALCTTrailer().

34 {
35  if(firmVersion == 2006)
36  {
38  firmwareVersion = 2006;
39  }
40  else if (firmVersion == 2007)
41  {
43  firmwareVersion = 2007;
44  }
45  else {
46  edm::LogError("CSCALCTTrailer|CSCRawToDigi") <<"failed to construct: undetermined ALCT firmware version!!" << firmVersion;
47  }
48 
49 }
CSCALCTTrailer2007 trailer2007
CSCALCTTrailer2006 trailer2006
void setSize(int size)
void setSize(int size)
tuple size
Write out results.
static unsigned short int firmwareVersion
CSCALCTTrailer::CSCALCTTrailer ( const unsigned short *  buf)

determine the version first

Now fill data

Definition at line 51 of file CSCALCTTrailer.cc.

References firmwareVersion, CSCALCTTrailer2006::sizeInWords(), CSCALCTTrailer2007::sizeInWords(), trailer2006, and trailer2007.

51  {
53  if ((buf[0]==0xDE0D)&&((buf[1]&0xF000)==0xD000)) {
54  firmwareVersion=2007;
55  }
56  else if ( (buf[2]&0xFFF)==0xE0D ) {
57  firmwareVersion=2006;
58  }
59  else {
60  edm::LogError("CSCALCTTrailer|CSCRawToDigi") <<"failed to construct: undetermined ALCT firmware version!!" << firmwareVersion;
61  }
62 
64  switch (firmwareVersion) {
65  case 2006:
66  memcpy(&trailer2006, buf, trailer2006.sizeInWords()*2);
67  break;
68  case 2007:
69  memcpy(&trailer2007, buf, trailer2007.sizeInWords()*2);
70  break;
71  default:
72  edm::LogError("CSCALCTTrailer|CSCRawToDigi")
73  <<"couldn't construct: ALCT firmware version is bad/not defined!";
74  break;
75  }
76 }
short unsigned int sizeInWords() const
CSCALCTTrailer2007 trailer2007
CSCALCTTrailer2006 trailer2006
short unsigned int sizeInWords() const
static unsigned short int firmwareVersion
CSCALCTTrailer::CSCALCTTrailer ( const CSCALCTStatusDigi digi)
inline

Definition at line 44 of file CSCALCTTrailer.h.

References CSCALCTTrailer(), and CSCALCTStatusDigi::trailer().

44  {
45  CSCALCTTrailer(digi.trailer());
46  }
const uint16_t * trailer() const
CSCALCTTrailer(int size, int firmVersion)
needed for packing

Member Function Documentation

unsigned CSCALCTTrailer::alctCRCCheck ( ) const
inline

Definition at line 108 of file CSCALCTTrailer.h.

References firmwareVersion, CSCALCTTrailer2006::reserved_3, CSCALCTTrailer2007::reserved_3, trailer2006, and trailer2007.

108  {
109  switch (firmwareVersion) {
110  case 2006:
111  return trailer2006.reserved_3;
112  case 2007:
113  return trailer2007.reserved_3;
114  default:
115  edm::LogError("CSCALCTTrailer|CSCRawToDigi")
116  <<"couldn't CRCcheck: ALCT firmware version is bad/not defined!";
117  return 0;
118  }
119  }
CSCALCTTrailer2007 trailer2007
CSCALCTTrailer2006 trailer2006
static unsigned short int firmwareVersion
CSCALCTTrailer2006 CSCALCTTrailer::alctTrailer2006 ( )
inline

Definition at line 123 of file CSCALCTTrailer.h.

References trailer2006.

123 {return trailer2006;}
CSCALCTTrailer2006 trailer2006
CSCALCTTrailer2007 CSCALCTTrailer::alctTrailer2007 ( )
inline

Definition at line 124 of file CSCALCTTrailer.h.

References trailer2007.

124 {return trailer2007;}
CSCALCTTrailer2007 trailer2007
bool CSCALCTTrailer::check ( ) const
inline

Definition at line 82 of file CSCALCTTrailer.h.

References CSCALCTTrailer2006::e0dLine, CSCALCTTrailer2007::e0dLine, firmwareVersion, trailer2006, and trailer2007.

82  {
83  switch (firmwareVersion) {
84  case 2006:
85  return (trailer2006.e0dLine & 0xfff) == 0xe0d;
86  case 2007:
87  return (trailer2007.e0dLine & 0xffff) == 0xde0d;
88  default:
89  edm::LogError("CSCALCTTrailer|CSCRawToDigi")
90  <<"couldn't check: ALCT firmware version is bad/not defined!";
91  return 0;
92  }
93  }
CSCALCTTrailer2007 trailer2007
CSCALCTTrailer2006 trailer2006
static unsigned short int firmwareVersion
unsigned short* CSCALCTTrailer::data ( )
inline

Definition at line 50 of file CSCALCTTrailer.h.

References firmwareVersion, CSCALCTTrailer2006::sizeInWords(), CSCALCTTrailer2007::sizeInWords(), theOriginalBuffer, trailer2006, and trailer2007.

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

50  {
51  switch (firmwareVersion) {
52  case 2006:
54  break;
55  case 2007:
57  break;
58  default:
59  edm::LogError("CSCALCTTrailer|CSCRawToDigi")
60  <<"couldn't access data: ALCT firmware version is bad/not defined!";
61  break;
62  }
63  return theOriginalBuffer;
64  }
short unsigned int sizeInWords() const
CSCALCTTrailer2007 trailer2007
CSCALCTTrailer2006 trailer2006
short unsigned int sizeInWords() const
unsigned short int theOriginalBuffer[4]
static unsigned short int firmwareVersion
unsigned CSCALCTTrailer::FrameCount ( ) const
inline

Definition at line 121 of file CSCALCTTrailer.h.

References wordCount().

121 { return wordCount(); }
int wordCount() const
int CSCALCTTrailer::getCRC ( )
inline

Definition at line 69 of file CSCALCTTrailer.h.

References CSCALCTTrailer2006::crc0, CSCALCTTrailer2007::crc0, CSCALCTTrailer2006::crc1, CSCALCTTrailer2007::crc1, firmwareVersion, trailer2006, and trailer2007.

69  {
70  switch (firmwareVersion) {
71  case 2006:
72  return ((trailer2006.crc1&0x7ff)<<11) | (trailer2006.crc0&0x7ff);
73  case 2007:
74  return ((trailer2007.crc1&0x7ff)<<11) | (trailer2007.crc0&0x7ff);
75  default:
76  edm::LogError("CSCALCTTrailer|CSCRawToDigi")
77  <<"couldn't getCRC: ALCT firmware version is bad/not defined!";
78  return 0;
79  }
80  }
CSCALCTTrailer2007 trailer2007
CSCALCTTrailer2006 trailer2006
static unsigned short int firmwareVersion
static void CSCALCTTrailer::setDebug ( bool  debugValue)
inlinestatic

Definition at line 48 of file CSCALCTTrailer.h.

References debug.

48 {debug = debugValue;}
static bool debug
static int CSCALCTTrailer::sizeInWords ( )
inlinestatic

in 16-bit frames

Definition at line 67 of file CSCALCTTrailer.h.

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

67 {return 4;}
int CSCALCTTrailer::wordCount ( ) const
inline

Definition at line 95 of file CSCALCTTrailer.h.

References firmwareVersion, CSCALCTTrailer2006::frameCount, CSCALCTTrailer2007::frameCount, trailer2006, and trailer2007.

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

95  {
96  switch (firmwareVersion) {
97  case 2006:
98  return trailer2006.frameCount;
99  case 2007:
100  return trailer2007.frameCount;
101  default:
102  edm::LogError("CSCALCTTrailer|CSCRawToDigi")
103  <<"couldn't wordCount: ALCT firmware version is bad/not defined!";
104  return 0;
105  }
106  }
CSCALCTTrailer2007 trailer2007
CSCALCTTrailer2006 trailer2006
static unsigned short int firmwareVersion

Member Data Documentation

bool CSCALCTTrailer::debug =false
staticprivate
short unsigned int CSCALCTTrailer::firmwareVersion =2006
staticprivate

Definition at line 128 of file CSCALCTTrailer.h.

Referenced by alctCRCCheck(), check(), CSCALCTTrailer(), data(), getCRC(), and wordCount().

unsigned short int CSCALCTTrailer::theOriginalBuffer[4]
private

Definition at line 131 of file CSCALCTTrailer.h.

Referenced by data().

CSCALCTTrailer2006 CSCALCTTrailer::trailer2006
private
CSCALCTTrailer2007 CSCALCTTrailer::trailer2007
private