CMS 3D CMS Logo

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
 
struct  FRDFileHeader_v2
 
struct  FRDFileHeaderContent_v1
 
struct  FRDFileHeaderContent_v2
 
struct  FRDFileHeaderIdentifier
 

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}}
 
constexpr std::array< unsigned char, 4 > FRDFileVersion_2 {{0x30, 0x30, 0x30, 0x32}}
 

Function Documentation

◆ getFRDFileHeaderVersion()

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

Definition at line 80 of file FRDFileHeader.h.

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

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

80  {
81  size_t i;
82  for (i = 0; i < 4; i++)
83  if (id[i] != FRDFileHeader_id[i])
84  return 0; //not FRD file header
85  uint16_t ret = 0;
86  for (i = 0; i < 4; i++) {
87  if (version[i] > '9' || version[i] < '0')
88  return 0; //NaN sequence
89  ret = ret * 10 + (uint16_t)(version[i] - '0');
90  }
91  return ret;
92 }
ret
prodAgent to be discontinued
constexpr std::array< unsigned char, 4 > FRDFileHeader_id
Definition: FRDFileHeader.h:21

Variable Documentation

◆ FRDFileHeader_id

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

Definition at line 21 of file FRDFileHeader.h.

Referenced by getFRDFileHeaderVersion().

◆ FRDFileVersion_1

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

Definition at line 22 of file FRDFileHeader.h.

◆ FRDFileVersion_2

constexpr std::array<unsigned char, 4> FRDFileVersion_2 {{0x30, 0x30, 0x30, 0x32}}

Definition at line 23 of file FRDFileHeader.h.