Experimental geometry

remage does not implement or manage any experimental geometry. Instead, the user must provide a geometry definition. There are two supported approaches:

See also

The pyg4ometry Python library provides powerful tools for building Monte Carlo geometries and exporting them as GDML. Relevant pyg4ometry-based packages include:

Full geometry implementations based on these tools:

Registering sensitive detectors

Sensitive detector volumes must be registered so that particle interactions are recorded in the output. In remage, this can be done in several ways. Each detector has a unique id (UID) and a type, which determines how hits are processed and stored. Detector of type Germanium, Scintillator and Optical are currently supported.

Note

Custom detector types cannot currently be registered at runtime.

The simplest method is to use the /RMG/Geometry/RegisterDetector macro command:

/RMG/Geometry/RegisterDetector Germanium B00000B 1
/RMG/Geometry/RegisterDetector Germanium C000RG1 2

This registers the physical volumes B00000B and C000RG1 as Germanium detectors with UIDs 1 and 2. If the copy number is not specified, 0 is used by default. See Output for details on how detector types affect output.

Alternatively, detectors can be imported from a GDML file that includes metadata, using the /RMG/Geometry/RegisterDetectorsFromGDML command.

Tip

The legend-pygeom-tools package automatically includes such metadata when writing GDML with write_pygeom().

Inspecting geometry

To inspect the simulation geometry, use the following macro commands:

Example session:

remage> /RMG/Geometry/IncludeGDMLFile geometry.gdml
remage> /run/initialize
G4GDML: Reading 'geometry.gdml'...
G4GDML: Reading definitions...
G4GDML: Reading materials...
G4GDML: Reading solids...
G4GDML: Reading structure...
G4GDML: Reading userinfo...
G4GDML: Reading setup...
G4GDML: Reading 'geometry.gdml' done!
Stripping off GDML names of materials, solids and volumes ...
[Summary -> Checking for overlaps in GDML geometry...
remage> /RMG/Geometry/PrintListOfPhysicalVolumes
[Summary ->  · B00000A  // 0 daugh. // 5.54635 g/cm3  // 488.951 g  // 8.81573 cL  // 1 atm // 293.15 K
[Summary ->  · B00000B  // 0 daugh. // 5.54635 g/cm3  // 700.096 g  // 1.26227 dL  // 1 atm // 293.15 K
...
[Summary ->  · wlsr_ttx // 1 daugh. // 350 mg/cm3 // 1.15983 kg // 3.3138 L   // 1 atm // 293.15 K
[Summary ->  · world    // 1 daugh. // 1e-22 mg/cm3 // 154028 kg // 1.54028e+18 km3 // 3e-18 Pa  // 2.73 K
[Summary ->
[Summary -> Total: 171 volumes

Tip

As seen above, the Geant4 overlap checker is enabled by default if GDML input is provided. It can be disabled with the /RMG/Geometry/GDMLDisableOverlapCheck command.