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