9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/unit_test.hpp>
32 #include "TGeoManager.h"
33 #include "TGeoMaterial.h"
34 #include "TGeoMatrix.h"
35 #include "TGeoMedium.h"
37 #include "TGeoVolume.h"
41 namespace tt = boost::test_tools;
49 ViewConfig
red({200, 0, 0});
50 ViewConfig
green({0, 200, 0});
51 ViewConfig
blue({0, 0, 200});
64 new TGeoManager(
"trd1",
"poza9");
65 TGeoMaterial *mat =
new TGeoMaterial(
"Al", 26.98, 13, 2.7);
66 TGeoMedium *med =
new TGeoMedium(
"MED", 1, mat);
67 TGeoVolume *top = gGeoManager->MakeBox(
"TOP", med, 100, 100, 100);
68 gGeoManager->SetTopVolume(top);
70 gGeoManager->MakeTrd2(
"Trd2", med, hxmin, hxmax, ht, ht, hy);
71 gGeoManager->CloseGeometry();
74 std::vector<std::string> axesTypes = {
"XZ*",
"xZ*",
"xz*",
"Xz*"};
77 for (
const auto &axes : axesTypes) {
79 *vol->GetShape(), *gGeoIdentity, axes, 1);
80 BOOST_CHECK_NE(
plane,
nullptr);
85 BOOST_CHECK_NE(
bounds,
nullptr);
97 const Vector3 offset{(-5.5 + (itrd++) * 2.5) * hxmax, 0., 0.};
102 objVis, center, center + 1.2 * (hXminY + hXmaxY) * rotation.col(0), 4.,
105 objVis, center, center + 1.2 * hY * rotation.col(1), 4., 2.5,
green);
107 objVis, center, center + 2 * rotation.col(2), 4., 2.5,
blue);
109 objVis.
write(
"TGeoConversion_TGeoTrd2_xz_PlaneSurface");
112 std::vector<std::string> notAllowed = {
"XY*",
"xy*",
"Xy*",
"xY*"};
113 for (
const auto &naxis : notAllowed) {
115 *gGeoIdentity, naxis, 1),
116 std::invalid_argument);
131 new TGeoManager(
"trd1",
"poza9");
132 TGeoMaterial *mat =
new TGeoMaterial(
"Al", 26.98, 13, 2.7);
133 TGeoMedium *med =
new TGeoMedium(
"MED", 1, mat);
134 TGeoVolume *top = gGeoManager->MakeBox(
"TOP", med, 100, 100, 100);
135 gGeoManager->SetTopVolume(top);
137 gGeoManager->MakeTrd2(
"Trd2", med, ht, ht, hxmin, hxmax, hy);
138 gGeoManager->CloseGeometry();
141 std::vector<std::string> axesTypes = {
"YZ*",
"yZ*",
"yz*",
"Yz*"};
144 for (
const auto &axes : axesTypes) {
146 *vol->GetShape(), *gGeoIdentity, axes, 1);
147 BOOST_CHECK_NE(
plane,
nullptr);
152 BOOST_CHECK_NE(
bounds,
nullptr);
164 const Vector3 offset{(-5.5 + (itrd++) * 2.5) * hxmax, 0., 0.};
169 objVis, center, center + 1.2 * (hXminY + hXmaxY) * rotation.col(0), 4.,
172 objVis, center, center + 1.2 * hY * rotation.col(1), 4., 2.5,
green);
174 objVis, center, center + 2 * rotation.col(2), 4., 2.5,
blue);
176 objVis.
write(
"TGeoConversion_TGeoTrd2_yz_PlaneSurface");
179 std::vector<std::string> notAllowed = {
"YX*",
"yx*",
"yX*",
"Yx*"};
180 for (
const auto &naxis : notAllowed) {
182 *gGeoIdentity, naxis, 1),
183 std::invalid_argument);