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