Belle II Software development
output_udst.py
1#!/usr/bin/env python3
2
3
10
11"""Tests udst creation with background BGx1 MC"""
12
13
14import basf2 as b2
15import b2test_utils as b2tu
16import modularAnalysis as ma
17import udst
18
19
20def create_udst():
21 """Create a udst with one event in it."""
22 pa = b2.create_path()
23 ma.inputMdst(b2.find_file("analysis/tests/mdst.root"), path=pa)
24 ma.fillParticleList("pi+:all", "", path=pa)
25 udst.add_udst_output(path=pa, filename="test.udst.root", particleLists=["pi+:all"])
26 b2tu.safe_process(pa, 1)
27 return
28
29
30def test_read_udst():
31 """Check that the udst contains the particles storearray"""
32 pa = b2.create_path()
33 ma.inputMdst("test.udst.root", path=pa)
34 ma.printDataStore(path=pa)
35 b2tu.safe_process(path=pa)
36 return
37
38
39if __name__ == "__main__":
40 with b2tu.clean_working_directory():
41 create_udst()
42 test_read_udst()
def add_udst_output(path, filename, particleLists=None, additionalBranches=None, dataDescription=None, mc=True)
Definition: udst.py:27