Back to home page

EIC code displayed by LXR

 
 

    


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

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 argparse
0010 
0011 # ------------------------------------------------------------------------------
0012 # Options parsing
0013 # ------------------------------------------------------------------------------
0014 
0015 """ Adds options that are common to all track generators """
0016 
0017 
0018 def common_track_generator_options(parser):
0019 
0020     parser.add_argument(
0021         "--random_seed",
0022         "-seed",
0023         help=("Seed for the random number generator"),
0024         default=5489,
0025         type=int,
0026     )
0027     parser.add_argument(
0028         "--pT_range",
0029         "-pTr",
0030         nargs=2,
0031         help=("Transverse momentum [range] of the test particle [GeV]"),
0032         type=float,
0033     )
0034     parser.add_argument(
0035         "--p_range",
0036         "-pr",
0037         nargs=2,
0038         help=("Total momentum [range] of the test particle [GeV]"),
0039         type=float,
0040     )
0041     parser.add_argument(
0042         "--eta_range",
0043         "-eta",
0044         nargs=2,
0045         help=("Eta range of generated tracks"),
0046         default=[-4, 4],
0047         type=float,
0048     )
0049     parser.add_argument(
0050         "--randomize_charge",
0051         "-rand_chrg",
0052         help=("Randomly flip charge sign per track"),
0053         action="store_true",
0054         default=False,
0055     )
0056 
0057     return parser
0058 
0059 
0060 """ Parent parser that contains random track generator options """
0061 
0062 
0063 def random_track_generator_options():
0064 
0065     parser = argparse.ArgumentParser(add_help=False)
0066 
0067     common_track_generator_options(parser)
0068 
0069     parser.add_argument(
0070         "--n_tracks", "-n", help=("Number of test tracks"), default=100, type=int
0071     )
0072 
0073     return parser
0074 
0075 
0076 """ Parent parser that contains uniform track generator options """
0077 
0078 
0079 def uniform_track_generator_options():
0080 
0081     parser = argparse.ArgumentParser(add_help=False)
0082 
0083     common_track_generator_options(parser)
0084 
0085     # Navigation options
0086     parser.add_argument(
0087         "--phi_steps", "-n_phi", help=("Number steps in phi"), default=50, type=int
0088     )
0089     parser.add_argument(
0090         "--eta_steps", "-n_eta", help=("Number steps in eta"), default=50, type=int
0091     )
0092 
0093     return parser