# 8. Background module¶

background.add_output(path, bgType, realTime, sampleType, phase=3, fileName='output.root', excludeBranches=[])[source]

A function to be used for output of BG simulation.

Parameters
• path – path name

• bgType – background type, to get available types: basf2 -m BeamBkgTagSetter

• realTime – equivalent time of superKEKB running in [ns]

• sampleType – ‘study’ (for BG studies) or ‘usual’, ‘PXD’, ‘ECL’ (for BG mixer)

• specify – the Phase, 1 for Phase 1, 2 for Phase 2, and 3 for Physics Run or Phase 3

• fileName – optional file name, can be overridden by basf2 -o

background.get_background_files(folder=None, output_file_info=True)[source]

Loads the location of the background files from the environmant variable BELLE2_BACKGROUND_DIR which is set on the validation server and ensures that background files exist and returns the list of background files which can be directly used with add_simulation() :

>>> add_simulation(main, bkgfiles=background.get_background_files())


Will fail with an assert if no background folder set or if no background file was found in the set folder.

Parameters
• folder (str) – A specific folder to search for background files can be given as an optional parameter

• output_file_info (str) – If true, a list of the found background files and there size will be printed This is useful to understand later which background campaign has been used to simulate events.