Belle II Software development
Herwig.py
1#!/usr/bin/env python3
2
3
10
11'''
12Example: Herwig continuum generator (ccbar production) using
13`add_herwig_continuum_generator` from the `herwig` module.
14
15Usage
16-----
17 basf2 Herwig.py -n 1000 # Y(4S), default conditions (exp 0, run 0)
18 basf2 Herwig.py --experiment 12 --run 798 -n 1000 # per-run beam energy; global tags required
19
20All CLI flags (--experiment, --run and -n) are automatically forwarded to add_herwig_continuum_generator().
21
22For use without CLI flags, pass the experiment, run, and event number to
23both EventInfoSetter and add_herwig_continuum_generator() explicitly.
24'''
25
26import basf2 as b2
27from herwig import add_herwig_continuum_generator
28
29main = b2.create_path()
30
31main.add_module('EventInfoSetter',
32 # expList=[exp],
33 # runList=[run],
34 # evtNumList=[nevents],
35 )
36
37add_herwig_continuum_generator(path=main, finalstate='ccbar',
38 # expList=[exp],
39 # runList=[run],
40 # nevents=nevents,
41 )
42
43main.add_module('Progress')
44# main.add_module('RootOutput', outputFileName='herwig_ccbar.root')
45# main.add_module('PrintMCParticles', logLevel=b2.LogLevel.DEBUG, onlyPrimaries=False)
46
47b2.process(main, calculateStatistics=True)
48print(b2.statistics)