CMS 3D CMS Logo

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

#include <GEMAMC13Status.h>

Classes

union  Errors
 
union  Warnings
 

Public Member Functions

uint8_t errors () const
 
 GEMAMC13Status ()
 
 GEMAMC13Status (const FEDRawData &fedData)
 
void inValidAMC ()
 
bool isBad () const
 
uint8_t warnings () const
 

Private Attributes

uint8_t errors_
 
uint8_t warnings_
 

Detailed Description

Definition at line 10 of file GEMAMC13Status.h.

Constructor & Destructor Documentation

◆ GEMAMC13Status() [1/2]

GEMAMC13Status::GEMAMC13Status ( )
inline

Definition at line 32 of file GEMAMC13Status.h.

32 {}

◆ GEMAMC13Status() [2/2]

GEMAMC13Status::GEMAMC13Status ( const FEDRawData fedData)
inline

Definition at line 33 of file GEMAMC13Status.h.

References FEDRawData::data(), relativeConstraints::error, errors_, FEDTrailer::length, FEDRawData::size(), python::warn(), and warnings_.

33  {
34  Errors error{0};
35  if ((fedData.size() / sizeof(uint64_t)) < 5) {
36  error.InValidSize = 1;
37  } else {
38  FEDTrailer trailer(fedData.data() + fedData.size() - FEDTrailer::length);
39  error.failTrailerCheck = !trailer.check();
40  error.failFragmentLength = (trailer.fragmentLength() * sizeof(uint64_t) != fedData.size());
41  error.moreTrailers = trailer.moreTrailers();
42  error.crcModified = trailer.crcModified();
43  error.slinkError = trailer.slinkError();
44  error.wrongFedId = trailer.wrongFedId();
45  }
46  errors_ = error.codes;
47 
48  Warnings warn{0};
49  warnings_ = warn.wcodes;
50  }
static const uint32_t length
Definition: FEDTrailer.h:57
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
def warn(args, kwargs)
Definition: __init__.py:19
unsigned long long uint64_t
Definition: Time.h:13
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24

Member Function Documentation

◆ errors()

uint8_t GEMAMC13Status::errors ( ) const
inline

Definition at line 58 of file GEMAMC13Status.h.

References errors_.

58 { return errors_; }

◆ inValidAMC()

void GEMAMC13Status::inValidAMC ( )
inline

Definition at line 51 of file GEMAMC13Status.h.

References python::warn(), and warnings_.

Referenced by GEMRawToDigiModule::produce().

51  {
52  Warnings warn{warnings_};
53  warn.InValidAMC = 1;
54  warnings_ = warn.wcodes;
55  }
def warn(args, kwargs)
Definition: __init__.py:19

◆ isBad()

bool GEMAMC13Status::isBad ( ) const
inline

Definition at line 57 of file GEMAMC13Status.h.

References errors_.

Referenced by GEMRawToDigiModule::produce().

57 { return errors_ != 0; }

◆ warnings()

uint8_t GEMAMC13Status::warnings ( ) const
inline

Definition at line 59 of file GEMAMC13Status.h.

References warnings_.

59 { return warnings_; }

Member Data Documentation

◆ errors_

uint8_t GEMAMC13Status::errors_
private

Definition at line 62 of file GEMAMC13Status.h.

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

◆ warnings_

uint8_t GEMAMC13Status::warnings_
private

Definition at line 63 of file GEMAMC13Status.h.

Referenced by GEMAMC13Status(), inValidAMC(), and warnings().