Belle II Software  release-05-01-25
EclDataAnalysis.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
13 
14 # import os
15 # import random
16 from basf2 import *
17 import glob
18 from ROOT import Belle2
19 from modularAnalysis import *
20 from simulation import add_simulation
21 from reconstruction import add_reconstruction
22 from beamparameters import add_beamparameters
23 
24 # Create paths
25 main = create_path()
26 
27 # Event setting and info
28 eventinfosetter = register_module('EventInfoSetter')
29 eventinfosetter.param({'evtNumList': [100], 'runList': [1]})
30 main.add_module(eventinfosetter)
31 
32 # random number for generation
33 import random
34 intseed = random.randint(1, 1)
35 
36 # generator settings
37 pGun = register_module('ParticleGun')
38 param_pGun = {
39  'pdgCodes': [13],
40  'nTracks': 1,
41  'momentumGeneration': 'fixed',
42  'momentumParams': [0.5],
43  'thetaGeneration': 'uniform',
44  'thetaParams': [0., 30.],
45  'phiGeneration': 'uniform',
46  'phiParams': [0., 360.],
47  'vertexGeneration': 'uniform',
48  'xVertexParams': [0.0, 0.0],
49  'yVertexParams': [0.0, 0.0],
50  'zVertexParams': [0.0, 0.0],
51 }
52 pGun.param(param_pGun)
53 main.add_module(pGun)
54 
55 # bkg = glob.glob(os.environ['BELLE2_BACKGROUND_DIR']+'*.root')
56 
57 add_simulation(main)
58 add_reconstruction(main)
59 
60 # display = register_module('Display')
61 # main.add_module(display)
62 
63 # eclDataAnalysis module
64 ecldataanalysis = register_module('ECLDataAnalysis')
65 ecldataanalysis.param('rootFileName', 'EclDataAnalysis_Test.root')
66 ecldataanalysis.param('doTracking', 1)
67 ecldataanalysis.param('doPureCsIStudy', 0)
68 main.add_module(ecldataanalysis)
69 
70 process(main)
71 print(statistics)