9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/unit_test.hpp>
33 BOOST_AUTO_TEST_SUITE(Geometry)
48 std::vector<double> layerRadii = {32., 72., 116., 172.};
49 std::vector<std::pair<int, int>> layerBinning = {
50 {16, 14}, {32, 14}, {52, 14}, {78, 14}};
51 std::vector<double> moduleTiltPhi = {0.145, 0.145, 0.145, 0.145};
52 std::vector<double> moduleHalfX = {8.4, 8.4, 8.4, 8.4};
53 std::vector<double> moduleHalfY = {36., 36., 36., 36.};
54 std::vector<double> moduleThickness = {0.15, 0.15, 0.15, 0.15};
56 std::vector<const Surface*> cylinderSurfaces;
57 for (
size_t ilp = 0; ilp < layerRadii.size(); ++ilp) {
59 dStore, moduleHalfX[ilp], moduleHalfY[ilp], moduleThickness[ilp],
60 moduleTiltPhi[ilp], layerRadii[ilp], 2., 5., layerBinning[ilp]);
61 cylinderSurfaces.insert(cylinderSurfaces.begin(), layerSurfaces.begin(),
66 for (
auto& sf : cylinderSurfaces) {
71 objVis.
write(
"ProtoLayerHelper_CylinderLayers_unsorted");
78 BOOST_CHECK(radialLayers.size() == 4);
80 std::vector<ColorRGB> sortedColors = {{102, 204, 255},
87 for (
auto&
layer : radialLayers) {
88 for (
auto& sf :
layer.surfaces()) {
91 Transform3::Identity(), sorted);
97 objVis.
write(
"ProtoLayerHelper_CylinderLayers_radially");
101 std::vector<const Surface*> discSurfaces;
103 std::vector<double> discZ = {-350., -250., -150., -100.};
104 std::vector<double> discRadii = {55., 55., 55., 55.};
105 std::vector<int> discModules = {22, 22, 22, 22};
107 std::vector<double> dModuleHalfXMinY = {6.4, 6.4, 6.4, 6.4};
108 std::vector<double> dModuleHalfXMaxY = {12.4, 12.4, 12.4, 12.4};
109 std::vector<double> dModuleHalfY = {36., 36., 36., 36.};
110 std::vector<double> dModuleTilt = {0.075, 0.075, 0.075, 0.075};
111 std::vector<double> dModuleThickness = {0.15, 0.15, 0.15, 0.15};
113 for (
size_t ilp = 0; ilp < discZ.size(); ++ilp) {
114 std::vector<const Surface*> layerSurfaces = ctGeometry.
surfacesRing(
115 dStore, dModuleHalfXMinY[ilp], dModuleHalfXMaxY[ilp], dModuleHalfY[ilp],
116 dModuleThickness[ilp], dModuleTilt[ilp], discRadii[ilp], discZ[ilp], 2.,
118 discSurfaces.insert(discSurfaces.begin(), layerSurfaces.begin(),
119 layerSurfaces.end());
122 for (
auto& sf : discSurfaces) {
126 objVis.
write(
"ProtoLayerHelper_DiscLayers_unsorted");
130 auto discLayersZ = plHelper.
protoLayers(tgContext, discSurfaces, {
binZ, 5.});
132 BOOST_CHECK(discLayersZ.size() == 4);
135 for (
auto&
layer : discLayersZ) {
136 for (
auto& sf :
layer.surfaces()) {
139 Transform3::Identity(), ViewConfig);
145 objVis.
write(
"ProtoLayerHelper_DiscLayers_longitudinally");
149 std::vector<const Surface*> ringSurfaces;
151 std::vector<double> ringZ = {-350., -250., -150., -100., -360., -255.,
152 -120., -330., -260., -150., -95.};
153 std::vector<double> ringRadii = {32., 32., 32., 32., 58., 58.,
154 58., 84., 84., 84., 84.};
155 std::vector<int> ringModules = {22, 22, 22, 22, 32, 32, 32, 44, 44, 44, 44};
157 std::vector<double> rModuleHalfXMinY(11, 6.4);
158 std::vector<double> rModuleHalfXMaxY(11, 6.4);
159 std::vector<double> rModuleHalfY(11, 10.);
160 std::vector<double> rModuleTilt(11, 0.075);
161 std::vector<double> rModuleThickness(11, 0.15);
163 for (
size_t ilp = 0; ilp < ringZ.size(); ++ilp) {
164 std::vector<const Surface*> layerSurfaces = ctGeometry.
surfacesRing(
165 dStore, rModuleHalfXMinY[ilp], rModuleHalfXMaxY[ilp], rModuleHalfY[ilp],
166 rModuleThickness[ilp], rModuleTilt[ilp], ringRadii[ilp], ringZ[ilp], 2.,
168 ringSurfaces.insert(ringSurfaces.begin(), layerSurfaces.begin(),
169 layerSurfaces.end());
172 for (
auto& sf : ringSurfaces) {
176 objVis.
write(
"ProtoLayerHelper_RingLayers_unsorted");
182 BOOST_CHECK(rSorted.size() == 3);
187 for (
auto& rBatch : rSorted) {
193 for (
auto&
layer : lSorted) {
194 dColor[ir] -= il * 50;
195 for (
auto& sf :
layer.surfaces()) {
203 objVis.
write(
"ProtoLayerHelper_RingLayers_sorted");
210 for (
auto&
layer : rzSorted) {
211 for (
auto& sf :
layer.surfaces()) {
214 objVis.
write(
"ProtoLayerHelper_RingLayers_rz_sorted" +
220 BOOST_AUTO_TEST_SUITE_END()