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