13 Test reconstruction of physics run.
17 import b2test_utils
as b2u
20 import subprocess
as sp
21 import multiprocessing
as mp
24 if __name__ ==
'__main__':
26 if 'BELLE2_VALIDATION_DATA_DIR' not in os.environ:
27 b2u.skip_test(
'BELLE2_VALIDATION_DATA_DIR environment variable not set, skipping the test.')
29 num_workers = max(int(mp.cpu_count() / (1. + os.getloadavg()[1])), 1)
30 basf2.B2INFO(f
'The test will be executed using {num_workers} workers.')
32 steering_file = basf2.find_file(
'reconstruction/tests/reco_cdst.py_noexec')
33 rawdata_files = glob.glob(os.environ[
'BELLE2_VALIDATION_DATA_DIR'] +
'/rawdata/physics.*HLT?.*.root')
34 rawdata_file = random.choice(rawdata_files)
35 basf2.B2INFO(f
'Running the test using {rawdata_file} as input file.')
36 assert(sp.call([
'basf2', steering_file, rawdata_file,
'physics']) == 0)