Belle II Software  light-2403-persian
__init__.py
1 #!/usr/bin/env python3
2 
3 
10 
11 """
12 Functions related to building or using the simulation/reconstruction geometry
13 """
14 
15 import basf2
16 
17 
18 def check_components(components):
19  """
20  Check list of geometry components. This function is used by the standard
21  scripts, for example `simulation.add_simulation()`. Thus, only the detector
22  components corresponding to subdetectors are allowed. In addition, TRG is
23  included. Trigger is not a geometry component, but it is used as an
24  additional component in raw-data and DQM scripts.
25 
26  If there is a unsupported component in the list the function will raise a
27  FATAL error and is guaranteed to not return.
28 
29  Parameters:
30  components (list(str)): List of geometry components.
31  """
32 
33  if components is None:
34  return
35  allowed_components = ['PXD', 'SVD', 'CDC', 'ECL', 'TOP', 'ARICH', 'KLM', 'TRG']
36  for component in components:
37  if not (component in allowed_components):
38  basf2.B2FATAL(f'Geometry component {component} is unknown or it cannot be used in standard scripts.')