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