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();
28  CSCTMBData(unsigned short *buf);
29  CSCTMBData(const CSCTMBData& data);
30  int UnpackTMB(unsigned short *buf);
32  bool checkSize() const;
33  static void setDebug(const bool value) {debug = value;}
34  short unsigned int CWordCnt() const {return cWordCnt;}
35  int getCRC() const {return theTMBTrailer.crc22();}
36  const unsigned short size() const {return size_;}
37 
41  bool hasTMBScope() const { return theTMBScopeIsPresent;}
42  CSCTMBScope & tmbScope() const;
44  bool hasTMBMiniScope() const { return theTMBMiniScopeIsPresent; }
45  CSCTMBMiniScope & tmbMiniScope() const;
47  bool hasTMBBlockedCFEB() const { return theBlockedCFEBIsPresent; }
51  bool hasRPC() const {return theRPCDataIsPresent;}
52  CSCRPCData * rpcData() {return &theRPCData;}
53 
55 
57  boost::dynamic_bitset<> pack();
58 
59 
60  std::bitset<22> calCRC22(const std::vector< std::bitset<16> >& datain);
61  std::bitset<22> nextCRC22_D16(const std::bitset<16>& D, const std::bitset<22>& C);
62  int TMBCRCcalc();
63 
65  static void selfTest();
66 
67  private:
68 
71  unsigned short * theOriginalBuffer;
74  unsigned theB0CLine;
75  unsigned theE0FLine;
76 
83 
88 
91 
93  static bool debug;
94  unsigned short size_;
95  unsigned short cWordCnt;
97 };
98 
99 #endif
bool hasTMBMiniScope() const
check this before using TMB mini scope
Definition: CSCTMBData.h:44
CSCTMBTrailer * tmbTrailer()
Definition: CSCTMBData.h:49
unsigned theE0FLine
Definition: CSCTMBData.h:75
CSCCLCTData * clctData()
Definition: CSCTMBData.h:39
bool theRPCDataIsPresent
Definition: CSCTMBData.h:96
CSCTMBTrailer theTMBTrailer
Definition: CSCTMBData.h:92
static void selfTest()
tests packing
Definition: CSCTMBData.cc:439
int TMBCRCcalc()
Definition: CSCTMBData.cc:119
unsigned short * theOriginalBuffer
Definition: CSCTMBData.h:71
short unsigned int CWordCnt() const
Definition: CSCTMBData.h:34
boost::dynamic_bitset pack()
not const because it sets size int TMBTrailer
Definition: CSCTMBData.cc:404
bool theBlockedCFEBIsPresent
Definition: CSCTMBData.h:89
const unsigned short size() const
Definition: CSCTMBData.h:36
std::bitset< 22 > nextCRC22_D16(const std::bitset< 16 > &D, const std::bitset< 22 > &C)
Definition: CSCTMBData.cc:372
unsigned short size_
Definition: CSCTMBData.h:94
bool theTMBMiniScopeIsPresent
Definition: CSCTMBData.h:86
unsigned theB0CLine
Definition: CSCTMBData.h:74
CSCRPCData theRPCData
Definition: CSCTMBData.h:79
bool hasTMBBlockedCFEB() const
check this before TMB Block CFEB
Definition: CSCTMBData.h:47
CSCTMBBlockedCFEB & tmbBlockedCFEB() const
Definition: CSCTMBData.cc:365
bool hasTMBScope() const
check this before using TMB Scope
Definition: CSCTMBData.h:41
int getCRC() const
Definition: CSCTMBData.h:35
std::bitset< 22 > calCRC22(const std::vector< std::bitset< 16 > > &datain)
Definition: CSCTMBData.cc:341
static bool debug
Definition: CSCTMBData.h:93
unsigned int crc22() const
static void setDebug(const bool value)
Definition: CSCTMBData.h:33
CSCTMBHeader theTMBHeader
Definition: CSCTMBData.h:77
CSCTMBBlockedCFEB * theTMBBlockedCFEB
Definition: CSCTMBData.h:90
CSCTMBScope & tmbScope() const
Definition: CSCTMBData.cc:352
unsigned short cWordCnt
Definition: CSCTMBData.h:95
CSCTMBMiniScope * theTMBMiniScope
Definition: CSCTMBData.h:87
bool theTMBScopeIsPresent
The TMB scope is not present in most of data hence its dynamic.
Definition: CSCTMBData.h:81
CSCTMBScope * theTMBScope
Definition: CSCTMBData.h:82
CSCRPCData * rpcData()
Definition: CSCTMBData.h:52
CSCTMBHeader * tmbHeader()
Definition: CSCTMBData.h:38
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
bool hasRPC() const
check this before using RPC
Definition: CSCTMBData.h:51
bool checkSize() const
sees if the size adds up to the word count
Definition: CSCTMBData.cc:335
CSCCLCTData theCLCTData
Definition: CSCTMBData.h:78
int UnpackTMB(unsigned short *buf)
Definition: CSCTMBData.cc:137
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
CSCTMBMiniScope & tmbMiniScope() const
Definition: CSCTMBData.cc:358