src
DataFormats
GEMDigi
interface
GEMVFATStatus.h
Go to the documentation of this file.
1
#ifndef DataFormats_GEMDigi_GEMVFATStatus_h
2
#define DataFormats_GEMDigi_GEMVFATStatus_h
3
#include "
GEMAMC.h
"
4
#include "
GEMOptoHybrid.h
"
5
#include "
GEMVFAT.h
"
6
#include <bitset>
7
#include <ostream>
8
9
class
GEMVFATStatus
{
10
public
:
11
union
Errors
{
12
uint8_t
codes
;
13
struct
{
14
uint8_t
vc
: 1;
// VFAT CRC error
15
uint8_t
InValidHeader
: 1;
16
uint8_t
EC
: 1;
// does not match AMC EC
17
uint8_t
BC
: 1;
// does not match AMC BC
18
uint8_t
vfatMask
: 1;
// VFAT mask error
19
uint8_t
zsMask
: 1;
// Zero Suppression mask error
20
};
21
};
22
union
Warnings
{
23
uint8_t
wcodes
;
24
struct
{
25
uint8_t
basicOFW
: 1;
// Basic overflow warning
26
uint8_t
zeroSupOFW
: 1;
// Zero-sup overflow warning
27
};
28
};
29
30
GEMVFATStatus
() {}
31
GEMVFATStatus
(
const
GEMAMC
&
amc
,
const
GEMOptoHybrid
& oh,
const
GEMVFAT
& vfat,
int
chamberType
,
bool
readMultiBX
)
32
:
chamberType_
(
chamberType
) {
33
Errors
error
{0};
34
Warnings
warn
{0};
35
36
error
.EC = vfat.
ec
() !=
amc
.lv1Idt();
37
if
(!
readMultiBX
)
38
error
.BC = vfat.
bc
() !=
amc
.bunchCrossing();
39
40
if
(oh.
version
() != 0) {
41
error
.vfatMask = (oh.
vfatMask
() >> vfat.
vfatId
()) ^ 0
x1
;
42
error
.zsMask = (oh.
zsMask
() >> vfat.
vfatId
()) & 0
x1
;
43
}
44
45
if
(vfat.
version
() > 2) {
46
error
.vc = vfat.
vc
();
47
if
(vfat.
header
() == 0x1E)
48
warn
.basicOFW = 0;
49
else
if
(vfat.
header
() == 0x5E)
50
warn
.basicOFW = 1;
51
else
if
(vfat.
header
() == 0x1A)
52
warn
.zeroSupOFW = 0;
53
else
if
(vfat.
header
() == 0x56)
54
warn
.zeroSupOFW = 1;
55
else
56
error
.InValidHeader = 1;
57
}
58
vfatPosition_
= vfat.
vfatId
();
59
60
errors_
=
error
.codes;
61
warnings_
=
warn
.wcodes;
62
}
63
64
uint16_t
vfatPosition
()
const
{
return
vfatPosition_
; }
65
bool
isBad
()
const
{
return
errors_
!= 0; }
66
uint8_t
errors
()
const
{
return
errors_
; }
67
uint8_t
warnings
()
const
{
return
warnings_
; }
68
int
chamberType
()
const
{
return
chamberType_
; }
69
70
private
:
71
int
chamberType_
;
72
uint16_t
vfatPosition_
;
73
uint8_t
errors_
;
74
uint8_t
warnings_
;
75
};
76
77
inline
std::ostream&
operator<<
(std::ostream&
out
,
const
GEMVFATStatus
&
status
) {
78
out
<<
"GEMVFATStatus errors "
<< std::bitset<8>(
status
.errors()) <<
" warnings "
79
<< std::bitset<8>(
status
.warnings());
80
return
out
;
81
}
82
#endif
GEMVFATStatus::Errors::vfatMask
uint8_t vfatMask
Definition:
GEMVFATStatus.h:18
operator<<
std::ostream & operator<<(std::ostream &out, const GEMVFATStatus &status)
Definition:
GEMVFATStatus.h:77
GEMVFATStatus::warnings
uint8_t warnings() const
Definition:
GEMVFATStatus.h:67
GEMVFATStatus::Errors::vc
uint8_t vc
Definition:
GEMVFATStatus.h:14
GEMVFATStatus::Warnings::zeroSupOFW
uint8_t zeroSupOFW
Definition:
GEMVFATStatus.h:26
relativeConstraints.error
error
Definition:
relativeConstraints.py:53
GEMVFATStatus::Warnings::wcodes
uint8_t wcodes
Definition:
GEMVFATStatus.h:23
GEMVFAT::header
uint8_t header() const
v3
Definition:
GEMVFAT.h:101
GEMVFATStatus::warnings_
uint8_t warnings_
Definition:
GEMVFATStatus.h:74
GEMOptoHybrid::zsMask
uint32_t zsMask() const
Definition:
GEMOptoHybrid.h:147
python.warn
def warn(args, kwargs)
Definition:
__init__.py:19
GEMVFATStatus::Errors::EC
uint8_t EC
Definition:
GEMVFATStatus.h:16
GEMVFATStatus::isBad
bool isBad() const
Definition:
GEMVFATStatus.h:65
GEMOptoHybrid::version
uint8_t version() const
Definition:
GEMOptoHybrid.h:80
GEMVFAT
Definition:
GEMVFAT.h:5
GEMVFAT::bc
uint16_t bc() const
Definition:
GEMVFAT.h:78
GEMVFAT::ec
uint8_t ec() const
Definition:
GEMVFAT.h:83
GEMVFATStatus::vfatPosition_
uint16_t vfatPosition_
Definition:
GEMVFATStatus.h:72
GEMVFATStatus
Definition:
GEMVFATStatus.h:9
GEMVFATStatus::errors_
uint8_t errors_
Definition:
GEMVFATStatus.h:73
GEMVFATStatus::errors
uint8_t errors() const
Definition:
GEMVFATStatus.h:66
GEMOptoHybrid
Definition:
GEMOptoHybrid.h:6
mps_update.status
status
Definition:
mps_update.py:68
GEMVFATStatus::Errors::BC
uint8_t BC
Definition:
GEMVFATStatus.h:17
GEMVFAT::vfatId
uint16_t vfatId() const
Definition:
GEMVFAT.h:88
GEMVFATStatus::chamberType
int chamberType() const
Definition:
GEMVFATStatus.h:68
GEMVFATStatus::Warnings
Definition:
GEMVFATStatus.h:22
MillePedeFileConverter_cfg.out
out
Definition:
MillePedeFileConverter_cfg.py:31
GEMVFATStatus::Errors::codes
uint8_t codes
Definition:
GEMVFATStatus.h:12
GEMVFATStatus::Warnings::basicOFW
uint8_t basicOFW
Definition:
GEMVFATStatus.h:25
GEMVFAT.h
GEMVFATStatus::vfatPosition
uint16_t vfatPosition() const
Definition:
GEMVFATStatus.h:64
GEMAMC
Definition:
GEMAMC.h:6
GEMVFATStatus::Errors
Definition:
GEMVFATStatus.h:11
GEMVFAT::version
int version() const
Definition:
GEMVFAT.h:95
GEMOptoHybrid::vfatMask
uint32_t vfatMask() const
Definition:
GEMOptoHybrid.h:146
GEMVFATStatus::GEMVFATStatus
GEMVFATStatus(const GEMAMC &amc, const GEMOptoHybrid &oh, const GEMVFAT &vfat, int chamberType, bool readMultiBX)
Definition:
GEMVFATStatus.h:31
GEMVFAT::vc
bool vc() const
Definition:
GEMVFAT.h:102
GEMOptoHybrid.h
GEMVFATStatus::chamberType_
int chamberType_
Definition:
GEMVFATStatus.h:71
amc
Definition:
AMCSpec.h:8
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition:
testProducerWithPsetDescEmpty_cfi.py:33
ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets::if
if(threadIdxLocalY==0 &&threadIdxLocalX==0)
Definition:
CAPixelDoubletsAlgos.h:173
muonGEMDigis_cfi.readMultiBX
readMultiBX
Definition:
muonGEMDigis_cfi.py:11
GEMVFATStatus::GEMVFATStatus
GEMVFATStatus()
Definition:
GEMVFATStatus.h:30
GEMVFATStatus::Errors::zsMask
uint8_t zsMask
Definition:
GEMVFATStatus.h:19
GEMVFATStatus::Errors::InValidHeader
uint8_t InValidHeader
Definition:
GEMVFATStatus.h:15
GEMAMC.h
Generated for CMSSW Reference Manual by
1.8.14