Belle II Software  release-08-01-10
dumpSensorInfoParameters.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 import basf2 as b2
13 from ROOT import Belle2
14 import ROOT as r
15 
16 
25 
26 
27 class printVelocity(b2.Module):
28  """ print velocity """
29 
30  def beginRun(self):
31  """do everything here"""
32 
34 
35  layer = 3
36  ladder = 1
37  sensor = 1
38  vxdID = Belle2.VxdID(layer, ladder, sensor)
39  sensorInfo = geoCache.getSensorInfo(vxdID)
40  print('printing velocity VS thickness for' + str(layer) + '.' + str(ladder) + '.' + str(sensor))
41  thickness = sensorInfo.getThickness()
42  N = 10
43  step = thickness / N
44  for s in range(0, N + 1):
45  print()
46  z = - thickness / 2 + step * s
47  print('Z = ' + str(z * 1e4) + ' um')
48  print(' electrons')
49  sensorInfo.getVelocity(-1, r.TVector3(0, 0, z)).Print()
50  print(' holes')
51  sensorInfo.getVelocity(+1, r.TVector3(0, 0, z)).Print()
52 
53 
54 class printMobility(b2.Module):
55  """print mobility"""
56 
57  def beginRun(self):
58  """do everything here"""
60 
61  layer = 3
62  ladder = 1
63  sensor = 1
64  vxdID = Belle2.VxdID(layer, ladder, sensor)
65  sensorInfo = geoCache.getSensorInfo(vxdID)
66  print('printing mobility VS thickness for' + str(layer) + '.' + str(ladder) + '.' + str(sensor))
67  thickness = sensorInfo.getThickness()
68  N = 10
69  step = thickness / N
70  for s in range(0, N + 1):
71  print()
72  z = - thickness / 2 + step * s
73  print('Z = ' + str(z * 1e4) + ' um')
74  print(' E-field')
75  sensorInfo.getEField(r.TVector3(0, 0, z)).Print()
76  print(' B-field')
77  sensorInfo.getBField(r.TVector3(0, 0, z)).Print()
78  print('electorn hall factor = ' + str(sensorInfo.getHallFactor(-1)))
79  print(' electron mobility = ' + str(sensorInfo.getElectronMobility(sensorInfo.getEField(r.TVector3(0, 0, z)).Mag())))
80  print(' hole mobility = ' + str(sensorInfo.getHoleMobility(sensorInfo.getEField(r.TVector3(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 
90 main = b2.create_path()
91 
92 eventinfosetter = b2.register_module('EventInfoSetter')
93 eventinfosetter.param('expList', [1003])
94 eventinfosetter.param('runList', [0])
95 eventinfosetter.param('evtNumList', [1])
96 main.add_module(eventinfosetter)
97 
98 main.add_module("Gearbox")
99 main.add_module('Geometry')
100 
101 main.add_module(printVelocity())
102 main.add_module(printMobility())
103 
104 b2.print_path(main)
105 
106 # Process events
107 b2.process(main)
108 
109 print(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