24#include "TGeoBoolNode.h"
25#include "TGeoCompositeShape.h"
26#include "TGeoMatrix.h"
27#include "TGeoScaledShape.h"
28#include "TGeoSphere.h"
32 double dz,
double zBottomCut,
double zTopCut)
40 fZBottomCut(zBottomCut),
55 TGeoScale* scale =
new TGeoScale(1.0, dy / dx, dz / dx);
58 TGeoScaledShape* scaledShape =
59 new TGeoScaledShape(
"scaledSphere", sphere, scale);
61 if (zBottomCut == 0. && zTopCut == 0.) {
62 fEllipsoid = scaledShape;
63 fEllipsoid->SetName(name.data());
67 if (zBottomCut == 0. || zBottomCut > dz) zBottomCut = -dz;
68 if (zTopCut == 0. || zTopCut < zBottomCut) zTopCut = dz;
79 TGeoBoolNode* boolNode =
new TGeoIntersection(scaledShape, cutBox);
81 fEllipsoid =
new TGeoCompositeShape(name.data(), boolNode);
92 fEllipsoid(scaledShape),
103 TGeoSphere* sphere =
dynamic_cast<TGeoSphere*
>(scaledShape->GetShape());
104 const Double_t* scale = scaledShape->GetScale()->GetScale();
106 Double_t rmax = sphere->GetRmax();
107 Double_t sx = scale[0];
108 Double_t sy = scale[1];
109 Double_t sz = scale[2];
127 :
VGM::ISolid(rhs),
VGM::IEllipsoid(rhs),
BaseVGM::VEllipsoid(rhs)
VGM implementation for Root ellipsoid solid.
virtual double ZSemiAxis() const
Return the semi-axis of the ellipse along z in mm.
virtual double XSemiAxis() const
Return the semi-axis of the ellipse along x in mm.
virtual std::string Name() const
Return the name of this solid.
virtual double YSemiAxis() const
Return the semi-axis of the ellipse along y in mm.
virtual double ZTopCut() const
Return the z top cut in mm.
virtual double ZBottomCut() const
Return the z bottom cut in mm.
void AddSolid(VGM::ISolid *, TGeoShape *)
static SolidMap * Instance()
static double Length()
Return Root length unit in VGM units.