12#define BOOST_TEST_MODULE test mch calibration pedestal data
13#define BOOST_TEST_DYN_LINK
14#include <boost/test/unit_test.hpp>
26 std::vector<uint16_t>
v(
n);
27 std::uniform_int_distribution<int> distribution(0, 1024);
28 std::mt19937 generator(std::random_device{}());
29 std::generate(
v.begin(),
v.end(), [&distribution, &generator] {
30 return distribution(generator);
60 std::vector<PedestalDigit> allDigits;
62 auto det2elec = o2::mch::raw::createDet2ElecMapper<o2::mch::raw::ElectronicMapperGenerated>();
68 auto dsId = seg.padDualSampaId(padID);
69 auto ch = seg.padDualSampaChannel(padID);
70 o2::mch::raw::DsDetId det(deId, dsId);
71 auto elec = det2elec(det).value();
72 auto solarId = elec.solarId();
73 allDigits.emplace_back(solarId, elec.elinkId(), ch, 42, 42, samples(15));
81 BOOST_REQUIRE(allDigits.size() == 1063528);
83 for (
const auto& ped : pd) {
93 auto it1 = pd.
begin();
94 auto it2 = pd.
begin();
102 auto it1 = pd.
begin();
112 for (
auto rec : pd) {
129 auto n1 = std::distance(pd.
begin(), pd.
end());
139 return c.mEntries > 0;
144BOOST_AUTO_TEST_CASE(IterationOnEmptyDataShouldNotBeAnInfiniteLoop, *boost::unit_test::timeout(10))
150BOOST_AUTO_TEST_SUITE_END()
o2::mch::mapping::CathodeSegmentation seg
Compute and store the mean and RMS of the pedestal digit amplitudes.
const_iterator cend() const
const_iterator cbegin() const
void fill(const gsl::span< const PedestalDigit > digits)
"Fat" digit for pedestal data.
void forEachPad(CALLABLE &&func) const
bool isValid(int catPadIndex) const
Not every integer is a valid catPadIndex. This method will tell if catPadIndex is a valid one.
std::array< int, 156 > deIdsForAllMCH
O2MCHMAPPINGIMPL3_EXPORT const Segmentation & segmentation(int detElemId)
std::vector< PedestalDigit > digits
Pedestal mean and sigma for one channel.
BOOST_AUTO_TEST_CASE(TestIteratorOnCompletePedestalData)
BOOST_TEST(digits==digitsD, boost::test_tools::per_element())
std::vector< Digit > digits