Belle II Software  release-05-02-19
TestStdV0 Class Reference
Inheritance diagram for TestStdV0:
Collaboration diagram for TestStdV0:

Public Member Functions

def test_stdkshorts_list (self)
 
def test_belle_list (self)
 
def test_stdlambdas_list (self)
 

Private Member Functions

def _check_list (self, std_function=stdV0s.stdKshorts, expected_modules=["ParticleLoader", "TreeFitter", "ParticleSelector", "ParticleLoader", "ParticleCombiner", "TreeFitter", "ParticleSelector", "ParticleListManipulator"], expected_lists=['V0', 'all', 'RD', 'merged'])
 

Detailed Description

Test case for standard V0 lists

Definition at line 9 of file test_std_v0.py.

Member Function Documentation

◆ _check_list()

def _check_list (   self,
  std_function = stdV0s.stdKshorts,
  expected_modules = [                 "ParticleLoader",                 "TreeFitter",                 "ParticleSelector",                 "ParticleLoader",                 "ParticleCombiner",                 "TreeFitter",                 "ParticleSelector",                 "ParticleListManipulator"],
  expected_lists = ['V0', 'all', 'RD', 'merged'] 
)
private
check that a given function works

Definition at line 12 of file test_std_v0.py.

12  def _check_list(
13  self,
14  std_function=stdV0s.stdKshorts,
15  expected_modules=[
16  "ParticleLoader",
17  "TreeFitter",
18  "ParticleSelector",
19  "ParticleLoader",
20  "ParticleCombiner",
21  "TreeFitter",
22  "ParticleSelector",
23  "ParticleListManipulator"],
24  expected_lists=['V0', 'all', 'RD', 'merged']):
25  """check that a given function works"""
26  testpath = create_path()
27  std_function(path=testpath)
28 
29  # verify that we load the correct amount of modules
30  self.assertEqual(
31  len(testpath.modules()), len(expected_modules),
32  "Function %s does not load the expected number of modules" % (std_function.__name__))
33 
34  #
35  loaded_modules = []
36  built_lists = []
37  for module in testpath.modules():
38  loaded_modules.append(module.type())
39  for param in module.available_params():
40  if module.type() == 'ParticleLoader' and param.name == 'decayStringsWithCuts':
41  name = param.values[0][0].split(':')[1].split(' -> ')[0]
42  built_lists.append(name)
43  if module.type() == 'ParticleListManipulator' and param.name == 'outputListName':
44  name = str(param.values).split(':')[1].split(' -> ')[0]
45  built_lists.append(name)
46  if module.type() == 'ParticleCombiner' and param.name == 'decayString':
47  name = param.values.split(':')[1].split(' -> ')[0]
48  built_lists.append(name)
49 
50  # we have the modules we expect
51  for a, b in zip(loaded_modules, expected_modules):
52  self.assertEqual(a, b, "Loaded module \'%s\' instead of \'%s\' with function %s" % (a, b, std_function.__name__))
53 
54  # we have the particle lists we expect
55  for a, b in zip(built_lists, expected_lists):
56  self.assertEqual(a, b, "Loaded list \'%s\' instead of \'%s\' with function %s" % (a, b, std_function.__name__))
57 

◆ test_belle_list()

def test_belle_list (   self)
check that the builder function works with the legacy Belle Kshorts list

Definition at line 62 of file test_std_v0.py.

◆ test_stdkshorts_list()

def test_stdkshorts_list (   self)
check that the builder function works with the stdKshorts list

Definition at line 58 of file test_std_v0.py.

◆ test_stdlambdas_list()

def test_stdlambdas_list (   self)
check that the builder function works with the stdLambdas list

Definition at line 69 of file test_std_v0.py.


The documentation for this class was generated from the following file: