diff --git a/README.md b/README.md index 27e31f144eed97af68d48e513f14646379cf0839..24e6c030ae6465e78dc7ba2f461f4d022039a5a2 100644 --- a/README.md +++ b/README.md @@ -5,14 +5,15 @@ Just a YAML and some conviniece functions, to manage multiple beambackgrounds fo The YAML maps beambackgroundfiles to different locations and adds some metadata. ## Installation -1. Get repo. +1. Clone the repository. 2. Set the `BEAMBACKGROUND_JSON` enviroment variable. For ETP this is `/work/jeppelt/etpackground/beambackgrounds.json` - If you are not running at ETP, you are responsible to keep the JSON file up to date. - ## Usage ### A single package of beambackgrounds + +``` import basf2 as b2 import simulation as si import os @@ -25,34 +26,37 @@ for gt in bbs.global_tags: print(gt) b2.conditions.append_globaltag(gt) -path = b2.create_path() +path = b2.Path() -evt_info = b2.register_module('EventInfoSetter', - evtNumList= [10], - expList=bbs.expList, - runList=bbs.run, +path.add_module('EventInfoSetter', + evtNumList= [10], + expList=bbs.expList, + runList=bbs.run ) -path.add_module(evt_info) -si.add_simulation(path, bkgfiles=bbs.get_file_list("ceph")) +si.add_simulation(path, + bkgfiles=bbs.get_file_list("ceph") +) path.add_module("Progress") b2.process(path) ``` ### Running in different places + Currently files can be read from these three locations: - KEKCC (only if on KEKCC), use `kek` keyword - Ceph@ETP (only if on ETP), use `ceph` keyword - ETP Belle2 Storage @ GridKA (only if `X509_USER_PROXY` is set), use `gridka` keyword - ### Example -```python + +Python: +``` beambackgrounds = get_beam_background_by_key("experiment22_run30") add_simulation(basf2_path, bkgfiles=beambackgrouns.gridka_file_list) - ``` ### Editing the JSON file -To update entries in the json file or add new entries, you simply create an `BeambackgroundMetadata` with the desired values. Then call its `update_json_entry` function. Be aware, that this will update the JSON file for everybody, so update with care. If you want to have a special version of a certain entry, create a new entry by setting the `key` property. \ No newline at end of file + +To update entries in the json file or add new entries, you simply create a `BeambackgroundMetadata` instance with the desired values. Then call its `update_json_entry` function. Be aware, that this will update the JSON file for everybody, so update with care. If you want to have a special version of a certain entry, create a new entry by setting the `key` property. \ No newline at end of file