DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Namespaces | Macros | Functions
ShapeUtilities.cpp File Reference
#include <DD4hep/Shapes.h>
#include <DD4hep/MatrixHelpers.h>
#include <DD4hep/DD4hepUnits.h>
#include <DD4hep/ShapeTags.h>
#include <DD4hep/Printout.h>
#include <DD4hep/detail/ShapesInterna.h>
#include <stdexcept>
#include <iomanip>
#include <sstream>
#include <TClass.h>
#include <TGeoMatrix.h>
#include <TGeoBoolNode.h>
#include <TGeoScaledShape.h>
#include <TGeoCompositeShape.h>

Go to the source code of this file.

Namespaces

 dd4hep
 Namespace for the AIDA detector description toolkit.
 

Macros

#define _USE_MATH_DEFINES
 

Functions

template<typename SOLID >
bool dd4hep::isInstance (const Handle< TGeoShape > &solid)
 Type check of various shapes. Result like dynamic_cast. Compare with python's isinstance(obj,type) More...
 
template bool dd4hep::isInstance< Box > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isInstance< Scale > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isInstance< ShapelessSolid > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isInstance< HalfSpace > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isInstance< ConeSegment > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isInstance< CutTube > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isInstance< EllipticalTube > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isInstance< Trap > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isInstance< Trd1 > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isInstance< Trd2 > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isInstance< Torus > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isInstance< Sphere > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isInstance< Paraboloid > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isInstance< Hyperboloid > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isInstance< PolyhedraRegular > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isInstance< Polyhedra > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isInstance< ExtrudedPolygon > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isInstance< TessellatedSolid > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isInstance< BooleanSolid > (const Handle< TGeoShape > &solid)
 
template<>
bool dd4hep::isInstance< Cone > (const Handle< TGeoShape > &solid)
 
template<>
bool dd4hep::isInstance< Tube > (const Handle< TGeoShape > &solid)
 
template<>
bool dd4hep::isInstance< Polycone > (const Handle< TGeoShape > &solid)
 
template<>
bool dd4hep::isInstance< EightPointSolid > (const Handle< TGeoShape > &solid)
 
template<>
bool dd4hep::isInstance< TwistedTube > (const Handle< TGeoShape > &solid)
 
template<>
bool dd4hep::isInstance< TruncatedTube > (const Handle< TGeoShape > &solid)
 
template<>
bool dd4hep::isInstance< PseudoTrap > (const Handle< TGeoShape > &solid)
 
template<>
bool dd4hep::isInstance< SubtractionSolid > (const Handle< TGeoShape > &solid)
 
template<>
bool dd4hep::isInstance< UnionSolid > (const Handle< TGeoShape > &solid)
 
template<>
bool dd4hep::isInstance< IntersectionSolid > (const Handle< TGeoShape > &solid)
 
template<typename SOLID >
bool dd4hep::isA (const Handle< TGeoShape > &solid)
 Type check of various shapes. Do not allow for polymorphism. Types must match exactly. More...
 
template bool dd4hep::isA< Box > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isA< Scale > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isA< ShapelessSolid > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isA< HalfSpace > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isA< Cone > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isA< ConeSegment > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isA< Tube > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isA< CutTube > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isA< EllipticalTube > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isA< Trap > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isA< Trd1 > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isA< Trd2 > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isA< Torus > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isA< Sphere > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isA< Paraboloid > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isA< Hyperboloid > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isA< PolyhedraRegular > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isA< Polyhedra > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isA< ExtrudedPolygon > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isA< Polycone > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isA< EightPointSolid > (const Handle< TGeoShape > &solid)
 
template bool dd4hep::isA< TessellatedSolid > (const Handle< TGeoShape > &solid)
 
template<>
bool dd4hep::isA< TwistedTube > (const Handle< TGeoShape > &solid)
 
template<>
bool dd4hep::isA< TruncatedTube > (const Handle< TGeoShape > &solid)
 
template<>
bool dd4hep::isA< PseudoTrap > (const Handle< TGeoShape > &solid)
 
template<>
bool dd4hep::isA< SubtractionSolid > (const Handle< TGeoShape > &solid)
 
template<>
bool dd4hep::isA< UnionSolid > (const Handle< TGeoShape > &solid)
 
template<>
bool dd4hep::isA< IntersectionSolid > (const Handle< TGeoShape > &solid)
 
std::string dd4hep::get_shape_tag (const TGeoShape *shape)
 Retrieve tag name from shape type. More...
 
template<typename T >
std::vector< double > dd4hep::dimensions (const TGeoShape *shape)
 
template<>
std::vector< double > dd4hep::dimensions< TGeoShapeAssembly > (const TGeoShape *shape)
 
template<>
std::vector< double > dd4hep::dimensions< TGeoBBox > (const TGeoShape *shape)
 
template<>
std::vector< double > dd4hep::dimensions< TGeoHalfSpace > (const TGeoShape *shape)
 
