CMS 3D CMS Logo

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 #ifndef LOCAL_UNPACK
21 #include <atomic>
22 #endif
23 
24 class CSCTMBData {
25 public:
26  CSCTMBData();
27  CSCTMBData(int firmwareVersion, int firmwareRevision, int ncfebs = 5);
28  ~CSCTMBData();
29  CSCTMBData(const uint16_t* buf);
30  CSCTMBData(const CSCTMBData& data);
31  int UnpackTMB(const uint16_t* 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; }
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  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:
70  const uint16_t* theOriginalBuffer;
73  unsigned theB0CLine;
74  unsigned theE0FLine;
75 
82 
87 
90 
92 #ifdef LOCAL_UNPACK
93  static bool debug;
94 #else
95  static std::atomic<bool> debug;
96 #endif
97  unsigned short size_;
98  unsigned short cWordCnt;
100 };
101 
102 #endif
CSCTMBTrailer.h
CSCTMBBlockedCFEB
Definition: CSCTMBBlockedCFEB.h:13
CSCTMBData::theTMBTrailer
CSCTMBTrailer theTMBTrailer
Definition: CSCTMBData.h:91
CSCTMBData::selfTest
static void selfTest()
tests packing
Definition: CSCTMBData.cc:424
CSCTMBData::size_
unsigned short size_
Definition: CSCTMBData.h:97
CSCTMBData::size
const unsigned short size() const
Definition: CSCTMBData.h:37
CSCTMBData::hasTMBScope
bool hasTMBScope() const
check this before using TMB Scope
Definition: CSCTMBData.h:42
CSCTMBData::theTMBScope
CSCTMBScope * theTMBScope
Definition: CSCTMBData.h:81
CSCTMBData::checkSize
bool checkSize() const
sees if the size adds up to the word count
Definition: CSCTMBData.cc:333
CSCTMBData::setDebug
static void setDebug(const bool value)
Definition: CSCTMBData.h:34
CSCTMBScope
Definition: CSCTMBScope.h:15
CSCRPCData.h
CSCTMBData::theBlockedCFEBIsPresent
bool theBlockedCFEBIsPresent
Definition: CSCTMBData.h:88
CSCTMBBlockedCFEB.h
CSCTMBData::tmbHeader
CSCTMBHeader * tmbHeader()
Definition: CSCTMBData.h:39
CSCTMBData::tmbTrailer
CSCTMBTrailer * tmbTrailer()
Definition: CSCTMBData.h:50
CSCTMBData::theTMBMiniScopeIsPresent
bool theTMBMiniScopeIsPresent
Definition: CSCTMBData.h:85
CSCTMBData::clctData
CSCCLCTData * clctData()
Definition: CSCTMBData.h:40
CSCTMBData::theRPCDataIsPresent
bool theRPCDataIsPresent
Definition: CSCTMBData.h:99
CSCTMBData::theTMBHeader
CSCTMBHeader theTMBHeader
Definition: CSCTMBData.h:76
CSCTMBData::pack
boost::dynamic_bitset pack()
not const because it sets size int TMBTrailer
Definition: CSCTMBData.cc:394
CSCTMBData::calCRC22
std::bitset< 22 > calCRC22(const std::vector< std::bitset< 16 > > &datain)
Definition: CSCTMBData.cc:338
simCaloStage2Layer1Digis_cfi.firmwareVersion
firmwareVersion
Definition: simCaloStage2Layer1Digis_cfi.py:21
CSCTMBData::getCRC
int getCRC() const
Definition: CSCTMBData.h:36
CSCTMBData::tmbScope
CSCTMBScope & tmbScope() const
Definition: CSCTMBData.cc:347
CSCTMBData::tmbBlockedCFEB
CSCTMBBlockedCFEB & tmbBlockedCFEB() const
Definition: CSCTMBData.cc:359
CSCTMBData::CSCTMBData
CSCTMBData()
Definition: CSCTMBData.cc:21
CSCTMBData::cWordCnt
unsigned short cWordCnt
Definition: CSCTMBData.h:98
CSCTMBData::CWordCnt
short unsigned int CWordCnt() const
Definition: CSCTMBData.h:35
CSCTMBData::theTMBBlockedCFEB
CSCTMBBlockedCFEB * theTMBBlockedCFEB
Definition: CSCTMBData.h:89
CSCTMBData::rpcData
CSCRPCData * rpcData()
Definition: CSCTMBData.h:53
CSCTMBData::nextCRC22_D16
std::bitset< 22 > nextCRC22_D16(const std::bitset< 16 > &D, const std::bitset< 22 > &C)
Definition: CSCTMBData.cc:365
CSCTMBData::TMBCRCcalc
int TMBCRCcalc()
Definition: CSCTMBData.cc:137
CSCTMBData::theTMBMiniScope
CSCTMBMiniScope * theTMBMiniScope
Definition: CSCTMBData.h:86
CSCTMBData::theTMBScopeIsPresent
bool theTMBScopeIsPresent
The TMB scope is not present in most of data hence its dynamic.
Definition: CSCTMBData.h:80
CSCTMBData::tmbMiniScope
CSCTMBMiniScope & tmbMiniScope() const
Definition: CSCTMBData.cc:353
CSCCLCTData.h
CSCTMBData::hasTMBMiniScope
bool hasTMBMiniScope() const
check this before using TMB mini scope
Definition: CSCTMBData.h:45
CSCTMBTrailer
Definition: CSCTMBTrailer.h:28
value
Definition: value.py:1
CSCTMBData
Definition: CSCTMBData.h:24
CSCTMBData::UnpackTMB
int UnpackTMB(const uint16_t *buf)
Definition: CSCTMBData.cc:154
CSCTMBData::theOriginalBuffer
const uint16_t * theOriginalBuffer
Definition: CSCTMBData.h:70
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
CSCTMBMiniScope
Definition: CSCTMBMiniScope.h:13
CSCTMBHeader
Definition: CSCTMBHeader.h:25
funct::D
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
CSCTMBScope.h
gen::C
C
Definition: PomwigHadronizer.cc:76
CSCTMBTrailer::crc22
unsigned int crc22() const
Definition: CSCTMBTrailer.cc:51
relativeConstraints.value
value
Definition: relativeConstraints.py:53
CSCTMBHeader.h
CSCTMBData::hasRPC
bool hasRPC() const
check this before using RPC
Definition: CSCTMBData.h:52
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
CSCTMBData::hasTMBBlockedCFEB
bool hasTMBBlockedCFEB() const
check this before TMB Block CFEB
Definition: CSCTMBData.h:48
CSCTMBData::theB0CLine
unsigned theB0CLine
Definition: CSCTMBData.h:73
CSCTMBMiniScope.h
CSCCLCTData
Definition: CSCCLCTData.h:24
CSCTMBData::~CSCTMBData
~CSCTMBData()
Definition: CSCTMBData.cc:109
CSCTMBData::theE0FLine
unsigned theE0FLine
Definition: CSCTMBData.h:74
CSCTMBData::theCLCTData
CSCCLCTData theCLCTData
Definition: CSCTMBData.h:77
CSCTMBData::theRPCData
CSCRPCData theRPCData
Definition: CSCTMBData.h:78
CSCTMBData::debug
static std::atomic< bool > debug
Definition: CSCTMBData.h:95
CSCRPCData
Definition: CSCRPCData.h:11