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