Main Page
Namespaces
Classes
Package Documentation
EventFilter
CSCRawToDigi
interface
CSCALCTHeader.h
Go to the documentation of this file.
1
#ifndef CSCALCTHeader_h
2
#define CSCALCTHeader_h
3
7
#include <bitset>
8
#include <vector>
9
#include <iosfwd>
10
#ifndef LOCAL_UNPACK
11
#include <atomic>
12
#endif
13
#include "
DataFormats/CSCDigi/interface/CSCALCTDigi.h
"
14
#include "
DataFormats/CSCDigi/interface/CSCALCTStatusDigi.h
"
15
#include "
EventFilter/CSCRawToDigi/interface/CSCALCTHeader2006.h
"
16
#include "
EventFilter/CSCRawToDigi/interface/CSCALCTHeader2007.h
"
17
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
18
#include "
FWCore/Utilities/interface/Exception.h
"
19
#include <boost/dynamic_bitset.hpp>
20
21
class
CSCALCTHeader
{
22
public
:
23
explicit
CSCALCTHeader
(
int
chamberType);
24
25
explicit
CSCALCTHeader
(
const
unsigned
short
* buf);
26
27
CSCALCTHeader
(
const
CSCALCTStatusDigi
& digi);
28
30
static
void
setDebug
(
bool
value
){
debug
=
value
;};
31
32
void
setEventInformation
(
const
CSCDMBHeader
&);
33
unsigned
short
int
nLCTChipRead
()
const
;
34
35
std::vector<CSCALCTDigi>
ALCTDigis
()
const
;
36
39
40
enum
FIFO_MODE
{
NO_DUMP
,
FULL_DUMP
,
LOCAL_DUMP
};
41
unsigned
short
int
FIFOMode
()
const
{
return
header2006
.
fifoMode
;}
42
unsigned
short
int
NTBins
()
const
{
43
#ifdef LOCAL_UNPACK
44
switch
(
firmwareVersion
) {
45
#else
46
switch
(
firmwareVersion
.load()) {
47
#endif
48
case
2006:
49
return
header2006
.
nTBins
;
50
case
2007:
51
return
header2007
.
rawBins
;
52
default
:
53
edm::LogError
(
"CSCALCTHeader|CSCRawToDigi"
)
54
<<
"trying to access NTBINs: ALCT firmware version is bad/not defined!"
;
55
return
0;
56
}
57
}
58
unsigned
short
int
BoardID
()
const
{
return
header2006
.
boardID
;}
59
unsigned
short
int
ExtTrig
()
const
{
return
header2006
.
extTrig
;}
60
unsigned
short
int
CSCID
()
const
{
return
header2006
.
cscID
;}
61
unsigned
short
int
BXNCount
()
const
{
62
#ifdef LOCAL_UNPACK
63
switch
(
firmwareVersion
) {
64
#else
65
switch
(
firmwareVersion
.load()) {
66
#endif
67
case
2006:
68
return
header2006
.
bxnCount
;
69
case
2007:
70
return
header2007
.
bxnCount
;
71
default
:
72
edm::LogError
(
"CSCALCTHeader|CSCRawToDigi"
)
73
<<
"trying to access BXNcount: ALCT firmware version is bad/not defined!"
;
74
return
0;
75
}
76
}
77
78
void
setBXNCount
(
unsigned
int
bxn) {
79
#ifdef LOCAL_UNPACK
80
switch
(
firmwareVersion
) {
81
#else
82
switch
(
firmwareVersion
.load()) {
83
#endif
84
case
2006:
85
header2006
.
bxnCount
= bxn % 0xFFF;
86
break
;
87
case
2007:
88
header2007
.
bxnCount
= bxn % 0xFFF;
89
break
;
90
default
:
91
edm::LogError
(
"CSCALCTHeader|CSCRawToDigi"
)
92
<<
"trying to set BXNcount: ALCT firmware version is bad/not defined!"
;
93
break
;
94
}
95
}
96
97
98
unsigned
short
int
L1Acc
()
const
{
99
#ifdef LOCAL_UNPACK
100
switch
(
firmwareVersion
) {
101
#else
102
switch
(
firmwareVersion
.load()) {
103
#endif
104
case
2006:
105
return
header2006
.
l1Acc
;
106
case
2007:
107
return
header2007
.
l1aCounter
;
108
default
:
109
edm::LogError
(
"CSCALCTHeader|CSCRawToDigi"
)
110
<<
"trying to access L1Acc: ALCT firmware version is bad/not defined!"
;
111
return
0;
112
}
113
}
114
115
void
setL1Acc
(
unsigned
int
l1a) {
116
#ifdef LOCAL_UNPACK
117
switch
(
firmwareVersion
) {
118
#else
119
switch
(
firmwareVersion
.load()) {
120
#endif
121
case
2006:
122
header2006
.
l1Acc
= l1a % 0xF;
123
break
;
124
case
2007:
125
header2007
.
l1aCounter
= l1a % 0xFFF;
126
break
;
127
default
:
128
edm::LogError
(
"CSCALCTHeader|CSCRawToDigi"
)
129
<<
"trying to set L1Acc: ALCT firmware version is bad/not defined!"
;
130
break
;
131
}
132
}
133
134
unsigned
short
int
L1AMatch
()
const
{
return
header2006
.
l1aMatch
;}
135
unsigned
short
int
ActiveFEBs
()
const
{
return
header2006
.
activeFEBs
;}
136
unsigned
short
int
Promote1
()
const
{
return
header2006
.
promote1
;}
137
unsigned
short
int
Promote2
()
const
{
return
header2006
.
promote2
;}
138
unsigned
short
int
LCTChipRead
()
const
{
return
header2006
.
lctChipRead
;}
139
unsigned
short
int
alctFirmwareVersion
()
const
{
return
firmwareVersion
;}
140
void
setDAVForChannel
(
int
wireGroup) {
141
if
(
firmwareVersion
== 2006) {
142
header2006
.
setDAV
((wireGroup-1)/16);
143
}
144
}
145
CSCALCTHeader2007
alctHeader2007
()
const
{
return
header2007
;}
146
CSCALCTHeader2006
alctHeader2006
()
const
{
return
header2006
;}
147
148
unsigned
short
int
*
data
() {
return
theOriginalBuffer
;}
149
151
int
sizeInWords
() {
152
#ifdef LOCAL_UNPACK
153
switch
(
firmwareVersion
) {
154
#else
155
switch
(
firmwareVersion
.load()) {
156
#endif
157
case
2006:
158
return
8;
159
case
2007:
160
return
sizeInWords2007_
;
161
default
:
162
edm::LogError
(
"CSCALCTHeader|CSCRawToDigi"
)
163
<<
"SizeInWords(): ALCT firmware version is bad/not defined!"
;
164
return
0;
165
}
166
}
167
168
bool
check
()
const
{
169
#ifdef LOCAL_UNPACK
170
switch
(
firmwareVersion
) {
171
#else
172
switch
(
firmwareVersion
.load()) {
173
#endif
174
case
2006:
175
return
header2006
.
flag_0
== 0xC;
176
case
2007:
177
return
header2007
.
flag1
== 0xDB0A;
178
default
:
179
edm::LogError
(
"CSCALCTHeader|CSCRawToDigi"
)
180
<<
"check(): ALCT firmware version is bad/not defined!"
;
181
return
false
;
182
}
183
}
184
185
void
add
(
const
std::vector<CSCALCTDigi> & digis);
186
187
boost::dynamic_bitset<>
pack
();
188
190
static
void
selfTest
(
int
firmware);
191
192
private
:
193
CSCALCTHeader2006
header2006
;
194
CSCALCTHeader2007
header2007
;
195
std::vector<CSCALCT>
theALCTs
;
196
CSCALCTs2006
alcts2006
;
197
CSCVirtexID
virtexID
;
198
CSCConfigurationRegister
configRegister
;
199
std::vector<CSCCollisionMask>
collisionMasks
;
200
std::vector<CSCHotChannelMask>
hotChannelMasks
;
201
202
//raw data also stored in this buffer
203
//maximum header size is 116 words
204
unsigned
short
int
theOriginalBuffer
[116];
205
206
#ifdef LOCAL_UNPACK
207
static
bool
debug
;
208
static
unsigned
short
int
firmwareVersion
;
209
#else
210
static
std::atomic<bool>
debug
;
211
static
std::atomic<unsigned short int>
firmwareVersion
;
212
#endif
213
215
unsigned
short
int
sizeInWords2007_
,
bxn0
,
bxn1
;
216
};
217
218
std::ostream &
operator<<
(std::ostream & os,
const
CSCALCTHeader
&
header
);
219
220
#endif
221
CSCALCTHeader::L1AMatch
unsigned short int L1AMatch() const
Definition:
CSCALCTHeader.h:134
CSCALCTHeader
Definition:
CSCALCTHeader.h:21
CSCALCTHeader2006::bxnCount
unsigned bxnCount
full bunch crossing number
Definition:
CSCALCTHeader2006.h:60
CSCALCTHeader2006::fifoMode
unsigned fifoMode
see the FIFO_MODE enum
Definition:
CSCALCTHeader2006.h:43
CSCALCTHeader::LCTChipRead
unsigned short int LCTChipRead() const
Definition:
CSCALCTHeader.h:138
MessageLogger.h
CSCALCTHeader::hotChannelMasks
std::vector< CSCHotChannelMask > hotChannelMasks
Definition:
CSCALCTHeader.h:200
CSCALCTHeader::collisionMasks
std::vector< CSCCollisionMask > collisionMasks
Definition:
CSCALCTHeader.h:199
CSCALCTStatusDigi.h
CSCALCTHeader2006::promote1
unsigned promote1
promotion bit for 1st LCT pattern
Definition:
CSCALCTHeader2006.h:51
CSCALCTHeader::virtexID
CSCVirtexID virtexID
Definition:
CSCALCTHeader.h:197
CSCALCTHeader::bxn1
unsigned short int bxn1
Definition:
CSCALCTHeader.h:215
CSCALCTHeader::nLCTChipRead
unsigned short int nLCTChipRead() const
for packing
Definition:
CSCALCTHeader.cc:158
operator<<
std::ostream & operator<<(std::ostream &os, const CSCALCTHeader &header)
Definition:
CSCALCTHeader.cc:321
CSCALCTHeader::NO_DUMP
Definition:
CSCALCTHeader.h:40
CSCALCTHeader2007::flag1
unsigned flag1
Definition:
CSCALCTHeader2007.h:41
CSCALCTStatusDigi
Definition:
CSCALCTStatusDigi.h:15
CSCALCTHeader::LOCAL_DUMP
Definition:
CSCALCTHeader.h:40
CSCALCTHeader::setBXNCount
void setBXNCount(unsigned int bxn)
Definition:
CSCALCTHeader.h:78
CSCALCTHeader::configRegister
CSCConfigurationRegister configRegister
Definition:
CSCALCTHeader.h:198
CSCALCTHeader::CSCALCTHeader
CSCALCTHeader(int chamberType)
Definition:
CSCALCTHeader.cc:22
CSCALCTHeader::check
bool check() const
Definition:
CSCALCTHeader.h:168
CSCALCTHeader::alcts2006
CSCALCTs2006 alcts2006
Definition:
CSCALCTHeader.h:196
CSCALCTHeader2007
Definition:
CSCALCTHeader2007.h:31
CSCALCTHeader::setEventInformation
void setEventInformation(const CSCDMBHeader &)
Definition:
CSCALCTHeader.cc:134
CSCALCTHeader::firmwareVersion
static std::atomic< unsigned short int > firmwareVersion
Definition:
CSCALCTHeader.h:211
CSCALCTHeader::selfTest
static void selfTest(int firmware)
tests that we unpack what we packed
Definition:
CSCALCTHeader.cc:286
CSCALCTHeader2006::extTrig
unsigned extTrig
trigger source was external
Definition:
CSCALCTHeader2006.h:49
RecoTauValidation_cfi.header
header
Definition:
RecoTauValidation_cfi.py:299
CSCALCTHeader::FIFO_MODE
FIFO_MODE
Definition:
CSCALCTHeader.h:40
CSCALCTHeader::alctHeader2007
CSCALCTHeader2007 alctHeader2007() const
Definition:
CSCALCTHeader.h:145
CSCALCTHeader::CSCID
unsigned short int CSCID() const
Definition:
CSCALCTHeader.h:60
CSCConfigurationRegister
Definition:
CSCALCTHeader2007.h:99
CSCALCTHeader::theOriginalBuffer
unsigned short int theOriginalBuffer[116]
Definition:
CSCALCTHeader.h:204
CSCALCTHeader::ActiveFEBs
unsigned short int ActiveFEBs() const
Definition:
CSCALCTHeader.h:135
CSCALCTHeader::header2006
CSCALCTHeader2006 header2006
Definition:
CSCALCTHeader.h:193
edm::LogError
Definition:
MessageLogger.h:174
CSCALCTDigi.h
CSCALCTHeader::ExtTrig
unsigned short int ExtTrig() const
Definition:
CSCALCTHeader.h:59
CSCALCTHeader::FULL_DUMP
Definition:
CSCALCTHeader.h:40
CSCALCTHeader2006
ALCT Header consists of several modular units that are defined as structs below.
Definition:
CSCALCTHeader2006.h:10
CSCALCTHeader::theALCTs
std::vector< CSCALCT > theALCTs
Definition:
CSCALCTHeader.h:195
CSCALCTHeader::add
void add(const std::vector< CSCALCTDigi > &digis)
Definition:
CSCALCTHeader.cc:207
CSCALCTHeader::header2007
CSCALCTHeader2007 header2007
Definition:
CSCALCTHeader.h:194
CSCALCTHeader::pack
boost::dynamic_bitset pack()
Definition:
CSCALCTHeader.cc:249
CSCALCTHeader2006::nTBins
unsigned nTBins
of 25 ns time bins in the raw dump
Definition:
CSCALCTHeader2006.h:45
CSCALCTHeader2007::l1aCounter
unsigned l1aCounter
Definition:
CSCALCTHeader2007.h:46
value
Definition:
value.py:1
CSCALCTHeader::sizeInWords2007_
unsigned short int sizeInWords2007_
size of the 2007 header in words
Definition:
CSCALCTHeader.h:215
CSCALCTHeader2007::bxnCount
unsigned bxnCount
Definition:
CSCALCTHeader2007.h:52
relativeConstraints.value
value
Definition:
relativeConstraints.py:52
CSCALCTHeader::Promote2
unsigned short int Promote2() const
Definition:
CSCALCTHeader.h:137
CSCALCTHeader::sizeInWords
int sizeInWords()
in 16-bit words
Definition:
CSCALCTHeader.h:151
CSCALCTHeader::ALCTDigis
std::vector< CSCALCTDigi > ALCTDigis() const
Definition:
CSCALCTHeader.cc:172
CSCALCTHeader2006.h
Exception.h
CSCALCTHeader::Promote1
unsigned short int Promote1() const
Definition:
CSCALCTHeader.h:136
CSCALCTHeader2007::rawBins
unsigned rawBins
Definition:
CSCALCTHeader2007.h:72
CSCALCTHeader::alctFirmwareVersion
unsigned short int alctFirmwareVersion() const
Definition:
CSCALCTHeader.h:139
CSCALCTHeader::bxn0
unsigned short int bxn0
Definition:
CSCALCTHeader.h:215
CSCVirtexID
Definition:
CSCALCTHeader2007.h:78
CSCALCTHeader::setDebug
static void setDebug(bool value)
to access data by via status digis
Definition:
CSCALCTHeader.h:30
CSCALCTHeader::L1Acc
unsigned short int L1Acc() const
Definition:
CSCALCTHeader.h:98
CSCALCTHeader2006::l1Acc
unsigned l1Acc
l1 accept counter
Definition:
CSCALCTHeader2006.h:34
CSCALCTHeader2006::promote2
unsigned promote2
promotion bit for 2nd LCT pattern
Definition:
CSCALCTHeader2006.h:53
CSCALCTHeader::FIFOMode
unsigned short int FIFOMode() const
Definition:
CSCALCTHeader.h:41
CSCALCTHeader2007.h
CSCALCTHeader2006::boardID
unsigned boardID
ALCT2000 board ID.
Definition:
CSCALCTHeader2006.h:38
CSCALCTHeader::NTBins
unsigned short int NTBins() const
Definition:
CSCALCTHeader.h:42
CSCALCTHeader2006::lctChipRead
unsigned lctChipRead
LCT chips read out in raw hit dump.
Definition:
CSCALCTHeader2006.h:67
CSCALCTHeader2006::activeFEBs
unsigned activeFEBs
LCT chips with ADB hits.
Definition:
CSCALCTHeader2006.h:69
CSCALCTs2006
Definition:
CSCALCTHeader2006.h:76
CSCALCTHeader::alctHeader2006
CSCALCTHeader2006 alctHeader2006() const
Definition:
CSCALCTHeader.h:146
CSCALCTHeader2006::cscID
unsigned cscID
chamber ID number
Definition:
CSCALCTHeader2006.h:36
CSCALCTHeader2006::setDAV
void setDAV(int afebBoard)
for packing
Definition:
CSCALCTHeader2006.h:31
CSCALCTHeader::BXNCount
unsigned short int BXNCount() const
Definition:
CSCALCTHeader.h:61
CSCALCTHeader2006::l1aMatch
unsigned l1aMatch
exteran L1A arrived in L1A window
Definition:
CSCALCTHeader2006.h:47
CSCALCTHeader::BoardID
unsigned short int BoardID() const
Definition:
CSCALCTHeader.h:58
CSCALCTHeader::setDAVForChannel
void setDAVForChannel(int wireGroup)
Definition:
CSCALCTHeader.h:140
CSCALCTHeader::setL1Acc
void setL1Acc(unsigned int l1a)
Definition:
CSCALCTHeader.h:115
CSCALCTHeader::debug
static std::atomic< bool > debug
Definition:
CSCALCTHeader.h:210
CSCALCTHeader2006::flag_0
unsigned flag_0
should be '01100', so it'll be a 6xxx in the ASCII dump
Definition:
CSCALCTHeader2006.h:40
CSCALCTHeader::data
unsigned short int * data()
Definition:
CSCALCTHeader.h:148
CSCDMBHeader
Definition:
CSCDMBHeader.h:15
Generated for CMSSW Reference Manual by
1.8.11