Belle II Software  release-06-02-00
test_beamspot_and_ip_variables.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 import basf2 as b2
13 import modularAnalysis as ma
14 import b2test_utils as b2tu
15 
16 
17 def check_file(input_file_name):
18  """Run the check with a quick basf2 printout for the
19  first event in ``input_file_name`` on the validation server"""
20  input_file = b2tu.require_file(input_file_name, 'validation')
21  pa = b2.Path()
22  ma.inputMdst("default", input_file, path=pa)
23  ma.printVariableValues(
24  "", ["IPX", "IPY", "IPZ", "genIPX", "genIPY", "genIPZ"], path=pa)
25  b2tu.safe_process(pa, 1)
26 
27 
28 if __name__ == "__main__":
29  b2.set_random_seed(":-)")
30  b2tu.configure_logging_for_tests()
31  check_file("mdst13.root")
32  check_file("mdst14.root")
33  # TODO: update this to check a data event when a suitable file is added