9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/unit_test.hpp>
20 namespace tt = boost::test_tools;
21 using namespace Acts::UnitLiterals;
36 std::cout <<
"Create first hit" << std::endl;
39 std::shared_ptr<const RectangleBounds> recBounds(
43 std::vector<float> boundariesX, boundariesY;
44 boundariesX.push_back(-35
_um);
45 boundariesX.push_back(35
_um);
46 boundariesY.push_back(-25
_mm);
47 boundariesY.push_back(25
_mm);
50 std::shared_ptr<BinUtility> buX(
new BinUtility(binDataX));
52 std::shared_ptr<BinUtility> buY(
new BinUtility(binDataY));
55 std::shared_ptr<const Segmentation> segmentation(
60 double rotation = 0.026;
62 Vector3D xPos(cos(rotation), sin(rotation), 0.);
63 Vector3D yPos(-sin(rotation), cos(rotation), 0.);
65 rotationPos.col(0) = xPos;
66 rotationPos.col(1) = yPos;
67 rotationPos.col(2) = zPos;
68 Transform3D t3d(Transform3D::Identity() * rotationPos);
74 auto pSur = Surface::makeShared<PlaneSurface>(recBounds, detElem);
76 cov << 0., 0., 0., 0., 0., 0., 0., 0., 0.;
84 std::cout <<
"Create second hit" << std::endl;
88 double rotation2 = -0.026;
90 Vector3D xNeg(cos(rotation2), sin(rotation2), 0.);
91 Vector3D yNeg(-sin(rotation2), cos(rotation2), 0.);
93 rotationNeg.col(0) = xNeg;
94 rotationNeg.col(1) = yNeg;
95 rotationNeg.col(2) = zNeg;
96 Transform3D t3d2(Transform3D::Identity() * rotationNeg);
97 t3d2.translation() =
Vector3D(0., 0., 10.005
_m);
101 auto pSur2 = Surface::makeShared<PlaneSurface>(recBounds, detElem2);
107 std::cout <<
"Store both hits" << std::endl;
109 std::vector<SpacePoint<PlanarModuleCluster>> resultSP;
110 std::vector<std::pair<PlanarModuleCluster const*, PlanarModuleCluster const*>>
116 dhsp.makeClusterPairs(
tgContext, {pmc}, {pmc2}, clusterPairs);
118 BOOST_CHECK_EQUAL(clusterPairs.size(), 1
u);
119 BOOST_CHECK_EQUAL(*(clusterPairs[0].first), *pmc);
120 BOOST_CHECK_EQUAL(*(clusterPairs[0].
second), *pmc2);
122 std::cout <<
"Calculate space point" << std::endl;
124 dhsp.calculateSpacePoints(
tgContext, clusterPairs, resultSP);
126 BOOST_CHECK_EQUAL(resultSP.size(), 1
u);
128 std::cout <<
"Create third hit" << std::endl;
131 Transform3D t3d3(Transform3D::Identity() * rotationNeg);
132 t3d3.translation() =
Vector3D(0., 0., 10.005
_m);
135 auto pSur3 = Surface::makeShared<PlaneSurface>(recBounds, detElem3);
141 std::cout <<
"Try to store hits" << std::endl;
144 dhsp.makeClusterPairs(
tgContext, {pmc}, {pmc3}, clusterPairs);
147 BOOST_CHECK_EQUAL(resultSP.size(), 1
u);