9 #include <boost/test/data/test_case.hpp> 
   10 #include <boost/test/unit_test.hpp> 
   23 #include "TGeoManager.h" 
   24 #include "TGeoMaterial.h" 
   25 #include "TGeoMatrix.h" 
   26 #include "TGeoMedium.h" 
   28 #include "TGeoVolume.h" 
   37 ViewConfig 
red({200, 0, 0});
 
   38 ViewConfig 
green({0, 200, 0});
 
   39 ViewConfig 
blue({0, 0, 200});
 
   41 std::vector<std::string> 
allowedAxes = {
"XY*", 
"Xy*", 
"xy*", 
"xY*",
 
   42                                         "YX*", 
"yx*", 
"yX*", 
"Yx*"};
 
   58   new TGeoManager(
"trd1", 
"poza9");
 
   59   TGeoMaterial *mat = 
new TGeoMaterial(
"Al", 26.98, 13, 2.7);
 
   60   TGeoMedium *med = 
new TGeoMedium(
"MED", 1, mat);
 
   61   TGeoVolume *top = gGeoManager->MakeBox(
"TOP", med, 100, 100, 100);
 
   62   gGeoManager->SetTopVolume(top);
 
   63   TGeoVolume *vol = gGeoManager->MakeTube(
"Tube", med, rmin, rmax, hz);
 
   65       gGeoManager->MakeTubs(
"Tube", med, rmin, rmax, hz, phimin, phimax);
 
   66   gGeoManager->CloseGeometry();
 
   71                                                     *gGeoIdentity, axes, 1);
 
   72     BOOST_CHECK_NE(cylinder, 
nullptr);
 
   75     auto bounds = 
dynamic_cast<const CylinderBounds *
>(&(cylinder->bounds()));
 
   76     BOOST_CHECK_NE(bounds, 
nullptr);
 
   90         objVis, center, center + 1.2 * bR * rotation.col(0), 4., 2.5, 
red);
 
   92         objVis, center, center + 1.2 * bR * rotation.col(1), 4., 2.5, 
green);
 
   94         objVis, center, center + 1.2 * bhZ * rotation.col(2), 4., 2.5, 
blue);
 
   96     objVis.
write(
"TGeoConversion_TGeoTube_CylinderSurface_" +
 
  102           *vols->GetShape(), *gGeoIdentity, axes, 1);
 
  103       BOOST_CHECK_NE(cylinderSegment, 
nullptr);
 
  107           dynamic_cast<const CylinderBounds *
>(&(cylinderSegment->bounds()));
 
  108       BOOST_CHECK_NE(boundsSegment, 
nullptr);
 
  119           objVis, center, center + 1.2 * bR * rotation.col(0), 4., 2.5, 
red);
 
  121           objVis, center, center + 1.2 * bR * rotation.col(1), 4., 2.5, 
green);
 
  123           objVis, center, center + 1.2 * bhZ * rotation.col(2), 4., 2.5, 
blue);
 
  124       objVis.
write(
"TGeoConversion_TGeoTube_CylinderSegmentSurface_" +
 
  129                                                         *gGeoIdentity, axes, 1),
 
  130                         std::invalid_argument);
 
  138                                                       *gGeoIdentity, naxes, 1),
 
  139                       std::invalid_argument);
 
  155   new TGeoManager(
"trd1", 
"poza9");
 
  156   TGeoMaterial *mat = 
new TGeoMaterial(
"Al", 26.98, 13, 2.7);
 
  157   TGeoMedium *med = 
new TGeoMedium(
"MED", 1, mat);
 
  158   TGeoVolume *top = gGeoManager->MakeBox(
"TOP", med, 100, 100, 100);
 
  159   gGeoManager->SetTopVolume(top);
 
  160   TGeoVolume *vol = gGeoManager->MakeTube(
"Tube", med, rmin, rmax, hz);
 
  161   vol->SetLineWidth(2);
 
  163       gGeoManager->MakeTubs(
"Tube", med, rmin, rmax, hz, phimin, phimax);
 
  164   gGeoManager->CloseGeometry();
 
  170     BOOST_CHECK_NE(disc, 
nullptr);
 
  173     auto bounds = 
dynamic_cast<const RadialBounds *
>(&(disc->bounds()));
 
  174     BOOST_CHECK_NE(bounds, 
nullptr);
 
  185         objVis, center, center + 1.2 * rmax * Vector3D::UnitX(), 4., 2.5, 
red);
 
  187                                      center + 1.2 * rmax * Vector3D::UnitY(),
 
  190         objVis, center, center + 1.2 * hz * Vector3D::UnitZ(), 4., 2.5, 
blue);
 
  191     objVis.
write(
"TGeoConversion_TGeoTube_DiscSurface_" +
 
  197           *vols->GetShape(), *gGeoIdentity, axes, 1);
 
  198       BOOST_CHECK_NE(discSegment, 
nullptr);
 
  202           dynamic_cast<const RadialBounds *
>(&(discSegment->bounds()));
 
  203       BOOST_CHECK_NE(boundsSegment, 
nullptr);
 
  214                                        center + 1.2 * bmaxr * Vector3D::UnitX(),
 
  217                                        center + 1.2 * bmaxr * Vector3D::UnitY(),
 
  220           objVis, center, center + 1.2 * hz * Vector3D::UnitZ(), 4., 2.5, 
blue);
 
  221       objVis.
write(
"TGeoConversion_TGeoTube_DiscSegmentSurface_" +
 
  227                                                         *gGeoIdentity, axes, 1),
 
  228                         std::invalid_argument);
 
  236                                                       *gGeoIdentity, naxes, 1),
 
  237                       std::invalid_argument);