9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/unit_test.hpp>
29 #include "TGeoManager.h"
30 #include "TGeoMaterial.h"
31 #include "TGeoMatrix.h"
32 #include "TGeoMedium.h"
33 #include "TGeoVolume.h"
37 namespace tt = boost::test_tools;
45 ViewConfig
red({200, 0, 0});
46 ViewConfig
green({0, 200, 0});
47 ViewConfig
blue({0, 0, 200});
55 new TGeoManager(
"arb8",
"poza12");
56 TGeoMaterial *mat =
new TGeoMaterial(
"Al", 26.98, 13, 2.7);
57 TGeoMedium *med =
new TGeoMedium(
"MED", 1, mat);
58 TGeoVolume *top = gGeoManager->MakeBox(
"TOP", med, 100, 100, 100);
59 gGeoManager->SetTopVolume(top);
64 TGeoArb8 *arb =
new TGeoArb8(dZ);
65 arb->SetVertex(0, -30, -25);
66 arb->SetVertex(1, -25, 25);
67 arb->SetVertex(2, 5, 25);
68 arb->SetVertex(3, 25, -25);
69 arb->SetVertex(4, -30, -25);
70 arb->SetVertex(5, -25, 25);
71 arb->SetVertex(6, 5, 25);
72 arb->SetVertex(7, 25, -25);
73 TGeoVolume *vol =
new TGeoVolume(
"ARB8", arb, med);
75 gGeoManager->CloseGeometry();
78 std::vector<std::string>
allowedAxes = {
"XY*",
"xy*",
"Xy*",
"xY*",
79 "YX*",
"yx*",
"Yx*",
"yX*"};
82 for (
const auto &axes : allowedAxes) {
84 *vol->GetShape(), *gGeoIdentity, axes, 1);
85 BOOST_CHECK_NE(
plane,
nullptr);
91 BOOST_CHECK_NE(
bounds,
nullptr);
99 objVis, center, center + 30 * rotation.col(0), 4., 2.5,
red);
101 objVis, center, center + 30 * rotation.col(1), 4., 2.5,
green);
103 objVis, center, center + 2 * rotation.col(2), 4., 2.5,
blue);
105 objVis.
write(
"TGeoConversion_TGeoArb8_PlaneSurface_" +
111 std::vector<std::string> notAllowed = {
112 "XZ*",
"xz*",
"xZ*",
"Xz*",
"ZX*",
"zx*",
"zX*",
"Zx*",
113 "YZ*",
"yz*",
"yZ*",
"Yz*",
"ZY*",
"zy*",
"Zy*",
"zY*"};
114 for (
const auto &naxis : notAllowed) {
116 *gGeoIdentity, naxis, 1),
117 std::invalid_argument);