5 from ROOT
import Belle2
6 from b2test_utils
import clean_working_directory, safe_process
10 """Test if the DataStore contains the expected content."""
13 """Create a new instance. If is_inverted is True we check of absence of content"""
19 """reimplementation of Module::event().
21 Checks for the amount of PXD Clusters and PXD Digits after
22 the prune module was run
30 assert PXDClusters.getEntries() == 0
32 assert PXDDigits.getEntries() > 0
34 assert PXDClusters.getEntries() > 0
36 assert PXDDigits.getEntries() == 0
43 basf2.set_log_level(basf2.LogLevel.ERROR)
44 basf2.conditions.disable_globaltag_replay()
45 basf2.set_random_seed(
"something important")
48 basf2.logging.set_info(basf2.LogLevel.FATAL, basf2.logging.get_info(basf2.LogLevel.ERROR))
50 input_file = basf2.find_file(
'framework/tests/root_input.root')
52 with clean_working_directory():
55 main.add_module(
'RootInput', inputFileName=input_file)
56 main.add_module(
'EventInfoPrinter')
57 main.add_module(
'PrintCollections')
58 main.add_module(
'PruneDataStore', matchEntries=[
'PXDClusters.*'])
59 main.add_module(
'PrintCollections')
63 main.add_module(
'RootOutput', outputFileName=
'prune_datastore_output_test.root', updateFileCatalog=
False)
71 main.add_module(
'RootInput', inputFileName=input_file)
72 main.add_module(
'EventInfoPrinter')
73 main.add_module(
'PrintCollections')
74 main.add_module(
'PruneDataStore', matchEntries=[
'PXDClusters.*'], keepMatchedEntries=
False)
75 main.add_module(
'PrintCollections')
79 main.add_module(
'RootOutput', outputFileName=
'prune_datastore_output_test.root', updateFileCatalog=
False)
87 main.add_module(
'RootInput', inputFileName=input_file)
88 main.add_module(
'EventInfoPrinter')
89 main.add_module(
'PrintCollections')
90 main.add_module(
'PruneDataStore', matchEntries=[
'[a-b][a'], keepMatchedEntries=
False)
91 main.add_module(
'PrintCollections')
94 assert(
not safe_process(main) == 0)