|
|
Geant4 User's Guide
For Application Developers Geometry |
Hierarchies of volumes based on CSG or specific solids can be
reflected by means of the G4ReflectionFactory class and
G4ReflectedSolid, which implements a solid that has been shifted
from its original reference frame to a new 'reflected' one. The reflection
transformation is applied as a decomposition into rotation and translation
transformations.
The factory is a singleton object which provides the following methods:
G4PhysicalVolumesPair Place(const G4Transform3D& transform3D,
const G4String& name,
G4LogicalVolume* LV,
G4LogicalVolume* motherLV,
G4bool isMany,
G4int copyNo,
G4bool surfCheck=false)
G4PhysicalVolumesPair Replicate(const G4String& name,
G4LogicalVolume* LV,
G4LogicalVolume* motherLV,
EAxis axis,
G4int nofReplicas,
G4double width,
G4double offset=0)
G4PhysicalVolumesPair Divide(const G4String& name,
G4LogicalVolume* LV,
G4LogicalVolume* motherLV,
EAxis axis,
G4int nofDivisions,
G4double width,
G4double offset);
The method Place() used for placements, evaluates the passed
transformation. In case the transformation contains a reflection, the
factory will act as follows:
Notes
#include "G4ReflectionFactory.hh"
// Calor placement with rotation
G4double calThickness = 100*cm;
G4double Xpos = calThickness*1.5;
G4RotationMatrix* rotD3 = new G4RotationMatrix();
rotD3->rotateY(10.*deg);
G4VPhysicalVolume* physiCalor =
new G4PVPlacement(rotD3, // rotation
G4ThreeVector(Xpos,0.,0.), // at (Xpos,0,0)
logicCalor, // its logical volume (defined elsewhere)
"Calorimeter", // its name
logicHall, // its mother volume (defined elsewhere)
false, // no boolean operation
0); // copy number
// Calor reflection with rotation
//
G4Translate3D translation(-Xpos, 0., 0.);
G4Transform3D rotation = G4Rotate3D(*rotD3);
G4ReflectX3D reflection;
G4Transform3D transform = translation*rotation*reflection;
G4ReflectionFactory::Instance()
->Place(transform, // the transformation with reflection
"Calorimeter", // the actual name
logicCalor, // the logical volume
logicHall, // the mother volume
false, // no boolean operation
1, // copy number
false); // no overlap check triggered
// Replicate layers
//
G4ReflectionFactory::Instance()
->Replicate("Layer", // layer name
logicLayer, // layer logical volume (defined elsewhere)
logicCalor, // its mother
kXAxis, // axis of replication
5, // number of replica
20*cm); // width of replica
|
|
Source listing 4.1.8 An example of usage of the G4ReflectionFactory class. |