9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/unit_test.hpp>
22 #include "TGeoManager.h"
23 #include "TGeoMaterial.h"
24 #include "TGeoMatrix.h"
25 #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});
48 new TGeoManager(
"arb8",
"poza12");
49 TGeoMaterial *mat =
new TGeoMaterial(
"Al", 26.98, 13, 2.7);
50 TGeoMedium *med =
new TGeoMedium(
"MED", 1, mat);
51 TGeoVolume *top = gGeoManager->MakeBox(
"TOP", med, 100, 100, 100);
52 gGeoManager->SetTopVolume(top);
53 TGeoArb8 *arb =
new TGeoArb8(1);
54 arb->SetVertex(0, -30, -25);
55 arb->SetVertex(1, -25, 25);
56 arb->SetVertex(2, 5, 25);
57 arb->SetVertex(3, 25, -25);
58 arb->SetVertex(4, -30, -25);
59 arb->SetVertex(5, -25, 25);
60 arb->SetVertex(6, 5, 25);
61 arb->SetVertex(7, 25, -25);
62 TGeoVolume *vol =
new TGeoVolume(
"ARB8", arb, med);
64 gGeoManager->CloseGeometry();
67 std::vector<std::string>
allowedAxes = {
"XY*",
"xy*",
"Xy*",
"xY*",
68 "YX*",
"yx*",
"Yx*",
"yX*"};
71 for (
const auto &axes : allowedAxes) {
73 *gGeoIdentity, axes, 1);
74 BOOST_CHECK_NE(
plane,
nullptr);
79 BOOST_CHECK_NE(bounds,
nullptr);
87 objVis, center, center + 30 * rotation.col(0), 4., 2.5,
red);
89 objVis, center, center + 30 * rotation.col(1), 4., 2.5,
green);
91 objVis, center, center + 2 * rotation.col(2), 4., 2.5,
blue);
93 objVis.
write(
"TGeoConversion_TGeoArb8_PlaneSurface_" +
99 std::vector<std::string> notAllowed = {
100 "XZ*",
"xz*",
"xZ*",
"Xz*",
"ZX*",
"zx*",
"zX*",
"Zx*",
101 "YZ*",
"yz*",
"yZ*",
"Yz*",
"ZY*",
"zy*",
"Zy*",
"zY*"};
102 for (
const auto &naxis : notAllowed) {
104 *gGeoIdentity, naxis, 1),
105 std::invalid_argument);