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
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::GEMAMC13Status ( )
inline

Definition at line 32 of file GEMAMC13Status.h.

32 {}
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
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
def warn
Definition: __init__.py:21

Member Function Documentation

uint8_t GEMAMC13Status::errors ( ) const
inline

Definition at line 58 of file GEMAMC13Status.h.

References errors_.

Referenced by operator<<().

58 { return errors_; }
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
Definition: __init__.py:21
bool GEMAMC13Status::isBad ( ) const
inline

Definition at line 57 of file GEMAMC13Status.h.

References errors_.

Referenced by GEMRawToDigiModule::produce().

57 { return errors_ != 0; }
uint8_t GEMAMC13Status::warnings ( ) const
inline

Definition at line 59 of file GEMAMC13Status.h.

References warnings_.

Referenced by operator<<().

59 { return warnings_; }

Member Data Documentation

uint8_t GEMAMC13Status::errors_
private

Definition at line 62 of file GEMAMC13Status.h.

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

uint8_t GEMAMC13Status::warnings_
private

Definition at line 63 of file GEMAMC13Status.h.

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