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