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