CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/EventFilter/CSCRawToDigi/interface/CSCCFEBData.h

Go to the documentation of this file.
00001 #ifndef CSCCFEBData_h
00002 #define CSCCFEBData_h
00003 
00004 class CSCCFEBTimeSlice;
00005 class CSCStripDigi;
00006 class CSCCFEBStatusDigi;
00007 
00008 #include<vector>
00009 #include<iosfwd>
00010 #include<iostream>
00011 //#include <boost/cstdint.hpp>
00012 
00013 
00014 class CSCCFEBData {
00015  public:
00017   CSCCFEBData(unsigned boardNumber, unsigned short * buf);
00019   CSCCFEBData(unsigned boardNumber, bool sixteenSamples);
00020   
00021   unsigned nTimeSamples() const { return theNumberOfSamples;}
00022 
00024   const CSCCFEBTimeSlice * timeSlice(unsigned i) const;
00025 
00026   unsigned adcCounts(unsigned layer, unsigned channel, unsigned timeBin) const;
00027   unsigned adcOverflow(unsigned layer, unsigned channel, unsigned timeBin) const;
00028   unsigned controllerData(unsigned uglay, unsigned ugchan, unsigned timeBin) const;
00029   unsigned overlappedSampleFlag(unsigned layer, unsigned channel, unsigned timeBin) const;
00030   unsigned errorstat(unsigned layer, unsigned channel, unsigned timeBin) const;
00031   
00032   void add(const CSCStripDigi &, int layer);
00035 
00037   void digis(uint32_t idlayer,  std::vector<CSCStripDigi> & result);
00038 
00039   std::vector<CSCStripDigi> digis(unsigned idlayer);
00041   std::vector<std::vector<CSCStripDigi> > stripDigis();
00042  
00044   CSCCFEBStatusDigi statusDigi() const;
00045 
00046   unsigned short * data() {return theData;}
00047   unsigned sizeInWords() const {return theSize;} 
00048   unsigned boardNumber() const {return boardNumber_;}
00049   void setBoardNumber(int cfeb) {boardNumber_=cfeb;}
00050   
00051   friend std::ostream & operator<<(std::ostream & os, const CSCCFEBData &);
00052   static void selfTest();
00053 
00055   bool check() const;
00056   
00057  private:
00058   unsigned short theData[1600];
00061   std::vector<std::pair<int,bool> > theSliceStarts;
00063   int theSize;
00064   unsigned boardNumber_;
00065   unsigned theNumberOfSamples;
00066   std::vector<uint16_t> bWords;
00067 };
00068 
00069 #endif