Belle II Software development
CRYGenerationOnly.py
1#!/usr/bin/env python3
2
3
10
11import basf2
12
13# Set the global log level
14basf2.set_log_level(basf2.LogLevel.INFO)
15
16# Set random seed
17basf2.set_random_seed(888)
18
19main = basf2.create_path()
20
21main.add_module('EventInfoSetter',
22 evtNumList=[100], # we want to process 100 events
23 runList=[1], # from run number 1
24 expList=[0], # and experiment number 0
25 )
26
27# Register the CRY module
28cry = main.add_module('CRYInput')
29# acceptance half-lengths - at least one particle has to enter that box
30# (without simulation, based on generator kinematics only!) to use that
31# event. All values in cm
32# 1 Parameter: sphere with the given radius around the origin
33# 2 parameters: xy radius and z half-length of a cylinder along the z-axis
34# 3 parameters: x, y and z half-lengths of a box at the origin.
35cry.param('acceptance', [125, 125])
36# How many trials to generate a cosmic per event?
37cry.param('maxTrials', 100000)
38# minimal kinetic energy in GeV - all particles below that energy are ignored
39cry.param('kineticEnergyThreshold', 0.01)
40
41main.add_module('Progress')
42main.add_module('RootOutput', outputFileName='./cry-outfile-test.root')
43# uncomment the following line if you want event by event info
44main.add_module("PrintMCParticles", logLevel=basf2.LogLevel.DEBUG, onlyPrimaries=False)
45
46# generate events
47basf2.process(main)
48
49# show call statistics
50print(basf2.statistics)