@@ -28,17 +28,18 @@ BOOST_AUTO_TEST_CASE(ConsecutiveFramesSelectTheirOwnCollisionsAndLookupROFs)
2828 const std::array<o2::InteractionRecord, 2 > collisions{firstOrigin + 50 , firstOrigin + 250 };
2929 const std::array<float , 2 > z{1 .f , 7 .f };
3030 // Two ROFs with nonzero delay and bias, matching the cluster loader.
31- const ROFTimingConfig timing{100 , 10 , 20 , 0 };
31+ const o2::its::LayerTiming timing{. mNROFsTF = 2 , . mROFLength = 100 , . mROFDelay = 10 , . mROFBias = 20 };
3232 for (int frame = 0 ; frame < 2 ; ++frame) {
3333 const auto origin = firstOrigin + 200 * frame;
34- const auto first = computeROFIntervalBC (origin, origin, timing, 0 );
35- const auto last = computeROFIntervalBC (origin + 100 , origin, timing, 1 );
36- BOOST_REQUIRE (first.ok () && last.ok ());
37- const ROFIntervalBC window{first.interval .begin , last.interval .end , 0 , 0 };
34+ const std::array<o2::itsmft::ROFRecord, 2 > rofs{{{origin, 0 , 0 , 0 }, {origin + 100 , 1 , 0 , 0 }}};
35+ const auto window = truthSeedingWindow (rofs, origin, timing);
36+ BOOST_REQUIRE (window);
37+ BOOST_CHECK_EQUAL (window->lower (), 30u );
38+ BOOST_CHECK_EQUAL (window->upper (), 230u );
3839 std::vector<o2::its::Vertex> vertices;
3940 std::vector<int > eventIds;
4041 for (int event = 0 ; event < 2 ; ++event) {
41- if (const auto time = truthSeedingTime (collisions[event], origin, window, 50 )) {
42+ if (const auto time = truthSeedingTime (collisions[event], origin, * window, 50 )) {
4243 o2::its::Vertex vertex;
4344 vertex.setXYZ (0 .f , 0 .f , z[event]);
4445 vertex.getTimeStamp () = *time;
@@ -62,7 +63,7 @@ BOOST_AUTO_TEST_CASE(ConsecutiveFramesSelectTheirOwnCollisionsAndLookupROFs)
6263BOOST_AUTO_TEST_CASE (TruthTimingPreservesOverlapAndRejectsOutOfFrameEvents)
6364{
6465 const o2::InteractionRecord origin{0 , 40 };
65- const ROFIntervalBC window{0 , 200 , 0 , 0 };
66+ const o2::its::TimeEstBC window{0 , 200 };
6667 const auto overlap = truthSeedingTime (origin - 10 , origin, window, 50 );
6768 BOOST_REQUIRE (overlap);
6869 BOOST_CHECK_EQUAL (overlap->lower (), 0 );
@@ -73,3 +74,19 @@ BOOST_AUTO_TEST_CASE(TruthTimingPreservesOverlapAndRejectsOutOfFrameEvents)
7374 BOOST_CHECK (!truthSeedingTime (origin, origin, window, 0 ));
7475 BOOST_CHECK (!truthSeedingTime (origin, origin, {}, 50 ));
7576}
77+
78+ BOOST_AUTO_TEST_CASE (TruthWindowUsesActualROFRecordsAndLegacyTimingFields)
79+ {
80+ const o2::InteractionRecord origin{0 , 40 };
81+ const std::array<o2::itsmft::ROFRecord, 2 > rofs{{{origin, 0 , 0 , 0 }, {origin + 1000 , 1 , 0 , 0 }}};
82+ o2::its::LayerTiming timing{.mNROFsTF = 2 , .mROFLength = 100 , .mROFDelay = 10 , .mROFBias = 20 , .mROFAddTimeErr = 50 };
83+ const auto window = truthSeedingWindow (rofs, origin, timing);
84+ BOOST_REQUIRE (window);
85+ BOOST_CHECK_EQUAL (window->lower (), 0u );
86+ BOOST_CHECK_EQUAL (window->upper (), 1180u );
87+ BOOST_CHECK (!truthSeedingWindow ({}, origin, timing));
88+ timing.mROFLength = 0 ;
89+ BOOST_CHECK (!truthSeedingWindow (rofs, origin, timing));
90+ timing.mROFLength = std::numeric_limits<uint32_t >::max ();
91+ BOOST_CHECK (!truthSeedingWindow (rofs, origin, timing));
92+ }
0 commit comments