Belle II Software  release-06-01-15
event_kinematics_variables.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 """
13 a test of the EventKinematics variables using the small test file for running quickly
14 """
15 
16 import b2test_utils
17 from basf2 import set_random_seed, create_path, process
18 
19 # make logging more reproducible by replacing some strings
21 set_random_seed("1337")
22 testinput = [b2test_utils.require_file('analysis/tests/mdst.root')]
23 
24 fsps = ['pi-:all', 'gamma:all']
25 
27 testpath = create_path()
28 testpath.add_module('RootInput', inputFileNames=testinput)
29 # There is an annoying warning in ParticleLoader about zero charged tracks
30 # If it will be removed in the future releases, the test log should be
31 # updated respectively.
32 testpath.add_module('ParticleLoader', decayStrings=fsps)
33 testpath.add_module('ParticleSelector', decayString='gamma:all', cut='isFromECL')
34 
35 # Variables created by event kinematics module
36 event_kinematics = [
37  "missingMomentumOfEvent",
38  "missingMomentumOfEvent_Px",
39  "missingMomentumOfEvent_Py",
40  "missingMomentumOfEvent_Pz",
41  "missingMomentumOfEvent_theta",
42  "missingMomentumOfEventCMS",
43  "missingMomentumOfEventCMS_Px",
44  "missingMomentumOfEventCMS_Py",
45  "missingMomentumOfEventCMS_Pz",
46  "missingMomentumOfEventCMS_theta",
47  "missingEnergyOfEventCMS",
48  "missingMass2OfEvent",
49  "visibleEnergyOfEventCMS",
50  "totalPhotonsEnergyOfEvent"
51 ]
52 
53 testpath.add_module('EventKinematics', particleLists=fsps)
54 # Print the variables to log
55 testpath.add_module('ParticlePrinter', listName='', fullPrint=False,
56  variables=event_kinematics)
57 process(testpath, 1)
def configure_logging_for_tests(user_replacements=None)
Definition: __init__.py:106
def require_file(filename, data_type="", py_case=None)
Definition: __init__.py:54