18#include <fmt/format.h>
39 while ((ndig =
advance(in, dff.digitSize,
"digits")) >= 0) {
48 std::vector<Digit>&
digits,
49 std::vector<ROFRecord>& rofs)
51 if (in.peek() == EOF) {
58 for (
int i = 0;
i < ndigits;
i++) {
65 in.read(
reinterpret_cast<char*
>(&tfTime),
sizeof(
uint32_t));
66 in.read(
reinterpret_cast<char*
>(&nofSamples),
sizeof(
uint16_t));
67 in.read(
reinterpret_cast<char*
>(&sat),
sizeof(
uint8_t));
68 in.read(
reinterpret_cast<char*
>(&deID),
sizeof(
uint32_t));
69 in.read(
reinterpret_cast<char*
>(&padID),
sizeof(
uint32_t));
70 in.read(
reinterpret_cast<char*
>(&
adc),
sizeof(
uint32_t));
71 digits.emplace_back(deID, padID,
adc, tfTime, nofSamples, sat > 0);
86 gsl::span<const Digit>
digits,
87 gsl::span<const ROFRecord> rofs)
92 for (
int i =
r.getFirstIdx();
i <=
r.getLastIdx();
i++) {
100 out.write(
reinterpret_cast<const char*
>(&tfTime),
sizeof(
uint32_t));
101 out.write(
reinterpret_cast<const char*
>(&nofSamples),
sizeof(
uint16_t));
102 out.write(
reinterpret_cast<const char*
>(&sat),
sizeof(
uint8_t));
103 out.write(
reinterpret_cast<const char*
>(&deID),
sizeof(
uint32_t));
104 out.write(
reinterpret_cast<const char*
>(&padID),
sizeof(
uint32_t));
105 out.write(
reinterpret_cast<const char*
>(&
adc),
sizeof(
uint32_t));
unsigned short int uint16_t
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 d
MCH digit implementation.
void count(std::istream &in, size_t &ntfs, size_t &nrofs, size_t &ndigits) override
bool read(std::istream &in, std::vector< Digit > &digits, std::vector< ROFRecord > &rofs) override
void rewind(std::istream &in)
int advance(std::istream &in, size_t itemByteSize, const char *itemName)
void writeNofItems(std::ostream &out, uint32_t nofItems)
int readNofItems(std::istream &in, const char *itemName)
std::array< DigitFileFormat, 5 > digitFileFormats
void rewind(std::istream &in)
bool write(std::ostream &out, gsl::span< const Digit > digits, gsl::span< const ROFRecord > rofs) override
std::vector< Digit > digits