3 from ROOT
import Belle2
16 """Check that SVVDShaperDigits are correctly zero-suppressed."""
19 '''initialize python module'''
28 for digit
in storedigits:
29 info = gc.get(digit.getSensorID())
30 isU = digit.isUStrip()
31 noise_in_e = info.getElectronicNoiseU()
if isU
else info.getElectronicNoiseV()
32 adu_equivalent = info.getAduEquivalentU()
if isU
else info.getAduEquivalentV()
33 noise_in_adu = noise_in_e / adu_equivalent
35 samples = digit.getSamples()
37 if s > threshold_in_adu:
40 basf2.B2FATAL(
"Found digit under threshold: {0}".format(digit.to_string()))
43 if __name__ ==
"__main__":
47 basf2.B2INFO(
'Creating simhits...')
50 create_simhits = basf2.create_path()
51 create_simhits.add_module(
'EventInfoSetter', evtNumList=[50])
52 create_simhits.add_module(
'Gearbox')
53 create_simhits.add_module(
'Geometry', components=[
'MagneticField',
'SVD'], useDB=
False)
54 create_simhits.add_module(
'ParticleGun')
55 create_simhits.add_module(
'FullSim')
56 create_simhits.add_module(
'RootOutput', outputFileName=
'SimulationForThresholdTest.root',
57 branchNames=[
'EventMetaData',
'SVDSimHits',
'SVDTrueHits'])
61 basf2.B2INFO(
'Threshold testing...')
65 test_threshold = basf2.create_path()
67 test_threshold.add_module(
'RootInput', inputFileName=
'SimulationForThresholdTest.root')
68 test_threshold.add_module(
'Gearbox')
69 test_threshold.add_module(
'Geometry', components=[
'MagneticField',
'SVD'], useDB=
False)
71 test_threshold.add_module(
'SVDDigitizer', ZeroSuppressionCut=threshold)
72 threshold_checker =
CheckZS(threshold)
73 test_threshold.add_module(threshold_checker)
77 basf2.B2INFO(
'Test done.')