16#include <fmt/format.h>
25std::string triggerTypeAsString(
uint32_t triggerType)
29 if (triggerType == 0) {
86 auto triggerType = o2::raw::RDHUtils::getTriggerType(rdh);
87 auto headerSize = o2::raw::RDHUtils::getHeaderSize(rdh);
89 os << fmt::format(
"version {:03d} headerSize {:03d} triggerType {:08x} {:s}\n",
93 triggerTypeAsString(triggerType));
95 os << fmt::format(
"cruId {:03d} dpwId {:02d} linkId {:03d}\n",
96 o2::raw::RDHUtils::getCRUID(rdh),
97 o2::raw::RDHUtils::getEndPointID(rdh),
98 o2::raw::RDHUtils::getLinkID(rdh));
100 auto memorySize = o2::raw::RDHUtils::getMemorySize(rdh);
102 os << fmt::format(
"offsetToNext {:05d} memorySize {:05d} {:s}\n",
103 o2::raw::RDHUtils::getOffsetToNext(rdh),
105 memorySize == headerSize ?
"EMPTY" :
"");
107 os << fmt::format(
"heartbeatOrbit{:010d} heartbeatBC {:04d} feeId {:6d}\n",
108 o2::raw::RDHUtils::getHeartBeatOrbit(rdh),
109 o2::raw::RDHUtils::getHeartBeatBC(rdh),
110 o2::raw::RDHUtils::getFEEID(rdh));
112 auto stop = o2::raw::RDHUtils::getStop(rdh);
113 os << fmt::format(
"stopBit {:1d} pagesCounter {:03d} packetCounter {:03d} {:s}\n",
115 o2::raw::RDHUtils::getPageCounter(rdh),
116 o2::raw::RDHUtils::getPacketCounter(rdh),
131 buffer.emplace_back(std::byte{
static_cast<uint8_t>((
w & UINT64_C(0x00000000000000FF)) >> 0)});
132 buffer.emplace_back(std::byte{
static_cast<uint8_t>((
w & UINT64_C(0x000000000000FF00)) >> 8)});
133 buffer.emplace_back(std::byte{
static_cast<uint8_t>((
w & UINT64_C(0x0000000000FF0000)) >> 16)});
134 buffer.emplace_back(std::byte{
static_cast<uint8_t>((
w & UINT64_C(0x00000000FF000000)) >> 24)});
135 buffer.emplace_back(std::byte{
static_cast<uint8_t>((
w & UINT64_C(0x000000FF00000000)) >> 32)});
136 buffer.emplace_back(std::byte{
static_cast<uint8_t>((
w & UINT64_C(0x0000FF0000000000)) >> 40)});
137 buffer.emplace_back(std::byte{
static_cast<uint8_t>((
w & UINT64_C(0x00FF000000000000)) >> 48)});
138 buffer.emplace_back(std::byte{
static_cast<uint8_t>((
w & UINT64_C(0xFF00000000000000)) >> 56)});
144 buffer.emplace_back(
static_cast<uint32_t>((
w & UINT64_C(0xFFFFFFFF00000000)) >> 32));
175 throw std::invalid_argument(fmt::format(
"buffer should be at least {} bytes",
minSize));
198 const void* rdhPtr =
reinterpret_cast<const void*
>(
buffer.data() +
index);
206 auto offsetToNext = o2::raw::RDHUtils::getOffsetToNext(rdhPtr);
207 if (offsetToNext == 0) {
210 index += offsetToNext;
217 assert(
buffer.size() % 4 == 0);
223 std::cout << (*reinterpret_cast<const RAWDataHeaderV4*>(rdhPtr)) <<
"\n";
226 std::cout << (*reinterpret_cast<const RAWDataHeaderV5*>(rdhPtr)) <<
"\n";
229 std::cout << (*reinterpret_cast<const RAWDataHeaderV6*>(rdhPtr)) <<
"\n";
232 std::cout << (*reinterpret_cast<const RAWDataHeaderV7*>(rdhPtr)) <<
"\n";
235 throw std::invalid_argument(fmt::format(
"RDH version {} not yet supported by showRDHs function",
Definition of the 32 Central Trigger System (CTS) Trigger Types defined in https://twiki....
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error s
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char Directory with events to Events directory is and not inside events Show standalone event Run event generator maximum time bin of continuous for triggered for automatic continuous for automatic continuous triggered uint64_t
GLubyte GLubyte GLubyte GLubyte w
uint64_t eightBytes(gsl::span< const std::byte > buffer)
o2::header::RDHAny createRDH(gsl::span< const std::byte > buffer, int version)
int forEachRDH(gsl::span< const std::byte > buffer, std::function< void(const void *)> f=nullptr)
void append(const char *msg, std::string &to)
int countRDHs(gsl::span< const std::byte > buffer)
Count the number of RDHs in the buffer.
void appendRDH(std::vector< std::byte > &buffer, const o2::header::RDHAny &rdh)
Append bytes from RDH to the buffer.
int showRDHs(gsl::span< const std::byte > buffer)
Dump the RDHs found in the buffer.
constexpr uint32_t TPCrst
static bool checkRDH(const RDHv4 &rdh, bool verbose=true, bool checkZeros=false)
static void setVersion(H &rdh, uint8_t v, NOTPTR(H))
static constexpr int getVersion()
get numeric version of the RDH