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
if
(
amc
.formatVer() == 0)
45
// Last OC in AMC13 is different to TCDS, AMC, and VFAT
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());
51
error
.MMCMlocked = !
amc
.mmcmLocked();
52
error
.DAQclocklocked = !
amc
.daqClockLocked();
53
error
.DAQnotReday = !
amc
.daqReady();
54
error
.BC0locked = !
amc
.bc0locked();
55
error
.badFEDId = (
amc13
->sourceId() !=
amc
.softSrcId() and
amc
.formatVer() != 0);
56
error
.L1AFull = (
amc
.l1aF() and
amc
.formatVer() != 0);
57
errors_
=
error
.ecodes;
58
59
Warnings
warn
{0};
60
warn
.backPressure =
amc
.backPressure();
61
warn
.L1ANearFull = (
amc
.l1aNF() and
amc
.formatVer() != 0);
62
warnings_
=
warn
.wcodes;
63
}
64
65
void
inValidOH
() {
66
Warnings
warn
{
warnings_
};
67
warn
.InValidOH = 1;
68
warnings_
=
warn
.wcodes;
69
}
70
71
uint8_t
amcNumber
()
const
{
return
amcNum_
; };
72
bool
isBad
()
const
{
return
errors_
!= 0; }
73
uint16_t
errors
()
const
{
return
errors_
; }
74
uint8_t
warnings
()
const
{
return
warnings_
; }
75
76
private
:
77
uint8_t
amcNum_
;
78
uint16_t
errors_
;
79
uint8_t
warnings_
;
80
};
81
82
inline
std::ostream&
operator<<
(std::ostream&
out
,
const
GEMAMCStatus
&
status
) {
83
out
<<
"GEMAMCStatus errors "
<< std::bitset<16>(
status
.errors()) <<
" warnings "
84
<< std::bitset<8>(
status
.warnings());
85
return
out
;
86
}
87
88
#endif
relativeConstraints.error
error
Definition:
relativeConstraints.py:53
GEMAMCStatus::inValidOH
void inValidOH()
Definition:
GEMAMCStatus.h:65
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:21
GEMAMCStatus::amcNumber
uint8_t amcNumber() const
Definition:
GEMAMCStatus.h:71
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:73
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:72
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:79
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:78
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:82
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:77
GEMAMCStatus::warnings
uint8_t warnings() const
Definition:
GEMAMCStatus.h:74
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