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