00001 #ifndef CSCAnodeData2007_h 00002 #define CSCAnodeData2007_h 00003 00004 #include "EventFilter/CSCRawToDigi/interface/CSCAnodeDataFormat.h" 00005 #include <cassert> 00006 class CSCALCTHeader; 00007 00008 class CSCAnodeDataFrame2007 { 00009 public: 00010 CSCAnodeDataFrame2007() {} 00011 00013 bool isHit(unsigned wireGroup) const { 00014 assert(wireGroup < 12); 00015 return ( (data_>>wireGroup) & 0x1 ); 00016 } 00017 00018 unsigned short data() const {return data_;} 00019 00020 private: 00021 unsigned short data_ : 12; 00022 unsigned short reserved_ : 3; 00023 unsigned short flag_ : 1; 00024 }; 00025 00026 00027 class CSCAnodeData2007 : public CSCAnodeDataFormat { 00028 00029 public: 00031 explicit CSCAnodeData2007(const CSCALCTHeader &); 00033 CSCAnodeData2007(const CSCALCTHeader &, const unsigned short *buf); 00034 00035 virtual unsigned short * data() {return theDataFrames;} 00037 virtual unsigned short int sizeInWords() const {return sizeInWords2007_;} 00038 00040 virtual std::vector<CSCWireDigi> wireDigis(int layer) const; 00041 00042 virtual void add(const CSCWireDigi &, int layer); 00043 00044 00045 private: 00046 void init(const CSCALCTHeader &); 00047 int index(int tbin, int layer, int layerPart) const; 00048 const CSCAnodeDataFrame2007 & findFrame(int tbin, int layer, int layerPart) const; 00049 CSCAnodeDataFrame2007 & findFrame(int tbin, int layer, int layerPart); 00050 00052 unsigned short theDataFrames[2700]; 00053 unsigned short int sizeInWords2007_; 00054 unsigned short int nAFEBs_; 00055 unsigned short int nTimeBins_; 00056 00057 unsigned short int layerParts_; 00058 unsigned short int maxWireGroups_; 00059 }; 00060 00061 #endif 00062 00063