Belle II Software  release-08-01-10
SVDShaperDigitsOrderingTest.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 
19 
20 import basf2 as b2
21 from ROOT import Belle2
22 
23 
24 class testSVDShaperDigitOrdering(b2.Module):
25 
26  """Module to check SVDShaperDigit ordering."""
27 
28  def __init__(self):
29  '''initialize'''
30 
31  super().__init__()
32 
33  def event(self):
34  ''' print shaper digits '''
35 
36  sds = Belle2.PyStoreArray('SVDShaperDigits')
37 
38  print('NEW EVENT!')
39  print('layer ladder sensor side strip')
40 
41  for sd in sds:
42  sensor = sd.getSensorID()
43  side = 'V'
44  if(sd.isUStrip()):
45  side = 'U'
46 
47  print(str(sensor.getLayerNumber()) + ' ' + str(sensor.getLadderNumber()) + ' ' +
48  str(sensor.getSensorNumber()) + ' ' + side + ' ' + str(sd.getCellID()))
49 
50 
51 main = b2.create_path()
52 
53 '''
54 # to run on 2017 testbeam data
55 main.add_module('RootInput', branchNames='RawSVDs')
56 main.add_module('Gearbox', fileName='testbeam/vxd/2017_geometry_1.xml')
57 main.add_module('Geometry')
58 main.add_module('SVDUnpacker', xmlMapFileName='testbeam/vxd/data/2017_svd_mapping.xml', GenerateShaperDigits=True, shutUpFTBError=1)
59 '''
60 
61 main.add_module('EventInfoSetter')
62 main.add_module('EventInfoPrinter')
63 main.add_module('EvtGenInput')
64 main.add_module('Gearbox')
65 main.add_module('Geometry', components=['SVD'])
66 main.add_module('FullSim')
67 main.add_module('SVDDigitizer', GenerateShaperDigits=False)
68 main.add_module('SVDPacker')
69 main.add_module('SVDUnpacker', GenerateShaperDigits=True)
70 
71 # TEST MODULE
72 main.add_module(testSVDShaperDigitOrdering())
73 
74 # Process events
75 b2.process(main)
76 
77 # Print call statistics
78 print(b2.statistics)
A (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:72