Belle II Software  release-08-01-10
datconPXDDataReduction.py
1 #!/usr/bin/env python3
2 
3 
10 
11 
15 
16 import basf2 as b2
17 from simulation import add_simulation
18 from tracking import add_hit_preparation_modules
19 from datcon.datcon_functions import add_datcon
20 
21 b2.set_random_seed(1337)
22 
23 num_events = 10
24 
25 output_filename = "datconPXDDataReduction.root"
26 
27 # create path
28 main = b2.create_path()
29 
30 main.add_module("EventInfoSetter", expList=0, runList=1, evtNumList=num_events)
31 
32 # generate BBbar events
33 main.add_module('EvtGenInput')
34 
35 # detector simulation, don't perform data reduction per default, but use DATCON instead
36 add_simulation(main, bkgOverlay=False, forceSetPXDDataReduction=True, usePXDDataReduction=False, cleanupPXDDataReduction=False)
37 
38 # add DATCON simulation using the DATCON
39 add_hit_preparation_modules(main, components=["SVD"])
40 add_datcon(main)
41 
42 main.add_module('Progress')
43 
44 # Finally add output
45 main.add_module("RootOutput", outputFileName=output_filename)
46 
47 # process events and print call statistics
48 b2.process(main)
49 print(b2.statistics)