9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/unit_test.hpp>
28 BOOST_AUTO_TEST_SUITE(Geometry)
43 std::vector<double> layerRadii = {32., 72., 116., 172.};
44 std::vector<std::pair<int, int>> layerBinning = {
45 {16, 14}, {32, 14}, {52, 14}, {78, 14}};
46 std::vector<double> moduleTiltPhi = {0.145, 0.145, 0.145, 0.145};
47 std::vector<double> moduleHalfX = {8.4, 8.4, 8.4, 8.4};
48 std::vector<double> moduleHalfY = {36., 36., 36., 36.};
49 std::vector<double> moduleThickness = {0.15, 0.15, 0.15, 0.15};
51 std::vector<const Surface*> cylinderSurfaces;
52 for (
size_t ilp = 0; ilp < layerRadii.size(); ++ilp) {
54 dStore, moduleHalfX[ilp], moduleHalfY[ilp], moduleThickness[ilp],
55 moduleTiltPhi[ilp], layerRadii[ilp], 2., 5., layerBinning[ilp]);
56 cylinderSurfaces.insert(cylinderSurfaces.begin(), layerSurfaces.begin(),
61 for (
auto& sf : cylinderSurfaces) {
66 objVis.
write(
"ProtoLayerHelper_CylinderLayers_unsorted");
73 BOOST_CHECK(radialLayers.size() == 4);
75 std::vector<ColorRGB> sortedColors = {{102, 204, 255},
82 for (
auto&
layer : radialLayers) {
83 for (
auto& sf :
layer.surfaces()) {
86 Transform3D::Identity(), sorted);
92 objVis.
write(
"ProtoLayerHelper_CylinderLayers_radially");
96 std::vector<const Surface*> discSurfaces;
98 std::vector<double> discZ = {-350., -250., -150., -100.};
99 std::vector<double> discRadii = {55., 55., 55., 55.};
100 std::vector<int> discModules = {22, 22, 22, 22};
102 std::vector<double> dModuleHalfXMinY = {6.4, 6.4, 6.4, 6.4};
103 std::vector<double> dModuleHalfXMaxY = {12.4, 12.4, 12.4, 12.4};
104 std::vector<double> dModuleHalfY = {36., 36., 36., 36.};
105 std::vector<double> dModuleTilt = {0.075, 0.075, 0.075, 0.075};
106 std::vector<double> dModuleThickness = {0.15, 0.15, 0.15, 0.15};
108 for (
size_t ilp = 0; ilp < discZ.size(); ++ilp) {
109 std::vector<const Surface*> layerSurfaces = ctGeometry.
surfacesRing(
110 dStore, dModuleHalfXMinY[ilp], dModuleHalfXMaxY[ilp], dModuleHalfY[ilp],
111 dModuleThickness[ilp], dModuleTilt[ilp], discRadii[ilp], discZ[ilp], 2.,
113 discSurfaces.insert(discSurfaces.begin(), layerSurfaces.begin(),
114 layerSurfaces.end());
117 for (
auto& sf : discSurfaces) {
121 objVis.
write(
"ProtoLayerHelper_DiscLayers_unsorted");
125 auto discLayersZ = plHelper.
protoLayers(tgContext, discSurfaces, {
binZ, 5.});
127 BOOST_CHECK(discLayersZ.size() == 4);
130 for (
auto&
layer : discLayersZ) {
131 for (
auto& sf :
layer.surfaces()) {
134 Transform3D::Identity(), ViewConfig);
140 objVis.
write(
"ProtoLayerHelper_DiscLayers_longitudinally");
144 std::vector<const Surface*> ringSurfaces;
146 std::vector<double> ringZ = {-350., -250., -150., -100., -360., -255.,
147 -120., -330., -260., -150., -95.};
148 std::vector<double> ringRadii = {32., 32., 32., 32., 58., 58.,
149 58., 84., 84., 84., 84.};
150 std::vector<int> ringModules = {22, 22, 22, 22, 32, 32, 32, 44, 44, 44, 44};
152 std::vector<double> rModuleHalfXMinY(11, 6.4);
153 std::vector<double> rModuleHalfXMaxY(11, 6.4);
154 std::vector<double> rModuleHalfY(11, 10.);
155 std::vector<double> rModuleTilt(11, 0.075);
156 std::vector<double> rModuleThickness(11, 0.15);
158 for (
size_t ilp = 0; ilp < ringZ.size(); ++ilp) {
159 std::vector<const Surface*> layerSurfaces = ctGeometry.
surfacesRing(
160 dStore, rModuleHalfXMinY[ilp], rModuleHalfXMaxY[ilp], rModuleHalfY[ilp],
161 rModuleThickness[ilp], rModuleTilt[ilp], ringRadii[ilp], ringZ[ilp], 2.,
163 ringSurfaces.insert(ringSurfaces.begin(), layerSurfaces.begin(),
164 layerSurfaces.end());
167 for (
auto& sf : ringSurfaces) {
171 objVis.
write(
"ProtoLayerHelper_RingLayers_unsorted");
177 BOOST_CHECK(rSorted.size() == 3);
182 for (
auto& rBatch : rSorted) {
188 for (
auto&
layer : lSorted) {
189 dColor[
ir] -= il * 50;
190 for (
auto& sf :
layer.surfaces()) {
198 objVis.
write(
"ProtoLayerHelper_RingLayers_sorted");
205 for (
auto&
layer : rzSorted) {
206 for (
auto& sf :
layer.surfaces()) {
209 objVis.
write(
"ProtoLayerHelper_RingLayers_rz_sorted" +
215 BOOST_AUTO_TEST_SUITE_END()