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