CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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::GEMAMCStatus ( )
inline

Definition at line 32 of file GEMAMCStatus.h.

32 {}
GEMAMCStatus::GEMAMCStatus ( const GEMAMC13 amc13,
const GEMAMC amc 
)
inline

Definition at line 33 of file GEMAMCStatus.h.

References GEMAMC::amcNum(), amcNum_, GEMAMC::backPressure(), GEMAMC::bc0locked(), GEMAMC::bunchCrossing(), GEMAMC13::bunchCrossing(), GEMAMC::daqClockLocked(), GEMAMC::daqReady(), relativeConstraints::error, errors_, GEMAMC13::lastBC, GEMAMC::lv1Id(), GEMAMC13::lv1Id(), GEMAMC::mmcmLocked(), GEMAMC::orbitNumber(), GEMAMC13::orbitNumber(), GEMAMC::runType(), python::warn(), and warnings_.

33  {
34  amcNum_ = amc.amcNum();
35  Errors error{0};
36  error.badEC = (amc13->lv1Id() != amc.lv1Id());
37  // Last BC in AMC13 is different to TCDS, AMC, and VFAT
38  error.badBC = !((amc13->bunchCrossing() == amc.bunchCrossing()) ||
39  (amc13->bunchCrossing() == 0 && amc.bunchCrossing() == GEMAMC13::lastBC));
40  error.badRunType = amc.runType() != 0x1;
41  // Last OC in AMC13 is different to TCDS, AMC, and VFAT
42  error.badOC = !((uint16_t(amc13->orbitNumber()) == amc.orbitNumber()) ||
43  (amc13->bunchCrossing() == 0 && uint16_t(amc.orbitNumber() + 1) == uint16_t(amc13->orbitNumber())));
44  error.MMCMlocked = !amc.mmcmLocked();
45  error.DAQclocklocked = !amc.daqClockLocked();
46  error.DAQnotReday = !amc.daqReady();
47  error.BC0locked = !amc.bc0locked();
48  errors_ = error.ecodes;
49 
50  Warnings warn{0};
51  warn.backPressure = amc.backPressure();
52  warnings_ = warn.wcodes;
53  }
uint8_t bc0locked() const
Definition: GEMAMC.h:111
uint8_t daqReady() const
Definition: GEMAMC.h:112
uint32_t lv1Id() const
Definition: GEMAMC.h:92
uint8_t mmcmLocked() const
Definition: GEMAMC.h:114
uint8_t amcNum() const
Definition: GEMAMC.h:93
uint16_t orbitNumber() const
Definition: GEMAMC.h:96
static const int lastBC
Definition: GEMAMC13.h:112
uint8_t runType() const
Definition: GEMAMC.h:100
uint8_t warnings_
Definition: GEMAMCStatus.h:69
uint16_t errors_
Definition: GEMAMCStatus.h:68
uint32_t orbitNumber() const
Definition: GEMAMC13.h:98
uint8_t daqClockLocked() const
Definition: GEMAMC.h:113
uint32_t lv1Id() const
Definition: GEMAMC13.h:95
uint8_t amcNum_
Definition: GEMAMCStatus.h:67
def warn
Definition: __init__.py:21
uint16_t bunchCrossing() const
Definition: GEMAMC13.h:94
uint16_t bunchCrossing() const
Definition: GEMAMC.h:91
uint8_t backPressure() const
Definition: GEMAMC.h:115

Member Function Documentation

uint8_t GEMAMCStatus::amcNumber ( ) const
inline

Definition at line 61 of file GEMAMCStatus.h.

References amcNum_.

61 { return amcNum_; };
uint8_t amcNum_
Definition: GEMAMCStatus.h:67
uint16_t GEMAMCStatus::errors ( ) const
inline

Definition at line 63 of file GEMAMCStatus.h.

References errors_.

Referenced by operator<<().

63 { return errors_; }
uint16_t errors_
Definition: GEMAMCStatus.h:68
void GEMAMCStatus::inValidOH ( )
inline

Definition at line 55 of file GEMAMCStatus.h.

References python::warn(), and warnings_.

55  {
56  Warnings warn{warnings_};
57  warn.InValidOH = 1;
58  warnings_ = warn.wcodes;
59  }
uint8_t warnings_
Definition: GEMAMCStatus.h:69
def warn
Definition: __init__.py:21
bool GEMAMCStatus::isBad ( ) const
inline

Definition at line 62 of file GEMAMCStatus.h.

References errors_.

62 { return errors_ != 0; }
uint16_t errors_
Definition: GEMAMCStatus.h:68
uint8_t GEMAMCStatus::warnings ( ) const
inline

Definition at line 64 of file GEMAMCStatus.h.

References warnings_.

Referenced by operator<<().

64 { return warnings_; }
uint8_t warnings_
Definition: GEMAMCStatus.h:69

Member Data Documentation

uint8_t GEMAMCStatus::amcNum_
private

Definition at line 67 of file GEMAMCStatus.h.

Referenced by amcNumber(), and GEMAMCStatus().

uint16_t GEMAMCStatus::errors_
private

Definition at line 68 of file GEMAMCStatus.h.

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

uint8_t GEMAMCStatus::warnings_
private

Definition at line 69 of file GEMAMCStatus.h.

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