CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCALCTTrailer.cc
Go to the documentation of this file.
1 
6 
7 bool CSCALCTTrailer::debug=false;
8 short unsigned int CSCALCTTrailer::firmwareVersion=2006;
9 
11  bzero(this, sizeInWords()*2);
12  e0dLine = 0xDE0D;
13  d_0=0xD;
14  d_1=0xD;
15  zero_0 = 0;
16  zero_1 = 0;
17  d_3 = 0xD;
18  reserved_3 = 1;
19 }
20 
21 
23  bzero(this, sizeInWords()*2);
24  e0dLine = 0xDE0D;
25  reserved_0 = 0xD;
26  reserved_1 = 0xD;
27  reserved_3 = 1;
28  reserved_4 = 0xD;
29 }
30 
31 
32 
33 CSCALCTTrailer::CSCALCTTrailer(int size, int firmVersion)
34 {
35  if(firmVersion == 2006)
36  {
37  trailer2006.setSize(size);
38  firmwareVersion = 2006;
39  }
40  else if (firmVersion == 2007)
41  {
42  trailer2007.setSize(size);
43  firmwareVersion = 2007;
44  }
45  else {
46  edm::LogError("CSCALCTTrailer|CSCRawToDigi") <<"failed to construct: undetermined ALCT firmware version!!" << firmVersion;
47  }
48 
49 }
50 
51 CSCALCTTrailer::CSCALCTTrailer(const unsigned short * buf){
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
CSCALCTTrailer(int size, int firmVersion)
needed for packing
CSCALCTTrailer2006 trailer2006
short unsigned int sizeInWords() const
static bool debug
void setSize(int size)
void setSize(int size)
tuple size
Write out results.
static unsigned short int firmwareVersion