5. Belle II Python Interface#
The Belle II Software has an extensive interface to the Python 3 scripting
language: All configuration and steering is done via python and in principle
also simple algorithms can be implemented directly in python. All main
functions are implemented in a module called basf2
and most people will just
start their steering file or script with
import basf2
main = basf2.Path()
- 5.1. Modules and Paths
- 5.2. Logging
- 5.3. Module Statistics
- 5.4. Conditions Database
- 5.5. Additional Functions
- 5.6. Other Modules
- 5.6.1. basf2.utils - Helper functions for printing basf2 objects
get_terminal_width()
is_mod_function()
list_functions()
pretty_print_description_list()
pretty_print_module()
pretty_print_table()
print_all_modules()
print_params()
print_path()
- 5.6.2. basf2.pickle_path - Functions necessary to pickle and unpickle a Path
check_pickle_path()
deserialize_conditions()
deserialize_module()
deserialize_path()
deserialize_value()
get_path_from_file()
make_code_pickable()
serialize_conditions()
serialize_module()
serialize_path()
serialize_value()
write_path_to_file()
- 5.6.3. B2Tools
- 5.6.4. b2test_utils - Helper functions useful for test scripts
check_error_free()
clean_working_directory()
configure_logging_for_tests()
get_object_with_name()
get_streamer_checksums()
is_ci()
local_software_directory()
print_belle2_environment()
require_file()
run_in_subprocess()
safe_process()
set_loglevel()
show_only_errors()
skip_test()
skip_test_if_light()
temporary_set_environment()
working_directory()
- 5.6.5. conditions_db
BearerAuth
ConditionsDB
PayloadInformation
chunks()
enable_debugging()
encode_name()
file_checksum()
get_cdb_authentication_token()
require_database_for_test()
set_cdb_authentication_token()
- 5.6.6. conditions_db.iov
IntervalOfValidity
IoVSet
- 5.6.7. hep_ipython_tools
IPythonHandler
handler
- 5.6.8. iov_conditional - Functions to Execute Paths Depending on Experiment Phases
PHASE2_IOVS
make_conditional_at()
phase_2_conditional()
- 5.6.9. pdg - access particle definitions
add_particle()
conjugate()
from_name()
from_names()
get()
load()
load_default()
search()
to_name()
to_names()
- 5.6.10. rundb - Helper classes for retrieving information from the RunDB
RunDB
- 5.6.11. terminal_utils - Helper functions for input from/output to a terminal
ANSIColors
InputEditor
Pager