LDMX Software
Packing
include
Packing
LDMXRoRHeader.h
1
#pragma once
2
#ifndef PACKING_LDMXRORHEADER_H
3
#define PACKING_LDMXRORHEADER_H
4
5
#include <cstdint>
6
#include <unordered_map>
7
#include <vector>
8
9
#include "Packing/Utility/Reader.h"
10
11
namespace
packing {
12
22
class
LDMXRoRHeader
{
23
public
:
25
static
const
unsigned
int
SIZE
= 16;
35
static
const
std::unordered_map<std::string, int>
SUBSYSTEM_ID
;
36
49
static
const
std::unordered_map<std::string, int>
CONTRIBUTOR_ID
;
50
63
static
std::tuple<int, int>
subsystem
(
const
std::string& name);
64
79
static
std::string
getSubsystemName
(uint8_t subsystem_id, uint8_t contributor_id);
80
82
utility::Reader
&
read
(
utility::Reader
& r);
85
bool
valid
()
const
{
return
valid_
; }
87
uint8_t
version
()
const
{
return
version_
; }
89
uint8_t
subsystem
()
const
{
return
subsystem_
; }
91
uint8_t
contributor
()
const
{
return
contributor_
; }
93
uint64_t
timestamp
()
const
{
return
timestamp_
; }
94
95
private
:
97
bool
valid_
{
false
};
99
uint8_t
version_
;
101
uint8_t
subsystem_
;
103
uint8_t
contributor_
;
111
uint64_t
timestamp_
;
112
113
};
114
115
}
// namespace packing
116
117
#endif
packing::LDMXRoRHeader
the header that the LDMX DAQ Firmware block includes in the output data stream at the beginning of ea...
Definition
LDMXRoRHeader.h:22
packing::LDMXRoRHeader::timestamp_
uint64_t timestamp_
timestamp of this Readout-Request (RoR)
Definition
LDMXRoRHeader.h:111
packing::LDMXRoRHeader::subsystem
uint8_t subsystem() const
ID number for subsystem originating data (compiled into firmware)
Definition
LDMXRoRHeader.h:89
packing::LDMXRoRHeader::valid_
bool valid_
set to true only when all validity checks pass during read()
Definition
LDMXRoRHeader.h:97
packing::LDMXRoRHeader::contributor
uint8_t contributor() const
ID number for contributor within subsystem (configured into firmware)
Definition
LDMXRoRHeader.h:91
packing::LDMXRoRHeader::getSubsystemName
static std::string getSubsystemName(uint8_t subsystem_id, uint8_t contributor_id)
Get the subsystem name from subsystem and contributor IDs.
Definition
LDMXRoRHeader.cxx:27
packing::LDMXRoRHeader::version
uint8_t version() const
version of LDMX data (should be zero)
Definition
LDMXRoRHeader.h:87
packing::LDMXRoRHeader::valid
bool valid() const
true if the header was parsed successfully (sentinel and reserved word matched)
Definition
LDMXRoRHeader.h:85
packing::LDMXRoRHeader::contributor_
uint8_t contributor_
ID number for contributor within subsystem (configured into firmware)
Definition
LDMXRoRHeader.h:103
packing::LDMXRoRHeader::SUBSYSTEM_ID
static const std::unordered_map< std::string, int > SUBSYSTEM_ID
The subsystem ID numbers organized by subsystem name.
Definition
LDMXRoRHeader.h:35
packing::LDMXRoRHeader::timestamp
uint64_t timestamp() const
get timestamp of this RoR
Definition
LDMXRoRHeader.h:93
packing::LDMXRoRHeader::version_
uint8_t version_
version of LDMX data (should be zero)
Definition
LDMXRoRHeader.h:99
packing::LDMXRoRHeader::read
utility::Reader & read(utility::Reader &r)
read the next LDMX RoR header into memory
Definition
LDMXRoRHeader.cxx:56
packing::LDMXRoRHeader::subsystem_
uint8_t subsystem_
ID number for subsystem originating data (compiled into firmware)
Definition
LDMXRoRHeader.h:101
packing::LDMXRoRHeader::CONTRIBUTOR_ID
static const std::unordered_map< std::string, int > CONTRIBUTOR_ID
The contributor ID is a configurable parameter of the DAQ firmware.
Definition
LDMXRoRHeader.h:49
packing::LDMXRoRHeader::SIZE
static const unsigned int SIZE
size of this header in bytes
Definition
LDMXRoRHeader.h:25
packing::utility::Reader
Reading a raw data file.
Definition
Reader.h:20
Generated by
1.12.0