Belle II Software development
SVDVariablesToStorageModuleTests.py
1#!/usr/bin/env python3
2
3
10
11import unittest
12import b2test_utils
13import b2test_utils_analysis
14import modularAnalysis as ma
15from basf2 import create_path, set_random_seed
16
17
18class SVDVariablesToStorageModuleTests(unittest.TestCase):
19 """The unit test for SVDVariablesToStorageModule"""
20
21 def test(self):
22 """ Test of SVDVariablesToStorageModule """
23
24 set_random_seed("something important")
25
27
28 main = create_path()
29
30 input_file = b2test_utils.require_file('SVDClusters.root', 'validation')
31 ma.inputMdst(input_file, path=main)
32
33 ma.fillParticleList("pi+:all", "", path=main)
34
35 variablesToNtuple = ["SVDClusterCharge", "SVDClusterSNR", "SVDClusterSize", "SVDClusterTime",
36 "SVDTrackPrime", "SVDResidual", "SVDLayer", "SVDLadder", "SVDSensor", "SVDSide"]
37
38 main.add_module("SVDVariablesToStorage",
39 outputFileName="SVDVariablesToStorageModuleTests.root",
40 containerName="SVDClusterVariables",
41 particleListName="pi+:all",
42 variablesToNtuple=variablesToNtuple)
44 b2test_utils_analysis.scanTTree("SVDVariablesToStorageModuleTests.root")
45 print("Test passed. Cleaning up.")
46
47
48if __name__ == '__main__':
50 unittest.main()
clean_working_directory()
Definition __init__.py:198
configure_logging_for_tests(user_replacements=None, replace_cdb_provider=True)
Definition __init__.py:106
require_file(filename, data_type="", py_case=None)
Definition __init__.py:54
safe_process(*args, **kwargs)
Definition __init__.py:245