CMS 3D CMS Logo

CSCALCTTrailer.cc

Go to the documentation of this file.
00001 
00005 #include "EventFilter/CSCRawToDigi/interface/CSCALCTTrailer.h"
00006 
00007 bool CSCALCTTrailer::debug=false;
00008 short unsigned int CSCALCTTrailer::firmwareVersion=2006; 
00009 
00010 
00011 
00012 CSCALCTTrailer::CSCALCTTrailer(int size, int firmVersion) 
00013 { 
00014   trailer2006.setSize(size);
00015   firmwareVersion = 2006;
00016 }
00017 
00018 CSCALCTTrailer::CSCALCTTrailer(const unsigned short * buf){
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 }

Generated on Tue Jun 9 17:34:23 2009 for CMSSW by  doxygen 1.5.4