12#define BOOST_TEST_MODULE Test MCHRaw BareElinkEncoder
13#define BOOST_TEST_MAIN
14#define BOOST_TEST_DYN_LINK
16#include <boost/test/unit_test.hpp>
21#include <fmt/printf.h>
31 enc.addChannelData(1, {
SampaCluster{20, 21, std::vector<uint16_t>{20}},
33 enc.addChannelData(5, {
SampaCluster{100, 101, std::vector<uint16_t>{100, 101}}});
34 enc.addChannelData(13, {
SampaCluster{260, 261, std::vector<uint16_t>{260, 261, 262}}});
35 enc.addChannelData(31, {
SampaCluster{620, 621, std::vector<uint16_t>{620, 621, 622, 623}}});
47 enc.addChannelData(5, {
SampaCluster{100, 101, 505, 606}});
48 enc.addChannelData(13, {
SampaCluster{260, 261, 1313, 141}});
49 enc.addChannelData(31, {
SampaCluster{620, 621, 3131, 414}});
54BOOST_AUTO_TEST_SUITE(o2_mch_raw)
56BOOST_AUTO_TEST_SUITE(elinkencoder)
67 auto initialSize = enc.len();
69 enc.addChannelData(31,
data);
79 auto initialSize = enc.len();
82 std::vector<SampaCluster>
data = {
88 enc.addChannelData(chId,
data);
97 auto initialSize = enc.len();
99 enc.addChannelData(5, {
SampaCluster(100, 101, 505, 606)});
100 enc.addChannelData(13, {
SampaCluster(260, 261, 1313, 141)});
101 enc.addChannelData(31, {
SampaCluster(620, 621, 3131, 414)});
111 auto initialSize = enc.len();
112 enc.addChannelData(1, {
SampaCluster(20, 21, std::vector<uint16_t>{1, 10, 100, 10, 1})});
113 enc.addChannelData(5, {
SampaCluster(100, 101, std::vector<uint16_t>{5, 50, 5})});
114 enc.addChannelData(13, {
SampaCluster(260, 261, std::vector<uint16_t>{13, 14, 15, 15, 13})});
115 enc.addChannelData(31, {
SampaCluster(620, 621, std::vector<uint16_t>{31})});
119template <
typename FORMAT,
typename CHARGESUM>
122 std::cout <<
msg <<
"=";
123 for (
auto i = 0;
i < enc.len();
i++) {
124 std::cout << (enc.get(
i) ?
"1" :
"0");
132 print(
"encoder20", enc);
133 BOOST_CHECK_THROW(enc.get(enc.len()), std::invalid_argument);
140 print(
"encoder10", enc);
141 BOOST_CHECK_THROW(enc.get(enc.len()), std::invalid_argument);
149 enc.fillWithSync(
s + 154);
156BOOST_AUTO_TEST_SUITE_END()
157BOOST_AUTO_TEST_SUITE_END()
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
SampaHeader sampaSync()
The 50-bits Sampa SYNC word.
BOOST_AUTO_TEST_CASE(FlatHisto)
Piece of data for one Sampa channel.
ElinkEncoder< BareFormat, SampleMode > createBareElinkEncoder10()
ElinkEncoder< BareFormat, ChargeSumMode > createBareElinkEncoder20()
BOOST_CHECK_NO_THROW(algorithm::merge(target, other))
BOOST_CHECK_EQUAL(triggersD.size(), triggers.size())
uint64_t const void const *restrict const msg