22#define BOOST_TEST_MODULE Test MCHTriggering EventFinder
23#define BOOST_TEST_DYN_LINK
25#include <initializer_list>
29#include <boost/test/unit_test.hpp>
30#include <boost/property_tree/ptree.hpp>
40BOOST_AUTO_TEST_SUITE(mchtriggering)
47 for (
const auto& objLabel : objLabels) {
48 labels.
addElement(objLabel.first, objLabel.second);
53std::vector<o2::mch::ROFRecord>
mchROFs = {
60 {100, 0, 10, 0, 1,
false},
61 {100, 1, 10, 0, 1,
false},
62 {100, 2, 10, 4, 1,
false},
63 {100, 2, 10, 8, 1,
true},
64 {100, 3, 10, 8, 1,
false},
65 {100, 0, 10, 8, 1,
false},
66 {100, 2, 10, 20, 1,
false}};
79std::vector<o2::mid::ROFRecord>
midROFs = {
87 BOOST_CHECK_EQUAL_COLLECTIONS(
output.begin(),
output.end(),
95 for (
int i = 0;
i <
output.getIndexedSize(); ++
i) {
96 const auto outputLabels =
output.getLabels(
i);
97 const auto expectedLabels =
expected.getLabels(
i);
98 BOOST_CHECK_EQUAL_COLLECTIONS(outputLabels.begin(), outputLabels.end(),
99 expectedLabels.begin(), expectedLabels.end());
119 std::vector<o2::mch::ROFRecord> expectedROFs = {
123 std::vector<o2::mch::Digit> expectedDigits = {
124 {100, 0, 10, 0, 1,
false},
125 {100, 1, 10, 0, 1,
false},
126 {100, 2, 10, 20, 1,
false}};
134 compare(eventFinder.getOutputROFs(), expectedROFs);
135 compare(eventFinder.getOutputDigits(), expectedDigits);
136 compare(eventFinder.getOutputLabels(), expectedLabels);
156 std::vector<o2::mch::ROFRecord> expectedROFs = {
161 std::vector<o2::mch::Digit> expectedDigits = {
162 {100, 0, 10, 0, 1,
false},
163 {100, 1, 10, 0, 1,
false},
164 {100, 2, 10, 4, 1,
false},
165 {100, 2, 10, 8, 1,
true},
166 {100, 3, 10, 8, 1,
false},
167 {100, 0, 10, 8, 1,
false},
168 {100, 2, 10, 20, 1,
false}};
181 compare(eventFinder.getOutputROFs(), expectedROFs);
182 compare(eventFinder.getOutputDigits(), expectedDigits);
183 compare(eventFinder.getOutputLabels(), expectedLabels);
202 std::vector<o2::mch::ROFRecord> expectedROFs = {
206 std::vector<o2::mch::Digit> expectedDigits = {
207 {100, 0, 20, 0, 2,
false},
208 {100, 1, 10, 0, 1,
false},
209 {100, 2, 20, 4, 2,
true},
210 {100, 3, 10, 8, 1,
false},
211 {100, 2, 10, 20, 1,
false}};
224 compare(eventFinder.getOutputROFs(), expectedROFs);
225 compare(eventFinder.getOutputDigits(), expectedDigits);
226 compare(eventFinder.getOutputLabels(), expectedLabels);
244 std::vector<o2::mch::ROFRecord> expectedROFs = {
247 std::vector<o2::mch::Digit> expectedDigits = {
248 {100, 0, 20, 0, 2,
false},
249 {100, 1, 10, 0, 1,
false},
250 {100, 2, 30, 4, 3,
true},
251 {100, 3, 10, 8, 1,
false}};
264 compare(eventFinder.getOutputROFs(), expectedROFs);
265 compare(eventFinder.getOutputDigits(), expectedDigits);
266 compare(eventFinder.getOutputLabels(), expectedLabels);
285 std::vector<o2::mch::ROFRecord> expectedROFs = {
289 std::vector<o2::mch::Digit> expectedDigits = {
290 {100, 2, 10, 8, 1,
true},
291 {100, 3, 10, 8, 1,
false},
292 {100, 0, 10, 8, 1,
false},
293 {100, 2, 10, 20, 1,
false}};
302 compare(eventFinder.getOutputROFs(), expectedROFs);
303 compare(eventFinder.getOutputDigits(), expectedDigits);
304 compare(eventFinder.getOutputLabels(), expectedLabels);
307BOOST_AUTO_TEST_SUITE_END()
Definition of a class to group MCH digits based on MID information.
Definition of a container to keep Monte Carlo truth external to simulation objects.
static void setValue(std::string const &mainkey, std::string const &subkey, T x)
Class to group MCH digits based on MID information.
void run(const gsl::span< const mch::ROFRecord > &mchROFs, const gsl::span< const mch::Digit > &digits, const dataformats::MCLabelContainer *labels, const gsl::span< const mid::ROFRecord > &midROFs)
run the event finder algorithm
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Defining DataPointCompositeObject explicitly as copiable.
std::map< std::string, ID > expected
BOOST_AUTO_TEST_CASE(TriggerWidth1BC)
std::pair< uint32_t, o2::MCCompLabel > ObjLabel
std::vector< o2::mid::ROFRecord > midROFs
o2::dataformats::MCLabelContainer mchLabels
void compare(const std::vector< T > &output, const std::vector< T > &expected)
std::vector< o2::mch::Digit > mchDigits
o2::dataformats::MCLabelContainer createLabels(std::initializer_list< ObjLabel > objLabels)
std::vector< o2::mch::ROFRecord > mchROFs
BOOST_CHECK_EQUAL(triggersD.size(), triggers.size())