EventFilter
CSCRawToDigi
src
CSCALCTTrailer.cc
Go to the documentation of this file.
1
5
#include "
EventFilter/CSCRawToDigi/interface/CSCALCTTrailer.h
"
6
7
#ifdef LOCAL_UNPACK
8
9
bool
CSCALCTTrailer::debug
=
false
;
10
short
unsigned
int
CSCALCTTrailer::firmwareVersion
= 2006;
11
12
#else
13
14
std::atomic<bool>
CSCALCTTrailer::debug
{
false
};
15
std::atomic<short unsigned int>
CSCALCTTrailer::firmwareVersion
{2006};
16
17
#endif
18
19
CSCALCTTrailer2006::CSCALCTTrailer2006
() {
20
bzero(
this
,
sizeInWords
() * 2);
21
e0dLine
= 0xDE0D;
22
d_0
= 0xD;
23
d_1
= 0xD;
24
zero_0
= 0;
25
zero_1
= 0;
26
d_3
= 0xD;
27
reserved_3
= 1;
28
}
29
30
CSCALCTTrailer2007::CSCALCTTrailer2007
() {
31
bzero(
this
,
sizeInWords
() * 2);
32
e0dLine
= 0xDE0D;
33
reserved_0
= 0xD;
34
reserved_1
= 0xD;
35
reserved_3
= 1;
36
reserved_4
= 0xD;
37
}
38
39
CSCALCTTrailer::CSCALCTTrailer
(
int
size
,
int
firmVersion) {
40
if
(firmVersion == 2006) {
41
trailer2006
.
setSize
(
size
);
42
firmwareVersion
= 2006;
43
}
else
if
(firmVersion == 2007) {
44
trailer2007
.
setSize
(
size
);
45
firmwareVersion
= 2007;
46
}
else
{
47
edm::LogError
(
"CSCALCTTrailer|CSCRawToDigi"
)
48
<<
"failed to construct: undetermined ALCT firmware version!!"
<< firmVersion;
49
}
50
}
51
52
CSCALCTTrailer::CSCALCTTrailer
(
const
unsigned
short
*
buf
) {
54
if
((
buf
[0] == 0xDE0D) && ((
buf
[1] & 0xF000) == 0xD000)) {
55
firmwareVersion
= 2007;
56
}
else
if
((
buf
[2] & 0xFFF) == 0xE0D) {
57
firmwareVersion
= 2006;
58
}
else
{
59
edm::LogError
(
"CSCALCTTrailer|CSCRawToDigi"
)
60
<<
"failed to construct: undetermined ALCT firmware version!!"
<<
firmwareVersion
;
61
}
62
64
#ifdef LOCAL_UNPACK
65
switch
(
firmwareVersion
) {
66
#else
67
switch
(
firmwareVersion
.load()) {
68
#endif
69
case
2006:
70
trailer2006
.
setFromBuffer
(
buf
);
71
break
;
72
case
2007:
73
trailer2007
.
setFromBuffer
(
buf
);
74
break
;
75
default
:
76
edm::LogError
(
"CSCALCTTrailer|CSCRawToDigi"
) <<
"couldn't construct: ALCT firmware version is bad/not defined!"
;
77
break
;
78
}
79
}
CSCALCTTrailer.h
CSCALCTTrailer2007::reserved_1
unsigned reserved_1
Definition:
CSCALCTTrailer.h:49
CSCALCTTrailer2007::reserved_3
unsigned reserved_3
Definition:
CSCALCTTrailer.h:50
CSCALCTTrailer2007::setFromBuffer
void setFromBuffer(unsigned short const *buf)
Definition:
CSCALCTTrailer.h:37
CSCALCTTrailer::trailer2006
CSCALCTTrailer2006 trailer2006
Definition:
CSCALCTTrailer.h:181
CSCALCTTrailer2006::reserved_3
unsigned reserved_3
Definition:
CSCALCTTrailer.h:31
CSCALCTTrailer2006::e0dLine
unsigned e0dLine
Definition:
CSCALCTTrailer.h:30
CSCALCTTrailer2006::setFromBuffer
void setFromBuffer(unsigned short const *buf)
Definition:
CSCALCTTrailer.h:18
CSCALCTTrailer2006::d_3
unsigned d_3
Definition:
CSCALCTTrailer.h:31
CSCALCTTrailer::firmwareVersion
static std::atomic< unsigned short int > firmwareVersion
Definition:
CSCALCTTrailer.h:178
CSCALCTTrailer2006::zero_1
unsigned zero_1
Definition:
CSCALCTTrailer.h:29
CSCALCTTrailer::trailer2007
CSCALCTTrailer2007 trailer2007
Definition:
CSCALCTTrailer.h:182
CSCALCTTrailer2006::zero_0
unsigned zero_0
Definition:
CSCALCTTrailer.h:28
CSCALCTTrailer2006::d_1
unsigned d_1
Definition:
CSCALCTTrailer.h:29
edm::LogError
Definition:
MessageLogger.h:183
CSCALCTTrailer2007::reserved_4
unsigned reserved_4
Definition:
CSCALCTTrailer.h:50
CSCALCTTrailer2007::sizeInWords
short unsigned int sizeInWords() const
Definition:
CSCALCTTrailer.h:44
CSCALCTTrailer2007::CSCALCTTrailer2007
CSCALCTTrailer2007()
Definition:
CSCALCTTrailer.cc:30
CSCALCTTrailer2007::e0dLine
unsigned e0dLine
Definition:
CSCALCTTrailer.h:47
visDQMUpload.buf
buf
Definition:
visDQMUpload.py:154
CSCALCTTrailer2006::d_0
unsigned d_0
Definition:
CSCALCTTrailer.h:28
CSCALCTTrailer2006::CSCALCTTrailer2006
CSCALCTTrailer2006()
Definition:
CSCALCTTrailer.cc:19
CSCALCTTrailer2006::setSize
void setSize(int size)
Definition:
CSCALCTTrailer.h:20
CSCALCTTrailer2006::sizeInWords
short unsigned int sizeInWords() const
Definition:
CSCALCTTrailer.h:25
CSCALCTTrailer2007::reserved_0
unsigned reserved_0
Definition:
CSCALCTTrailer.h:48
CSCALCTTrailer2007::setSize
void setSize(int size)
Definition:
CSCALCTTrailer.h:39
CSCALCTTrailer::CSCALCTTrailer
CSCALCTTrailer(int size, int firmVersion)
needed for packing
Definition:
CSCALCTTrailer.cc:39
findQualityFiles.size
size
Write out results.
Definition:
findQualityFiles.py:443
CSCALCTTrailer::debug
static std::atomic< bool > debug
Definition:
CSCALCTTrailer.h:177
Generated for CMSSW Reference Manual by
1.8.16