|
ATLAS Offline Software
|
#include <TrackingVolumeToSoNode.h>
Definition at line 28 of file TrackingVolumeToSoNode.h.
◆ TrackingVolumeToSoNode()
TrackingVolumeToSoNode::TrackingVolumeToSoNode |
( |
| ) |
|
◆ ~TrackingVolumeToSoNode()
TrackingVolumeToSoNode::~TrackingVolumeToSoNode |
( |
| ) |
|
|
virtualdefault |
◆ getShapeFromBounds()
Definition at line 212 of file TrackingVolumeToSoNode.cxx.
214 const GeoShape*
sh=
nullptr;
227 GeoSimplePolygonBrep* shape =
new GeoSimplePolygonBrep(tvolSpbBounds->
halflengthZ());
243 const GeoBox* box =
new GeoBox(tvolCubBounds->
halflengthX(),
251 const GeoTrd* trd =
new GeoTrd(tvolTrdBounds->
halflengthY(),
261 if (tvolBevCylBounds) {
266 double thPlus = tvolBevCylBounds->
thetaPlus();
267 double thMinus= tvolBevCylBounds->
thetaMinus();
268 const GeoTube* tub =
new GeoTube(innerR, outerR, halfZ);
270 const GeoShapeShift* boxP =
new GeoShapeShift(
new GeoBox(2*outerR/
cos(thPlus),outerR ,outerR*
sin(thPlus)),trBoxP);
272 const GeoShapeShift* boxM =
new GeoShapeShift(
new GeoBox(2*outerR/
cos(thPlus),outerR ,outerR*
sin(thPlus)),trBoxM);
273 const GeoShapeSubtraction* shape=
new GeoShapeSubtraction(
new GeoShapeSubtraction(tub,boxM), boxP);
278 if (tvolSubtrBounds) {
300 const GeoShapeShift* shift1 =
new GeoShapeShift(shape1, transf1);
301 const GeoShapeShift* shift2 =
new GeoShapeShift(shape2, transf2);
302 const GeoShapeSubtraction* subtr=
new GeoShapeSubtraction(shift1, shift2);
306 if (tvolCombBounds) {
327 const GeoShapeShift* shift1 =
new GeoShapeShift(shape1,transf1);
328 const GeoShapeShift* shift2 =
new GeoShapeShift(shape2,transf2);
330 const GeoShapeIntersection*
intersection=
new GeoShapeIntersection( shift1, shift2);
333 const GeoShapeUnion* uni=
new GeoShapeUnion( shift1, shift2);
337 std::cout <<
"TrackingVolumeToSoNode::getShapeFromBounds: bounds not recognized" << std::endl;
◆ translateTrackingVolume()
Definition at line 60 of file TrackingVolumeToSoNode.cxx.
64 SoNode* sovol =
nullptr;
73 GeoSimplePolygonBrep* shape =
new GeoSimplePolygonBrep(tvolSpbBounds->
halflengthZ());
84 if (tvolSubtrBounds) {
130 minHalfX, maxHalfX, halfY, minHalfX,
137 if (tvolDTrdBounds) {
148 const GeoShapeShift* shiftA =
new GeoShapeShift(trdA,GeoTrf::TranslateY3D(-
y1)*GeoTrf::RotateX3D(-90*
CLHEP::deg)*GeoTrf::RotateZ3D(-90*
CLHEP::deg));
149 const GeoShapeShift* shiftB =
new GeoShapeShift(trdB,GeoTrf::TranslateY3D(+
y2)*GeoTrf::RotateX3D(-90*
CLHEP::deg)*GeoTrf::RotateZ3D(-90*
CLHEP::deg));
150 const GeoShapeUnion* dtrd =
new GeoShapeUnion(shiftA,shiftB);
158 if (tvolBevCylBounds) {
160 int type = tvolBevCylBounds->
type();
162 double tp =
tan(hPhi);
168 (*tvolTubs).pRMin = innerR;
169 (*tvolTubs).pRMax = outerR;
170 (*tvolTubs).pDz = hZ;
171 (*tvolTubs).pDPhi = 2*hPhi;
172 (*tvolTubs).pSPhi = -hPhi;
174 }
else if (
type==1 ) {
175 const GeoTubs* tubs =
new GeoTubs(innerR,outerR,hZ,-hPhi,2*hPhi);
176 const GeoBox* box =
new GeoBox( innerR,
tp*innerR, hZ);
177 const GeoShapeSubtraction* sub =
new GeoShapeSubtraction(tubs,
new GeoShapeShift(box,GeoTrf::Transform3D::Identity()));
181 }
else if (
type==2 ) {
182 const GeoTubs* tubs =
new GeoTubs(innerR,outerR/
cos(hPhi),hZ,-hPhi,2*hPhi);
183 const GeoBox* box =
new GeoBox( outerR*(1./
cos(hPhi)-1.),
tp*outerR,hZ );
184 const GeoShapeSubtraction* sub =
new GeoShapeSubtraction(tubs,
new GeoShapeShift(box,GeoTrf::TranslateX3D(outerR/
cos(hPhi))));
188 }
else if (
type==3 ) {
189 const GeoTubs* tubs =
new GeoTubs(innerR,outerR/
cos(hPhi),hZ,-hPhi,2*hPhi);
190 const GeoBox* boxO =
new GeoBox( outerR*(1./
cos(hPhi)-1.),
tp*outerR,hZ );
191 const GeoBox* boxI =
new GeoBox( innerR,
tp*innerR, hZ);
192 const GeoShapeUnion* uni =
new GeoShapeUnion(boxI,
new GeoShapeShift(boxO,GeoTrf::TranslateX3D(outerR/
cos(hPhi))));
193 const GeoShapeSubtraction* sub =
new GeoShapeSubtraction(tubs,uni);
200 if (!sovol)
return nullptr;
203 SoSeparator* sosep =
new SoSeparator();
205 sosep->addChild(sotra);
206 sosep->addChild(sovol);
The documentation for this class was generated from the following files:
double halflengthZ() const
This method returns the halflength in local z.
double maxHalflengthX() const
This method returns the maximal halflength in local x.
void setParametersForTrapezoid(float dz, float theta, float phi, float dy1, float dx1, float dx2, float dy2, float dx3, float dx4, float alp1, float alp2)
double outerRadius() const
This method returns the outer radius.
virtual void handleShape(const GeoShape *subtract)
bool intersection() const
This method distinguishes between Union(0) and Intersection(1)
double halflengthZ() const
This method returns the halflength in local z.
double minHalflengthX() const
This method returns the minimal halflength in local x.
int type() const
This method returns the type.
SoTubs - Inventor version of the G4Tubs Geant Geometry entity.
double thetaMinus() const
This method returns the thetaMinus.
double halflengthX() const
This method returns the halflength in local x.
std::vector< std::string > intersection(std::vector< std::string > &v1, std::vector< std::string > &v2)
const Volume * first() const
This method returns the first VolumeBounds.
double halflengthZ() const
This method returns the halflength in local z.
double halflengthY() const
This method returns the halflength in local y.
Amg::Transform3D getRotateZ3D(double angle)
get a rotation transformation around Z-axis
double maxHalflengthX() const
This method returns the X halflength at maximal Y (local coordinates)
double halflengthY() const
This method returns the halflength in local y.
Amg::Transform3D getRotateX3D(double angle)
get a rotation transformation around X-axis
double halflengthY1() const
This method returns the halflength1 in local y.
Eigen::Affine3d Transform3D
double halflengthZ() const
This method returns the halflengthZ.
const GeoShape * getShapeFromBounds(const Trk::VolumeBounds *volBounds) const
double thetaPlus() const
This method returns the thetaPlus.
double halflengthY2() const
This method returns the halflength2 in local y.
static void initClass()
Class Initializer, required.
void setParametersForBox(float dx, float dy, float dz, float xcenter=0.0, float ycenter=0.0, float zcenter=0.0)
const Volume * outer() const
This method returns the outer Volume.
double outerRadius() const
This method returns the outer radius.
const Amg::Transform3D & transform() const
Return methods for geometry transform.
double halfPhiSector() const
This method returns the halfPhiSector angle.
double innerRadius() const
This method returns the inner radius.
double minHalflengthX() const
This method returns the X halflength at minimal Y.
double innerRadius() const
This method returns the inner radius.
double medHalflengthX() const
This method returns the (maximal) halflength in local x.
const VolumeBounds & volumeBounds() const
returns the volumeBounds()
double halflengthZ() const
This method returns the halflength in local z.
double halflengthZ() const
This method returns the halflengthZ.
const Volume * second() const
This method returns the second VolumeBounds.
double halfPhiSector() const
This method returns the halfPhiSector angle.
const std::vector< std::pair< double, double > > & xyVertices() const
This method returns the set of xy generating vertices.
static SoTransform * toSoTransform(const HepGeom::Transform3D &, SoTransform *t=0)
const Volume * inner() const
This method returns the inner Volume.