Belle II Software development
ECLMuon.py
1#!/usr/bin/env python3
2
3
10
11
17
18"""
19<header>
20<output>ECLMuonOutput.root</output>
21<contact>Priyanka Cheema, pche3675@uni.sydney.edu.au</contact>
22</header>
23"""
24
25import os
26import glob
27import basf2 as b2
28from simulation import add_simulation
29from reconstruction import add_reconstruction
30
31# Create paths
32main = b2.create_path()
33
34# Event setting and info
35eventinfosetter = b2.register_module('EventInfoSetter')
36eventinfosetter.param({'evtNumList': [1000], 'runList': [1]})
37main.add_module(eventinfosetter)
38
39# Fixed random seed
40b2.set_random_seed(123456)
41
42# single particle generator settings
43pGun = b2.register_module('ParticleGun')
44param_pGun = {
45 'pdgCodes': [13],
46 'nTracks': 1,
47 'momentumGeneration': 'uniform',
48 'momentumParams': [0.5, 3],
49 'thetaGeneration': 'uniform',
50 'thetaParams': [13., 155.],
51 'phiGeneration': 'uniform',
52 'phiParams': [0, 360],
53 'vertexGeneration': 'uniform',
54 'xVertexParams': [0.0, 0.0],
55 'yVertexParams': [0.0, 0.0],
56 'zVertexParams': [0.0, 0.0],
57}
58
59pGun.param(param_pGun)
60main.add_module(pGun)
61
62if 'BELLE2_BACKGROUND_DIR' in os.environ:
63 bg = glob.glob(os.environ['BELLE2_BACKGROUND_DIR'] + '/*.root')
64 b2.B2INFO('Using background samples from ' +
65 os.environ['BELLE2_BACKGROUND_DIR'])
66else:
67 b2.B2FATAL('Environment variable BELLE2_BACKGROUND_DIR is not set.')
68
69add_simulation(main, bkgfiles=bg)
70add_reconstruction(main)
71
72# eclDataAnalysis module
73ecldataanalysis = b2.register_module('ECLDataAnalysis')
74ecldataanalysis.param('rootFileName', '../ECLMuonOutput.root')
75ecldataanalysis.param('doTracking', 1)
76main.add_module(ecldataanalysis)
77
78main.add_module('Progress')
79b2.process(main)
80# print(statistics)