I’m wondering what is the origin of a G4Trap ?
I created two solids
G4Trap* housing_up =
new G4Trap(“housing_up”,fHousingSize.z(),dY,fHousingSize.x(),1.0*mm);
and
G4Box* housing_bottom =
new G4Box(“housing_bottom”,fHousingSize.x()/2.0,fHousingSize.y()/2.0,fHousingSize.z()/2.0);
and made an union without relative displacement along X :
G4ThreeVector trans(0.0,fHousingSize.y()/2.0+dY/2.0-kCarTolerance,0.0);
G4UnionSolid* housing_solid =
new G4UnionSolid(“PMTHousing”,housing_bottom,housing_up,0,trans);
However the G4Trap is not aligned with the G4Box along X…
Sorry, I’ve misunderstood the issue. The problem is not in the dimensions of the box. To align the solids a displacement in X should be added to the translation vector:
Hi,
It worked, many thanks ! Could you point me to some place where I could find an explanation ? I thought that by default they would be aligned…
Thanks again.
I do not know where a detailed explanation of this kind of G4Trap (Right Angular Wedge) can be found. The construction of Right Angular Wedge can be understood from its source:
Hi again,
I am implementing the generic G4ExtrudedSolid and find one of the arguments is a vector of ZSection objects. Looking at the code I find a ZSection is defined by the z position, offset and scale. The first parameter seems obvious, but I could not find a description of the meaning of the last two… Could you point me to some part of the documentation ?
Many thanks,
Bernardo
G4ExtrudedSolid is a solid constructed by moving a 2D polygonal contour along a 3D polyline. The coordinates of a node in the polyline are defined by first two parameters in corresponding ZSection, z-position and offset (x,y). During movement the polygonal contour can be scaled. The scale factor is defined by third parameter of ZSection.
In most of cases G4ExtrudedSolid is used for solids that have only two z-sections. For this reason G4ExtrudedSolid has second, simplified constructor without vector of ZSection objects. I suggested to you this one.
In your case off1, off2 should be specified as G4TwoVector(0,0), and scale1, scale2 should be equal to 1.