24 if (!opt.has_value()) {
25 throw std::invalid_argument(fmt::format(
"elinkId {} is not valid", elinkId));
27 return opt.value() * 2 + (chId > 31);
42 for (
const auto&
s :
data) {
43 n10 +=
s.nof10BitWords();
47 bunchCrossingCounter =
data[0].bunchCrossing;
52 header.channelAddress(chId % 32);
53 assertNofBits(
"bunchCrossingCounter", bunchCrossingCounter, 20);
54 header.bunchCrossingCounter(bunchCrossingCounter);
68 return (
static_cast<uint64_t>(a10) << 40) |
77 while (b10.size() % 5) {
82void b10to64(std::vector<uint10_t> b10, std::vector<uint64_t>& b64,
uint16_t prefix14)
89 for (
auto i = 0;
i < b10.size();
i += 5) {
91 b64.emplace_back(
v | prefix);
98 b10.emplace_back(
c.nofSamples());
99 b10.emplace_back(
c.sampaTime);
100 if (
c.isClusterSum()) {
101 b10.emplace_back(
c.chargeSum & 0x3FF);
102 b10.emplace_back((
c.chargeSum & 0xFFC00) >> 10);
104 for (
auto&
s :
c.samples) {
113 b10.emplace_back((
value & 0x3FF));
114 b10.emplace_back((
value & 0xFFC00) >> 10);
115 b10.emplace_back((
value & 0x3FF00000) >> 20);
116 b10.emplace_back((
value & 0xFFC0000000) >> 30);
117 b10.emplace_back((
value & 0x3FF0000000000) >> 40);
127 gsl::span<const SampaCluster>
clusters,
unsigned short int uint16_t
std::vector< std::string > header
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
GLsizei const GLfloat * value
uint64_t build64(uint16_t a10, uint16_t b10=0, uint16_t c10=0, uint16_t d10=0, uint16_t e10=0)
void addPadding(std::vector< uint10_t > &b10)
void fillUserLogicBuffer10(std::vector< uint10_t > &b10, gsl::span< const SampaCluster > clusters, uint8_t elinkId, DualSampaChannelId chId, bool addSync)
uint16_t computeChipAddress(uint8_t elinkId, DualSampaChannelId chId)
void assertNofBits(std::string_view msg, T value, int n)
void append(std::vector< uint10_t > &b10, uint50_t value)
SampaHeader buildSampaHeader(uint8_t elinkId, DualSampaChannelId chId, gsl::span< const SampaCluster > data)
int assertIsInRange(std::string what, uint64_t value, uint64_t min, uint64_t max)
void appendSync(std::vector< uint10_t > &b10)
void b10to64(std::vector< uint10_t > b10, std::vector< uint64_t > &b64, uint16_t prefix14)
void bufferizeClusters(gsl::span< const SampaCluster > clusters, std::vector< uint10_t > &b10)
int computeHeaderParity(uint64_t value)
std::optional< uint8_t > indexFromElinkId(uint8_t elinkId)
Extracts the index from the elinkId.
constexpr uint64_t sampaSyncWord
int computeHammingCode(uint64_t value)
std::vector< Cluster > clusters