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 "
GEMVFAT.h
"
5
#include <bitset>
6
#include <ostream>
7
8
class
GEMVFATStatus
{
9
public
:
10
union
Errors
{
11
uint8_t
codes
;
12
struct
{
13
uint8_t
vc
: 1;
// VFAT CRC error
14
uint8_t
InValidHeader
: 1;
15
uint8_t
EC
: 1;
// does not match AMC EC
16
uint8_t
BC
: 1;
// does not match AMC BC
17
};
18
};
19
union
Warnings
{
20
uint8_t
wcodes
;
21
struct
{
22
uint8_t
basicOFW
: 1;
// Basic overflow warning
23
uint8_t
zeroSupOFW
: 1;
// Zero-sup overflow warning
24
};
25
};
26
27
GEMVFATStatus
() {}
28
GEMVFATStatus
(
const
GEMAMC
&
amc
,
const
GEMVFAT
& vfat, uint16_t
position
,
bool
readMultiBX
) {
29
Errors
error
{0};
30
Warnings
warn
{0};
31
32
error
.EC = vfat.
ec
() !=
amc
.lv1Idt();
33
if
(!
readMultiBX
)
34
error
.BC = vfat.
bc
() !=
amc
.bunchCrossing();
35
36
if
(vfat.
version
() > 2) {
37
error
.vc = vfat.
vc
();
38
if
(vfat.
header
() == 0x1E)
39
warn
.basicOFW = 0;
40
else
if
(vfat.
header
() == 0x5E)
41
warn
.basicOFW = 1;
42
else
if
(vfat.
header
() == 0x1A)
43
warn
.zeroSupOFW = 0;
44
else
if
(vfat.
header
() == 0x56)
45
warn
.zeroSupOFW = 1;
46
else
47
error
.InValidHeader = 1;
48
}
49
vfatPosition_
=
position
;
50
51
errors_
=
error
.codes;
52
warnings_
=
warn
.wcodes;
53
}
54
55
uint16_t
vfatPosition
()
const
{
return
vfatPosition_
; }
56
bool
isBad
()
const
{
return
errors_
!= 0; }
57
uint16_t
errors
()
const
{
return
errors_
; }
58
uint8_t
warnings
()
const
{
return
warnings_
; }
59
60
private
:
61
uint16_t
vfatPosition_
;
62
uint16_t
errors_
;
63
uint8_t
warnings_
;
64
};
65
66
inline
std::ostream&
operator<<
(std::ostream&
out
,
const
GEMVFATStatus
&
status
) {
67
out
<<
"GEMVFATStatus errors "
<< std::bitset<8>(
status
.errors()) <<
" warnings "
68
<< std::bitset<8>(
status
.warnings());
69
return
out
;
70
}
71
#endif
operator<<
std::ostream & operator<<(std::ostream &out, const GEMVFATStatus &status)
Definition:
GEMVFATStatus.h:66
GEMVFATStatus::warnings
uint8_t warnings() const
Definition:
GEMVFATStatus.h:58
GEMVFATStatus::Errors::vc
uint8_t vc
Definition:
GEMVFATStatus.h:13
GEMVFATStatus::Warnings::zeroSupOFW
uint8_t zeroSupOFW
Definition:
GEMVFATStatus.h:23
relativeConstraints.error
error
Definition:
relativeConstraints.py:53
GEMVFATStatus::Warnings::wcodes
uint8_t wcodes
Definition:
GEMVFATStatus.h:20
GEMVFAT::header
uint8_t header() const
v3
Definition:
GEMVFAT.h:100
GEMVFATStatus::errors_
uint16_t errors_
Definition:
GEMVFATStatus.h:62
GEMVFATStatus::warnings_
uint8_t warnings_
Definition:
GEMVFATStatus.h:63
python.warn
def warn(args, kwargs)
Definition:
__init__.py:21
GEMVFATStatus::Errors::EC
uint8_t EC
Definition:
GEMVFATStatus.h:15
GEMVFATStatus::isBad
bool isBad() const
Definition:
GEMVFATStatus.h:56
GEMVFATStatus::GEMVFATStatus
GEMVFATStatus(const GEMAMC &amc, const GEMVFAT &vfat, uint16_t position, bool readMultiBX)
Definition:
GEMVFATStatus.h:28
GEMVFAT
Definition:
GEMVFAT.h:5
GEMVFAT::bc
uint16_t bc() const
Definition:
GEMVFAT.h:77
GEMVFAT::ec
uint8_t ec() const
Definition:
GEMVFAT.h:82
GEMVFATStatus::vfatPosition_
uint16_t vfatPosition_
Definition:
GEMVFATStatus.h:61
GEMVFATStatus
Definition:
GEMVFATStatus.h:8
mps_update.status
status
Definition:
mps_update.py:68
GEMVFATStatus::Errors::BC
uint8_t BC
Definition:
GEMVFATStatus.h:16
GEMVFATStatus::Warnings
Definition:
GEMVFATStatus.h:19
MillePedeFileConverter_cfg.out
out
Definition:
MillePedeFileConverter_cfg.py:31
GEMVFATStatus::Errors::codes
uint8_t codes
Definition:
GEMVFATStatus.h:11
GEMVFATStatus::Warnings::basicOFW
uint8_t basicOFW
Definition:
GEMVFATStatus.h:22
GEMVFAT.h
GEMVFATStatus::vfatPosition
uint16_t vfatPosition() const
Definition:
GEMVFATStatus.h:55
if
if(0==first)
Definition:
CAHitNtupletGeneratorKernelsImpl.h:58
GEMAMC
Definition:
GEMAMC.h:6
GEMVFATStatus::Errors
Definition:
GEMVFATStatus.h:10
GEMVFAT::version
int version() const
Definition:
GEMVFAT.h:94
position
static int position[264][3]
Definition:
ReadPGInfo.cc:289
GEMVFAT::vc
bool vc() const
Definition:
GEMVFAT.h:101
amc
Definition:
AMCSpec.h:8
muonGEMDigis_cfi.readMultiBX
readMultiBX
Definition:
muonGEMDigis_cfi.py:11
GEMVFATStatus::GEMVFATStatus
GEMVFATStatus()
Definition:
GEMVFATStatus.h:27
GEMVFATStatus::errors
uint16_t errors() const
Definition:
GEMVFATStatus.h:57
GEMVFATStatus::Errors::InValidHeader
uint8_t InValidHeader
Definition:
GEMVFATStatus.h:14
GEMAMC.h
Generated for CMSSW Reference Manual by
1.8.14