CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Attributes
GEMAMCStatus Class Reference

#include <GEMAMCStatus.h>

Classes

union  Errors
 
union  Warnings
 

Public Member Functions

uint8_t amcNumber () const
 
uint16_t errors () const
 
 GEMAMCStatus ()
 
 GEMAMCStatus (const GEMAMC13 *amc13, const GEMAMC &amc)
 
void inValidOH ()
 
bool isBad () const
 
uint8_t warnings () const
 

Private Attributes

uint8_t amcNum_
 
uint16_t errors_
 
uint8_t warnings_
 

Detailed Description

Definition at line 8 of file GEMAMCStatus.h.

Constructor & Destructor Documentation

◆ GEMAMCStatus() [1/2]

GEMAMCStatus::GEMAMCStatus ( )
inline

Definition at line 35 of file GEMAMCStatus.h.

35 {}

◆ GEMAMCStatus() [2/2]

GEMAMCStatus::GEMAMCStatus ( const GEMAMC13 amc13,
const GEMAMC amc 
)
inline

Definition at line 36 of file GEMAMCStatus.h.

References amcNum_, relativeConstraints::error, errors_, GEMAMC13::lastBC, python::warn(), and warnings_.

36  {
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  }
def warn(args, kwargs)
Definition: __init__.py:21
static const int lastBC
Definition: GEMAMC13.h:112
uint8_t warnings_
Definition: GEMAMCStatus.h:80
uint16_t errors_
Definition: GEMAMCStatus.h:79
uint8_t amcNum_
Definition: GEMAMCStatus.h:78
Definition: AMCSpec.h:8

Member Function Documentation

◆ amcNumber()

uint8_t GEMAMCStatus::amcNumber ( ) const
inline

Definition at line 72 of file GEMAMCStatus.h.

References amcNum_.

72 { return amcNum_; };
uint8_t amcNum_
Definition: GEMAMCStatus.h:78

◆ errors()

uint16_t GEMAMCStatus::errors ( ) const
inline

Definition at line 74 of file GEMAMCStatus.h.

References errors_.

74 { return errors_; }
uint16_t errors_
Definition: GEMAMCStatus.h:79

◆ inValidOH()

void GEMAMCStatus::inValidOH ( )
inline

Definition at line 66 of file GEMAMCStatus.h.

References python::warn(), and warnings_.

66  {
67  Warnings warn{warnings_};
68  warn.InValidOH = 1;
69  warnings_ = warn.wcodes;
70  }
def warn(args, kwargs)
Definition: __init__.py:21
uint8_t warnings_
Definition: GEMAMCStatus.h:80

◆ isBad()

bool GEMAMCStatus::isBad ( ) const
inline

Definition at line 73 of file GEMAMCStatus.h.

References errors_.

73 { return errors_ != 0; }
uint16_t errors_
Definition: GEMAMCStatus.h:79

◆ warnings()

uint8_t GEMAMCStatus::warnings ( ) const
inline

Definition at line 75 of file GEMAMCStatus.h.

References warnings_.

75 { return warnings_; }
uint8_t warnings_
Definition: GEMAMCStatus.h:80

Member Data Documentation

◆ amcNum_

uint8_t GEMAMCStatus::amcNum_
private

Definition at line 78 of file GEMAMCStatus.h.

Referenced by amcNumber(), and GEMAMCStatus().

◆ errors_

uint16_t GEMAMCStatus::errors_
private

Definition at line 79 of file GEMAMCStatus.h.

Referenced by errors(), GEMAMCStatus(), and isBad().

◆ warnings_

uint8_t GEMAMCStatus::warnings_
private

Definition at line 80 of file GEMAMCStatus.h.

Referenced by GEMAMCStatus(), inValidOH(), and warnings().