template<>
std::vector< double > dd4hep::dimensions< TGeoPcon > (const TGeoShape *shape)
 
template<>
std::vector< double > dd4hep::dimensions< TGeoConeSeg > (const TGeoShape *shape)
 
template<>
std::vector< double > dd4hep::dimensions< TGeoCone > (const TGeoShape *shape)
 
template<>
std::vector< double > dd4hep::dimensions< TGeoTube > (const TGeoShape *shape)
 
template<>
std::vector< double > dd4hep::dimensions< TGeoTubeSeg > (const TGeoShape *shape)
 
template<>
std::vector< double > dd4hep::dimensions< TwistedTubeObject > (const TGeoShape *shape)
 
template<>
std::vector< double > dd4hep::dimensions< TGeoCtub > (const TGeoShape *shape)
 
template<>
std::vector< double > dd4hep::dimensions< TGeoEltu > (const TGeoShape *shape)
 
template<>
std::vector< double > dd4hep::dimensions< TGeoTrd1 > (const TGeoShape *shape)
 
template<>
std::vector< double > dd4hep::dimensions< TGeoTrd2 > (const TGeoShape *shape)
 
template<>
std::vector< double > dd4hep::dimensions< TGeoParaboloid > (const TGeoShape *shape)
 
template<>
std::vector< double > dd4hep::dimensions< TGeoHype > (const TGeoShape *shape)
 
template<>
std::vector< double > dd4hep::dimensions< TGeoSphere > (const TGeoShape *shape)
 
template<>
std::vector< double > dd4hep::dimensions< TGeoTorus > (const TGeoShape *shape)
 
template<>
std::vector< double > dd4hep::dimensions< TGeoPgon > (const TGeoShape *shape)
 
template<>
std::vector< double > dd4hep::dimensions< TGeoXtru > (const TGeoShape *shape)
 
template<>
std::vector< double > dd4hep::dimensions< TGeoArb8 > (const TGeoShape *shape)
 
template<>
std::vector< double > dd4hep::dimensions< TGeoTrap > (const TGeoShape *shape)
 
template<>
std::vector< double > dd4hep::dimensions< TGeoGtra > (const TGeoShape *shape)
 
template<>
std::vector< double > dd4hep::dimensions< TGeoScaledShape > (const TGeoShape *shape)
 
template<>
std::vector< double > dd4hep::dimensions< TGeoTessellated > (const TGeoShape *shape)
 
template<>
std::vector< double > dd4hep::dimensions< TGeoCompositeShape > (const TGeoShape *shape)
 
template<typename SOLID >
std::vector< double > dd4hep::dimensions (const Handle< TGeoShape > &solid)
 Access Shape dimension parameters (As in TGeo, but angles in radians rather than degrees) More...
 
template std::vector< double > dd4hep::dimensions< ShapelessSolid > (const Handle< TGeoShape > &shape)
 
template std::vector< double > dd4hep::dimensions< Box > (const Handle< TGeoShape > &shape)
 
template std::vector< double > dd4hep::dimensions< Scale > (const Handle< TGeoShape > &shape)
 
template std::vector< double > dd4hep::dimensions< HalfSpace > (const Handle< TGeoShape > &shape)
 
template std::vector< double > dd4hep::dimensions< Polycone > (const Handle< TGeoShape > &shape)
 
template std::vector< double > dd4hep::dimensions< ConeSegment > (const Handle< TGeoShape > &shape)
 
template std::vector< double > dd4hep::dimensions< Tube > (const Handle< TGeoShape > &shape)
 
template std::vector< double > dd4hep::dimensions< CutTube > (const Handle< TGeoShape > &shape)
 
template std::vector< double > dd4hep::dimensions< TwistedTube > (const Handle< TGeoShape > &shape)
 
template std::vector< double > dd4hep::dimensions< EllipticalTube > (const Handle< TGeoShape > &shape)
 
template std::vector< double > dd4hep::dimensions< Cone > (const Handle< TGeoShape > &shape)
 
template std::vector< double > dd4hep::dimensions< Trap > (const Handle< TGeoShape > &shape)
 
template std::vector< double > dd4hep::dimensions< Trd1 > (const Handle< TGeoShape > &shape)
 
template std::vector< double > dd4hep::dimensions< Trd2 > (const Handle< TGeoShape > &shape)
 
template std::vector< double > dd4hep::dimensions< Torus > (const Handle< TGeoShape > &shape)
 
template std::vector< double > dd4hep::dimensions< Sphere > (const Handle< TGeoShape > &shape)
 
template std::vector< double > dd4hep::dimensions< Paraboloid > (const Handle< TGeoShape > &shape)
 
template std::vector< double > dd4hep::dimensions< Hyperboloid > (const Handle< TGeoShape > &shape)
 
