CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCTMBData.h
Go to the documentation of this file.
1 //_______________________________________
2 //
3 // Class to group TMB data
4 // CSCTMBData 9/18/03 B.Mohr
5 //_______________________________________
6 //
7 
8 #ifndef CSCTMBData_h
9 #define CSCTMBData_h
10 
18 #include <bitset>
19 #include <boost/dynamic_bitset.hpp>
20 
21 
22 class CSCTMBData {
23 
24  public:
25 
26  CSCTMBData();
27  CSCTMBData(int firmwareVersion, int firmwareRevision, int ncfebs=5);
28  ~CSCTMBData();
29  CSCTMBData(unsigned short *buf);
30  CSCTMBData(const CSCTMBData& data);
31  int UnpackTMB(unsigned short *buf);
33  bool checkSize() const;
34  static void setDebug(const bool value) {debug = value;}
35  short unsigned int CWordCnt() const {return cWordCnt;}
36  int getCRC() const {return theTMBTrailer.crc22();}
37  const unsigned short size() const {return size_;}
38 
42  bool hasTMBScope() const { return theTMBScopeIsPresent;}
43  CSCTMBScope & tmbScope() const;
45  bool hasTMBMiniScope() const { return theTMBMiniScopeIsPresent; }
46  CSCTMBMiniScope & tmbMiniScope() const;
48  bool hasTMBBlockedCFEB() const { return theBlockedCFEBIsPresent; }
52  bool hasRPC() const {return theRPCDataIsPresent;}
53  CSCRPCData * rpcData() {return &theRPCData;}
54 
56 
58  boost::dynamic_bitset<> pack();
59 
60 
61  std::bitset<22> calCRC22(const std::vector< std::bitset<16> >& datain);
62  std::bitset<22> nextCRC22_D16(const std::bitset<16>& D, const std::bitset<22>& C);
63  int TMBCRCcalc();
64 
66  static void selfTest();
67 
68  private:
69 
72  unsigned short * theOriginalBuffer;
75  unsigned theB0CLine;
76  unsigned theE0FLine;
77 
84 
89 
92 
94  static bool debug;
95  unsigned short size_;
96  unsigned short cWordCnt;
98 };
99 
100 #endif
bool hasTMBMiniScope() const
check this before using TMB mini scope
Definition: CSCTMBData.h:45
CSCTMBTrailer * tmbTrailer()
Definition: CSCTMBData.h:50
unsigned theE0FLine
Definition: CSCTMBData.h:76
CSCCLCTData * clctData()
Definition: CSCTMBData.h:40
bool theRPCDataIsPresent
Definition: CSCTMBData.h:97
CSCTMBTrailer theTMBTrailer
Definition: CSCTMBData.h:93
static void selfTest()
tests packing
Definition: CSCTMBData.cc:464
int TMBCRCcalc()
Definition: CSCTMBData.cc:143
unsigned short * theOriginalBuffer
Definition: CSCTMBData.h:72
short unsigned int CWordCnt() const
Definition: CSCTMBData.h:35
boost::dynamic_bitset pack()
not const because it sets size int TMBTrailer
Definition: CSCTMBData.cc:429
bool theBlockedCFEBIsPresent
Definition: CSCTMBData.h:90
const unsigned short size() const
Definition: CSCTMBData.h:37
std::bitset< 22 > nextCRC22_D16(const std::bitset< 16 > &D, const std::bitset< 22 > &C)
Definition: CSCTMBData.cc:397
unsigned short size_
Definition: CSCTMBData.h:95
bool theTMBMiniScopeIsPresent
Definition: CSCTMBData.h:87
unsigned theB0CLine
Definition: CSCTMBData.h:75
CSCRPCData theRPCData
Definition: CSCTMBData.h:80
bool hasTMBBlockedCFEB() const
check this before TMB Block CFEB
Definition: CSCTMBData.h:48
CSCTMBBlockedCFEB & tmbBlockedCFEB() const
Definition: CSCTMBData.cc:390
bool hasTMBScope() const
check this before using TMB Scope
Definition: CSCTMBData.h:42
int getCRC() const
Definition: CSCTMBData.h:36
std::bitset< 22 > calCRC22(const std::vector< std::bitset< 16 > > &datain)
Definition: CSCTMBData.cc:366
static bool debug
Definition: CSCTMBData.h:94
unsigned int crc22() const
static void setDebug(const bool value)
Definition: CSCTMBData.h:34
CSCTMBHeader theTMBHeader
Definition: CSCTMBData.h:78
CSCTMBBlockedCFEB * theTMBBlockedCFEB
Definition: CSCTMBData.h:91
CSCTMBScope & tmbScope() const
Definition: CSCTMBData.cc:377
unsigned short cWordCnt
Definition: CSCTMBData.h:96
CSCTMBMiniScope * theTMBMiniScope
Definition: CSCTMBData.h:88
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
bool theTMBScopeIsPresent
The TMB scope is not present in most of data hence its dynamic.
Definition: CSCTMBData.h:82
CSCTMBScope * theTMBScope
Definition: CSCTMBData.h:83
CSCRPCData * rpcData()
Definition: CSCTMBData.h:53
CSCTMBHeader * tmbHeader()
Definition: CSCTMBData.h:39
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
bool hasRPC() const
check this before using RPC
Definition: CSCTMBData.h:52
bool checkSize() const
sees if the size adds up to the word count
Definition: CSCTMBData.cc:360
CSCCLCTData theCLCTData
Definition: CSCTMBData.h:79
int UnpackTMB(unsigned short *buf)
Definition: CSCTMBData.cc:161
CSCTMBMiniScope & tmbMiniScope() const
Definition: CSCTMBData.cc:383