Message: Trouble with G4SubtractionSolid -- pipe at angle to wall Not Logged In (login)

Trouble with G4SubtractionSolid -- pipe at angle to wall

Forum: Geometry
Date: 14 Jan, 2011
From: Michael H. Kelsey <Michael H. Kelsey>

 I am having trouble constructing a specific G4SubtractionSolid: a flat panel (scintillator veto) with a cylindrical hole drilled at an angle to the surface. I have checked my geometry, and have convinced myself that I'm supplying the correct parameters, but the hole comes out perpendicular to the surface. Here is a simplified version of the code I'm using: ``` G4Box* panel = new G4Box("Panel", scintThick/2., sidePanelWidth/2., midPanelHeight/2.); G4Tubs* pipe = new G4Tubs("PipeHole", 0., radius, thick/2., 0, 360*deg);``` ` G4double phi = -(panelTransform.getRotation().phiX());` ``` G4RotationMatrix holerot; holerot.rotateY(90*deg).rotateZ(phi);``` ` G4ThreeVector holepos(0., holeY, holeZ);` ``` G4VSolid* panelWithHole = new G4SubtractionSolid("PanelWithHole", panel, pipe, &holerot, holepos);``` The angle "phi" is where the panel ends up positioned in the pentagon. With "holerot", I first take the G4Tubs, and rotate it horizontally, then that horizontal position is rotated around Z "opposite" the panel's transform. The net result _should_ be the panel is at an angle, but the hole is along the X axis. The attached graphic shows what I mean. The yellow panel is tilted at 36 degrees to the viewpoint (it's part of a pentagon, with the point toward the viewer). The hole you see _should_ be exactly along the viewpoint (X) axis, but instead you can see that it's also tilted. By playing with viewpointThetaPhi, I have confirmed that the hole is exactly normal to the panel, which it should not be. This is not just a visualization issue. Grid_test confirms that the pipe which comes through the hole (which I suppressed for the drawing) has volume overlaps with the panel. Am I just missing some simple piece of geometry? Or have I found a problem with boolean solids dealing with compound rotations? The fact that the hole appears circular at all means that the rotateY() operation above _is_ being applied; it's the subsequent rotateZ() which is not. -- Michael Kelsey

 Inline Depth: Outline Depth: Add message:

1 Re: Trouble with G4SubtractionSolid -- pipe at angle to wall   (John Allison - 15 Jan, 2011)
1 Re: Trouble with G4SubtractionSolid -- pipe at angle to wall   (Mike Kelsey - 15 Jan, 2011)
2 Re: Trouble with G4SubtractionSolid -- forgot attachment   (Michael H. Kelsey - 15 Jan, 2011)
3 Re: Trouble with G4SubtractionSolid -- bug? in CLHEP::HepRotation   (Michael H. Kelsey - 15 Jan, 2011)
1 Re: Trouble with G4SubtractionSolid -- bug? in CLHEP::HepRotation   (Tom Roberts - 15 Jan, 2011)
Re: Trouble with G4SubtractionSolid -- bug? in CLHEP::HepRotation   (Mike Kelsey - 15 Jan, 2011)
Re: Trouble with G4SubtractionSolid -- bug? in CLHEP::HepRotation   (Joseph Perl - 15 Jan, 2011)
 to: "Trouble with G4SubtractionSolid -- pipe at angle to wall"
This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews

[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]