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