R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
testNeulandTSyncEngine.cxx
Go to the documentation of this file.
1#include "R3BNeulandCommon.h"
3#include <gtest/gtest.h>
4
5// NOLINTBEGIN (cppcoreguidelines-avoid-magic-numbers)
6namespace
7{
11
12 // void add_z_direction_ref_points(TSync& engine)
13 // {
14 // const auto num_of_dp = engine.get_num_of_dp();
15 // const auto ref_bar_num = engine.get_ref_bar_num();
16
17 // const auto vertical_offset = 10;
18
19 // for (int plane_id{}; plane_id < 2 * num_of_dp; ++plane_id)
20 // {
21 // auto module_num = R3B::Neuland::IsPlaneIDHorizontal(plane_id) ? ref_bar_num + 100 * (plane_id / 2)
22 // : vertical_offset + 50 + 100 * (plane_id /
23 // 2);
24 // engine.add_point(0., module_num);
25 // }
26 // }
27
28 void add_horizontal_plane_points(TSync& engine)
29 {
30 const auto num_of_dp = engine.get_num_of_dp();
31 const auto target_plane_id = 8;
32
33 for (int local_bar_id{}; local_bar_id < R3B::Neuland::BarsPerPlane; ++local_bar_id)
34 {
35 auto module_num = target_plane_id * R3B::Neuland::BarsPerPlane + local_bar_id + 1;
36 engine.add_point(0., module_num);
37 }
38 }
39
40 TEST(TestNeulandTSyncEngine, test_horizontal_plane)
41 {
42 auto engine = TSync{};
43 auto record_type = RecordType::invalid;
44
45 engine.set_number_of_modules(1300);
46 engine.init();
47
48 EXPECT_EQ(engine.get_record_type(), RecordType::invalid);
49 add_horizontal_plane_points(engine);
50 engine.end_of_event();
51 EXPECT_EQ(engine.get_record_type(), RecordType::xy_plane);
52 engine.reset();
53 EXPECT_EQ(engine.get_record_type(), RecordType::invalid);
54 }
55} // namespace
56// NOLINTEND (cppcoreguidelines-avoid-magic-numbers)
Main interface for TSync calculation.
constexpr auto BarsPerPlane