Belle II Software development
dumpSimulationParameters.py
1#!/usr/bin/env python3
2
3
10
11import basf2 as b2
12from ROOT import Belle2
13
14
23
24
25class printElectronicNoise(b2.Module):
26 """ print electronic noise """
27
28 def beginRun(self):
29 """do everything here"""
30
32
33 print('printing ElectronicNoise for all ladder = 1 sensors')
34 for layer in geoCache.getLayers(Belle2.VXD.SensorInfoBase.SVD):
35 layerNumber = layer.getLayerNumber()
36 for ladder in geoCache.getLadders(layer):
37 if not ladder.getLadderNumber() == 1:
38 continue
39 for sensor in geoCache.getSensors(ladder):
40 sensorNumber = sensor.getSensorNumber()
41 print(str(layerNumber) + '.1.' + str(sensorNumber))
42 sensorInfo = geoCache.getSensorInfo(sensor)
43 print(' U-side noise = '+str(sensorInfo.getElectronicNoiseU())+' e-')
44 print(' V-side noise = '+str(sensorInfo.getElectronicNoiseV())+' e-')
45
46
47class printAduEquivalent(b2.Module):
48 """ print ADU equivalent"""
49
50 def beginRun(self):
51 """do everything here"""
53
54 print('printing AduEquivalent for all ladder = 1 sensors')
55 for layer in geoCache.getLayers(Belle2.VXD.SensorInfoBase.SVD):
56 layerNumber = layer.getLayerNumber()
57 for ladder in geoCache.getLadders(layer):
58 if not ladder.getLadderNumber() == 1:
59 continue
60 for sensor in geoCache.getSensors(ladder):
61 sensorNumber = sensor.getSensorNumber()
62 print(str(layerNumber) + '.1.' + str(sensorNumber))
63 sensorInfo = geoCache.getSensorInfo(sensor)
64 print(' U-side ADU equivalent = '+str(sensorInfo.getAduEquivalentU())+' e-/ADC')
65 print(' V-side ADU equivalent = '+str(sensorInfo.getAduEquivalentV())+' e-/ADC')
66
67
68# add your GT here:
69# gt = ""
70# b2conditions.prepend_globaltag(gt)
71
72main = b2.create_path()
73
74eventinfosetter = b2.register_module('EventInfoSetter')
75eventinfosetter.param('expList', [1003])
76eventinfosetter.param('runList', [0])
77eventinfosetter.param('evtNumList', [1])
78main.add_module(eventinfosetter)
79
80main.add_module("Gearbox")
81main.add_module('Geometry')
82
83main.add_module(printElectronicNoise())
84main.add_module(printAduEquivalent())
85
86b2.print_path(main)
87
88# Process events
89b2.process(main)
90
91print(b2.statistics)
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:214