Belle II Software development
dumpSensorInfoParameters.py
1#!/usr/bin/env python3
2
3
10
11import basf2 as b2
12from ROOT import Belle2
13import ROOT as r
14
15
24
25
26class printVelocity(b2.Module):
27 """ print velocity """
28
29 def beginRun(self):
30 """do everything here"""
31
33
34 layer = 3
35 ladder = 1
36 sensor = 1
37 vxdID = Belle2.VxdID(layer, ladder, sensor)
38 sensorInfo = geoCache.getSensorInfo(vxdID)
39 print('printing velocity VS thickness for' + str(layer) + '.' + str(ladder) + '.' + str(sensor))
40 thickness = sensorInfo.getThickness()
41 N = 10
42 step = thickness / N
43 for s in range(0, N + 1):
44 print()
45 z = - thickness / 2 + step * s
46 print('Z = ' + str(z * 1e4) + ' um')
47 print(' electrons')
48 sensorInfo.getVelocity(-1, r.Math.XYZVector(0, 0, z)).Print()
49 print(' holes')
50 sensorInfo.getVelocity(+1, r.Math.XYZVector(0, 0, z)).Print()
51
52
53class printMobility(b2.Module):
54 """print mobility"""
55
56 def beginRun(self):
57 """do everything here"""
59
60 layer = 3
61 ladder = 1
62 sensor = 1
63 vxdID = Belle2.VxdID(layer, ladder, sensor)
64 sensorInfo = geoCache.getSensorInfo(vxdID)
65 print('printing mobility VS thickness for' + str(layer) + '.' + str(ladder) + '.' + str(sensor))
66 thickness = sensorInfo.getThickness()
67 N = 10
68 step = thickness / N
69 for s in range(0, N + 1):
70 print()
71 z = - thickness / 2 + step * s
72 print('Z = ' + str(z * 1e4) + ' um')
73 print(' E-field')
74 sensorInfo.getEField(r.Math.XYZVector(0, 0, z)).Print()
75 print(' B-field')
76 sensorInfo.getBField(r.Math.XYZVector(0, 0, z)).Print()
77 print('electorn hall factor = ' + str(sensorInfo.getHallFactor(-1)))
78 print(' electron mobility = ' +
79 str(sensorInfo.getElectronMobility(sensorInfo.getEField(r.Math.XYZVector(0, 0, z)).Mag())))
80 print(' hole mobility = ' + str(sensorInfo.getHoleMobility(sensorInfo.getEField(r.Math.XYZVector(0, 0, z)).Mag())))
81 print('hole hall factor = ' + str(sensorInfo.getHallFactor(+1)))
82
83 print('TEMPERATURE = ' + str(sensorInfo.getTemperature))
84
85
86# add your GT here:
87# gt = ""
88# b2conditions.prepend_globaltag(gt)
89
90main = b2.create_path()
91
92eventinfosetter = b2.register_module('EventInfoSetter')
93eventinfosetter.param('expList', [1003])
94eventinfosetter.param('runList', [0])
95eventinfosetter.param('evtNumList', [1])
96main.add_module(eventinfosetter)
97
98main.add_module("Gearbox")
99main.add_module('Geometry')
100
101main.add_module(printVelocity())
102main.add_module(printMobility())
103
104b2.print_path(main)
105
106# Process events
107b2.process(main)
108
109print(b2.statistics)
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:214
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33