Belle II Software  release-08-01-10
test_standalone_reco_no_mc_exp0.py
1 
8 
9 import os
10 import pathlib
11 import subprocess
12 
13 import basf2 as b2
14 
15 
16 if __name__ == "__main__":
17 
18  prepare_path = os.getenv("BELLE2_PREPARE_PATH", "")
19  if prepare_path == "":
20  parent_path = pathlib.Path(b2.find_file('framework')).parent.absolute()
21  prepare_path = os.path.join(parent_path, "prepare_tests")
22  try:
23  os.mkdir(prepare_path)
24  except FileExistsError:
25  pass
26 
27  # Generate and simulate few events without MC information for exp. 0
28  steering = b2.find_file(os.path.join('reconstruction', 'tests', 'prepare', 'evtgen_no_mc.py_noexec'))
29  output_file = os.path.join(prepare_path, 'test_standalone_reco_no_mc_bbbar_exp0.root')
30  subprocess.check_call(
31  ['basf2', steering, '--experiment', '0', '--run', '0', '-n', '3', '-o', output_file]
32  )