19 #include "CLHEP/Units/GlobalSystemOfUnits.h" 33 template <
class NumType>
34 inline constexpr NumType convertUnits(NumType millimeters)
48 string volName =
name;
49 volName.erase(0, volName.rfind(
'_') + 1);
52 for (
int i = 0;
i < 6; ++
i) {
64 double halfX = convertUnits(box.
halfX());
65 double halfY = convertUnits(box.
halfY());
66 double halfZ = convertUnits(box.
halfZ());
70 double x1 = convertUnits(trap.
x1());
71 double x2 = convertUnits(trap.
x2());
72 double x3 = convertUnits(trap.
x3());
73 double x4 = convertUnits(trap.
x4());
74 double y1 = convertUnits(trap.
y1());
75 double y2 = convertUnits(trap.
y2());
78 double halfZ = convertUnits(trap.
halfZ());
79 double alpha1 = trap.
alpha1();
80 double alpha2 = trap.
alpha2();
81 buildTrap(
x1,
x2, x3, x4,
y1,
y2,
theta,
phi, halfZ, alpha1, alpha2);
84 double zhalf = convertUnits(cons.
zhalf());
85 double rInMinusZ = convertUnits(cons.
rInMinusZ());
86 double rOutMinusZ = convertUnits(cons.
rOutMinusZ());
87 double rInPlusZ = convertUnits(cons.
rInPlusZ());
88 double rOutPlusZ = convertUnits(cons.
rOutPlusZ());
89 double startPhi = cons.
phiFrom();
94 double zhalf = convertUnits(tubs.
zhalf());
95 double rIn = convertUnits(tubs.
rIn());
96 double rOut = convertUnits(tubs.
rOut());
102 double x1 = convertUnits(ptrap.
x1());
103 double x2 = convertUnits(ptrap.
x2());
104 double y1 = convertUnits(ptrap.
y1());
105 double y2 = convertUnits(ptrap.
y2());
106 double halfZ = convertUnits(ptrap.
halfZ());
112 double zhalf = convertUnits(tubs.
zHalf());
113 double rIn = convertUnits(tubs.
rIn());
114 double rOut = convertUnits(tubs.
rOut());
117 double cutAtStart = convertUnits(tubs.
cutAtStart());
118 double cutAtDelta = convertUnits(tubs.
cutAtDelta());
192 cout <<
" Orientation of surfaces:";
193 std::string sideName[3] = {
"positiveSide",
"negativeSide",
"onSurface"};
194 for (
int i = 0;
i < 6; ++
i) {
237 if (
x.Cross(
y).Dot(
z) < 0.5) {
238 cout <<
"*** WARNING: Rotation is not RH " << endl;
257 cout <<
"Refplane pos " << refPlane->position() << endl;
264 if (refPlane->toGlobal(globalZdir).z() < 0.) {
265 globalZdir = -globalZdir;
270 cout <<
"*** WARNING RefPlane check failed!***" << chk << endl;
275 std::vector<VolumeSide>
result;
276 for (
int i = 0;
i < 6; ++
i) {
295 #include "buildBox.icc" 296 #include "buildTrap.icc" 297 #include "buildTubs.icc" 298 #include "buildCons.icc" 299 #include "buildPseudoTrap.icc" 300 #include "buildTruncTubs.icc"
double radius(void) const
radius of the cut-out (neg.) or rounding (pos.)
MagGeoBuilderFromDDD::volumeHandle volumeHandle
Local3DVector LocalVector
A truncated tube section.
const DDTranslation & translation() const
The absolute translation of the current node.
void buildTrap(double x1, double x2, double x3, double x4, double y1, double y2, double theta, double phi, double halfZ, double alpha1, double alpha2)
double startPhi(void) const
angular start of the tube-section
double rInPlusZ(void) const
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the expanded-view.
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Geom::Phi< T > phi() const
volumeHandle(const DDExpandedView &fv, bool expand2Pi=false, bool debugVal=false)
std::vector< VolumeSide > sides() const override
The surfaces and they orientation, as required to build a MagVolume.
double rOutMinusZ(void) const
double cutAtStart(void) const
truncation at begin of the tube-section
double phi(void) const
Azimuthal angle of the line joining the centres of the faces at -/+pDz.
ALPAKA_FN_ACC int side(int ieta, int iphi)
double halfZ(void) const
half of the z-Axis
bool cutInside(void) const
true, if truncation is on the inner side of the tube-section
const GlobalPoint & center() const
Return the center of the volume.
unsigned short volumeno
volume number
unsigned short copyno
copy number
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
double halfZ(void) const
half of the z-Axis
double x3(void) const
Half-length along x of the side at y=-pDy2 of the face at +pDz.
static const char *const name(DDSolidShape s)
double x2(void) const
half length along x on +z
const std::string & name() const
Returns the name.
double phiFrom(void) const
double y2(void) const
half length along y on +z
void buildBox(double halfX, double halfY, double halfZ)
Surface::GlobalPoint GlobalPoint
double zHalf(void) const
half of the z-Axis
Interface to a Trapezoid.
double deltaPhi(void) const
int masterSector
The sector for which an interpolator for this class of volumes should be built.
void buildCons(double zhalf, double rInMinusZ, double rOutMinusZ, double rInPlusZ, double rOutPlusZ, double startPhi, double deltaPhi)
double y2(void) const
Half-length along y of the face at +pDz.
void referencePlane(const DDExpandedView &fv)
double rInMinusZ(void) const
double x4(void) const
Half-length along x of the side at y=+pDy2 of the face at +pDz.
DDSolidShape shape(void) const
The type of the solid.
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.
double rIn(void) const
inner radius
int copyno() const
Copy number associated with the current node.
double rOutPlusZ(void) const
double deltaPhi(void) const
constexpr NumType convertMmToCm(NumType millimeters)
double x2(void) const
Half-length along x of the side at y=+pDy1 of the face at -pDz.
double rOut(void) const
outer radius
void buildTruncTubs(double zhalf, double rIn, double rOut, double startPhi, double deltaPhi, double cutAtStart, double cutAtDelta, bool cutInside)
void buildPseudoTrap(double x1, double x2, double y1, double y2, double halfZ, double radius, bool atMinusZ)
double x1(void) const
half length along x on -z
std::string name
Name of the volume.
double alpha1(void) const
Angle with respect to the y axis from the centre of the side at y=-pDy1 to the centre at y=+pDy1 of t...
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
DDSolidShape shape() const override
Shape of the solid.
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
double alpha2(void) const
Angle with respect to the y axis from the centre of the side at y=-pDy2 to the centre at y=+pDy2 of t...
double startPhi(void) const
double deltaPhi(void) const
angular span of the tube-section
double y1(void) const
Half-length along y of the face at -pDz.
bool atMinusZ(void) const
true, if cut-out or rounding is on the -z side
Provides an exploded view of the detector (tree-view)
Geom::Theta< T > theta() const
double y1(void) const
half length along y on -z
double theta(void) const
Polar angle of the line joining the centres of the faces at -/+pDz.
double cutAtDelta(void) const
truncation at end of the tube-section
void buildTubs(double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
std::string magFile
Name of magnetic field table file.
Global3DVector GlobalVector
double x1(void) const
Half-length along x of the side at y=-pDy1 of the face at -pDz.