Belle II Software  release-08-01-10
SVDChargeStudy.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 import basf2 as b2
13 import svd as svd
14 from SVDChargeSharing import SVDChargeSharing
15 b2.logging.log_level = b2.LogLevel.WARNING
16 
17 # Particle gun module
18 particlegun = b2.register_module('ParticleGun')
19 # Create Event information
20 eventinfosetter = b2.register_module('EventInfoSetter')
21 # Show progress of processing
22 progress = b2.register_module('Progress')
23 # Load parameters
24 gearbox = b2.register_module('Gearbox')
25 # Create geometry
26 geometry = b2.register_module('Geometry')
27 # RootOutput
28 output = b2.register_module('RootOutput')
29 
30 analyze = SVDChargeSharing()
31 
32 # Specify number of events to generate
33 eventinfosetter.param('evtNumList', [100000])
34 
35 # Set parameters for particlegun
36 particlegun.param({
37  'nTracks': 1,
38  'pdgCodes': [211, -211, 11, -11],
39  'momentumGeneration': 'normal',
40  'momentumParams': [3, 0.2],
41  'phiGeneration': 'uniform',
42  'phiParams': [0, 360],
43  'thetaGeneration': 'uniform',
44  'thetaParams': [89, 91],
45  'vertexGeneration': 'normal',
46  'xVertexParams': [0.0, 0.1],
47  'yVertexParams': [0.0, 0.1],
48  'zVertexParams': [0.0, 5.0]
49 })
50 
51 # Override backplane capacitances in gearbox:
52 
53 factor = 2.0
54 
55 if (factor != 1.0):
56  base_params = {
57  'Barrel': {'U': 0.12, 'V': 0.39},
58  'Layer3': {'U': 0.08, 'V': 0.26},
59  'Slanted': {'U': 0.11, 'V': 0.42}
60  }
61 
62  gearbox.param({
63  "overridePrefix": "//DetectorComponent[@name='SVD']//Components/",
64  "override": [
65  (('Sensor' if sensor == 'Layer3' else 'SensorBase') +
66  '[@type=\"' + sensor + '\"]/Active/BackplaneCapacitance' + coordinate,
67  str(factor * value), 'pF')
68  for (sensor, vals) in base_params.items() for (coordinate, value) in vals.items()
69  ],
70  })
71 
72 # create processing path
73 main = b2.create_path()
74 main.add_module(eventinfosetter)
75 main.add_module(progress)
76 main.add_module(particlegun)
77 main.add_module(gearbox)
78 main.add_module(geometry)
79 main.add_module("FullSim")
82 main.add_module(analyze)
83 
84 # generate events
85 b2.process(main)
86 
87 # show call statistics
88 print(b2.statistics)
def add_svd_simulation(path, useConfigFromDB=False, daqMode=2, relativeShift=9)
Definition: __init__.py:245
def add_svd_reconstruction(path, isROIsimulation=False, createRecoDigits=False, applyMasking=False)
Definition: __init__.py:15