# How to position one solid relative to another?

I have been modifying example B1 to simulate a collimator.

I generated a box emulating an absorber and a tube emulating a hole. I then used a subtraction solid to place the hole in the absorber, and specified the resulting solid as a logical volume as in the following code.

``````G4Box* theAbsorber = new G4Box("Absorber",4*cm,4*cm,.5*tAbsorb);
G4Tubs* theHole = new G4Tubs("Hole",hole_rmin,hole_rmax,hole_hz,0,2*M_PI*rad);
G4VSolid* solidShape2 =
new G4SubtractionSolid("Absorber-Hole",theAbsorber,theHole);
G4LogicalVolume* logicShape2 =
new G4LogicalVolume(solidShape2,  shape2_mat, "Shape2");
``````

This code works, with the hole centered in the absorber and oriented along the z axis. What I would now like to do is to modify the code to rotate and offset the hole in the absorber. I think that I probably need to use G4PVPlacement to do this but am having trouble understanding exactly how to do this since I haven’t seen an example and am unsure whether the solids theAbsorber and theHole are even the logical volumes needed by G4PVPlacement. Can someone please tell me what I need to do to offset and rotate the hole?

Simply add the rotation and translation to the line

``````G4VSolid* solidShape2 =
new G4SubtractionSolid("Absorber-Hole",theAbsorber, theHole, theRotation, theTranslation);
``````

Constructors are described for example here: Geant4: G4SubtractionSolid Class Reference

If the hole does not overlap the absorber, it is not necessary to make subtraction for so simple thing.
just, place the hole within the absorber .

Many thanks weller. Are the specific actions of gean4 methods documented anywhere? Even if I had known that rotation and translation variables could be included in the subtraction solid definition (which I wasn’t), it is unclear from the constructor definition that the rotation and translation applies to the second solid rather than the result of the subtraction.

Thanks Michael. I guess I need to spend more time studying the “Book for Application Developers”.