Belle II Software  release-08-01-10
test_geometry_payloads_creation.py
1 
8 
9 '''
10 Test if the creation of the geometry payloads works fine.
11 '''
12 
13 import b2test_utils as b2tu
14 b2tu.skip_test_if_light() # light builds don't contain full geometry # noqa
15 import basf2 as b2
16 
17 
18 # We will test few configurations
19 # 1: default settings
20 with b2tu.clean_working_directory():
21  main1 = b2.Path()
22  main1.add_module('EventInfoSetter')
23  main1.add_module('Gearbox')
24  main1.add_module('Geometry',
25  createPayloads=True,
26  payloadIov=[0, 1, 2, 3]
27  )
28  assert(b2tu.safe_process(main1) == 0)
29 
30 # 2: include only few components
31 with b2tu.clean_working_directory():
32  main2 = b2.Path()
33  main2.add_module('EventInfoSetter')
34  main2.add_module('Gearbox')
35  main2.add_module('Geometry',
36  createPayloads=True,
37  components=['ARICH', 'ECL', 'PXD'],
38  payloadIov=[0, 1, 2, 3]
39  )
40  assert(b2tu.safe_process(main2) == 0)
41 
42 # 3: exclude few components
43 with b2tu.clean_working_directory():
44  main3 = b2.Path()
45  main3.add_module('EventInfoSetter')
46  main3.add_module('Gearbox')
47  main3.add_module('Geometry',
48  createPayloads=True,
49  excludedComponents=['ARICH', 'ECL', 'PXD'],
50  payloadIov=[0, 1, 2, 3]
51  )
52  assert(b2tu.safe_process(main3) == 0)