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?