template std::vector< double > dd4hep::dimensions< PolyhedraRegular > (const Handle< TGeoShape > &shape)
 
template std::vector< double > dd4hep::dimensions< Polyhedra > (const Handle< TGeoShape > &shape)
 
template std::vector< double > dd4hep::dimensions< ExtrudedPolygon > (const Handle< TGeoShape > &shape)
 
template std::vector< double > dd4hep::dimensions< EightPointSolid > (const Handle< TGeoShape > &shape)
 
template std::vector< double > dd4hep::dimensions< TessellatedSolid > (const Handle< TGeoShape > &shape)
 
template std::vector< double > dd4hep::dimensions< BooleanSolid > (const Handle< TGeoShape > &shape)
 
template std::vector< double > dd4hep::dimensions< SubtractionSolid > (const Handle< TGeoShape > &shape)
 
template std::vector< double > dd4hep::dimensions< UnionSolid > (const Handle< TGeoShape > &shape)
 
template std::vector< double > dd4hep::dimensions< IntersectionSolid > (const Handle< TGeoShape > &shape)
 
template<>
std::vector< double > dd4hep::dimensions< PseudoTrap > (const Handle< TGeoShape > &shape)
 
template<>
std::vector< double > dd4hep::dimensions< TruncatedTube > (const Handle< TGeoShape > &shape)
 
template<>
std::vector< double > dd4hep::dimensions< Solid > (const Handle< TGeoShape > &shape)
 
std::vector< double > dd4hep::get_shape_dimensions (const Handle< TGeoShape > &shape)
 Access Shape dimension parameters (As in TGeo, but angles in radians rather than degrees) More...
 
std::vector< double > dd4hep::get_shape_dimensions (TGeoShape *shape)
 Access Shape dimension parameters (As in TGeo, but angles in radians rather than degrees) More...
 
template<typename T >
void dd4hep::set_dimensions (T shape, const std::vector< double > &)
 
template<>
void dd4hep::set_dimensions (TGeoShapeAssembly *, const std::vector< double > &)
 
template<>
void dd4hep::set_dimensions (TGeoBBox *sh, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (TGeoHalfSpace *sh, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (TGeoPcon *sh, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (TGeoConeSeg *sh, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (TGeoCone *sh, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (TGeoTube *sh, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (TGeoTubeSeg *sh, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (TwistedTubeObject *sh, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (TGeoCtub *sh, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (TGeoEltu *sh, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (TGeoTrd1 *sh, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (TGeoTrd2 *sh, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (TGeoParaboloid *sh, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (TGeoHype *sh, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (TGeoSphere *sh, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (TGeoTorus *sh, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (TGeoPgon *sh, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (TGeoXtru *sh, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (TGeoArb8 *sh, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (TGeoTrap *sh, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (TGeoGtra *sh, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (TGeoScaledShape *sh, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (TGeoTessellated *sh, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (TGeoCompositeShape *, const std::vector< double > &)
 
template<>
void dd4hep::set_dimensions (ShapelessSolid shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (Box shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (Scale shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (HalfSpace shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (Polycone shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (Cone shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (ConeSegment shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (Tube shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (CutTube shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (TwistedTube shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (EllipticalTube shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (Trap shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (Trd1 shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (Trd2 shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (Paraboloid shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (Hyperboloid shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (Sphere shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (Torus shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (PolyhedraRegular shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (Polyhedra shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (ExtrudedPolygon shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (EightPointSolid shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (TessellatedSolid shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (BooleanSolid shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (SubtractionSolid shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (UnionSolid shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (IntersectionSolid shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (TruncatedTube shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (PseudoTrap shape, const std::vector< double > &params)
 
template<>
void dd4hep::set_dimensions (Solid shape, const std::vector< double > &params)
 Set the shape dimensions. As for the TGeo shape, but angles in rad rather than degrees. More...
 
template<>
void dd4hep::set_dimensions (const TGeoShape *shape, const std::vector< double > &params)
 Set the shape dimensions. As for the TGeo shape, but angles in rad rather than degrees. More...
 
void dd4hep::set_shape_dimensions (TGeoShape *shape, const std::vector< double > &params)
 Set the shape dimensions (As for the TGeo shape, but angles in rad rather than degrees) More...
 
void dd4hep::set_shape_dimensions (Solid solid, const std::vector< double > &params)
 Set the shape dimensions. As for the TGeo shape, but angles in rad rather than degrees. More...
 
std::string dd4hep::toStringSolid (const TGeoShape *shape, int precision=2)
 Pretty print of solid attributes. More...
 
std::string dd4hep::toStringMesh (const TGeoShape *shape, int precision=2)
 Output mesh vertices to string. More...
 

Macro Definition Documentation

◆ _USE_MATH_DEFINES

#define _USE_MATH_DEFINES

Definition at line 15 of file ShapeUtilities.cpp.