CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Functions | Variables
FRDFileHeader.h File Reference
#include <array>
#include <cstddef>
#include <cstdint>

Go to the source code of this file.

Classes

struct  FRDFileHeader_v1
 

Functions

uint16_t getFRDFileHeaderVersion (const std::array< uint8_t, 4 > &id, const std::array< uint8_t, 4 > &version)
 

Variables

constexpr std::array< unsigned
char, 4 > 
FRDFileHeader_id {{0x52, 0x41, 0x57, 0x5f}}
 
constexpr std::array< unsigned
char, 4 > 
FRDFileVersion_1 {{0x30, 0x30, 0x30, 0x31}}
 

Function Documentation

uint16_t getFRDFileHeaderVersion ( const std::array< uint8_t, 4 > &  id,
const std::array< uint8_t, 4 > &  version 
)
inline

Definition at line 43 of file FRDFileHeader.h.

References FRDFileHeader_id, mps_fire::i, and runTheMatrix::ret.

Referenced by evf::EvFDaqDirector::parseFRDFileHeader(), evf::EvFDaqDirector::rawFileHasHeader(), and FRDStreamSource::setRunAndEventInfo().

43  {
44  size_t i;
45  for (i = 0; i < 4; i++)
46  if (id[i] != FRDFileHeader_id[i])
47  return 0; //not FRD file header
48  uint16_t ret = 0;
49  for (i = 0; i < 4; i++) {
50  if (version[i] > '9' || version[i] < '0')
51  return 0; //NaN sequence
52  ret = ret * 10 + (uint16_t)(version[i] - '0');
53  }
54  return ret;
55 }
tuple ret
prodAgent to be discontinued
constexpr std::array< unsigned char, 4 > FRDFileHeader_id
Definition: FRDFileHeader.h:21

Variable Documentation

constexpr std::array<unsigned char, 4> FRDFileHeader_id {{0x52, 0x41, 0x57, 0x5f}}

Definition at line 21 of file FRDFileHeader.h.

Referenced by FRDFileHeader_v1::FRDFileHeader_v1(), and getFRDFileHeaderVersion().

constexpr std::array<unsigned char, 4> FRDFileVersion_1 {{0x30, 0x30, 0x30, 0x31}}

Definition at line 22 of file FRDFileHeader.h.