Belle II Software  release-06-02-00
gen_dimuon_detectoroutput.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 import basf2 as b2
13 from generators import add_kkmc_generator
14 from simulation import add_simulation
15 from reconstruction import add_reconstruction
16 from beamparameters import add_beamparameters
17 from rawdata import add_packers, add_raw_seqoutput
18 
19 b2.set_random_seed(5433)
20 
21 b2.use_central_database('production')
22 
23 # Show the Trigger cuts and their properties that are in the database
24 # from softwaretrigger import db_access
25 #
26 # B2RESULT("Currently, there are the following cuts in the global condition database:")
27 # for base_identifier, cut_identifier in db_access.get_all_cuts_in_database():
28 # B2RESULT(base_identifier + " " + cut_identifier)
29 # cut = db_access.download_cut_from_db(base_identifier, cut_identifier, False)
30 # B2RESULT("Cut condition: " + cut.decompile())
31 # B2RESULT("Cut is a reject cut: " + str(cut.isRejectCut()))
32 
33 main = b2.create_path()
34 
35 # specify number of events to be generated
36 eventinfosetter = b2.register_module('EventInfoSetter')
37 eventinfosetter.param('evtNumList', [100])
38 eventinfosetter.param('runList', [1])
39 eventinfosetter.param('expList', [1])
40 main.add_module(eventinfosetter)
41 
42 # set the BeamParameters for running at Y(4S)
43 beamparameters = add_beamparameters(main, "Y4S")
44 
45 add_kkmc_generator(main, 'mu-mu+')
46 
47 # Print out list of generated particles to check decay is correct
48 # printMCParticles(path=main)
49 
50 # detector simulation, digitisers and clusterisers
51 add_simulation(main)
52 
53 # reconstruction for HLT
54 add_reconstruction(main)
55 
56 # pack raw data
57 add_packers(main)
58 
59 # Check what is currently in the datastore before pruning for output
60 # printDataStore(path=main)
61 
62 # SROOT raw data output
63 
64 # If you want MC Truth Relations later
65 add_raw_seqoutput(main, 'raw.sroot', additionalObjects=['SoftwareTriggerResult', 'MCParticles'])
66 # add_raw_seqoutput(main, 'raw.sroot', additionalObjects=['SoftwareTriggerResult'])
67 
68 # Go!
69 b2.process(main)
70 
71 # Print call statistics
72 print(b2.statistics)