11from ROOT
import Belle2
13from svd
import add_svd_reconstruction
17 """Create SVD ShaperDigits"""
20 """digits is a list of (sensor, side, strip) for which to generate a digit"""
27 self.
samples = ROOT.array(
'unsigned char', 6)()
29 for i, sample
in zip(range(6), [0, 0, 12, 18, 12, 8]):
44 for sensor, side, strip
in self.
digits:
47 print(
'\nGenerated digits:')
49 print(
"digit: sensor %s, side %s, strip %d" %
50 (digit.getSensorID(),
'u' if digit.isUStrip()
else 'v', digit.getCellID()))
54 """Check ordering of SVD digits"""
62 new_ID = d.getUniqueChannelID()
63 if new_ID > current_ID:
66 Belle2.B2ERROR(
'Wrong ordering!')
70 """Print all SVD digits and clusters"""
77 print(
'\nSorted digits and clusters:')
79 print(
"digit: sensor %s, u-side %s, strip %d" %
80 (d.getSensorID(), d.isUStrip(), d.getCellID()))
82 print(
"cluster: sensor %s, side %s, position %d size %d" %
83 (c.getSensorID(),
'u' if c.isUCluster()
else 'v', c.getPosition(), c.getSize()))
86if __name__ ==
"__main__":
99 basf2.B2INFO(
'Test SVDShaperDigitSorter\n' +
100 'In this test, we generate some ShaperDigits in radnom order\n' +
101 'and insert them in the DataStore. Then we call shaper digit\n' +
102 'sorter module and check whether the digits are correctly sorted.\n')
104 test_ordering = basf2.create_path()
105 test_ordering.add_module(
"EventInfoSetter")
106 test_ordering.add_module(
"Gearbox")
107 test_ordering.add_module(
"Geometry", components=[
"SVD"])
109 test_ordering.add_module(
"SVDShaperDigitSorter")
110 add_svd_reconstruction(test_ordering)
115 basf2.B2INFO(f
'\nTest finished {["successfully", "with failure"][result]}.\n')
A (simplified) python wrapper for StoreArray.
Class to store SVD mode information.
The SVD ShaperDigit class.
Class to uniquely identify a any structure of the PXD and SVD.
def __init__(self, digits)
def clean_working_directory()
def safe_process(*args, **kwargs)