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