9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/unit_test.hpp>
21 #include "TGeoManager.h"
22 #include "TGeoMaterial.h"
23 #include "TGeoMatrix.h"
24 #include "TGeoMedium.h"
26 #include "TGeoVolume.h"
30 namespace tt = boost::test_tools;
38 ViewConfig
red({200, 0, 0});
39 ViewConfig
green({0, 200, 0});
40 ViewConfig
blue({0, 0, 200});
53 new TGeoManager(
"trd1",
"poza9");
54 TGeoMaterial *mat =
new TGeoMaterial(
"Al", 26.98, 13, 2.7);
55 TGeoMedium *med =
new TGeoMedium(
"MED", 1, mat);
56 TGeoVolume *top = gGeoManager->MakeBox(
"TOP", med, 100, 100, 100);
57 gGeoManager->SetTopVolume(top);
58 TGeoVolume *vol = gGeoManager->MakeTrd2(
"Trd2", med, hxmin, hxmax, t, t, hy);
59 gGeoManager->CloseGeometry();
62 std::vector<std::string> axesTypes = {
"XZ*",
"xZ*",
"xz*",
"Xz*"};
65 for (
const auto &axes : axesTypes) {
67 *gGeoIdentity, axes, 1);
68 BOOST_CHECK_NE(
plane,
nullptr);
72 BOOST_CHECK_NE(bounds,
nullptr);
90 objVis, center, center + 1.2 * (hXminY + hXmaxY) * rotation.col(0), 4.,
93 objVis, center, center + 1.2 * hY * rotation.col(1), 4., 2.5,
green);
95 objVis, center, center + 2 * rotation.col(2), 4., 2.5,
blue);
97 objVis.
write(
"TGeoConversion_TGeoTrd2_xz_PlaneSurface");
100 std::vector<std::string> notAllowed = {
"XY*",
"xy*",
"Xy*",
"xY*"};
101 for (
const auto &naxis : notAllowed) {
103 *gGeoIdentity, naxis, 1),
104 std::invalid_argument);
119 new TGeoManager(
"trd1",
"poza9");
120 TGeoMaterial *mat =
new TGeoMaterial(
"Al", 26.98, 13, 2.7);
121 TGeoMedium *med =
new TGeoMedium(
"MED", 1, mat);
122 TGeoVolume *top = gGeoManager->MakeBox(
"TOP", med, 100, 100, 100);
123 gGeoManager->SetTopVolume(top);
124 TGeoVolume *vol = gGeoManager->MakeTrd2(
"Trd2", med, t, t, hxmin, hxmax, hy);
125 gGeoManager->CloseGeometry();
128 std::vector<std::string> axesTypes = {
"YZ*",
"yZ*",
"yz*",
"Yz*"};
131 for (
const auto &axes : axesTypes) {
133 *gGeoIdentity, axes, 1);
134 BOOST_CHECK_NE(
plane,
nullptr);
138 BOOST_CHECK_NE(bounds,
nullptr);
156 objVis, center, center + 1.2 * (hXminY + hXmaxY) * rotation.col(0), 4.,
159 objVis, center, center + 1.2 * hY * rotation.col(1), 4., 2.5,
green);
161 objVis, center, center + 2 * rotation.col(2), 4., 2.5,
blue);
163 objVis.
write(
"TGeoConversion_TGeoTrd2_yz_PlaneSurface");
166 std::vector<std::string> notAllowed = {
"YX*",
"yx*",
"yX*",
"Yx*"};
167 for (
const auto &naxis : notAllowed) {
169 *gGeoIdentity, naxis, 1),
170 std::invalid_argument);