Main Page
Namespaces
Classes
Package Documentation
src
EventFilter
CSCRawToDigi
interface
CSCTMBHeader.h
Go to the documentation of this file.
1
#ifndef CSCTMBHeader_h
2
#define CSCTMBHeader_h
3
5
6
#include <iosfwd>
7
#include <vector>
8
#include "
DataFormats/CSCDigi/interface/CSCTMBStatusDigi.h
"
9
#include "
DataFormats/CSCDigi/interface/CSCALCTDigi.h
"
10
#include "
DataFormats/CSCDigi/interface/CSCCLCTDigi.h
"
11
#include "
DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigi.h
"
12
#include "
EventFilter/CSCRawToDigi/interface/CSCVTMBHeaderFormat.h
"
13
#include "
FWCore/Utilities/interface/Exception.h
"
14
#include <boost/shared_ptr.hpp>
15
#ifndef LOCAL_UNPACK
16
#include <atomic>
17
#endif
18
class
CSCDMBHeader
;
19
struct
CSCTMBHeader2006
;
20
struct
CSCTMBHeader2007
;
21
struct
CSCTMBHeader2007_rev0x50c3
;
22
struct
CSCTMBHeader2013
;
23
24
25
class
CSCTMBHeader
{
26
27
public
:
28
CSCTMBHeader
(
int
firmwareVersion,
int
firmwareRevision);
29
CSCTMBHeader
(
const
CSCTMBStatusDigi
& digi);
30
CSCTMBHeader
(
const
unsigned
short
* buf);
31
33
void
setEventInformation
(
const
CSCDMBHeader
& dmbHeader)
34
{
35
theHeaderFormat
->setEventInformation(dmbHeader);
36
}
37
38
int
FirmwareVersion
()
const
{
return
theFirmwareVersion
;}
39
int
FirmwareRevision
()
const
{
return
theHeaderFormat
->firmwareRevision();}
40
41
42
uint16_t
BXNCount
()
const
{
43
return
theHeaderFormat
->BXNCount();
44
}
45
uint16_t
ALCTMatchTime
()
const
{
46
return
theHeaderFormat
->ALCTMatchTime();
47
}
48
uint16_t
CLCTOnly
()
const
{
49
return
theHeaderFormat
->CLCTOnly();
50
}
51
uint16_t
ALCTOnly
()
const
{
52
return
theHeaderFormat
->ALCTOnly();
53
}
54
uint16_t
TMBMatch
()
const
{
55
return
theHeaderFormat
->TMBMatch();
56
}
57
58
uint16_t
Bxn0Diff
()
const
{
59
return
theHeaderFormat
->Bxn0Diff();
60
}
61
uint16_t
Bxn1Diff
()
const
{
62
return
theHeaderFormat
->Bxn1Diff();
63
}
64
65
uint16_t
L1ANumber
()
const
{
66
return
theHeaderFormat
->L1ANumber();
67
}
68
69
uint16_t
sizeInBytes
()
const
{
70
return
theHeaderFormat
->sizeInWords()*2;
71
}
72
74
CSCTMBHeader2007
tmbHeader2007
()
const
;
75
CSCTMBHeader2007_rev0x50c3
tmbHeader2007_rev0x50c3
()
const
;
76
CSCTMBHeader2006
tmbHeader2006
()
const
;
77
CSCTMBHeader2013
tmbHeader2013
()
const
;
78
79
uint16_t
NTBins
()
const
{
80
return
theHeaderFormat
->NTBins();
81
}
82
uint16_t
NCFEBs
()
const
{
83
return
theHeaderFormat
->NCFEBs();
84
}
85
86
uint16_t
syncError
()
const
{
return
theHeaderFormat
->syncError();}
87
uint16_t
syncErrorCLCT
()
const
{
return
theHeaderFormat
->syncErrorCLCT();}
88
uint16_t
syncErrorMPC0
()
const
{
return
theHeaderFormat
->syncErrorMPC0();}
89
uint16_t
syncErrorMPC1
()
const
{
return
theHeaderFormat
->syncErrorMPC1();}
90
91
92
void
setNCFEBs
(uint16_t ncfebs) {
93
theHeaderFormat
->setNCFEBs(ncfebs);
94
}
95
96
98
std::vector<CSCCLCTDigi>
CLCTDigis
(uint32_t idlayer)
99
{
100
return
theHeaderFormat
->CLCTDigis(idlayer);
101
}
102
104
std::vector<CSCCorrelatedLCTDigi>
CorrelatedLCTDigis
(uint32_t idlayer)
const
105
{
106
return
theHeaderFormat
->CorrelatedLCTDigis(idlayer);
107
}
108
111
unsigned
short
int
sizeInWords
()
const
{
return
theHeaderFormat
->sizeInWords();}
112
113
unsigned
short
int
NHeaderFrames
()
const
{
114
return
theHeaderFormat
->NHeaderFrames();
115
}
116
117
unsigned
short
*
data
() {
118
return
theHeaderFormat
->data();
119
}
120
122
static
void
setDebug
(
const
bool
value
) {
debug
=
value
;}
123
124
bool
check
()
const
{
125
return
theHeaderFormat
->check();
126
}
127
129
//void setChamberId(const CSCDetId & detId) {theChamberId = detId;}
130
132
void
addCLCT0
(
const
CSCCLCTDigi
& digi) {
theHeaderFormat
->addCLCT0(digi);}
133
void
addCLCT1
(
const
CSCCLCTDigi
& digi) {
theHeaderFormat
->addCLCT1(digi);}
134
void
addALCT0
(
const
CSCALCTDigi
& digi) {
theHeaderFormat
->addALCT0(digi);}
135
void
addALCT1
(
const
CSCALCTDigi
& digi) {
theHeaderFormat
->addALCT1(digi);}
136
void
addCorrelatedLCT0
(
const
CSCCorrelatedLCTDigi
& digi) {
137
theHeaderFormat
->addCorrelatedLCT0(digi);
138
}
139
void
addCorrelatedLCT1
(
const
CSCCorrelatedLCTDigi
& digi) {
140
theHeaderFormat
->addCorrelatedLCT1(digi);
141
}
142
144
void
add
(
const
std::vector<CSCCLCTDigi> & digis);
145
void
add
(
const
std::vector<CSCCorrelatedLCTDigi> & digis);
146
147
149
static
void
selfTest
();
150
151
friend
std::ostream &
operator<<
(std::ostream & os,
const
CSCTMBHeader
& hdr);
152
153
private
:
154
155
//void swapCLCTs(CSCCLCTDigi& digi1, CSCCLCTDigi& digi2);
156
157
#ifdef LOCAL_UNPACK
158
static
bool
debug
;
159
#else
160
static
std::atomic<bool>
debug
;
161
#endif
162
163
boost::shared_ptr<CSCVTMBHeaderFormat>
theHeaderFormat
;
164
int
theFirmwareVersion
;
165
166
};
167
168
#endif
169
CSCTMBHeader::BXNCount
uint16_t BXNCount() const
Definition:
CSCTMBHeader.h:42
CSCTMBHeader::setEventInformation
void setEventInformation(const CSCDMBHeader &dmbHeader)
fills fields like bxn and l1a
Definition:
CSCTMBHeader.h:33
CSCTMBHeader::tmbHeader2007
CSCTMBHeader2007 tmbHeader2007() const
will throw if the cast fails
Definition:
CSCTMBHeader.cc:160
CSCTMBHeader2013
Definition:
CSCTMBHeader2013.h:7
CSCTMBHeader::NTBins
uint16_t NTBins() const
Definition:
CSCTMBHeader.h:79
CSCTMBHeader::FirmwareRevision
int FirmwareRevision() const
Definition:
CSCTMBHeader.h:39
CSCTMBStatusDigi.h
CSCCorrelatedLCTDigi.h
CSCTMBHeader::NHeaderFrames
unsigned short int NHeaderFrames() const
Definition:
CSCTMBHeader.h:113
CSCALCTDigi
Definition:
CSCALCTDigi.h:15
CSCTMBHeader::theFirmwareVersion
int theFirmwareVersion
Definition:
CSCTMBHeader.h:164
CSCTMBHeader::syncErrorCLCT
uint16_t syncErrorCLCT() const
Definition:
CSCTMBHeader.h:87
CSCTMBHeader::CLCTOnly
uint16_t CLCTOnly() const
Definition:
CSCTMBHeader.h:48
CSCTMBHeader::L1ANumber
uint16_t L1ANumber() const
Definition:
CSCTMBHeader.h:65
CSCTMBHeader::syncErrorMPC0
uint16_t syncErrorMPC0() const
Definition:
CSCTMBHeader.h:88
CSCTMBHeader::CorrelatedLCTDigis
std::vector< CSCCorrelatedLCTDigi > CorrelatedLCTDigis(uint32_t idlayer) const
returns CorrelatedLCT digis
Definition:
CSCTMBHeader.h:104
CSCTMBHeader::Bxn1Diff
uint16_t Bxn1Diff() const
Definition:
CSCTMBHeader.h:61
CSCTMBHeader::addCorrelatedLCT0
void addCorrelatedLCT0(const CSCCorrelatedLCTDigi &digi)
Definition:
CSCTMBHeader.h:136
CSCTMBHeader::add
void add(const std::vector< CSCCLCTDigi > &digis)
these methods need more brains to figure which one goes first
Definition:
CSCTMBHeader.cc:142
CSCTMBHeader::addCorrelatedLCT1
void addCorrelatedLCT1(const CSCCorrelatedLCTDigi &digi)
Definition:
CSCTMBHeader.h:139
CSCTMBHeader::NCFEBs
uint16_t NCFEBs() const
Definition:
CSCTMBHeader.h:82
CSCTMBHeader::addCLCT1
void addCLCT1(const CSCCLCTDigi &digi)
Definition:
CSCTMBHeader.h:133
CSCTMBHeader::theHeaderFormat
boost::shared_ptr< CSCVTMBHeaderFormat > theHeaderFormat
Definition:
CSCTMBHeader.h:163
CSCTMBHeader2007_rev0x50c3
Definition:
CSCTMBHeader2007_rev0x50c3.h:7
CSCTMBHeader::setNCFEBs
void setNCFEBs(uint16_t ncfebs)
Definition:
CSCTMBHeader.h:92
CSCTMBHeader::syncErrorMPC1
uint16_t syncErrorMPC1() const
Definition:
CSCTMBHeader.h:89
CSCTMBHeader::setDebug
static void setDebug(const bool value)
Definition:
CSCTMBHeader.h:122
CSCALCTDigi.h
CSCTMBHeader::selfTest
static void selfTest()
tests that packing and unpacking give same results
Definition:
CSCTMBHeader.cc:202
CSCTMBHeader::syncError
uint16_t syncError() const
Definition:
CSCTMBHeader.h:86
CSCTMBHeader::data
unsigned short * data()
Definition:
CSCTMBHeader.h:117
CSCTMBHeader::ALCTOnly
uint16_t ALCTOnly() const
Definition:
CSCTMBHeader.h:51
CSCTMBHeader::Bxn0Diff
uint16_t Bxn0Diff() const
Definition:
CSCTMBHeader.h:58
CSCTMBHeader::debug
static std::atomic< bool > debug
Definition:
CSCTMBHeader.h:160
CSCTMBHeader::operator<<
friend std::ostream & operator<<(std::ostream &os, const CSCTMBHeader &hdr)
Definition:
CSCTMBHeader.cc:266
CSCTMBHeader2007
Definition:
CSCTMBHeader2007.h:7
value
Definition:
value.py:1
CSCCLCTDigi
Definition:
CSCCLCTDigi.h:15
CSCTMBHeader::ALCTMatchTime
uint16_t ALCTMatchTime() const
Definition:
CSCTMBHeader.h:45
relativeConstraints.value
value
Definition:
relativeConstraints.py:52
CSCTMBHeader::sizeInWords
unsigned short int sizeInWords() const
Definition:
CSCTMBHeader.h:111
CSCTMBHeader::sizeInBytes
uint16_t sizeInBytes() const
Definition:
CSCTMBHeader.h:69
Exception.h
CSCTMBHeader::CLCTDigis
std::vector< CSCCLCTDigi > CLCTDigis(uint32_t idlayer)
returns CLCT digis
Definition:
CSCTMBHeader.h:98
CSCTMBStatusDigi
Definition:
CSCTMBStatusDigi.h:15
CSCTMBHeader::tmbHeader2006
CSCTMBHeader2006 tmbHeader2006() const
Definition:
CSCTMBHeader.cc:191
CSCTMBHeader::tmbHeader2007_rev0x50c3
CSCTMBHeader2007_rev0x50c3 tmbHeader2007_rev0x50c3() const
Definition:
CSCTMBHeader.cc:170
CSCTMBHeader::addCLCT0
void addCLCT0(const CSCCLCTDigi &digi)
Needed before data packing.
Definition:
CSCTMBHeader.h:132
CSCTMBHeader::check
bool check() const
Definition:
CSCTMBHeader.h:124
CSCTMBHeader::TMBMatch
uint16_t TMBMatch() const
Definition:
CSCTMBHeader.h:54
CSCVTMBHeaderFormat.h
CSCTMBHeader::FirmwareVersion
int FirmwareVersion() const
Definition:
CSCTMBHeader.h:38
CSCTMBHeader::addALCT1
void addALCT1(const CSCALCTDigi &digi)
Definition:
CSCTMBHeader.h:135
CSCCLCTDigi.h
CSCTMBHeader::CSCTMBHeader
CSCTMBHeader(int firmwareVersion, int firmwareRevision)
Definition:
CSCTMBHeader.cc:20
CSCTMBHeader2006
Definition:
CSCTMBHeader2006.h:7
CSCCorrelatedLCTDigi
Definition:
CSCCorrelatedLCTDigi.h:18
CSCTMBHeader::tmbHeader2013
CSCTMBHeader2013 tmbHeader2013() const
Definition:
CSCTMBHeader.cc:180
CSCTMBHeader
Definition:
CSCTMBHeader.h:25
CSCTMBHeader::addALCT0
void addALCT0(const CSCALCTDigi &digi)
Definition:
CSCTMBHeader.h:134
CSCDMBHeader
Definition:
CSCDMBHeader.h:15
Generated for CMSSW Reference Manual by
1.8.11