From d73ee8c9a5720205978426090a74d287d58be581 Mon Sep 17 00:00:00 2001 From: Markus Frank Date: Fri, 14 Dec 2018 15:46:39 +0100 Subject: [PATCH] Add named shape constructors (Issue Names for shapes #469) --- DDCore/include/DD4hep/Shapes.h | 380 +++++++++++++++--- DDCore/src/Shapes.cpp | 316 ++++++++++----- examples/ClientTests/compact/CheckShape.xml | 3 + .../compact/Check_Shape_PseudoTrap3.xml | 72 ++++ examples/ClientTests/ref/Ref_PseudoTrap3.txt | 128 ++++++ 5 files changed, 743 insertions(+), 156 deletions(-) create mode 100644 examples/ClientTests/compact/Check_Shape_PseudoTrap3.xml create mode 100644 examples/ClientTests/ref/Ref_PseudoTrap3.txt diff --git a/DDCore/include/DD4hep/Shapes.h b/DDCore/include/DD4hep/Shapes.h index 5111a030d..3974a38e9 100644 --- a/DDCore/include/DD4hep/Shapes.h +++ b/DDCore/include/DD4hep/Shapes.h @@ -170,7 +170,7 @@ namespace dd4hep { class Box: public Solid_type { protected: /// Internal helper method to support object construction - void make(double x_val, double y_val, double z_val); + void make(const std::string& name, double x_val, double y_val, double z_val); public: /// Default constructor @@ -181,13 +181,23 @@ namespace dd4hep { template Box(const Q* p) : Solid_type(p) { } /// Constructor to be used with an existing object template Box(const Handle& e) : Solid_type(e) { } + /// Constructor to create an anonymous new box object (retrieves name from volume) - Box(double x_val, double y_val, double z_val) { make(x_val, y_val, z_val); } + Box(double x_val, double y_val, double z_val) + { make("", x_val, y_val, z_val); } + /// Constructor to create a named new box object (retrieves name from volume) + Box(const std::string& name, double x_val, double y_val, double z_val) + { make(name.c_str(), x_val, y_val, z_val); } + /// Constructor to create an anonymous new box object (retrieves name from volume) template - Box(const X& x_val, const Y& y_val, const Z& z_val) { - make(_toDouble(x_val), _toDouble(y_val), _toDouble(z_val)); - } + Box(const X& x_val, const Y& y_val, const Z& z_val) + { make("", _toDouble(x_val), _toDouble(y_val), _toDouble(z_val)); } + /// Constructor to create a named new box object (retrieves name from volume) + template + Box(const std::string& name, const X& x_val, const Y& y_val, const Z& z_val) + { make(name.c_str(), _toDouble(x_val), _toDouble(y_val), _toDouble(z_val)); } + /// Assignment operator Box& operator=(const Box& copy) = default; /// Set the box dimensions @@ -213,7 +223,7 @@ namespace dd4hep { class HalfSpace: public Solid_type { protected: /// Internal helper method to support object construction - void make(const double* const point, const double* const normal); + void make(const std::string& name, const double* const point, const double* const normal); public: /// Default constructor @@ -224,8 +234,15 @@ namespace dd4hep { template HalfSpace(const Q* p) : Solid_type(p) { } /// Constructor to be used with an existing object template HalfSpace(const Handle& e) : Solid_type(e) { } + /// Constructor to create an new halfspace object from a point on a plane and the plane normal - HalfSpace(const double* const point, const double* const normal) { make(point,normal); } + HalfSpace(const double* const point, const double* const normal) + { make("", point, normal); } + + /// Constructor to create an new named halfspace object from a point on a plane and the plane normal + HalfSpace(const std::string& nam, const double* const point, const double* const normal) + { make(nam.c_str(), point, normal); } + /// Assignment operator HalfSpace& operator=(const HalfSpace& copy) = default; }; @@ -258,6 +275,7 @@ namespace dd4hep { template Polycone(const Q* p) : Solid_type(p) { } /// Constructor to be used when reading the already parsed polycone object template Polycone(const Handle& e) : Solid_type(e) { } + /// Constructor to create a new polycone object Polycone(double startPhi, double deltaPhi); /// Constructor to create a new polycone object. Add at the same time all Z planes @@ -266,9 +284,18 @@ namespace dd4hep { /// Constructor to create a new polycone object. Add at the same time all Z planes Polycone(double startPhi, double deltaPhi, const std::vector& rmin, const std::vector& rmax, const std::vector& z); + + /// Constructor to create a new named polycone object + Polycone(const std::string& name, double startPhi, double deltaPhi); + /// Constructor to create a new named polycone object. Add at the same time all Z planes + Polycone(const std::string& name, double startPhi, double deltaPhi, + const std::vector& r, const std::vector& z); + /// Constructor to create a new named polycone object. Add at the same time all Z planes + Polycone(const std::string& name, double startPhi, double deltaPhi, + const std::vector& rmin, const std::vector& rmax, const std::vector& z); + /// Assignment operator Polycone& operator=(const Polycone& copy) = default; - /// Add Z-planes to the Polycone void addZPlanes(const std::vector& rmin, const std::vector& rmax, const std::vector& z); }; @@ -295,13 +322,17 @@ namespace dd4hep { template ConeSegment(const Q* p) : Solid_type(p) { } /// Constructor to be used when reading the already parsed ConeSegment object template ConeSegment(const Handle& e) : Solid_type(e) { } + /// Constructor to create a new ConeSegment object ConeSegment(double dz, double rmin1, double rmax1, - double rmin2, double rmax2, - double startPhi = 0.0, double endPhi = 2.0 * M_PI); + double rmin2, double rmax2, double startPhi = 0.0, double endPhi = 2.0 * M_PI); + + /// Constructor to create a new named ConeSegment object + ConeSegment(const std::string& name, double dz, double rmin1, double rmax1, + double rmin2, double rmax2, double startPhi = 0.0, double endPhi = 2.0 * M_PI); + /// Assignment operator ConeSegment& operator=(const ConeSegment& copy) = default; - /// Set the cone segment dimensions ConeSegment& setDimensions(double dz, double rmin1, double rmax1, double rmin2, double rmax2, @@ -343,6 +374,7 @@ namespace dd4hep { template Tube(const Q* p) : Solid_type(p) { } /// Constructor to assign an object template Tube(const Handle& e) : Solid_type(e) { } + /// Constructor to create a new anonymous tube object with attribute initialization Tube(double rmin, double rmax, double dz) { make("", rmin, rmax, dz, 0, 2*M_PI); } @@ -352,6 +384,7 @@ namespace dd4hep { /// Constructor to create a new anonymous tube object with attribute initialization Tube(double rmin, double rmax, double dz, double startPhi, double endPhi) { make("", rmin, rmax, dz, startPhi, endPhi); } + /// Legacy: Constructor to create a new identifiable tube object with attribute initialization Tube(const std::string& nam, double rmin, double rmax, double dz) { make(nam, rmin, rmax, dz, 0, 2*M_PI); } @@ -365,6 +398,7 @@ namespace dd4hep { template Tube(const RMIN& rmin, const RMAX& rmax, const Z& dz, const ENDPHI& endPhi = 2.0*M_PI) { make("", _toDouble(rmin), _toDouble(rmax), _toDouble(dz), 0, _toDouble(endPhi)); } + /// Assignment operator Tube& operator=(const Tube& copy) = default; /// Set the tube dimensions @@ -383,7 +417,8 @@ namespace dd4hep { class CutTube: public Solid_type { protected: /// Internal helper method to support object construction - void make(double rmin, double rmax, double dz, double startPhi, double endPhi, + void make(const std::string& name, + double rmin, double rmax, double dz, double startPhi, double endPhi, double lx, double ly, double lz, double tx, double ty, double tz); public: @@ -395,9 +430,16 @@ namespace dd4hep { template CutTube(const Q* p) : Solid_type(p) { } /// Constructor to assign an object template CutTube(const Handle& e) : Solid_type(e) { } - /// Legacy: Constructor to create a new identifiable tube object with attribute initialization + + /// Constructor to create a new cut-tube object with attribute initialization CutTube(double rmin, double rmax, double dz, double startPhi, double endPhi, double lx, double ly, double lz, double tx, double ty, double tz); + + /// Constructor to create a new identifiable cut-tube object with attribute initialization + CutTube(const std::string& name, + double rmin, double rmax, double dz, double startPhi, double endPhi, + double lx, double ly, double lz, double tx, double ty, double tz); + /// Assignment operator CutTube& operator=(const CutTube& copy) = default; }; @@ -415,8 +457,9 @@ namespace dd4hep { class TruncatedTube: public Solid_type { protected: /// Internal helper method to support object construction - void make(double zhalf, double rmin, double rmax, double startPhi, double deltaPhi, - double cutAtStart, double cutAtDelta, bool cutInside); + void make(const std::string& name, + double zhalf, double rmin, double rmax, double startPhi, double deltaPhi, + double cutAtStart, double cutAtDelta, bool cutInside); public: /// Default constructor @@ -427,9 +470,16 @@ namespace dd4hep { template TruncatedTube(const Q* p) : Solid_type(p) { } /// Constructor to assign an object template TruncatedTube(const Handle& e) : Solid_type(e) { } + /// Constructor to create a truncated tube object with attribute initialization TruncatedTube(double zhalf, double rmin, double rmax, double startPhi, double deltaPhi, double cutAtStart, double cutAtDelta, bool cutInside); + + /// Constructor to create a truncated tube object with attribute initialization + TruncatedTube(const std::string& name, + double zhalf, double rmin, double rmax, double startPhi, double deltaPhi, + double cutAtStart, double cutAtDelta, bool cutInside); + /// Assignment operator TruncatedTube& operator=(const TruncatedTube& copy) = default; }; @@ -449,7 +499,7 @@ namespace dd4hep { class EllipticalTube: public Solid_type { protected: /// Internal helper method to support object construction - void make(double a, double b, double dz); + void make(const std::string& nam, double a, double b, double dz); public: /// Default constructor @@ -460,12 +510,22 @@ namespace dd4hep { template EllipticalTube(const Q* p) : Solid_type(p) { } /// Constructor to assign an object template EllipticalTube(const Handle& e) : Solid_type(e) { } + /// Constructor to create a new anonymous tube object with attribute initialization - EllipticalTube(double a, double b, double dz) { make(a, b, dz); } + EllipticalTube(double a, double b, double dz) { make("", a, b, dz); } /// Constructor to create a new anonymous tube object with attribute initialization template EllipticalTube(const A& a, const B& b, const DZ& dz) - { make(_toDouble(a), _toDouble(b), _toDouble(dz)); } + { make("",_toDouble(a), _toDouble(b), _toDouble(dz)); } + + /// Constructor to create a new identified tube object with attribute initialization + EllipticalTube(const std::string& nam, double a, double b, double dz) + { make(nam, a, b, dz); } + /// Constructor to create a new identified tube object with attribute initialization + template + EllipticalTube(const std::string& nam, const A& a, const B& b, const DZ& dz) + { make(nam, _toDouble(a), _toDouble(b), _toDouble(dz)); } + /// Assignment operator EllipticalTube& operator=(const EllipticalTube& copy) = default; /// Set the tube dimensions @@ -484,7 +544,7 @@ namespace dd4hep { class Cone: public Solid_type { protected: /// Internal helper method to support object construction - void make(double z, double rmin1, double rmax1, double rmin2, double rmax2); + void make(const std::string& name, double z, double rmin1, double rmax1, double rmin2, double rmax2); public: /// Default constructor Cone() = default; @@ -494,12 +554,23 @@ namespace dd4hep { template Cone(const Q* p) : Solid_type(p) { } /// Constructor to be used when passing an already created object template Cone(const Handle& e) : Solid_type(e) { } + /// Constructor to create a new anonymous object with attribute initialization Cone(double z, double rmin1, double rmax1, double rmin2, double rmax2) - { make(z, rmin1, rmax1, rmin2, rmax2); } + { make("", z, rmin1, rmax1, rmin2, rmax2); } + /// Constructor to create a new anonymous object with attribute initialization template Cone(const Z& z, const RMIN1& rmin1, const RMAX1& rmax1, const RMIN2& rmin2, const RMAX2& rmax2) - { make(_toDouble(z), _toDouble(rmin1), _toDouble(rmax1), _toDouble(rmin2), _toDouble(rmax2)); } + { make("", _toDouble(z), _toDouble(rmin1), _toDouble(rmax1), _toDouble(rmin2), _toDouble(rmax2)); } + + /// Constructor to create a new anonymous object with attribute initialization + Cone(const std::string& nam, double z, double rmin1, double rmax1, double rmin2, double rmax2) + { make(nam, z, rmin1, rmax1, rmin2, rmax2); } + /// Constructor to create a new anonymous object with attribute initialization + template + Cone(const std::string& nam, const Z& z, const RMIN1& rmin1, const RMAX1& rmax1, const RMIN2& rmin2, const RMAX2& rmax2) + { make(nam, _toDouble(z), _toDouble(rmin1), _toDouble(rmax1), _toDouble(rmin2), _toDouble(rmax2)); } + /// Assignment operator Cone& operator=(const Cone& copy) = default; /// Set the box dimensions @@ -518,7 +589,7 @@ namespace dd4hep { class Trap: public Solid_type { private: /// Internal helper method to support object construction - void make(double pz, double py, double px, double pLTX); + void make(const std::string& name, double pz, double py, double px, double pLTX); public: /// Default constructor Trap() = default; @@ -528,15 +599,31 @@ namespace dd4hep { template Trap(const Q* p) : Solid_type(p) { } /// Constructor to be used when passing an already created object template Trap(const Handle& e) : Solid_type(e) { } + /// Constructor to create a new anonymous object with attribute initialization Trap(double z, double theta, double phi, double h1, double bl1, double tl1, double alpha1, double h2, double bl2, double tl2, double alpha2); /// Constructor to create a new anonymous object for right angular wedge from STEP (Se G4 manual for details) - Trap(double pz, double py, double px, double pLTX) { make(pz,py,px,pLTX); } + Trap(double pz, double py, double px, double pLTX) + { make("", pz,py,px,pLTX); } /// Constructor to create a new anonymous object with attribute initialization template Trap(PZ pz, PY py, PX px, PLTX pLTX) - { make(_toDouble(pz),_toDouble(py),_toDouble(px),_toDouble(pLTX)); } + { make("", _toDouble(pz),_toDouble(py),_toDouble(px),_toDouble(pLTX)); } + + /// Constructor to create a new identified object with attribute initialization + Trap(const std::string& name, + double z, double theta, double phi, + double h1, double bl1, double tl1, double alpha1, + double h2, double bl2, double tl2, double alpha2); + /// Constructor to create a new identified object for right angular wedge from STEP (Se G4 manual for details) + Trap(const std::string& nam, double pz, double py, double px, double pLTX) + { make(nam, pz,py,px,pLTX); } + /// Constructor to create a new identified object with attribute initialization + template + Trap(const std::string& nam, PZ pz, PY py, PX px, PLTX pLTX) + { make(nam, _toDouble(pz),_toDouble(py),_toDouble(px),_toDouble(pLTX)); } + /// Assignment operator Trap& operator=(const Trap& copy) = default; /// Set the trap dimensions @@ -557,7 +644,7 @@ namespace dd4hep { class PseudoTrap: public Solid_type { private: /// Internal helper method to support object construction - void make(double x1, double x2, double y1, double y2, double z, double radius, bool minusZ); + void make(const std::string& nam, double x1, double x2, double y1, double y2, double z, double radius, bool minusZ); public: /// Default constructor PseudoTrap() = default; @@ -567,9 +654,18 @@ namespace dd4hep { template PseudoTrap(const Q* p) : Solid_type(p) { } /// Constructor to be used when passing an already created object template PseudoTrap(const Handle& e) : Solid_type(e) { } + /// Constructor to create a new anonymous object with attribute initialization PseudoTrap(double x1, double x2, double y1, double y2, double z, double radius, bool minusZ) - { make(x1, x2, y1, y2, z, radius, minusZ); } + { make("", x1, x2, y1, y2, z, radius, minusZ); } + + /// Constructor to create a new identified object with attribute initialization + PseudoTrap(const std::string& nam, + double x1, double x2, + double y1, double y2, double z, + double radius, bool minusZ) + { make(nam, x1, x2, y1, y2, z, radius, minusZ); } + /// Assignment operator PseudoTrap& operator=(const PseudoTrap& copy) = default; }; @@ -587,7 +683,7 @@ namespace dd4hep { class Trd1: public Solid_type { private: /// Internal helper method to support object construction - void make(double x1, double x2, double y, double z); + void make(const std::string& nam, double x1, double x2, double y, double z); public: /// Default constructor @@ -598,12 +694,23 @@ namespace dd4hep { template Trd1(const Q* p) : Solid_type(p) { } /// Constructor to be used when passing an already created object template Trd1(const Handle& e) : Solid_type(e) { } + /// Constructor to create a new anonymous object with attribute initialization - Trd1(double x1, double x2, double y, double z); + Trd1(double x1, double x2, double y, double z) + { make("", x1, x2, y, z); } /// Constructor to create a new anonymous object with attribute initialization template Trd1(X1 x1, X2 x2, Y y, Z z) - { make(_toDouble(x1),_toDouble(x2),_toDouble(y),_toDouble(z)); } + { make("", _toDouble(x1),_toDouble(x2),_toDouble(y),_toDouble(z)); } + + /// Constructor to create a new anonymous object with attribute initialization + Trd1(const std::string& nam, double x1, double x2, double y, double z) + { make(nam, x1, x2, y, z); } + /// Constructor to create a new anonymous object with attribute initialization + template + Trd1(const std::string& nam, X1 x1, X2 x2, Y y, Z z) + { make(nam, _toDouble(x1),_toDouble(x2),_toDouble(y),_toDouble(z)); } + /// Assignment operator Trd1& operator=(const Trd1& copy) = default; /// Set the Trd1 dimensions @@ -623,7 +730,7 @@ namespace dd4hep { class Trd2: public Solid_type { private: /// Internal helper method to support object construction - void make(double x1, double x2, double y1, double y2, double z); + void make(const std::string& nam, double x1, double x2, double y1, double y2, double z); public: /// Default constructor @@ -634,12 +741,23 @@ namespace dd4hep { template Trd2(const Q* p) : Solid_type(p) { } /// Constructor to be used when passing an already created object template Trd2(const Handle& e) : Solid_type(e) { } + /// Constructor to create a new anonymous object with attribute initialization - Trd2(double x1, double x2, double y1, double y2, double z); + Trd2(double x1, double x2, double y1, double y2, double z) + { make("", x1, x2, y1, y2, z); } /// Constructor to create a new anonymous object with attribute initialization template Trd2(X1 x1, X2 x2, Y1 y1, Y2 y2, Z z) - { make(_toDouble(x1),_toDouble(x2),_toDouble(y1),_toDouble(y2),_toDouble(z)); } + { make("", _toDouble(x1),_toDouble(x2),_toDouble(y1),_toDouble(y2),_toDouble(z)); } + + /// Constructor to create a new identified object with attribute initialization + Trd2(const std::string& nam, double x1, double x2, double y1, double y2, double z) + { make(nam, x1, x2, y1, y2, z); } + /// Constructor to create a new identified object with attribute initialization + template + Trd2(const std::string& nam, X1 x1, X2 x2, Y1 y1, Y2 y2, Z z) + { make(nam, _toDouble(x1),_toDouble(x2),_toDouble(y1),_toDouble(y2),_toDouble(z)); } + /// Assignment operator Trd2& operator=(const Trd2& copy) = default; /// Set the Trd2 dimensions @@ -660,7 +778,7 @@ namespace dd4hep { class Torus: public Solid_type { private: /// Internal helper method to support object construction - void make(double r, double rmin, double rmax, double startPhi, double deltaPhi); + void make(const std::string& nam, double r, double rmin, double rmax, double startPhi, double deltaPhi); public: /// Default constructor Torus() = default; @@ -670,13 +788,23 @@ namespace dd4hep { template Torus(const Q* p) : Solid_type(p) { } /// Constructor to be used when passing an already created object template Torus(const Handle& e) : Solid_type(e) { } + /// Constructor to create a new anonymous object with attribute initialization template Torus(R r, RMIN rmin, RMAX rmax, STARTPHI startPhi=M_PI, DELTAPHI deltaPhi = 2.*M_PI) - { make(_toDouble(r),_toDouble(rmin),_toDouble(rmax),_toDouble(startPhi),_toDouble(deltaPhi)); } + { make("", _toDouble(r),_toDouble(rmin),_toDouble(rmax),_toDouble(startPhi),_toDouble(deltaPhi)); } /// Constructor to create a new anonymous object with attribute initialization Torus(double r, double rmin, double rmax, double startPhi=M_PI, double deltaPhi = 2.*M_PI) - { make(r, rmin, rmax, startPhi, deltaPhi); } + { make("", r, rmin, rmax, startPhi, deltaPhi); } + + /// Constructor to create a new identified object with attribute initialization + template + Torus(const std::string& nam, R r, RMIN rmin, RMAX rmax, STARTPHI startPhi=M_PI, DELTAPHI deltaPhi = 2.*M_PI) + { make(nam, _toDouble(r),_toDouble(rmin),_toDouble(rmax),_toDouble(startPhi),_toDouble(deltaPhi)); } + /// Constructor to create a new identified object with attribute initialization + Torus(const std::string& nam, double r, double rmin, double rmax, double startPhi=M_PI, double deltaPhi = 2.*M_PI) + { make(nam, r, rmin, rmax, startPhi, deltaPhi); } + /// Assignment operator Torus& operator=(const Torus& copy) = default; /// Set the Torus dimensions @@ -696,7 +824,8 @@ namespace dd4hep { class Sphere: public Solid_type { protected: /// Constructor function to be used when creating a new object with attribute initialization - void make(double rmin, double rmax, + void make(const std::string& nam, + double rmin, double rmax, double startTheta, double endTheta, double startPhi, double endPhi); public: @@ -708,11 +837,12 @@ namespace dd4hep { template Sphere(const Q* p) : Solid_type(p) { } /// Constructor to be used when passing an already created object template Sphere(const Handle& e) : Solid_type(e) { } + /// Constructor to create a new anonymous object with attribute initialization Sphere(double rmin, double rmax, double startTheta= 0.0, double endTheta = M_PI, double startPhi = 0.0, double endPhi = 2. * M_PI) - { make(rmin, rmax, startTheta, endTheta, startPhi, endPhi); } + { make("", rmin, rmax, startTheta, endTheta, startPhi, endPhi); } /// Constructor to create a new anonymous object with generic attribute initialization template + Sphere(const std::string& nam, + RMIN rmin, RMAX rmax, + STARTTHETA startTheta = 0.0, ENDTHETA endTheta = M_PI, + STARTPHI startPhi = 0.0, ENDPHI endPhi = 2. * M_PI) { + make(nam, + _toDOuble(rmin), _toDouble(rmax), _toDouble(startTheta), _toDouble(endTheta), _toDouble(startPhi), _toDouble(endPhi)); } + /// Assignment operator Sphere& operator=(const Sphere& copy) = default; /// Set the Sphere dimensions @@ -744,7 +896,7 @@ namespace dd4hep { */ class Paraboloid: public Solid_type { /// Constructor function to create a new anonymous object with attribute initialization - void make(double r_low, double r_high, double delta_z); + void make(const std::string& nam, double r_low, double r_high, double delta_z); public: /// Default constructor Paraboloid() = default; @@ -754,13 +906,23 @@ namespace dd4hep { template Paraboloid(const Q* p) : Solid_type(p) { } /// Constructor to be used when passing an already created object template Paraboloid(const Handle& e) : Solid_type(e) { } + /// Constructor to create a new anonymous object with attribute initialization Paraboloid(double r_low, double r_high, double delta_z) - { make(r_low, r_high, delta_z); } + { make("", r_low, r_high, delta_z); } /// Constructor to create a new anonymous object with attribute initialization template Paraboloid(R_LOW r_low, R_HIGH r_high, DELTA_Z delta_z) - { make(_toDouble(r_low), _toDouble(r_high), _toDouble(delta_z)); } + { make("", _toDouble(r_low), _toDouble(r_high), _toDouble(delta_z)); } + + /// Constructor to create a new identified object with attribute initialization + Paraboloid(const std::string& nam, double r_low, double r_high, double delta_z) + { make(nam, r_low, r_high, delta_z); } + /// Constructor to create a new identified object with attribute initialization + template + Paraboloid(const std::string& nam, R_LOW r_low, R_HIGH r_high, DELTA_Z delta_z) + { make(nam, _toDouble(r_low), _toDouble(r_high), _toDouble(delta_z)); } + /// Assignment operator Paraboloid& operator=(const Paraboloid& copy) = default; /// Set the Paraboloid dimensions @@ -779,7 +941,7 @@ namespace dd4hep { */ class Hyperboloid: public Solid_type { /// Constructor function to create a new anonymous object with attribute initialization - void make(double rin, double stin, double rout, double stout, double dz); + void make(const std::string& nam, double rin, double stin, double rout, double stout, double dz); public: /// Default constructor Hyperboloid() = default; @@ -789,15 +951,23 @@ namespace dd4hep { template Hyperboloid(const Q* p) : Solid_type(p) { } /// Constructor to be used when passing an already created object template Hyperboloid(const Handle& e) : Solid_type(e) { } + /// Constructor to create a new anonymous object with attribute initialization - Hyperboloid(double rin, double stin, double rout, double stout, double dz) { - make(rin, stin, rout, stout, dz); - } + Hyperboloid(double rin, double stin, double rout, double stout, double dz) + { make("", rin, stin, rout, stout, dz); } /// Constructor to create a new anonymous object with attribute initialization template - Hyperboloid(RIN rin, STIN stin, ROUT rout, STOUT stout, DZ dz) { - make(_toDouble(rin), _toDouble(stin), _toDouble(rout), _toDouble(stout), _toDouble(dz)); - } + Hyperboloid(RIN rin, STIN stin, ROUT rout, STOUT stout, DZ dz) + { make("", _toDouble(rin), _toDouble(stin), _toDouble(rout), _toDouble(stout), _toDouble(dz)); } + + /// Constructor to create a new identified object with attribute initialization + Hyperboloid(const std::string& nam, double rin, double stin, double rout, double stout, double dz) + { make(nam, rin, stin, rout, stout, dz); } + /// Constructor to create a new identified object with attribute initialization + template + Hyperboloid(const std::string& nam, RIN rin, STIN stin, ROUT rout, STOUT stout, DZ dz) + { make(nam, _toDouble(rin), _toDouble(stin), _toDouble(rout), _toDouble(stout), _toDouble(dz)); } + /// Assignment operator Hyperboloid& operator=(const Hyperboloid& copy) = default; /// Set the Hyperboloid dimensions @@ -816,7 +986,7 @@ namespace dd4hep { class PolyhedraRegular: public Solid_type { protected: /// Helper function to create the polyhedron - void make(int nsides, double rmin, double rmax, double zpos, double zneg, double start, double delta); + void make(const std::string& nam, int nsides, double rmin, double rmax, double zpos, double zneg, double start, double delta); public: /// Default constructor PolyhedraRegular() = default; @@ -826,12 +996,26 @@ namespace dd4hep { template PolyhedraRegular(const Q* p) : Solid_type(p) { } /// Constructor to be used when passing an already created object template PolyhedraRegular(const Handle& e) : Solid_type(e) { } + /// Constructor to create a new object. Phi(start)=0, deltaPhi=2PI, Z-planes at -zlen/2 and +zlen/2 - PolyhedraRegular(int nsides, double rmin, double rmax, double zlen); + PolyhedraRegular(int nsides, double rmin, double rmax, double zlen) + { make("", nsides, rmin, rmax, zlen / 2, -zlen / 2, 0, 2.0*M_PI); } + /// Constructor to create a new object with phi_start, deltaPhi=2PI, Z-planes at -zlen/2 and +zlen/2 + PolyhedraRegular(int nsides, double phi_start, double rmin, double rmax, double zlen) + { make("", nsides, rmin, rmax, zlen / 2, -zlen / 2, phi_start, 2.0*M_PI); } /// Constructor to create a new object. Phi(start)=0, deltaPhi=2PI, Z-planes a zplanes[0] and zplanes[1] - PolyhedraRegular(int nsides, double rmin, double rmax, double zplanes[2]); + PolyhedraRegular(int nsides, double rmin, double rmax, double zplanes[2]) + { make("", nsides, rmin, rmax, zplanes[0], zplanes[1], 0, 2.0*M_PI); } + + /// Constructor to create a new object. Phi(start)=0, deltaPhi=2PI, Z-planes at -zlen/2 and +zlen/2 + PolyhedraRegular(const std::string& nam, int nsides, double rmin, double rmax, double zlen) + { make(nam, nsides, rmin, rmax, zlen / 2, -zlen / 2, 0, 2.0*M_PI); } /// Constructor to create a new object with phi_start, deltaPhi=2PI, Z-planes at -zlen/2 and +zlen/2 - PolyhedraRegular(int nsides, double phi_start, double rmin, double rmax, double zlen); + PolyhedraRegular(const std::string& nam, int nsides, double phi_start, double rmin, double rmax, double zlen) + { make(nam, nsides, rmin, rmax, zlen / 2, -zlen / 2, phi_start, 2.0*M_PI); } + /// Constructor to create a new object. Phi(start)=0, deltaPhi=2PI, Z-planes a zplanes[0] and zplanes[1] + PolyhedraRegular(const std::string& nam, int nsides, double rmin, double rmax, double zplanes[2]) + { make(nam, nsides, rmin, rmax, zplanes[0], zplanes[1], 0, 2.0*M_PI); } /// Assignment operator PolyhedraRegular& operator=(const PolyhedraRegular& copy) = default; }; @@ -848,8 +1032,10 @@ namespace dd4hep { class Polyhedra : public Solid_type { protected: /// Helper function to create the polyhedron - void make(int nsides, double start, double delta, - const std::vector& z, const std::vector& rmin, const std::vector& rmax); + void make(const std::string& nam, int nsides, double start, double delta, + const std::vector& z, + const std::vector& rmin, + const std::vector& rmax); public: /// Default constructor Polyhedra() = default; @@ -859,12 +1045,28 @@ namespace dd4hep { template Polyhedra(const Q* p) : Solid_type(p) { } /// Constructor to be used when passing an already created object template Polyhedra(const Handle& e) : Solid_type(e) { } + /// Constructor to create a new object. Phi(start), deltaPhi, Z-planes at specified positions Polyhedra(int nsides, double start, double delta, - const std::vector& z, const std::vector& r); + const std::vector& z, const std::vector& r) { + std::vector rmin(r.size(), 0.); + make("", nsides, start, delta, z, rmin, r); + } /// Constructor to create a new object. Phi(start), deltaPhi, Z-planes at specified positions Polyhedra(int nsides, double start, double delta, - const std::vector& z, const std::vector& rmin, const std::vector& rmax); + const std::vector& z, const std::vector& rmin, const std::vector& rmax) + { make("", nsides, start, delta, z, rmin, rmax); } + + /// Constructor to create a new object. Phi(start), deltaPhi, Z-planes at specified positions + Polyhedra(const std::string& nam, int nsides, double start, double delta, + const std::vector& z, const std::vector& r) { + std::vector rmin(r.size(), 0.); + make(nam, nsides, start, delta, z, rmin, r); + } + /// Constructor to create a new object. Phi(start), deltaPhi, Z-planes at specified positions + Polyhedra(const std::string& nam, int nsides, double start, double delta, + const std::vector& z, const std::vector& rmin, const std::vector& rmax) + { make(nam, nsides, start, delta, z, rmin, rmax); } /// Assignment operator Polyhedra& operator=(const Polyhedra& copy) = default; }; @@ -881,7 +1083,8 @@ namespace dd4hep { class ExtrudedPolygon : public Solid_type { protected: /// Helper function to create the polygon - void make(const std::vector & pt_x, + void make(const std::string& nam, + const std::vector & pt_x, const std::vector & pt_y, const std::vector & sec_z, const std::vector & sec_x, @@ -896,13 +1099,25 @@ namespace dd4hep { template ExtrudedPolygon(const Q* p) : Solid_type(p) { } /// Constructor to be used when passing an already created object template ExtrudedPolygon(const Handle& e) : Solid_type(e) { } + /// Constructor to create a new object. ExtrudedPolygon(const std::vector & pt_x, const std::vector & pt_y, const std::vector & sec_z, const std::vector & sec_x, const std::vector & sec_y, - const std::vector & zscale); + const std::vector & zscale) + { make("", pt_x, pt_y, sec_z, sec_x, sec_y, zscale); } + + /// Constructor to create a new identified object. + ExtrudedPolygon(const std::string& nam, + const std::vector & pt_x, + const std::vector & pt_y, + const std::vector & sec_z, + const std::vector & sec_x, + const std::vector & sec_y, + const std::vector & zscale) + { make(nam, pt_x, pt_y, sec_z, sec_x, sec_y, zscale); } /// Assignment operator ExtrudedPolygon& operator=(const ExtrudedPolygon& copy) = default; }; @@ -919,7 +1134,7 @@ namespace dd4hep { class EightPointSolid: public Solid_type { private: /// Internal helper method to support object construction - void make(double dz, const double* vtx); + void make(const std::string& nam, double dz, const double* vtx); public: /// Default constructor EightPointSolid() = default; @@ -928,9 +1143,16 @@ namespace dd4hep { /// Constructor to be used with an existing object template EightPointSolid(const Q* p) : Solid_type(p) { } /// Constructor to be used when passing an already created object - template EightPointSolid(const Handle& e) : Solid_type(e) {} + template EightPointSolid(const Handle& e) : Solid_type(e) { } + /// Constructor to create a new anonymous object with attribute initialization - EightPointSolid(double dz, const double* vertices) { make(dz,vertices); } + EightPointSolid(double dz, const double* vertices) + { make("", dz, vertices); } + + /// Constructor to create a new identified object with attribute initialization + EightPointSolid(const std::string& nam, double dz, const double* vertices) + { make(nam, dz, vertices); } + /// Assignment operator EightPointSolid& operator=(const EightPointSolid& copy) = default; }; @@ -977,6 +1199,7 @@ namespace dd4hep { SubtractionSolid(const SubtractionSolid& e) = default; /// Constructor to be used when passing an already created object template SubtractionSolid(const Handle& e) : BooleanSolid(e) { } + /// Constructor to create a new object. Position is identity, Rotation is identity-rotation! SubtractionSolid(const Solid& shape1, const Solid& shape2); /// Constructor to create a new object. Placement by position, Rotation is identity-rotation! @@ -987,6 +1210,17 @@ namespace dd4hep { SubtractionSolid(const Solid& shape1, const Solid& shape2, const Rotation3D& rot); /// Constructor to create a new object. Placement by a generic transformation within the mother SubtractionSolid(const Solid& shape1, const Solid& shape2, const Transform3D& pos); + + /// Constructor to create a new identified object. Position is identity, Rotation is identity-rotation! + SubtractionSolid(const std::string& name, const Solid& shape1, const Solid& shape2); + /// Constructor to create a new identified object. Placement by position, Rotation is identity-rotation! + SubtractionSolid(const std::string& name, const Solid& shape1, const Solid& shape2, const Position& pos); + /// Constructor to create a new identified object. Placement by a RotationZYX within the mother + SubtractionSolid(const std::string& name, const Solid& shape1, const Solid& shape2, const RotationZYX& rot); + /// Constructor to create a new identified object. Placement by a generic rotoation within the mother + SubtractionSolid(const std::string& name, const Solid& shape1, const Solid& shape2, const Rotation3D& rot); + /// Constructor to create a new identified object. Placement by a generic transformation within the mother + SubtractionSolid(const std::string& name, const Solid& shape1, const Solid& shape2, const Transform3D& pos); /// Assignment operator SubtractionSolid& operator=(const SubtractionSolid& copy) = default; }; @@ -1009,6 +1243,7 @@ namespace dd4hep { UnionSolid(const UnionSolid& e) = default; /// Constructor to be used when passing an already created object template UnionSolid(const Handle& e) : BooleanSolid(e) { } + /// Constructor to create a new object. Position is identity, Rotation is identity-rotation! UnionSolid(const Solid& shape1, const Solid& shape2); /// Constructor to create a new object. Placement by position, Rotation is identity-rotation! @@ -1019,6 +1254,17 @@ namespace dd4hep { UnionSolid(const Solid& shape1, const Solid& shape2, const Rotation3D& rot); /// Constructor to create a new object. Placement by a generic transformation within the mother UnionSolid(const Solid& shape1, const Solid& shape2, const Transform3D& pos); + + /// Constructor to create a new identified object. Position is identity, Rotation is identity-rotation! + UnionSolid(const std::string& name, const Solid& shape1, const Solid& shape2); + /// Constructor to create a new identified object. Placement by position, Rotation is identity-rotation! + UnionSolid(const std::string& name, const Solid& shape1, const Solid& shape2, const Position& pos); + /// Constructor to create a new identified object. Placement by a RotationZYX within the mother + UnionSolid(const std::string& name, const Solid& shape1, const Solid& shape2, const RotationZYX& rot); + /// Constructor to create a new identified object. Placement by a generic rotoation within the mother + UnionSolid(const std::string& name, const Solid& shape1, const Solid& shape2, const Rotation3D& rot); + /// Constructor to create a new identified object. Placement by a generic transformation within the mother + UnionSolid(const std::string& name, const Solid& shape1, const Solid& shape2, const Transform3D& pos); /// Assignment operator UnionSolid& operator=(const UnionSolid& copy) = default; }; @@ -1041,6 +1287,7 @@ namespace dd4hep { IntersectionSolid(const IntersectionSolid& e) = default; /// Constructor to be used when passing an already created object template IntersectionSolid(const Handle& e) : BooleanSolid(e) { } + /// Constructor to create a new object. Position is identity, Rotation is identity-rotation! IntersectionSolid(const Solid& shape1, const Solid& shape2); /// Constructor to create a new object. Placement by position, Rotation is identity-rotation! @@ -1051,6 +1298,17 @@ namespace dd4hep { IntersectionSolid(const Solid& shape1, const Solid& shape2, const Rotation3D& rot); /// Constructor to create a new object. Placement by a generic transformation within the mother IntersectionSolid(const Solid& shape1, const Solid& shape2, const Transform3D& pos); + + /// Constructor to create a new identified object. Position is identity, Rotation is identity-rotation! + IntersectionSolid(const std::string& name, const Solid& shape1, const Solid& shape2); + /// Constructor to create a new identified object. Placement by position, Rotation is identity-rotation! + IntersectionSolid(const std::string& name, const Solid& shape1, const Solid& shape2, const Position& pos); + /// Constructor to create a new identified object. Placement by a RotationZYX within the mother + IntersectionSolid(const std::string& name, const Solid& shape1, const Solid& shape2, const RotationZYX& rot); + /// Constructor to create a new identified object. Placement by a generic rotoation within the mother + IntersectionSolid(const std::string& name, const Solid& shape1, const Solid& shape2, const Rotation3D& rot); + /// Constructor to create a new identified object. Placement by a generic transformation within the mother + IntersectionSolid(const std::string& name, const Solid& shape1, const Solid& shape2, const Transform3D& pos); /// Assignment operator IntersectionSolid& operator=(const IntersectionSolid& copy) = default; }; diff --git a/DDCore/src/Shapes.cpp b/DDCore/src/Shapes.cpp index 6e3faec28..5fa48c493 100644 --- a/DDCore/src/Shapes.cpp +++ b/DDCore/src/Shapes.cpp @@ -283,8 +283,8 @@ ShapelessSolid::ShapelessSolid(const string& nam) { _assign(new TGeoShapeAssembly(), nam, "assembly", true); } -void Box::make(double x_val, double y_val, double z_val) { - _assign(new TGeoBBox(x_val, y_val, z_val), "", "box", true); +void Box::make(const std::string& nam, double x_val, double y_val, double z_val) { + _assign(new TGeoBBox(nam.c_str(), x_val, y_val, z_val), "", "box", true); } /// Set the box dimensionsy @@ -310,8 +310,8 @@ double Box::z() const { } /// Internal helper method to support object construction -void HalfSpace::make(const double* const point, const double* const normal) { - _assign(new TGeoHalfSpace("",(Double_t*)point, (Double_t*)normal), "", "halfspace",true); +void HalfSpace::make(const std::string& nam, const double* const point, const double* const normal) { + _assign(new TGeoHalfSpace(nam.c_str(),(Double_t*)point, (Double_t*)normal), "", "halfspace",true); } /// Constructor to be used when creating a new object @@ -360,6 +360,52 @@ Polycone::Polycone(double startPhi, double deltaPhi, const vector& r, co _assign(new TGeoPcon(¶ms[0]), "", "polycone", true); } +/// Constructor to be used when creating a new object +Polycone::Polycone(const std::string& nam, double startPhi, double deltaPhi) { + _assign(new TGeoPcon(nam.c_str(), startPhi/units::deg, deltaPhi/units::deg, 0), "", "polycone", false); +} + +/// Constructor to be used when creating a new polycone object. Add at the same time all Z planes +Polycone::Polycone(const std::string& nam, double startPhi, double deltaPhi, + const vector& rmin, const vector& rmax, const vector& z) { + vector params; + if (rmin.size() < 2) { + throw runtime_error("dd4hep: PolyCone Not enough Z planes. minimum is 2!"); + } + if((z.size()!=rmin.size()) || (z.size()!=rmax.size()) ) { + throw runtime_error("dd4hep: Polycone: vectors z,rmin,rmax not of same length"); + } + params.push_back(startPhi/units::deg); + params.push_back(deltaPhi/units::deg); + params.push_back(rmin.size()); + for (size_t i = 0; i < rmin.size(); ++i) { + params.push_back(z[i] ); + params.push_back(rmin[i] ); + params.push_back(rmax[i] ); + } + _assign(new TGeoPcon(¶ms[0]), nam, "polycone", true); +} + +/// Constructor to be used when creating a new polycone object. Add at the same time all Z planes +Polycone::Polycone(const std::string& nam, double startPhi, double deltaPhi, const vector& r, const vector& z) { + vector params; + if (r.size() < 2) { + throw runtime_error("dd4hep: PolyCone Not enough Z planes. minimum is 2!"); + } + if((z.size()!=r.size()) ) { + throw runtime_error("dd4hep: Polycone: vectors z,r not of same length"); + } + params.push_back(startPhi/units::deg); + params.push_back(deltaPhi/units::deg); + params.push_back(r.size()); + for (size_t i = 0; i < r.size(); ++i) { + params.push_back(z[i] ); + params.push_back(0.0 ); + params.push_back(r[i] ); + } + _assign(new TGeoPcon(¶ms[0]), nam, "polycone", true); +} + /// Add Z-planes to the Polycone void Polycone::addZPlanes(const vector& rmin, const vector& rmax, const vector& z) { TGeoPcon* sh = *this; @@ -390,7 +436,19 @@ ConeSegment::ConeSegment(double dz, double rmin2, double rmax2, double startPhi, double endPhi) { - _assign(new TGeoConeSeg(dz, rmin1, rmax1, rmin2, rmax2, startPhi/units::deg, endPhi/units::deg), "", "cone_segment", true); + _assign(new TGeoConeSeg(dz, rmin1, rmax1, rmin2, rmax2, + startPhi/units::deg, endPhi/units::deg), "", "cone_segment", true); +} + +/// Constructor to be used when creating a new cone segment object +ConeSegment::ConeSegment(const std::string& nam, + double dz, + double rmin1, double rmax1, + double rmin2, double rmax2, + double startPhi, double endPhi) +{ + _assign(new TGeoConeSeg(nam.c_str(), dz, rmin1, rmax1, rmin2, rmax2, + startPhi/units::deg, endPhi/units::deg), "", "cone_segment", true); } /// Set the cone segment dimensions @@ -405,7 +463,7 @@ ConeSegment& ConeSegment::setDimensions(double dz, /// Constructor to be used when creating a new object with attribute initialization void Tube::make(const string& nam, double rmin, double rmax, double z, double startPhi, double endPhi) { - _assign(new TGeoTubeSeg(rmin,rmax,z,startPhi/units::deg,endPhi/units::deg),nam,"tube",true); + _assign(new TGeoTubeSeg(nam.c_str(), rmin,rmax,z,startPhi/units::deg,endPhi/units::deg),nam,"tube",true); } /// Set the tube dimensions @@ -418,22 +476,36 @@ Tube& Tube::setDimensions(double rmin, double rmax, double z, double startPhi, d /// Constructor to be used when creating a new object with attribute initialization CutTube::CutTube(double rmin, double rmax, double dz, double startPhi, double endPhi, double lx, double ly, double lz, double tx, double ty, double tz) { - make(rmin,rmax,dz,startPhi/units::deg,endPhi/units::deg,lx,ly,lz,tx,ty,tz); + make("", rmin,rmax,dz,startPhi/units::deg,endPhi/units::deg,lx,ly,lz,tx,ty,tz); } /// Constructor to be used when creating a new object with attribute initialization -void CutTube::make(double rmin, double rmax, double dz, double startPhi, double endPhi, +CutTube::CutTube(const std::string& nam, + double rmin, double rmax, double dz, double startPhi, double endPhi, + double lx, double ly, double lz, double tx, double ty, double tz) { + make(nam, rmin,rmax,dz,startPhi/units::deg,endPhi/units::deg,lx,ly,lz,tx,ty,tz); +} + +/// Constructor to be used when creating a new object with attribute initialization +void CutTube::make(const std::string& nam, double rmin, double rmax, double dz, double startPhi, double endPhi, double lx, double ly, double lz, double tx, double ty, double tz) { - _assign(new TGeoCtub(rmin,rmax,dz,startPhi,endPhi,lx,ly,lz,tx,ty,tz),"","cuttube",true); + _assign(new TGeoCtub(nam.c_str(), rmin,rmax,dz,startPhi,endPhi,lx,ly,lz,tx,ty,tz),"","cuttube",true); } /// Constructor to create a truncated tube object with attribute initialization TruncatedTube::TruncatedTube(double zhalf, double rmin, double rmax, double startPhi, double deltaPhi, double cutAtStart, double cutAtDelta, bool cutInside) -{ make(zhalf, rmin, rmax, startPhi/units::deg, deltaPhi/units::deg, cutAtStart, cutAtDelta, cutInside); } +{ make("", zhalf, rmin, rmax, startPhi/units::deg, deltaPhi/units::deg, cutAtStart, cutAtDelta, cutInside); } + +/// Constructor to create a truncated tube object with attribute initialization +TruncatedTube::TruncatedTube(const std::string& nam, + double zhalf, double rmin, double rmax, double startPhi, double deltaPhi, + double cutAtStart, double cutAtDelta, bool cutInside) +{ make(nam, zhalf, rmin, rmax, startPhi/units::deg, deltaPhi/units::deg, cutAtStart, cutAtDelta, cutInside); } /// Internal helper method to support object construction -void TruncatedTube::make(double zhalf, double rmin, double rmax, double startPhi, double deltaPhi, +void TruncatedTube::make(const std::string& nam, + double zhalf, double rmin, double rmax, double startPhi, double deltaPhi, double cutAtStart, double cutAtDelta, bool cutInside) { // check the parameters if( rmin <= 0 || rmax <= 0 || cutAtStart <= 0 || cutAtDelta <= 0 ) @@ -470,12 +542,12 @@ void TruncatedTube::make(double zhalf, double rmin, double rmax, double startPhi //rot.RotateX( 90.0 ); rot.RotateZ( -alpha/dd4hep::deg ); TGeoTranslation trans(xBox, 0., 0.); - TGeoBBox* box = new TGeoBBox(boxX, boxY, boxZ); - TGeoTubeSeg* tubs = new TGeoTubeSeg(rmin, rmax, zhalf, startPhi, deltaPhi); + TGeoBBox* box = new TGeoBBox((nam+"Box").c_str(), boxX, boxY, boxZ); + TGeoTubeSeg* tubs = new TGeoTubeSeg((nam+"Tubs").c_str(), rmin, rmax, zhalf, startPhi, deltaPhi); TGeoSubtraction* sub = new TGeoSubtraction(tubs, box, nullptr, new TGeoCombiTrans(trans, rot)); // For debugging: // TGeoUnion* sub = new TGeoUnion(tubs, box, nullptr, new TGeoCombiTrans(trans, rot)); - _assign(new TGeoCompositeShape("", sub),"","trunctube",true); + _assign(new TGeoCompositeShape(nam.c_str(), sub),"","trunctube",true); #if 0 cout << "Trans:"; trans.Print(); cout << endl; cout << "Rot: "; rot.Print(); cout << endl; @@ -503,13 +575,13 @@ void TruncatedTube::make(double zhalf, double rmin, double rmax, double startPhi } /// Constructor to be used when creating a new object with attribute initialization -void EllipticalTube::make(double a, double b, double dz) { - _assign(new TGeoEltu("", a, b, dz), "", "elliptic_tube", true); +void EllipticalTube::make(const std::string& nam, double a, double b, double dz) { + _assign(new TGeoEltu(nam.c_str(), a, b, dz), "", "elliptic_tube", true); } /// Constructor to be used when creating a new object with attribute initialization -void Cone::make(double z, double rmin1, double rmax1, double rmin2, double rmax2) { - _assign(new TGeoCone(z, rmin1, rmax1, rmin2, rmax2 ), "", "cone", true); +void Cone::make(const std::string& nam, double z, double rmin1, double rmax1, double rmin2, double rmax2) { + _assign(new TGeoCone(nam.c_str(), z, rmin1, rmax1, rmin2, rmax2 ), "", "cone", true); } /// Set the box dimensions (startPhi=0.0, endPhi=2*pi) @@ -519,14 +591,9 @@ Cone& Cone::setDimensions(double z, double rmin1, double rmax1, double rmin2, do return *this; } -/// Constructor to create a new anonymous object with attribute initialization -Trd1::Trd1(double x1, double x2, double y, double z) { - make(x1,x2,y,z); -} - /// Constructor to be used when creating a new object with attribute initialization -void Trd1::make(double x1, double x2, double y, double z) { - _assign(new TGeoTrd1(x1, x2, y, z ), "", "trd2", true); +void Trd1::make(const std::string& nam, double x1, double x2, double y, double z) { + _assign(new TGeoTrd1(nam.c_str(), x1, x2, y, z ), "", "trd2", true); } /// Set the Trd1 dimensions @@ -536,14 +603,9 @@ Trd1& Trd1::setDimensions(double x1, double x2, double y, double z) { return *this; } -/// Constructor to create a new anonymous object with attribute initialization -Trd2::Trd2(double x1, double x2, double y1, double y2, double z) { - make(x1,x2,y1,y2,z); -} - /// Constructor to be used when creating a new object with attribute initialization -void Trd2::make(double x1, double x2, double y1, double y2, double z) { - _assign(new TGeoTrd2(x1, x2, y1, y2, z ), "", "trd2", true); +void Trd2::make(const std::string& nam, double x1, double x2, double y1, double y2, double z) { + _assign(new TGeoTrd2(nam.c_str(), x1, x2, y1, y2, z ), "", "trd2", true); } /// Set the Trd2 dimensions @@ -554,8 +616,8 @@ Trd2& Trd2::setDimensions(double x1, double x2, double y1, double y2, double z) } /// Constructor to be used when creating a new object with attribute initialization -void Paraboloid::make(double r_low, double r_high, double delta_z) { - _assign(new TGeoParaboloid(r_low, r_high, delta_z ), "", "paraboloid", true); +void Paraboloid::make(const std::string& nam, double r_low, double r_high, double delta_z) { + _assign(new TGeoParaboloid(nam.c_str(), r_low, r_high, delta_z ), "", "paraboloid", true); } /// Set the Paraboloid dimensions @@ -566,8 +628,8 @@ Paraboloid& Paraboloid::setDimensions(double r_low, double r_high, double delta_ } /// Constructor to create a new anonymous object with attribute initialization -void Hyperboloid::make(double rin, double stin, double rout, double stout, double dz) { - _assign(new TGeoHype(rin, stin/units::deg, rout, stout/units::deg, dz), "", "hyperboloid", true); +void Hyperboloid::make(const std::string& nam, double rin, double stin, double rout, double stout, double dz) { + _assign(new TGeoHype(nam.c_str(), rin, stin/units::deg, rout, stout/units::deg, dz), "", "hyperboloid", true); } /// Set the Hyperboloid dimensions @@ -578,8 +640,8 @@ Hyperboloid& Hyperboloid::setDimensions(double rin, double stin, double rout, do } /// Constructor function to be used when creating a new object with attribute initialization -void Sphere::make(double rmin, double rmax, double startTheta, double endTheta, double startPhi, double endPhi) { - _assign(new TGeoSphere(rmin, rmax, +void Sphere::make(const std::string& nam, double rmin, double rmax, double startTheta, double endTheta, double startPhi, double endPhi) { + _assign(new TGeoSphere(nam.c_str(), rmin, rmax, startTheta/units::deg, endTheta/units::deg, startPhi/units::deg, endPhi/units::deg), "", "sphere", true); } @@ -592,8 +654,8 @@ Sphere& Sphere::setDimensions(double rmin, double rmax, double startTheta, doubl } /// Constructor to be used when creating a new object with attribute initialization -void Torus::make(double r, double rmin, double rmax, double startPhi, double deltaPhi) { - _assign(new TGeoTorus(r, rmin, rmax, startPhi/units::deg, deltaPhi/units::deg), "", "torus", true); +void Torus::make(const std::string& nam, double r, double rmin, double rmax, double startPhi, double deltaPhi) { + _assign(new TGeoTorus(nam.c_str(), r, rmin, rmax, startPhi/units::deg, deltaPhi/units::deg), "", "torus", true); } /// Set the Torus dimensions @@ -613,7 +675,17 @@ Trap::Trap(double z, double theta, double phi, } /// Constructor to be used when creating a new anonymous object with attribute initialization -void Trap::make(double pz, double py, double px, double pLTX) { +Trap::Trap(const std::string& nam, + double z, double theta, double phi, + double h1, double bl1, double tl1, double alpha1, + double h2, double bl2, double tl2, double alpha2) { + _assign(new TGeoTrap(nam.c_str(), z, theta/units::deg, phi/units::deg, + h1, bl1, tl1, alpha1/units::deg, + h2, bl2, tl2, alpha2/units::deg), "", "trap", true); +} + +/// Constructor to be used when creating a new anonymous object with attribute initialization +void Trap::make(const std::string& nam, double pz, double py, double px, double pLTX) { double z = pz / 2e0; double theta = 0e0; double phi = 0e0; @@ -621,7 +693,7 @@ void Trap::make(double pz, double py, double px, double pLTX) { double bl = px / 2e0; double tl = pLTX / 2e0; double alpha1 = (pLTX - px) / py; - _assign(new TGeoTrap(z, theta, phi, + _assign(new TGeoTrap(nam.c_str(), z, theta, phi, h, bl, tl, alpha1/units::deg, h, bl, tl, alpha1/units::deg), "", "trap", true); } @@ -638,7 +710,7 @@ Trap& Trap::setDimensions(double z, double theta, double phi, } /// Internal helper method to support object construction -void PseudoTrap::make(double x1, double x2, double y1, double y2, double z, double r, bool atMinusZ) { +void PseudoTrap::make(const std::string& nam, double x1, double x2, double y1, double y2, double z, double r, bool atMinusZ) { double x = atMinusZ ? x1 : x2; double h = 0; bool intersec = false; // union or intersection solid @@ -716,47 +788,33 @@ void PseudoTrap::make(double x1, double x2, double y1, double y2, double z, doub except("PseudoTrap","Check parameters of the PseudoTrap!"); } - Solid trap(new TGeoTrd2(x1, x2, y1, y2, halfZ)); - Solid tubs(new TGeoTubeSeg(0.,std::abs(r),h,startPhi,startPhi + halfOpeningAngle*2.)); + Solid trap(new TGeoTrd2((nam+"Trd2").c_str(), x1, x2, y1, y2, halfZ)); + Solid tubs(new TGeoTubeSeg((nam+"Tubs").c_str(), 0.,std::abs(r),h,startPhi,startPhi + halfOpeningAngle*2.)); TGeoCompositeShape* solid = 0; if( intersec ) { - solid = SubtractionSolid(trap, tubs, Transform3D(RotationX(M_PI/2.), Position(0.,0.,displacement))).ptr(); + solid = SubtractionSolid(nam, trap, tubs, Transform3D(RotationX(M_PI/2.), Position(0.,0.,displacement))).ptr(); } else { - SubtractionSolid sub(tubs, Box(1.1*x, 1.1*h, std::sqrt(r*r-x*x)), Transform3D(RotationX(M_PI/2.))); - solid = UnionSolid(trap, sub, Transform3D(RotationX(M_PI/2.), Position(0,0,displacement))).ptr(); + SubtractionSolid sub((nam+"Subs").c_str(), tubs, Box(1.1*x, 1.1*h, std::sqrt(r*r-x*x)), Transform3D(RotationX(M_PI/2.))); + solid = UnionSolid(nam, trap, sub, Transform3D(RotationX(M_PI/2.), Position(0,0,displacement))).ptr(); } _assign(solid,"","pseudo-trap", true); } /// Helper function to create poly hedron -void PolyhedraRegular::make(int nsides, double rmin, double rmax, double zpos, double zneg, double start, double delta) { +void PolyhedraRegular::make(const std::string& nam, int nsides, double rmin, double rmax, + double zpos, double zneg, double start, double delta) { if (rmin < 0e0 || rmin > rmax) throw runtime_error("dd4hep: PolyhedraRegular: Illegal argument rmin:<" + _toString(rmin) + "> is invalid!"); else if (rmax < 0e0) throw runtime_error("dd4hep: PolyhedraRegular: Illegal argument rmax:<" + _toString(rmax) + "> is invalid!"); - double params[] = { start, delta, double(nsides), 2e0, zpos, rmin, rmax, zneg, rmin, rmax }; - _assign(new TGeoPgon(params), "", "polyhedra", false); + double params[] = { start/units::deg, delta/units::deg, double(nsides), 2e0, zpos, rmin, rmax, zneg, rmin, rmax }; + _assign(new TGeoPgon(params), nam, "polyhedra", false); //_setDimensions(¶ms[0]); } -/// Constructor to be used when creating a new object -PolyhedraRegular::PolyhedraRegular(int nsides, double rmin, double rmax, double zlen) { - make(nsides, rmin, rmax, zlen / 2, -zlen / 2, 0, 360.); -} - -/// Constructor to be used when creating a new object -PolyhedraRegular::PolyhedraRegular(int nsides, double phistart, double rmin, double rmax, double zlen) { - make(nsides, rmin, rmax, zlen / 2, -zlen / 2, phistart/units::deg, 360.); -} - -/// Constructor to be used when creating a new object -PolyhedraRegular::PolyhedraRegular(int nsides, double rmin, double rmax, double zplanes[2]) { - make(nsides, rmin, rmax, zplanes[0], zplanes[1], 0, 360.); -} - /// Helper function to create poly hedron -void Polyhedra::make(int nsides, double start, double delta, +void Polyhedra::make(const std::string& nam, int nsides, double start, double delta, const vector& z, const vector& rmin, const vector& rmax) { vector temp; if ( rmin.size() != z.size() || rmax.size() != z.size() ) { @@ -775,23 +833,12 @@ void Polyhedra::make(int nsides, double start, double delta, temp.push_back(rmin[i]); temp.push_back(rmax[i]); } - _assign(new TGeoPgon(&temp[0]), "", "polyhedra", false); -} - -/// Constructor to create a new object. Phi(start), deltaPhi, Z-planes at specified positions -Polyhedra::Polyhedra(int nsides, double start, double delta, const vector& z, const vector& r) { - vector rmin(r.size(), 0.); - make(nsides, start/units::deg, delta/units::deg, z, rmin, r); -} - -/// Constructor to create a new object. Phi(start), deltaPhi, Z-planes at specified positions -Polyhedra::Polyhedra(int nsides, double start, double delta, - const vector& z, const vector& rmin, const vector& rmax) { - make(nsides, start/units::deg, delta/units::deg, z, rmin, rmax); + _assign(new TGeoPgon(&temp[0]), nam, "polyhedra", false); } /// Helper function to create the polyhedron -void ExtrudedPolygon::make(const vector& pt_x, +void ExtrudedPolygon::make(const std::string& nam, + const vector& pt_x, const vector& pt_y, const vector& sec_z, const vector& sec_x, @@ -799,27 +846,16 @@ void ExtrudedPolygon::make(const vector& pt_x, const vector& sec_scale) { TGeoXtru* solid = new TGeoXtru(sec_z.size()); - _assign(solid, "", "polyhedra", false); + _assign(solid, nam, "xtru", false); // No need to transform coordinates to cm. We are in the dd4hep world: all is already in cm. solid->DefinePolygon(pt_x.size(), &(*pt_x.begin()), &(*pt_y.begin())); for( size_t i = 0; i < sec_z.size(); ++i ) solid->DefineSection(i, sec_z[i], sec_x[i], sec_y[i], sec_scale[i]); } -/// Constructor to create a new object. -ExtrudedPolygon::ExtrudedPolygon(const vector& pt_x, - const vector& pt_y, - const vector& sec_z, - const vector& sec_x, - const vector& sec_y, - const vector& sec_scale) -{ - make(pt_x, pt_y, sec_z, sec_x, sec_y, sec_scale); -} - /// Creator method -void EightPointSolid::make(double dz, const double* vtx) { - _assign(new TGeoArb8(dz, (double*)vtx), "", "Arb8", true); +void EightPointSolid::make(const std::string& nam, double dz, const double* vtx) { + _assign(new TGeoArb8(nam.c_str(), dz, (double*)vtx), "", "Arb8", true); } /// Constructor to be used when creating a new object. Position is identity, Rotation is the identity rotation @@ -852,6 +888,36 @@ SubtractionSolid::SubtractionSolid(const Solid& shape1, const Solid& shape2, con _assign(new TGeoCompositeShape("", sub), "", "subtraction", true); } +/// Constructor to be used when creating a new object. Position is identity, Rotation is the identity rotation +SubtractionSolid::SubtractionSolid(const std::string& nam, const Solid& shape1, const Solid& shape2) { + TGeoSubtraction* sub = new TGeoSubtraction(shape1, shape2, detail::matrix::_identity(), detail::matrix::_identity()); + _assign(new TGeoCompositeShape(nam.c_str(), sub), "", "subtraction", true); +} + +/// Constructor to be used when creating a new object. Placement by a generic transformation within the mother +SubtractionSolid::SubtractionSolid(const std::string& nam, const Solid& shape1, const Solid& shape2, const Transform3D& trans) { + TGeoSubtraction* sub = new TGeoSubtraction(shape1, shape2, detail::matrix::_identity(), detail::matrix::_transform(trans)); + _assign(new TGeoCompositeShape(nam.c_str(), sub), "", "subtraction", true); +} + +/// Constructor to be used when creating a new object. Rotation is the identity rotation +SubtractionSolid::SubtractionSolid(const std::string& nam, const Solid& shape1, const Solid& shape2, const Position& pos) { + TGeoSubtraction* sub = new TGeoSubtraction(shape1, shape2, detail::matrix::_identity(), detail::matrix::_translation(pos)); + _assign(new TGeoCompositeShape(nam.c_str(), sub), "", "subtraction", true); +} + +/// Constructor to be used when creating a new object +SubtractionSolid::SubtractionSolid(const std::string& nam, const Solid& shape1, const Solid& shape2, const RotationZYX& rot) { + TGeoSubtraction* sub = new TGeoSubtraction(shape1, shape2, detail::matrix::_identity(), detail::matrix::_rotationZYX(rot)); + _assign(new TGeoCompositeShape(nam.c_str(), sub), "", "subtraction", true); +} + +/// Constructor to be used when creating a new object +SubtractionSolid::SubtractionSolid(const std::string& nam, const Solid& shape1, const Solid& shape2, const Rotation3D& rot) { + TGeoSubtraction* sub = new TGeoSubtraction(shape1, shape2, detail::matrix::_identity(), detail::matrix::_rotation3D(rot)); + _assign(new TGeoCompositeShape(nam.c_str(), sub), "", "subtraction", true); +} + /// Constructor to be used when creating a new object. Position is identity, Rotation is identity rotation UnionSolid::UnionSolid(const Solid& shape1, const Solid& shape2) { TGeoUnion* uni = new TGeoUnion(shape1, shape2, detail::matrix::_identity(), detail::matrix::_identity()); @@ -882,6 +948,36 @@ UnionSolid::UnionSolid(const Solid& shape1, const Solid& shape2, const Rotation3 _assign(new TGeoCompositeShape("", uni), "", "union", true); } +/// Constructor to be used when creating a new object. Position is identity, Rotation is identity rotation +UnionSolid::UnionSolid(const std::string& nam, const Solid& shape1, const Solid& shape2) { + TGeoUnion* uni = new TGeoUnion(shape1, shape2, detail::matrix::_identity(), detail::matrix::_identity()); + _assign(new TGeoCompositeShape(nam.c_str(), uni), "", "union", true); +} + +/// Constructor to be used when creating a new object. Placement by a generic transformation within the mother +UnionSolid::UnionSolid(const std::string& nam, const Solid& shape1, const Solid& shape2, const Transform3D& trans) { + TGeoUnion* uni = new TGeoUnion(shape1, shape2, detail::matrix::_identity(), detail::matrix::_transform(trans)); + _assign(new TGeoCompositeShape(nam.c_str(), uni), "", "union", true); +} + +/// Constructor to be used when creating a new object. Rotation is identity rotation +UnionSolid::UnionSolid(const std::string& nam, const Solid& shape1, const Solid& shape2, const Position& pos) { + TGeoUnion* uni = new TGeoUnion(shape1, shape2, detail::matrix::_identity(), detail::matrix::_translation(pos)); + _assign(new TGeoCompositeShape(nam.c_str(), uni), "", "union", true); +} + +/// Constructor to be used when creating a new object +UnionSolid::UnionSolid(const std::string& nam, const Solid& shape1, const Solid& shape2, const RotationZYX& rot) { + TGeoUnion *uni = new TGeoUnion(shape1, shape2, detail::matrix::_identity(), detail::matrix::_rotationZYX(rot)); + _assign(new TGeoCompositeShape(nam.c_str(), uni), "", "union", true); +} + +/// Constructor to be used when creating a new object +UnionSolid::UnionSolid(const std::string& nam, const Solid& shape1, const Solid& shape2, const Rotation3D& rot) { + TGeoUnion *uni = new TGeoUnion(shape1, shape2, detail::matrix::_identity(), detail::matrix::_rotation3D(rot)); + _assign(new TGeoCompositeShape(nam.c_str(), uni), "", "union", true); +} + /// Constructor to be used when creating a new object. Position is identity, Rotation is identity rotation IntersectionSolid::IntersectionSolid(const Solid& shape1, const Solid& shape2) { TGeoIntersection* inter = new TGeoIntersection(shape1, shape2, detail::matrix::_identity(), detail::matrix::_identity()); @@ -912,6 +1008,36 @@ IntersectionSolid::IntersectionSolid(const Solid& shape1, const Solid& shape2, c _assign(new TGeoCompositeShape("", inter), "", "intersection", true); } +/// Constructor to be used when creating a new object. Position is identity, Rotation is identity rotation +IntersectionSolid::IntersectionSolid(const std::string& nam, const Solid& shape1, const Solid& shape2) { + TGeoIntersection* inter = new TGeoIntersection(shape1, shape2, detail::matrix::_identity(), detail::matrix::_identity()); + _assign(new TGeoCompositeShape(nam.c_str(), inter), "", "intersection", true); +} + +/// Constructor to be used when creating a new object. Placement by a generic transformation within the mother +IntersectionSolid::IntersectionSolid(const std::string& nam, const Solid& shape1, const Solid& shape2, const Transform3D& trans) { + TGeoIntersection* inter = new TGeoIntersection(shape1, shape2, detail::matrix::_identity(), detail::matrix::_transform(trans)); + _assign(new TGeoCompositeShape(nam.c_str(), inter), "", "intersection", true); +} + +/// Constructor to be used when creating a new object. Position is identity. +IntersectionSolid::IntersectionSolid(const std::string& nam, const Solid& shape1, const Solid& shape2, const Position& pos) { + TGeoIntersection* inter = new TGeoIntersection(shape1, shape2, detail::matrix::_identity(), detail::matrix::_translation(pos)); + _assign(new TGeoCompositeShape(nam.c_str(), inter), "", "intersection", true); +} + +/// Constructor to be used when creating a new object +IntersectionSolid::IntersectionSolid(const std::string& nam, const Solid& shape1, const Solid& shape2, const RotationZYX& rot) { + TGeoIntersection* inter = new TGeoIntersection(shape1, shape2, detail::matrix::_identity(), detail::matrix::_rotationZYX(rot)); + _assign(new TGeoCompositeShape(nam.c_str(), inter), "", "intersection", true); +} + +/// Constructor to be used when creating a new object +IntersectionSolid::IntersectionSolid(const std::string& nam, const Solid& shape1, const Solid& shape2, const Rotation3D& rot) { + TGeoIntersection* inter = new TGeoIntersection(shape1, shape2, detail::matrix::_identity(), detail::matrix::_rotation3D(rot)); + _assign(new TGeoCompositeShape(nam.c_str(), inter), "", "intersection", true); +} + #define INSTANTIATE(X) template class dd4hep::Solid_type INSTANTIATE(TGeoShape); diff --git a/examples/ClientTests/compact/CheckShape.xml b/examples/ClientTests/compact/CheckShape.xml index 1ddbc3082..287fcefcf 100644 --- a/examples/ClientTests/compact/CheckShape.xml +++ b/examples/ClientTests/compact/CheckShape.xml @@ -54,5 +54,8 @@ + + + diff --git a/examples/ClientTests/compact/Check_Shape_PseudoTrap3.xml b/examples/ClientTests/compact/Check_Shape_PseudoTrap3.xml new file mode 100644 index 000000000..6a48c8098 --- /dev/null +++ b/examples/ClientTests/compact/Check_Shape_PseudoTrap3.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/ClientTests/ref/Ref_PseudoTrap3.txt b/examples/ClientTests/ref/Ref_PseudoTrap3.txt new file mode 100644 index 000000000..c4a471f95 --- /dev/null +++ b/examples/ClientTests/ref/Ref_PseudoTrap3.txt @@ -0,0 +1,128 @@ +ShapeCheck[0] TGeoCompositeShape 43 Mesh-points: +TGeoCompositeShape PseudoTrap N(mesh)=43 N(vert)=43 N(seg)=0 N(pols)=0 +TGeoCompositeShape 0 Local ( -10.00, -30.00, -30.00) Global ( -50.00, -40.00, -30.00) +TGeoCompositeShape 1 Local ( -10.00, 30.00, -30.00) Global ( -50.00, 20.00, -30.00) +TGeoCompositeShape 2 Local ( 10.00, 30.00, -30.00) Global ( -30.00, 20.00, -30.00) +TGeoCompositeShape 3 Local ( 10.00, -30.00, -30.00) Global ( -30.00, -40.00, -30.00) +TGeoCompositeShape 4 Local ( 3.00, -10.00, 30.00) Global ( -37.00, -20.00, 30.00) +TGeoCompositeShape 5 Local ( 2.96, 10.00, 30.47) Global ( -37.04, 0.00, 30.47) +TGeoCompositeShape 6 Local ( 2.85, 10.00, 30.93) Global ( -37.15, 0.00, 30.93) +TGeoCompositeShape 7 Local ( 2.67, 10.00, 31.36) Global ( -37.33, 0.00, 31.36) +TGeoCompositeShape 8 Local ( 2.43, 10.00, 31.76) Global ( -37.57, 0.00, 31.76) +TGeoCompositeShape 9 Local ( 2.12, 10.00, 32.12) Global ( -37.88, 0.00, 32.12) +TGeoCompositeShape 10 Local ( 1.76, 10.00, 32.43) Global ( -38.24, 0.00, 32.43) +TGeoCompositeShape 11 Local ( 1.36, 10.00, 32.67) Global ( -38.64, 0.00, 32.67) +TGeoCompositeShape 12 Local ( 0.93, 10.00, 32.85) Global ( -39.07, 0.00, 32.85) +TGeoCompositeShape 13 Local ( 0.47, 10.00, 32.96) Global ( -39.53, 0.00, 32.96) +TGeoCompositeShape 14 Local ( 0.00, 10.00, 33.00) Global ( -40.00, 0.00, 33.00) +TGeoCompositeShape 15 Local ( -0.47, 10.00, 32.96) Global ( -40.47, 0.00, 32.96) +TGeoCompositeShape 16 Local ( -0.93, 10.00, 32.85) Global ( -40.93, 0.00, 32.85) +TGeoCompositeShape 17 Local ( -1.36, 10.00, 32.67) Global ( -41.36, 0.00, 32.67) +TGeoCompositeShape 18 Local ( -1.76, 10.00, 32.43) Global ( -41.76, 0.00, 32.43) +TGeoCompositeShape 19 Local ( -2.12, 10.00, 32.12) Global ( -42.12, 0.00, 32.12) +TGeoCompositeShape 20 Local ( -2.43, 10.00, 31.76) Global ( -42.43, 0.00, 31.76) +TGeoCompositeShape 21 Local ( -2.67, 10.00, 31.36) Global ( -42.67, 0.00, 31.36) +TGeoCompositeShape 22 Local ( -2.85, 10.00, 30.93) Global ( -42.85, 0.00, 30.93) +TGeoCompositeShape 23 Local ( -2.96, 10.00, 30.47) Global ( -42.96, 0.00, 30.47) +TGeoCompositeShape 24 Local ( 2.96, -10.00, 30.47) Global ( -37.04, -20.00, 30.47) +TGeoCompositeShape 25 Local ( 2.85, -10.00, 30.93) Global ( -37.15, -20.00, 30.93) +TGeoCompositeShape 26 Local ( 2.67, -10.00, 31.36) Global ( -37.33, -20.00, 31.36) +TGeoCompositeShape 27 Local ( 2.43, -10.00, 31.76) Global ( -37.57, -20.00, 31.76) +TGeoCompositeShape 28 Local ( 2.12, -10.00, 32.12) Global ( -37.88, -20.00, 32.12) +TGeoCompositeShape 29 Local ( 1.76, -10.00, 32.43) Global ( -38.24, -20.00, 32.43) +TGeoCompositeShape 30 Local ( 1.36, -10.00, 32.67) Global ( -38.64, -20.00, 32.67) +TGeoCompositeShape 31 Local ( 0.93, -10.00, 32.85) Global ( -39.07, -20.00, 32.85) +TGeoCompositeShape 32 Local ( 0.47, -10.00, 32.96) Global ( -39.53, -20.00, 32.96) +TGeoCompositeShape 33 Local ( 0.00, -10.00, 33.00) Global ( -40.00, -20.00, 33.00) +TGeoCompositeShape 34 Local ( -0.47, -10.00, 32.96) Global ( -40.47, -20.00, 32.96) +TGeoCompositeShape 35 Local ( -0.93, -10.00, 32.85) Global ( -40.93, -20.00, 32.85) +TGeoCompositeShape 36 Local ( -1.36, -10.00, 32.67) Global ( -41.36, -20.00, 32.67) +TGeoCompositeShape 37 Local ( -1.76, -10.00, 32.43) Global ( -41.76, -20.00, 32.43) +TGeoCompositeShape 38 Local ( -2.12, -10.00, 32.12) Global ( -42.12, -20.00, 32.12) +TGeoCompositeShape 39 Local ( -2.43, -10.00, 31.76) Global ( -42.43, -20.00, 31.76) +TGeoCompositeShape 40 Local ( -2.67, -10.00, 31.36) Global ( -42.67, -20.00, 31.36) +TGeoCompositeShape 41 Local ( -2.85, -10.00, 30.93) Global ( -42.85, -20.00, 30.93) +TGeoCompositeShape 42 Local ( -2.96, -10.00, 30.47) Global ( -42.96, -20.00, 30.47) +TGeoCompositeShape Bounding box: dx= 10.00 dy= 30.00 dz= 31.50 Origin: x= 0.00 y= 0.00 z= 1.50 +ShapeCheck[1] TGeoCompositeShape 44 Mesh-points: +TGeoCompositeShape PseudoTrap N(mesh)=44 N(vert)=44 N(seg)=0 N(pols)=0 +TGeoCompositeShape 0 Local ( -3.00, -10.00, 30.00) Global ( -13.00, -20.00, 30.00) +TGeoCompositeShape 1 Local ( -3.00, 10.00, 30.00) Global ( -13.00, 0.00, 30.00) +TGeoCompositeShape 2 Local ( 3.00, 10.00, 30.00) Global ( -7.00, 0.00, 30.00) +TGeoCompositeShape 3 Local ( 3.00, -10.00, 30.00) Global ( -7.00, -20.00, 30.00) +TGeoCompositeShape 4 Local ( -10.00, 30.00, -30.00) Global ( -20.00, 20.00, -30.00) +TGeoCompositeShape 5 Local ( -9.88, 30.00, -31.56) Global ( -19.88, 20.00, -31.56) +TGeoCompositeShape 6 Local ( -9.51, 30.00, -33.09) Global ( -19.51, 20.00, -33.09) +TGeoCompositeShape 7 Local ( -8.91, 30.00, -34.54) Global ( -18.91, 20.00, -34.54) +TGeoCompositeShape 8 Local ( -8.09, 30.00, -35.88) Global ( -18.09, 20.00, -35.88) +TGeoCompositeShape 9 Local ( -7.07, 30.00, -37.07) Global ( -17.07, 20.00, -37.07) +TGeoCompositeShape 10 Local ( -5.88, 30.00, -38.09) Global ( -15.88, 20.00, -38.09) +TGeoCompositeShape 11 Local ( -4.54, 30.00, -38.91) Global ( -14.54, 20.00, -38.91) +TGeoCompositeShape 12 Local ( -3.09, 30.00, -39.51) Global ( -13.09, 20.00, -39.51) +TGeoCompositeShape 13 Local ( -1.56, 30.00, -39.88) Global ( -11.56, 20.00, -39.88) +TGeoCompositeShape 14 Local ( -0.00, 30.00, -40.00) Global ( -10.00, 20.00, -40.00) +TGeoCompositeShape 15 Local ( 1.56, 30.00, -39.88) Global ( -8.44, 20.00, -39.88) +TGeoCompositeShape 16 Local ( 3.09, 30.00, -39.51) Global ( -6.91, 20.00, -39.51) +TGeoCompositeShape 17 Local ( 4.54, 30.00, -38.91) Global ( -5.46, 20.00, -38.91) +TGeoCompositeShape 18 Local ( 5.88, 30.00, -38.09) Global ( -4.12, 20.00, -38.09) +TGeoCompositeShape 19 Local ( 7.07, 30.00, -37.07) Global ( -2.93, 20.00, -37.07) +TGeoCompositeShape 20 Local ( 8.09, 30.00, -35.88) Global ( -1.91, 20.00, -35.88) +TGeoCompositeShape 21 Local ( 8.91, 30.00, -34.54) Global ( -1.09, 20.00, -34.54) +TGeoCompositeShape 22 Local ( 9.51, 30.00, -33.09) Global ( -0.49, 20.00, -33.09) +TGeoCompositeShape 23 Local ( 9.88, 30.00, -31.56) Global ( -0.12, 20.00, -31.56) +TGeoCompositeShape 24 Local ( 10.00, 30.00, -30.00) Global ( 0.00, 20.00, -30.00) +TGeoCompositeShape 25 Local ( -9.88, -30.00, -31.56) Global ( -19.88, -40.00, -31.56) +TGeoCompositeShape 26 Local ( -9.51, -30.00, -33.09) Global ( -19.51, -40.00, -33.09) +TGeoCompositeShape 27 Local ( -8.91, -30.00, -34.54) Global ( -18.91, -40.00, -34.54) +TGeoCompositeShape 28 Local ( -8.09, -30.00, -35.88) Global ( -18.09, -40.00, -35.88) +TGeoCompositeShape 29 Local ( -7.07, -30.00, -37.07) Global ( -17.07, -40.00, -37.07) +TGeoCompositeShape 30 Local ( -5.88, -30.00, -38.09) Global ( -15.88, -40.00, -38.09) +TGeoCompositeShape 31 Local ( -4.54, -30.00, -38.91) Global ( -14.54, -40.00, -38.91) +TGeoCompositeShape 32 Local ( -3.09, -30.00, -39.51) Global ( -13.09, -40.00, -39.51) +TGeoCompositeShape 33 Local ( -1.56, -30.00, -39.88) Global ( -11.56, -40.00, -39.88) +TGeoCompositeShape 34 Local ( -0.00, -30.00, -40.00) Global ( -10.00, -40.00, -40.00) +TGeoCompositeShape 35 Local ( 1.56, -30.00, -39.88) Global ( -8.44, -40.00, -39.88) +TGeoCompositeShape 36 Local ( 3.09, -30.00, -39.51) Global ( -6.91, -40.00, -39.51) +TGeoCompositeShape 37 Local ( 4.54, -30.00, -38.91) Global ( -5.46, -40.00, -38.91) +TGeoCompositeShape 38 Local ( 5.88, -30.00, -38.09) Global ( -4.12, -40.00, -38.09) +TGeoCompositeShape 39 Local ( 7.07, -30.00, -37.07) Global ( -2.93, -40.00, -37.07) +TGeoCompositeShape 40 Local ( 8.09, -30.00, -35.88) Global ( -1.91, -40.00, -35.88) +TGeoCompositeShape 41 Local ( 8.91, -30.00, -34.54) Global ( -1.09, -40.00, -34.54) +TGeoCompositeShape 42 Local ( 9.51, -30.00, -33.09) Global ( -0.49, -40.00, -33.09) +TGeoCompositeShape 43 Local ( 9.88, -30.00, -31.56) Global ( -0.12, -40.00, -31.56) +TGeoCompositeShape Bounding box: dx= 10.00 dy= 30.00 dz= 35.00 Origin: x= 0.00 y= 0.00 z= -5.00 +ShapeCheck[2] TGeoCompositeShape 4 Mesh-points: +TGeoCompositeShape PseudoTrap N(mesh)=4 N(vert)=4 N(seg)=0 N(pols)=0 +TGeoCompositeShape 0 Local ( -10.00, -30.00, -30.00) Global ( 10.00, -40.00, -30.00) +TGeoCompositeShape 1 Local ( -10.00, 30.00, -30.00) Global ( 10.00, 20.00, -30.00) +TGeoCompositeShape 2 Local ( 10.00, 30.00, -30.00) Global ( 30.00, 20.00, -30.00) +TGeoCompositeShape 3 Local ( 10.00, -30.00, -30.00) Global ( 30.00, -40.00, -30.00) +TGeoCompositeShape Bounding box: dx= 10.00 dy= 30.00 dz= 30.00 Origin: x= 0.00 y= 0.00 z= 0.00 +ShapeCheck[3] TGeoCompositeShape 5 Mesh-points: +TGeoCompositeShape PseudoTrap N(mesh)=5 N(vert)=5 N(seg)=0 N(pols)=0 +TGeoCompositeShape 0 Local ( 10.00, -30.00, -30.00) Global ( 60.00, -40.00, -30.00) +TGeoCompositeShape 1 Local ( -3.00, -10.00, 30.00) Global ( 47.00, -20.00, 30.00) +TGeoCompositeShape 2 Local ( -3.00, 10.00, 30.00) Global ( 47.00, 0.00, 30.00) +TGeoCompositeShape 3 Local ( 3.00, 10.00, 30.00) Global ( 53.00, 0.00, 30.00) +TGeoCompositeShape 4 Local ( 3.00, -10.00, 30.00) Global ( 53.00, -20.00, 30.00) +TGeoCompositeShape Bounding box: dx= 10.00 dy= 30.00 dz= 30.00 Origin: x= 0.00 y= 0.00 z= 0.00 +ShapeCheck[4] TGeoCompositeShape 6 Mesh-points: +TGeoCompositeShape PseudoTrap N(mesh)=6 N(vert)=6 N(seg)=0 N(pols)=0 +TGeoCompositeShape 0 Local ( -10.00, 30.00, -30.00) Global ( 70.00, 20.00, -30.00) +TGeoCompositeShape 1 Local ( 10.00, 30.00, -30.00) Global ( 90.00, 20.00, -30.00) +TGeoCompositeShape 2 Local ( -3.00, -10.00, 30.00) Global ( 77.00, -20.00, 30.00) +TGeoCompositeShape 3 Local ( -3.00, 10.00, 30.00) Global ( 77.00, 0.00, 30.00) +TGeoCompositeShape 4 Local ( 3.00, 10.00, 30.00) Global ( 83.00, 0.00, 30.00) +TGeoCompositeShape 5 Local ( 3.00, -10.00, 30.00) Global ( 83.00, -20.00, 30.00) +TGeoCompositeShape Bounding box: dx= 10.00 dy= 30.00 dz= 30.00 Origin: x= 0.00 y= 0.00 z= 0.00 +ShapeCheck[5] TGeoBBox 8 Mesh-points: +TGeoBBox Box N(mesh)=8 N(vert)=8 N(seg)=12 N(pols)=6 +TGeoBBox 0 Local ( -80.00, -50.00, -0.00) Global ( -60.00, -50.00, -30.00) +TGeoBBox 1 Local ( -80.00, 50.00, -0.00) Global ( -60.00, 50.00, -30.00) +TGeoBBox 2 Local ( 80.00, 50.00, -0.00) Global ( 100.00, 50.00, -30.00) +TGeoBBox 3 Local ( 80.00, -50.00, -0.00) Global ( 100.00, -50.00, -30.00) +TGeoBBox 4 Local ( -80.00, -50.00, 0.00) Global ( -60.00, -50.00, -30.00) +TGeoBBox 5 Local ( -80.00, 50.00, 0.00) Global ( -60.00, 50.00, -30.00) +TGeoBBox 6 Local ( 80.00, 50.00, 0.00) Global ( 100.00, 50.00, -30.00) +TGeoBBox 7 Local ( 80.00, -50.00, 0.00) Global ( 100.00, -50.00, -30.00) +TGeoBBox Bounding box: dx= 80.00 dy= 50.00 dz= 0.00 Origin: x= 0.00 y= 0.00 z= 0.00