CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10/src/EventFilter/CSCRawToDigi/interface/CSCAnodeData2006.h

Go to the documentation of this file.
00001 #ifndef CSCAnodeData2006_h
00002 #define CSCAnodeData2006_h
00003 #include "EventFilter/CSCRawToDigi/interface/CSCAnodeDataFormat.h"
00004 #include "DataFormats/CSCDigi/interface/CSCALCTDigi.h"
00005 #include <cassert>
00006 class CSCALCTHeader;
00007 
00008 class CSCAnodeDataFrame2006 {
00009 public:
00010   CSCAnodeDataFrame2006() {}
00011   CSCAnodeDataFrame2006(unsigned short frame):
00012     theFrame(frame) {}
00013   CSCAnodeDataFrame2006(unsigned chip, unsigned tbin, unsigned data);
00014 
00016   bool isHit(unsigned wireGroup) const {
00017     assert(wireGroup < 8);
00018     return ( (theFrame>>wireGroup) & 0x1 );
00019   }
00020 
00022   void addHit(unsigned wireBit) {
00023     theFrame |= (1 << wireBit);
00024   }
00025 
00027   unsigned tbin() const {return (theFrame >> 8) & 0x1F;}
00030   unsigned chip() const {return (theFrame >>13) & 0x3;}
00031   unsigned short data() const {return theFrame & 0xFF;}
00032   unsigned short frame() const {return theFrame;}
00033 
00034 private:
00035   unsigned short theFrame;
00036   //unsigned short data_ : 8;
00037   //unsigned short tbin_ : 5;
00038   //unsigned short chip_ : 2;
00039   //unsigned short ddu_code_ : 1;
00040 };
00041 
00042 
00043 
00044 class CSCAnodeData2006 : public CSCAnodeDataFormat 
00045 {
00046 public:
00048   CSCAnodeData2006(const CSCALCTHeader &);
00050   CSCAnodeData2006(const CSCALCTHeader &, const unsigned short *buf);
00051 
00052   virtual unsigned short * data() {return theDataFrames;}
00054   virtual unsigned short int sizeInWords() const {return nAFEBs_ * nTimeBins_ * 6 * 2;}
00055 
00057   virtual std::vector<CSCWireDigi> wireDigis(int layer) const;
00058 
00059   virtual void add(const CSCWireDigi &, int layer);
00060 
00061   static  void selfTest();
00062 
00063 private:
00064   void init();
00065 
00066   CSCAnodeDataFrame2006 rawHit(int afeb, int tbin, int layer, int halfLayer) const;
00067 
00069   int index(int afeb, int tbin, int layer) const;
00070 
00071   void addHit(int afeb, int tbin, int layer, int halfLayer, unsigned wireBit);
00072 
00074   unsigned short theDataFrames[2700];
00076   int nAFEBs_;
00077   int nTimeBins_;
00078   unsigned int alctBX_; 
00079 };
00080 
00081 #endif
00082 
00083