src
DataFormats
GEMDigi
interface
GEMAMCStatus.h
Go to the documentation of this file.
1
#ifndef DataFormats_GEMDigi_GEMAMCStatus_h
2
#define DataFormats_GEMDigi_GEMAMCStatus_h
3
#include "
GEMAMC13.h
"
4
#include "
GEMAMC.h
"
5
#include <bitset>
6
#include <ostream>
7
8
class
GEMAMCStatus
{
9
public
:
10
union
Errors
{
11
uint16_t
ecodes
;
12
struct
{
13
uint16_t
badEC
: 1;
// event counter
14
uint16_t
badBC
: 1;
// bunch crossing
15
uint16_t
badOC
: 1;
// orbit number
16
uint16_t
badRunType
: 1;
17
uint16_t
badCRC
: 1;
18
uint16_t
MMCMlocked
: 1;
19
uint16_t
DAQclocklocked
: 1;
20
uint16_t
DAQnotReday
: 1;
21
uint16_t
BC0locked
: 1;
22
uint16_t
badFEDId
: 1;
23
uint16_t
L1AFull
: 1;
24
};
25
};
26
union
Warnings
{
27
uint8_t
wcodes
;
28
struct
{
29
uint8_t
InValidOH
: 1;
30
uint8_t
backPressure
: 1;
31
uint8_t
L1ANearFull
: 1;
32
};
33
};
34
35
GEMAMCStatus
() {}
36
GEMAMCStatus
(
const
GEMAMC13
*
amc13
,
const
GEMAMC
&
amc
) {
37
amcNum_
=
amc
.amcNum();
38
Errors
error
{0};
39
error
.badEC = (
amc13
->lv1Id() !=
amc
.lv1Id());
40
// Last BC in AMC13 is different to TCDS, AMC, and VFAT
41
error
.badBC = !((
amc13
->bunchCrossing() ==
amc
.bunchCrossing()) ||
42
(
amc13
->bunchCrossing() == 0 &&
amc
.bunchCrossing() ==
GEMAMC13::lastBC
));
43
error
.badRunType =
amc
.runType() != 0x1;
44
// Last OC in AMC13 is different to TCDS, AMC, and VFAT
45
if
(
amc
.formatVer() == 0)
46
error
.badOC =
47
!((uint16_t(
amc13
->orbitNumber()) ==
amc
.orbitNumber()) ||
48
(
amc13
->bunchCrossing() == 0 && uint16_t(
amc
.orbitNumber() + 1) == uint16_t(
amc13
->orbitNumber())));
49
else
50
error
.badOC = !((
amc13
->orbitNumber() == (
amc
.orbitNumber() + 1)) ||
51
(
amc13
->bunchCrossing() == 0 &&
amc13
->orbitNumber() == (
amc
.orbitNumber() + 2)));
52
error
.MMCMlocked = !
amc
.mmcmLocked();
53
error
.DAQclocklocked = !
amc
.daqClockLocked();
54
error
.DAQnotReday = !
amc
.daqReady();
55
error
.BC0locked = !
amc
.bc0locked();
56
error
.badFEDId = (
amc13
->sourceId() !=
amc
.softSrcId() and
amc
.formatVer() != 0);
57
error
.L1AFull = (
amc
.l1aF() and
amc
.formatVer() != 0);
58
errors_
=
error
.ecodes;
59
60
Warnings
warn
{0};
61
warn
.backPressure =
amc
.backPressure();
62
warn
.L1ANearFull = (
amc
.l1aNF() and
amc
.formatVer() != 0);
63
warnings_
=
warn
.wcodes;
64
}
65
66
void
inValidOH
() {
67
Warnings
warn
{
warnings_
};
68
warn
.InValidOH = 1;
69
warnings_
=
warn
.wcodes;
70
}
71
72
uint8_t
amcNumber
()
const
{
return
amcNum_
; };
73
bool
isBad
()
const
{
return
errors_
!= 0; }
74
uint16_t
errors
()
const
{
return
errors_
; }
75
uint8_t
warnings
()
const
{
return
warnings_
; }
76
77
private
:
78
uint8_t
amcNum_
;
79
uint16_t
errors_
;
80
uint8_t
warnings_
;
81
};
82
83
inline
std::ostream&
operator<<
(std::ostream&
out
,
const
GEMAMCStatus
&
status
) {
84
out
<<
"GEMAMCStatus errors "
<< std::bitset<16>(
status
.errors()) <<
" warnings "
85
<< std::bitset<8>(
status
.warnings());
86
return
out
;
87
}
88
89
#endif
relativeConstraints.error
error
Definition:
relativeConstraints.py:53
GEMAMCStatus::inValidOH
void inValidOH()
Definition:
GEMAMCStatus.h:66
amc13
Definition:
AMC13Spec.h:14
GEMAMCStatus::Warnings
Definition:
GEMAMCStatus.h:26
GEMAMCStatus::Errors::badRunType
uint16_t badRunType
Definition:
GEMAMCStatus.h:16
python.warn
def warn(args, kwargs)
Definition:
__init__.py:19
GEMAMCStatus::amcNumber
uint8_t amcNumber() const
Definition:
GEMAMCStatus.h:72
GEMAMCStatus::Errors::badBC
uint16_t badBC
Definition:
GEMAMCStatus.h:14
GEMAMCStatus::Errors::badCRC
uint16_t badCRC
Definition:
GEMAMCStatus.h:17
GEMAMCStatus::Warnings::wcodes
uint8_t wcodes
Definition:
GEMAMCStatus.h:27
GEMAMCStatus::Errors::badOC
uint16_t badOC
Definition:
GEMAMCStatus.h:15
GEMAMCStatus::errors
uint16_t errors() const
Definition:
GEMAMCStatus.h:74
GEMAMCStatus::GEMAMCStatus
GEMAMCStatus(const GEMAMC13 *amc13, const GEMAMC &amc)
Definition:
GEMAMCStatus.h:36
GEMAMCStatus::Errors::ecodes
uint16_t ecodes
Definition:
GEMAMCStatus.h:11
GEMAMC13::lastBC
static const int lastBC
Definition:
GEMAMC13.h:112
GEMAMCStatus::isBad
bool isBad() const
Definition:
GEMAMCStatus.h:73
mps_update.status
status
Definition:
mps_update.py:68
GEMAMCStatus::Errors::badEC
uint16_t badEC
Definition:
GEMAMCStatus.h:13
GEMAMCStatus::warnings_
uint8_t warnings_
Definition:
GEMAMCStatus.h:80
GEMAMCStatus::Errors::MMCMlocked
uint16_t MMCMlocked
Definition:
GEMAMCStatus.h:18
GEMAMCStatus::Errors::L1AFull
uint16_t L1AFull
Definition:
GEMAMCStatus.h:23
GEMAMCStatus::Errors::DAQnotReday
uint16_t DAQnotReday
Definition:
GEMAMCStatus.h:20
GEMAMCStatus::errors_
uint16_t errors_
Definition:
GEMAMCStatus.h:79
GEMAMCStatus::Warnings::InValidOH
uint8_t InValidOH
Definition:
GEMAMCStatus.h:29
GEMAMCStatus::Errors::DAQclocklocked
uint16_t DAQclocklocked
Definition:
GEMAMCStatus.h:19
MillePedeFileConverter_cfg.out
out
Definition:
MillePedeFileConverter_cfg.py:31
GEMAMCStatus
Definition:
GEMAMCStatus.h:8
GEMAMC13.h
GEMAMCStatus::GEMAMCStatus
GEMAMCStatus()
Definition:
GEMAMCStatus.h:35
GEMAMC
Definition:
GEMAMC.h:6
operator<<
std::ostream & operator<<(std::ostream &out, const GEMAMCStatus &status)
Definition:
GEMAMCStatus.h:83
GEMAMCStatus::Warnings::backPressure
uint8_t backPressure
Definition:
GEMAMCStatus.h:30
GEMAMCStatus::Warnings::L1ANearFull
uint8_t L1ANearFull
Definition:
GEMAMCStatus.h:31
GEMAMCStatus::amcNum_
uint8_t amcNum_
Definition:
GEMAMCStatus.h:78
GEMAMCStatus::warnings
uint8_t warnings() const
Definition:
GEMAMCStatus.h:75
GEMAMCStatus::Errors::BC0locked
uint16_t BC0locked
Definition:
GEMAMCStatus.h:21
GEMAMC13
Definition:
GEMAMC13.h:6
amc
Definition:
AMCSpec.h:8
GEMAMCStatus::Errors::badFEDId
uint16_t badFEDId
Definition:
GEMAMCStatus.h:22
GEMAMC.h
GEMAMCStatus::Errors
Definition:
GEMAMCStatus.h:10
Generated for CMSSW Reference Manual by
1.8.14