12from ROOT
import Belle2
13from b2test_utils
import clean_working_directory, safe_process
17 """Test if the DataStore contains the expected content."""
20 """Create a new instance. If is_inverted is True we check of absence of content"""
26 """reimplementation of Module::event().
28 Checks for the amount of PXD Clusters
and PXD Digits after
29 the prune module was run
37 assert PXDClusters.getEntries() == 0
39 assert PXDDigits.getEntries() > 0
41 assert PXDClusters.getEntries() > 0
43 assert PXDDigits.getEntries() == 0
51basf2.set_log_level(basf2.LogLevel.ERROR)
52basf2.conditions.disable_globaltag_replay()
53basf2.set_random_seed(
"something important")
56basf2.logging.set_info(basf2.LogLevel.FATAL, basf2.logging.get_info(basf2.LogLevel.ERROR))
58input_file = basf2.find_file(
'framework/tests/root_input.root')
60with clean_working_directory():
63 main.add_module(
'RootInput', inputFileName=input_file)
64 main.add_module(
'EventInfoPrinter')
65 main.add_module(
'PrintCollections')
66 main.add_module(
'PruneDataStore', matchEntries=[
'PXDClusters.*'])
67 main.add_module(
'PrintCollections')
71 main.add_module(
'RootOutput', outputFileName=
'prune_datastore_output_test.root', updateFileCatalog=
False)
79 main.add_module(
'RootInput', inputFileName=input_file)
80 main.add_module(
'EventInfoPrinter')
81 main.add_module(
'PrintCollections')
82 main.add_module(
'PruneDataStore', matchEntries=[
'PXDClusters.*'], keepMatchedEntries=
False)
83 main.add_module(
'PrintCollections')
87 main.add_module(
'RootOutput', outputFileName=
'prune_datastore_output_test.root', updateFileCatalog=
False)
95 main.add_module(
'RootInput', inputFileName=input_file)
96 main.add_module(
'EventInfoPrinter')
97 main.add_module(
'PrintCollections')
98 main.add_module(
'PruneDataStore', matchEntries=[
'[a-b][a'], keepMatchedEntries=
False)
99 main.add_module(
'PrintCollections')
102 assert(
not safe_process(main) == 0)
A (simplified) python wrapper for StoreArray.
a (simplified) python wrapper for StoreObjPtr.
def __init__(self, is_inverted)
_is_inverted
variable to remember if we test for existence or absence