![]() |
![]() |
#include <EventFilter/CSCRawToDigi/interface/CSCALCTTrailer.h>
Public Member Functions | |
unsigned | alctCRCCheck () const |
CSCALCTTrailer2006 | alctTrailer2006 () |
CSCALCTTrailer2007 | alctTrailer2007 () |
bool | check () const |
CSCALCTTrailer (const CSCALCTStatusDigi &digi) | |
CSCALCTTrailer (const unsigned short *buf) | |
CSCALCTTrailer (int size, int firmVersion) | |
needed for packing | |
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 | |
Private Attributes | |
unsigned short int | theOriginalBuffer [4] |
CSCALCTTrailer2006 | trailer2006 |
CSCALCTTrailer2007 | trailer2007 |
Static Private Attributes | |
static bool | debug = false |
documented in flags https://www.phys.ufl.edu/~madorsky/alctv/alct2000_spec.PDF | |
static unsigned short int | firmwareVersion = 2006 |
Definition at line 48 of file CSCALCTTrailer.h.
needed for packing
needed for packing
Definition at line 12 of file CSCALCTTrailer.cc.
References firmwareVersion, CSCALCTTrailer2006::setSize(), and trailer2006.
Referenced by CSCALCTTrailer().
00013 { 00014 trailer2006.setSize(size); 00015 firmwareVersion = 2006; 00016 }
CSCALCTTrailer::CSCALCTTrailer | ( | const unsigned short * | buf | ) |
determine the version first
Now fill data
Definition at line 18 of file CSCALCTTrailer.cc.
References firmwareVersion, CSCALCTTrailer2006::sizeInWords(), CSCALCTTrailer2007::sizeInWords(), trailer2006, and trailer2007.
00018 { 00020 if ((buf[0]==0xDE0D)&&((buf[1]&0xF000)==0xD000)) { 00021 firmwareVersion=2007; 00022 } 00023 else if ( (buf[2]&0xFFF)==0xE0D ) { 00024 firmwareVersion=2006; 00025 } 00026 else { 00027 edm::LogError("CSCALCTTrailer|CSCRawToDigi") <<"failed to construct: undetermined ALCT firmware version!!"; 00028 } 00029 00031 switch (firmwareVersion) { 00032 case 2006: 00033 memcpy(&trailer2006, buf, trailer2006.sizeInWords()*2); 00034 break; 00035 case 2007: 00036 memcpy(&trailer2007, buf, trailer2007.sizeInWords()*2); 00037 break; 00038 default: 00039 edm::LogError("CSCALCTTrailer|CSCRawToDigi") 00040 <<"couldn't construct: ALCT firmware version is bad/not defined!"; 00041 break; 00042 } 00043 }
CSCALCTTrailer::CSCALCTTrailer | ( | const CSCALCTStatusDigi & | digi | ) | [inline] |
Definition at line 54 of file CSCALCTTrailer.h.
References CSCALCTTrailer(), and CSCALCTStatusDigi::trailer().
00054 { 00055 CSCALCTTrailer(digi.trailer()); 00056 }
unsigned CSCALCTTrailer::alctCRCCheck | ( | ) | const [inline] |
Definition at line 118 of file CSCALCTTrailer.h.
References firmwareVersion, CSCALCTTrailer2006::reserved_3, CSCALCTTrailer2007::reserved_3, trailer2006, and trailer2007.
00118 { 00119 switch (firmwareVersion) { 00120 case 2006: 00121 return trailer2006.reserved_3; 00122 case 2007: 00123 return trailer2007.reserved_3; 00124 default: 00125 edm::LogError("CSCALCTTrailer|CSCRawToDigi") 00126 <<"couldn't CRCcheck: ALCT firmware version is bad/not defined!"; 00127 return 0; 00128 } 00129 }
CSCALCTTrailer2006 CSCALCTTrailer::alctTrailer2006 | ( | ) | [inline] |
Definition at line 133 of file CSCALCTTrailer.h.
References trailer2006.
00133 {return trailer2006;}
CSCALCTTrailer2007 CSCALCTTrailer::alctTrailer2007 | ( | ) | [inline] |
Definition at line 134 of file CSCALCTTrailer.h.
References trailer2007.
00134 {return trailer2007;}
bool CSCALCTTrailer::check | ( | ) | const [inline] |
Definition at line 92 of file CSCALCTTrailer.h.
References CSCALCTTrailer2006::e0dLine, CSCALCTTrailer2007::e0dLine, firmwareVersion, trailer2006, and trailer2007.
00092 { 00093 switch (firmwareVersion) { 00094 case 2006: 00095 return (trailer2006.e0dLine & 0xfff) == 0xe0d; 00096 case 2007: 00097 return (trailer2007.e0dLine & 0xffff) == 0xde0d; 00098 default: 00099 edm::LogError("CSCALCTTrailer|CSCRawToDigi") 00100 <<"couldn't check: ALCT firmware version is bad/not defined!"; 00101 return 0; 00102 } 00103 }
unsigned short* CSCALCTTrailer::data | ( | ) | [inline] |
Definition at line 60 of file CSCALCTTrailer.h.
References firmwareVersion, CSCALCTTrailer2006::sizeInWords(), CSCALCTTrailer2007::sizeInWords(), theOriginalBuffer, trailer2006, and trailer2007.
Referenced by CSCEventData::pack().
00060 { 00061 switch (firmwareVersion) { 00062 case 2006: 00063 memcpy(theOriginalBuffer, &trailer2006, trailer2006.sizeInWords()*2); 00064 break; 00065 case 2007: 00066 memcpy(theOriginalBuffer, &trailer2007, trailer2007.sizeInWords()*2); 00067 break; 00068 default: 00069 edm::LogError("CSCALCTTrailer|CSCRawToDigi") 00070 <<"couldn't access data: ALCT firmware version is bad/not defined!"; 00071 break; 00072 } 00073 return theOriginalBuffer; 00074 }
unsigned CSCALCTTrailer::FrameCount | ( | ) | const [inline] |
Definition at line 131 of file CSCALCTTrailer.h.
References wordCount().
00131 { return wordCount(); }
int CSCALCTTrailer::getCRC | ( | ) | [inline] |
Definition at line 79 of file CSCALCTTrailer.h.
References CSCALCTTrailer2007::crc0, CSCALCTTrailer2006::crc0, CSCALCTTrailer2006::crc1, CSCALCTTrailer2007::crc1, firmwareVersion, trailer2006, and trailer2007.
00079 { 00080 switch (firmwareVersion) { 00081 case 2006: 00082 return ((trailer2006.crc1&0x7ff)<<11) | (trailer2006.crc0&0x7ff); 00083 case 2007: 00084 return ((trailer2007.crc1&0x7ff)<<11) | (trailer2007.crc0&0x7ff); 00085 default: 00086 edm::LogError("CSCALCTTrailer|CSCRawToDigi") 00087 <<"couldn't getCRC: ALCT firmware version is bad/not defined!"; 00088 return 0; 00089 } 00090 }
static int CSCALCTTrailer::sizeInWords | ( | ) | [inline, static] |
in 16-bit frames
Definition at line 77 of file CSCALCTTrailer.h.
Referenced by CSCEventData::checkALCTClasses(), CSCEventData::CSCEventData(), and CSCEventData::pack().
int CSCALCTTrailer::wordCount | ( | ) | const [inline] |
Definition at line 105 of file CSCALCTTrailer.h.
References firmwareVersion, CSCALCTTrailer2007::frameCount, CSCALCTTrailer2006::frameCount, trailer2006, and trailer2007.
Referenced by FrameCount(), and cscdqm::EventProcessor::processCSC().
00105 { 00106 switch (firmwareVersion) { 00107 case 2006: 00108 return trailer2006.frameCount; 00109 case 2007: 00110 return trailer2007.frameCount; 00111 default: 00112 edm::LogError("CSCALCTTrailer|CSCRawToDigi") 00113 <<"couldn't wordCount: ALCT firmware version is bad/not defined!"; 00114 return 0; 00115 } 00116 }
bool CSCALCTTrailer::debug = false [static, private] |
documented in flags https://www.phys.ufl.edu/~madorsky/alctv/alct2000_spec.PDF
Definition at line 137 of file CSCALCTTrailer.h.
Referenced by setDebug().
short unsigned int CSCALCTTrailer::firmwareVersion = 2006 [static, private] |
Definition at line 138 of file CSCALCTTrailer.h.
Referenced by alctCRCCheck(), check(), CSCALCTTrailer(), data(), getCRC(), and wordCount().
unsigned short int CSCALCTTrailer::theOriginalBuffer[4] [private] |
Definition at line 139 of file CSCALCTTrailer.h.
Referenced by alctCRCCheck(), alctTrailer2006(), check(), CSCALCTTrailer(), data(), getCRC(), and wordCount().
Definition at line 140 of file CSCALCTTrailer.h.
Referenced by alctCRCCheck(), alctTrailer2007(), check(), CSCALCTTrailer(), data(), getCRC(), and wordCount().