Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-27 07:24:06

0001 # This file is part of the ACTS project.
0002 #
0003 # Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 #
0005 # This Source Code Form is subject to the terms of the Mozilla Public
0006 # License, v. 2.0. If a copy of the MPL was not distributed with this
0007 # file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 import detray
0010 
0011 from detray.detectors import metadata, metadata_generator
0012 from detray.detectors import Shape
0013 from detray.detectors import (
0014     add_silicon_tracker_defaults,
0015 )
0016 
0017 import argparse
0018 import logging
0019 import sys
0020 
0021 # --------------------------------------------------------------------------
0022 # Generate the ITk metadata type
0023 # --------------------------------------------------------------------------
0024 
0025 """ Add all types needed to describe the ATLAS ITk detector """
0026 
0027 
0028 def add_itk_types(md: metadata):
0029     logger = logging.getLogger(__name__)
0030     logger.info("Define types required by the ATLAS Inner Tracker (ITk):")
0031 
0032     # Strip stereo annulus shape
0033     logger.info("-> adding ITk strip detecor custom shape")
0034     md.add_sensitive(Shape.ANNULUS)
0035 
0036     # Add default types for silicon trackers (cylindrical detector shape)
0037     add_silicon_tracker_defaults(metadata=md, use_mat_maps=True)
0038 
0039     logger.info("Done")
0040 
0041 
0042 def __main__():
0043     # Commandline options
0044     parser = argparse.ArgumentParser(prog=sys.argv[0])
0045     detray.detectors.add_logging_options(parser)
0046     detray.detectors.add_io_options(parser)
0047 
0048     args = parser.parse_args()
0049     detray.detectors.parse_logging_options(args)
0050     detray.detectors.parse_io_options(args)
0051 
0052     md = metadata("itk")
0053 
0054     add_itk_types(md)
0055 
0056     # Dump the metadata to header file
0057     if args.output:
0058         metadata_generator(md, args.output)
0059     else:
0060         metadata_generator(md)
0061 
0062 
0063 if __name__ == "__main__":
0064     __main__()