BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
MicrosliceDescriptor.h
Go to the documentation of this file.
1// Copyright 2013 Jan de Cuveland <cmail@cuveland.de>
2/// \file
3/// \brief Defines the fles::MicrosliceDescriptor struct and corresponding
4/// enums.
5#ifndef FLES_MICROSLICEDESCRIPTOR_H
6#define FLES_MICROSLICEDESCRIPTOR_H
7
8#include <boost/serialization/access.hpp>
9#include <cstdint>
10
11/// Main FLES namespace.
12namespace fles
13{
14
15/**
16 * \brief Subsystem identifier enum.
17 *
18 * This enum defines the possible values for the
19 * fles::MicrosliceDescriptor::sys_id variable.
20 */
21enum class SubsystemIdentifier : uint8_t
22{
23 // CBM detectors
24 STS = 0x10, ///< Silicon Tracking System (STS)
25 MVD = 0x20, ///< Micro-Vertex Detector (MVD)
26 RICH = 0x30, ///< Ring Imaging CHerenkov detector (RICH)
27 TRD = 0x40, ///< Transition Radiation Detector (TRD)
28 MUCH = 0x50, ///< Muon Chamber system (MuCh)
29 RPC = 0x60, ///< Resistive Plate Chambers (RPC)
30 ECAL = 0x70, ///< Electromagnetic CALorimeter (ECAL)
31 PSD = 0x80, ///< Projectile Spectator Detector (PSD)
32
33 // Other detectors (experimental)
34 TRB3 = 0xE0, ///< TRB3 Stream
35 Hodoscope = 0xE1, ///< Fiber Hodoscope
36 Cherenkov = 0xE2, ///< Cherenkov
37 LeadGlass = 0xE3, ///< Lead Glas Calorimeter
38
39 // FLES (pattern generators)
40 FLES = 0xF0 ///< First-level Event Selector (FLES)
41};
42
43enum class SubsystemFormatFLES : uint8_t
44{
45 // FLIB hardware pattern generators
46 CbmNetPattern = 0x10, ///< FLIB hardware pattern generator ("pgen")
47 CbmNetFrontendEmulation = 0x11, ///< FLIB front-end emulation ("emu")
49
50 // Flesnet software pattern generators
51 Uninitialized = 0x80, ///< Uninitialized data content (without crc)
52 BasicRampPattern = 0x81 ///< Basic test pattern (without crc)
53};
54
55/**
56 * \brief Header format identifier enum.
57 *
58 * This enum defines the possible values for the
59 * fles::MicrosliceDescriptor::hdr_id variable.
60 */
61enum class HeaderFormatIdentifier : uint8_t
62{
63 Standard = 0xDD
64};
65
66/**
67 * \brief Header format version enum.
68 *
69 * This enum defines the possible values for the
70 * fles::MicrosliceDescriptor::hdr_ver variable.
71 */
72enum class HeaderFormatVersion : uint8_t
73{
74 Standard = 0x01
75};
76
77/**
78 * \brief Microslice status and error flags.
79 *
80 * This enum defines the bits in the
81 * fles::MicrosliceDescriptor::flags word.
82 */
83enum class MicrosliceFlags : uint16_t
84{
85 CrcValid = 0x0001, // information in CRC field is valid
86 OverflowFlim = 0x0002, // truncated by FLIM
87 OverflowUser = 0x0004, // truncated by user logic
88 DataError = 0x0008 // data error flag set by user logic
89};
90
91#pragma pack(1)
92
93/**
94 * \brief %Microslice descriptor struct.
95 *
96 * This packed struct matches the descriptor generated by the FLIB hardware.
97 */
99{
100 uint8_t hdr_id; ///< Header format identifier (0xDD)
101 uint8_t hdr_ver; ///< Header format version (0x01)
102 uint16_t eq_id; ///< Equipment identifier
103 uint16_t flags; ///< Status and error flags
104 uint8_t sys_id; ///< Subsystem identifier
105 uint8_t sys_ver; ///< Subsystem format/version
106 uint64_t idx; ///< Microslice index / start time
107 uint32_t crc; ///< CRC-32C (Castagnoli polynomial) of data content
108 uint32_t size; ///< Content size (bytes)
109 uint64_t offset; ///< Offset in event buffer (bytes)
110
112 /// Provide boost serialization access.
113 template<class Archive>
114 void serialize(Archive& ar, const unsigned int /* version */)
115 {
116 ar & hdr_id;
117 ar & hdr_ver;
118 ar & eq_id;
119 ar & flags;
120 ar & sys_id;
121 ar & sys_ver;
122 ar & idx;
123 ar & crc;
124 ar & size;
125 ar & offset;
126 }
127};
128
129#pragma pack()
130
131} // namespace fles
132
133#endif // FLES_MICROSLICEDESCRIPTOR_H
Main FLES namespace.
HeaderFormatIdentifier
Header format identifier enum.
HeaderFormatVersion
Header format version enum.
SubsystemIdentifier
Subsystem identifier enum.
@ ECAL
Electromagnetic CALorimeter (ECAL).
@ MVD
Micro-Vertex Detector (MVD).
@ RPC
Resistive Plate Chambers (RPC).
@ MUCH
Muon Chamber system (MuCh).
@ PSD
Projectile Spectator Detector (PSD).
@ LeadGlass
Lead Glas Calorimeter.
@ RICH
Ring Imaging CHerenkov detector (RICH).
@ STS
Silicon Tracking System (STS).
@ FLES
First-level Event Selector (FLES).
@ TRD
Transition Radiation Detector (TRD).
MicrosliceFlags
Microslice status and error flags.
@ CbmNetFrontendEmulation
FLIB front-end emulation ("emu").
@ BasicRampPattern
Basic test pattern (without crc).
@ CbmNetPattern
FLIB hardware pattern generator ("pgen").
@ Uninitialized
Uninitialized data content (without crc).
Microslice descriptor struct.
uint16_t flags
Status and error flags.
uint64_t idx
Microslice index / start time.
uint8_t hdr_id
Header format identifier (0xDD).
uint32_t size
Content size (bytes).
friend class boost::serialization::access
uint8_t sys_id
Subsystem identifier.
uint32_t crc
CRC-32C (Castagnoli polynomial) of data content.
uint16_t eq_id
Equipment identifier.
uint8_t hdr_ver
Header format version (0x01).
void serialize(Archive &ar, const unsigned int)
Provide boost serialization access.
uint8_t sys_ver
Subsystem format/version.
uint64_t offset
Offset in event buffer (bytes).