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"
46 ViewConfig
red({200, 0, 0});
47 ViewConfig
green({0, 200, 0});
48 ViewConfig
blue({0, 0, 200});
50 std::vector<std::string>
allowedAxes = {
"XY*",
"Xy*",
"xy*",
"xY*",
51 "YX*",
"yx*",
"yX*",
"Yx*"};
67 new TGeoManager(
"trd1",
"poza9");
68 TGeoMaterial *mat =
new TGeoMaterial(
"Al", 26.98, 13, 2.7);
69 TGeoMedium *med =
new TGeoMedium(
"MED", 1, mat);
70 TGeoVolume *top = gGeoManager->MakeBox(
"TOP", med, 100, 100, 100);
71 gGeoManager->SetTopVolume(top);
72 TGeoVolume *vol = gGeoManager->MakeTube(
"Tube", med, rmin, rmax, hz);
74 gGeoManager->MakeTubs(
"Tube", med, rmin, rmax, hz, phimin, phimax);
75 gGeoManager->CloseGeometry();
80 *vol->GetShape(), *gGeoIdentity, axes, 1);
81 BOOST_CHECK_NE(cylinder,
nullptr);
86 BOOST_CHECK_NE(
bounds,
nullptr);
100 objVis, center, center + 1.2 * bR * rotation.col(0), 4., 2.5,
red);
102 objVis, center, center + 1.2 * bR * rotation.col(1), 4., 2.5,
green);
104 objVis, center, center + 1.2 * bhZ * rotation.col(2), 4., 2.5,
blue);
106 objVis.
write(
"TGeoConversion_TGeoTube_CylinderSurface_" +
112 *vols->GetShape(), *gGeoIdentity, axes, 1);
113 BOOST_CHECK_NE(cylinderSegment,
nullptr);
118 dynamic_cast<const CylinderBounds *
>(&(cylinderSegment->bounds()));
119 BOOST_CHECK_NE(boundsSegment,
nullptr);
130 objVis, center, center + 1.2 * bR * rotation.col(0), 4., 2.5,
red);
132 objVis, center, center + 1.2 * bR * rotation.col(1), 4., 2.5,
green);
134 objVis, center, center + 1.2 * bhZ * rotation.col(2), 4., 2.5,
blue);
135 objVis.
write(
"TGeoConversion_TGeoTube_CylinderSegmentSurface_" +
140 *gGeoIdentity, axes, 1),
141 std::invalid_argument);
149 *gGeoIdentity, naxes, 1),
150 std::invalid_argument);
164 double phimax = -45.;
166 new TGeoManager(
"trd1",
"poza9");
167 TGeoMaterial *mat =
new TGeoMaterial(
"Al", 26.98, 13, 2.7);
168 TGeoMedium *med =
new TGeoMedium(
"MED", 1, mat);
169 TGeoVolume *top = gGeoManager->MakeBox(
"TOP", med, 100, 100, 100);
170 gGeoManager->SetTopVolume(top);
171 TGeoVolume *vol = gGeoManager->MakeTube(
"Tube", med, rmin, rmax, hz);
172 vol->SetLineWidth(2);
174 gGeoManager->MakeTubs(
"Tube", med, rmin, rmax, hz, phimin, phimax);
175 gGeoManager->CloseGeometry();
180 *vol->GetShape(), *gGeoIdentity, axes, 1);
181 BOOST_CHECK_NE(disc,
nullptr);
186 BOOST_CHECK_NE(
bounds,
nullptr);
197 objVis, center, center + 1.2 * rmax * Vector3::UnitX(), 4., 2.5,
red);
199 objVis, center, center + 1.2 * rmax * Vector3::UnitY(), 4., 2.5,
green);
201 objVis, center, center + 1.2 * hz * Vector3::UnitZ(), 4., 2.5,
blue);
202 objVis.
write(
"TGeoConversion_TGeoTube_DiscSurface_" +
208 *vols->GetShape(), *gGeoIdentity, axes, 1);
209 BOOST_CHECK_NE(discSegment,
nullptr);
214 dynamic_cast<const RadialBounds *
>(&(discSegment->bounds()));
215 BOOST_CHECK_NE(boundsSegment,
nullptr);
226 center + 1.2 * bmaxr * Vector3::UnitX(),
229 center + 1.2 * bmaxr * Vector3::UnitY(),
232 objVis, center, center + 1.2 * hz * Vector3::UnitZ(), 4., 2.5,
blue);
233 objVis.
write(
"TGeoConversion_TGeoTube_DiscSegmentSurface_" +
239 *gGeoIdentity, axes, 1),
240 std::invalid_argument);
248 *gGeoIdentity, naxes, 1),
249 std::invalid_argument);