CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch12/src/EventFilter/CSCRawToDigi/interface/CSCEventData.h

Go to the documentation of this file.
00001 #ifndef CSCEventData_h
00002 #define CSCEventData_h
00003 
00004 class CSCCFEBData;
00005 class CLCTData;
00006 class TMBScope;
00007 class CSCDMBHeader;
00008 class CSCDMBTrailer;
00009 class CSCStripDigi;
00010 class CSCALCTHeader;
00011 class CSCALCTHeader2007;
00012 class CSCAnodeData;
00013 class CSCALCTTrailer;
00014 class CSCTMBHeader;
00015 class CSCTMBData;
00016 class CSCCLCTData;
00017 class CSCTMBTrailer;
00018 class CSCWireDigi;
00019 class CSCStripDigi;
00020 class CSCComparatorOutput;
00021 #include <map>
00022 #include <vector>
00023 #include "EventFilter/CSCRawToDigi/interface/CSCDMBHeader.h"
00024 #include "EventFilter/CSCRawToDigi/interface/CSCDMBTrailer.h"
00025 #include "EventFilter/CSCRawToDigi/interface/CSCDMBHeader.h"
00026 #include "EventFilter/CSCRawToDigi/interface/CSCDMBTrailer.h"
00027 #include "EventFilter/CSCRawToDigi/interface/CSCALCTHeader.h"
00028 #include "EventFilter/CSCRawToDigi/interface/CSCAnodeData.h"
00029 #include "EventFilter/CSCRawToDigi/interface/CSCALCTTrailer.h"
00030 #include "EventFilter/CSCRawToDigi/interface/CSCTMBData.h"
00031 #include "EventFilter/CSCRawToDigi/interface/CSCDMBTrailer.h"
00032 #include "DataFormats/CSCDigi/interface/CSCRPCDigi.h"
00033 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
00034 #include <boost/dynamic_bitset.hpp>
00035 
00036 class CSCEventData {
00037  public:
00038   explicit CSCEventData(int chamberType);
00040   CSCEventData(unsigned short * buf);
00041   CSCEventData(){}
00044   ~CSCEventData();
00045   CSCEventData(const CSCEventData & data);
00046   CSCEventData operator=(const CSCEventData & data);
00047 
00049   unsigned short size() const {return size_;}
00050 
00052   static void setDebug(const bool value) {debug = value;}
00053 
00054 
00056   bool isALCT(const short unsigned int * buf);
00057 
00059   bool isTMB(const short unsigned int * buf);
00060 
00061 
00062   
00063 
00065   CSCCFEBData * cfebData(unsigned icfeb) const;
00066 
00068   std::vector<CSCStripDigi> stripDigis(const CSCDetId & idlayer) const;
00069 
00071   std::vector<CSCStripDigi> stripDigis(unsigned idlayer, unsigned icfeb) const;
00072 
00073 
00075   std::vector< std::vector<CSCStripDigi> > stripDigis() const;
00076   
00077 
00078   std::vector<CSCWireDigi> wireDigis(unsigned ilayer) const;
00080   std::vector< std::vector<CSCWireDigi> > wireDigis() const;
00081 
00082 
00084   int nalct() const {return theDMBHeader.nalct();}
00085 
00087   int nclct() const {return theDMBHeader.nclct();}
00088 
00090   const CSCDMBHeader * dmbHeader() const {return &theDMBHeader;}
00091   CSCDMBHeader * dmbHeader()  {return &theDMBHeader;}
00092   
00094   CSCALCTHeader * alctHeader() const;
00095 
00097   CSCALCTTrailer * alctTrailer() const;
00098 
00100   CSCAnodeData * alctData() const;
00101 
00103   CSCTMBData * tmbData() const;
00104 
00106   CSCTMBHeader * tmbHeader() const;
00107 
00109   CSCCLCTData * clctData() const;
00110 
00112   const CSCDMBTrailer * dmbTrailer() const {return &theDMBTrailer;}
00114   void add(const CSCStripDigi &, int layer);
00115   void add(const CSCWireDigi &, int layer);
00116   void add(const CSCComparatorDigi &, int layer);
00118   void add(const std::vector<CSCALCTDigi> &);
00119   void add(const std::vector<CSCCLCTDigi> &);
00120   void add(const std::vector<CSCCorrelatedLCTDigi> &);
00121 
00122   
00125   void setEventInformation(int bxnum, int lvl1num);
00126 
00128   boost::dynamic_bitset<> pack();
00129 
00131   void addALCTStructures();
00132 
00134   int chamberType() const {return theChamberType;}
00135 
00136 
00137   static bool debug;
00138   //uint16_t dataPresent; // 7 bit word which will tell if alct, clct, and 5 cfebs are present
00139   static void selfTest();
00140 
00141 private:
00144   void init();
00145   void unpack_data(unsigned short * buf);
00146   void copy(const CSCEventData &);
00147   void destroy();
00148 
00150   void checkALCTClasses();
00152   void checkTMBClasses();
00153 
00155   void addComparatorInformation(std::vector<CSCStripDigi>&, int layer) const;
00156 
00157   CSCDMBHeader theDMBHeader;
00158   //these are empty data objects unless filled in CSCEventData.cc
00162   CSCALCTHeader * theALCTHeader;
00163   CSCAnodeData  * theAnodeData;
00164   CSCALCTTrailer * theALCTTrailer;
00165   CSCTMBData    * theTMBData;
00166 
00168   CSCCFEBData * theCFEBData[5];
00169 
00170   CSCDMBTrailer theDMBTrailer;
00171 
00172   int size_;
00175   int theChamberType;
00176   
00178   unsigned short * alctZSErecovered;
00179   int zseEnable; 
00180 };
00181 
00182 std::ostream & operator<<(std::ostream & os, const CSCEventData & evt);
00183 #endif