Systems
A detector in gemc is composed by one or more systems, each a hierarchical collection of geant4 volumes. In the example below an example with two systems, Forward Detector and Central Detector, is shown.
| Systems Hierarchy Visualisation | Corresponding Hierarchy List |
|---|---|
] |
Create a system
To create a new system, use the script templates.py. It setups a new directory
with the name of the system containing template files with default geometry and materials.
For example, to create a forward system:
system_template.py -s forward
In the directory forward, the following files appear:
- a subdir called
counterwas created in the current directory - inside
counter, few files were created:counter.yaml: a steering card (yaml file) that defines the simulation configurationcounter.py: the python executable that builds the systemgeometry.py: the geometry definition filematerials.py: the materials definition fileREADME.md: a template readme file meant to be edited by the user
Create the system geometry and run gemc
Following the above example, to build the detector, execute forward.py. This will create the databases for the geometry and materials. The default
database format is text and the default variation is default, so the files
forward__geometry_default.txt and forward__materials_default.txt will appear.
To load the system in gemc, the following entry is added to the steering card:
"+gsystem": [
{
"system": "./forward",
"factory": "text",
"variation": "default"
}
]
The steering card also setups 200 events, each with one , with two outputs: a root file and a text file. Modify as needed and run gemc:
gemc forward.jcard
These steps have been summarized in the following recording:
Variations
The templates script accepts a -v option to create one or more variations of a system.
For example, to create a forward system with two variations, default and lead_target:
templates.py -s forward -v default lead_target
This will allow to have two versions of the same forward detector. As an example, the lead_target variation could be identical
to the default except for the target material. For more details check the Variations Example.
Database factories
[s2]: “<li>Forward detector <ul style='list-style-type: \" ⌙ ︎ \" '> “ [s3]: “<li>paddles <ul style='list-style-type: \" ⌙ ︎ \" '> <li> paddle 1</li> <li> … </li> </ul> </li> “ [s4]: “<li>pmts <ul style='list-style-type: \" ⌙ ︎ \" '> <li> pmt 1 </li> <li> … </li> </ul> </li> </ul> </li>” [s5]: “<li>Central detector <ul style='list-style-type: \" ⌙ ︎ \" '> “ [s6]: “<li>shield </li> <li> paddles <ul style='list-style-type: \" ⌙ ︎ \" '> “ [s7]: “<li>light guides <ul style='list-style-type: \" ⌙ ︎ \" '> <li> lg 1 </li> <li> … </li> </ul> </li> “ [s8]: “<li>pmts <ul style='list-style-type: \" ⌙ ︎ \" '> <li> pmt 1 </li> <li> … </li> </ul> </li> </ul> </li>” [s9]: “</li></ul>{:/}” [pi0]: “π0”
]