40 using namespace UnitLiterals;
43 double rotationAngle = 90_degree;
44 Vector3D xPos(cos(rotationAngle), 0., sin(rotationAngle));
46 Vector3D zPos(-sin(rotationAngle), 0., cos(rotationAngle));
57 surfaceMaterial = std::make_shared<HomogeneousSurfaceMaterial>(matProp);
62 using namespace UnitLiterals;
66 std::vector<Vector3D> translations;
67 translations.push_back({-2
_m, 0., 0.});
68 translations.push_back({-1
_m, 0., 0.});
69 translations.push_back({1
_m -
eps, 0., 0.});
70 translations.push_back({1
_m +
eps, 0., 0.});
71 translations.push_back({2
_m -
eps, 0., 0.});
72 translations.push_back({2
_m +
eps, 0., 0.});
75 std::array<std::shared_ptr<const Surface>, 6> surfaces;
77 for (i = 0; i < translations.size(); i++) {
79 trafo.translation() = translations[i];
81 auto detElement = std::make_unique<const DetectorElementStub>(
82 std::make_shared<const Transform3D>(trafo),
rBounds, 1.
_um,
85 surfaces[i] = detElement->surface().getSharedPtr();
91 std::array<LayerPtr, 6> layers;
92 for (i = 0; i < 6; i++) {
94 trafo.translation() = translations[i];
96 std::unique_ptr<SurfaceArray> surArray(
new SurfaceArray(surfaces[i]));
101 auto mutableSurface =
const_cast<Surface*
>(surfaces[i].get());
107 trafoVol1.translation() =
Vector3D(-1.5
_m, 0., 0.);
110 std::make_shared<const CuboidVolumeBounds>(1.5_m, 0.5_m, 0.5_m);
117 layVec.push_back(layers[0]);
118 layVec.push_back(layers[1]);
119 std::unique_ptr<const LayerArray> layArr1(layArrCreator.
layerArray(
124 std::make_shared<const Transform3D>(trafoVol1), boundsVol,
nullptr,
125 std::move(layArr1),
nullptr, {},
"Volume 1");
129 trafoVol2.translation() =
Vector3D(1.5
_m, 0., 0.);
132 for (i = 2; i < 6; i++)
133 layVec.push_back(layers[i]);
134 std::unique_ptr<const LayerArray> layArr2(
139 std::make_shared<const Transform3D>(trafoVol2), boundsVol,
nullptr,
140 std::move(layArr2),
nullptr, {},
"Volume 2");
143 trackVolume2->glueTrackingVolume(
147 trackVolume1->glueTrackingVolume(
153 trafoWorld.translation() =
Vector3D(0., 0., 0.);
156 std::make_shared<const CuboidVolumeBounds>(3._m, 0.5_m, 0.5_m);
158 std::vector<std::pair<TrackingVolumePtr, Vector3D>> tapVec;
160 tapVec.push_back(std::make_pair(trackVolume1,
Vector3D(-1.5
_m, 0., 0.)));
161 tapVec.push_back(std::make_pair(trackVolume2,
Vector3D(1.5
_m, 0., 0.)));
163 std::vector<float> binBoundaries = {-3._m, 0., 3._m};
166 std::unique_ptr<const BinUtility> bu(
new BinUtility(binData));
168 std::shared_ptr<const TrackingVolumeArray> trVolArr(
173 worldVol, trVolArr,
"World"));
176 return std::shared_ptr<TrackingGeometry>(
181 std::shared_ptr<const RectangleBounds>
rBounds =
nullptr;