Back to home page

EIC code displayed by LXR

 
 

    


Warning, /acts/Detray/python/detray/README.md is written in an unsupported language. File is not indexed.

0001 # Detray Python Package
0002 
0003 ## Detector Module
0004 
0005 This module contains the tools to generate the detector metadata headers used to define a detray detector type. This can be steered manually or automatically during the cmake configuration step.
0006 
0007 ### Generating custom Detector Metadata
0008 
0009 The detector metadata is a C++ `struct` used by the detray core library as a template parameter to gather the compile-time information on the capabilities of the detector modelling, for example:
0010 
0011 `using odd_detector_t = detray::detector<detray::odd_metadata<algebra_t>>`,
0012 
0013 with the `algebra_t` defined according to the linear algebra backend to be used, for instance the `detray::array<float>` plugin.
0014 
0015 A generic metadata type (the default metadata) exists, which comprises most of the geometry modelling capabilities detray has to offer, however, at the expense of increased build times and likely higher runtime of subsequent track reconstruction pipelines. A custom metadata can be defined by providing a python script that configures the detray metadata code generator,
0016 which can be invoked during the configuration stage of the cmake build:
0017 ```shell
0018 cmake -S detray -B detray-build -DDETRAY_METADATA_GENERATOR=path/to/custom_metadata.py
0019 ```
0020 The resulting metadata header, ready to be used in downstream projects, will be available in the `detray/detectors` folder. Example metadata generation scripts, for instance for the ACTS Open Data Detector (ODD detector mentioned above), can be found in the `detray/detectors/python/` folder. They can be invoked manually by:
0021 ```shell
0022 source detray-build/python/setup.sh
0023 python3 detray/detectors/python/odd_metadata.py
0024 ```
0025 
0026 ### Metadata Configuration Manual
0027 
0028 Generate a metadata representation and dump the header file:
0029 
0030 ```python
0031 from detray.detectors import metadata, metadata_generator
0032 
0033 md = metadata("detector_name")
0034 
0035 [...]
0036 
0037 metadata_generator(md)
0038 ```
0039 
0040 Adding surface shapes for passive or sensitive detector elements or portals between detector sub-volumes: