Belle II Software  release-06-01-15
rawdata_simulation.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 # Usage:
13 # basf2 rawdata_simulation.py -o outputfilename.sroot
14 
15 
16 import basf2
17 
18 from simulation import add_simulation
19 from softwaretrigger import constants
20 
21 from rawdata import add_packers
22 
23 # You could use your own components here or just use the default for the HLT (everything except PXD)
24 # e.g. without SVD
25 # components = ["CDC", "ECL", "TOP", "ARICH", "KLM"]
26 # if you leave out the components in all calls, the default will be used
27 components = constants.DEFAULT_HLT_COMPONENTS
28 
29 main_path = basf2.create_path()
30 
31 main_path.add_module("EventInfoSetter", evtNumList=[10])
32 main_path.add_module("EvtGenInput")
33 
34 add_simulation(main_path, components)
35 add_packers(main_path, components=components)
36 
37 main_path.add_module("SeqRootOutput",
38  outputFileName="hlt_rawdata_simulation.sroot",
39  saveObjs=["EventMetaData"] + constants.RAWDATA_OBJECTS)
40 
41 basf2.print_path(main_path)
42 basf2.process(main_path)
43 
44 print(basf2.statistics)