14from ROOT
import Belle2
19 """A simple module to check SVD digit fits."""
21 def __init__(self, filename='dumped_digits.txt'):
22 """Initialize the module"""
39 """ Tasks at the start of a run """
42 'EventNo Layer Ladder Sensor Side StripNo TimeTrigger ' +
43 'GoodStrip Gain Noise Width TimeShift ' +
44 'Sample0 Sample1 Sample2 Sample3 Sample4 Sample5 Charge TimeFit Chi2\n')
47 """Cycle through RecoDigit/ShaperDigit pairs and dump the corresponding data"""
51 event_number = evt_info.getEvent()
52 mode_byte = svd_evt_info.getModeByte()
55 for reco_digit
in reco_digits:
57 shaper_digit = reco_digit.getRelatedTo(
'SVDShaperDigits')
62 [layer, ladder, sensor] = self.decode(reco_digit.getRawSensorID())
63 s += f
'{event_number} {layer} {ladder} {sensor} {"u" if reco_digit.isUStrip() else "v"} {reco_digit.getCellID()} '
64 sensorID = reco_digit.getSensorID()
65 stripNo = reco_digit.getCellID()
67 triggerBin = ord(mode_byte.getTriggerBin())
68 triggerTime = 0.25 * 31.44 * (-4 + triggerBin + 0.5)
69 s += f
'{triggerTime:.3f} '
71 stripNoise = self.noise_cal.getNoise(sensorID, reco_digit.isUStrip(), stripNo)
72 stripGain = 22500 / self.pulse_cal.getADCFromCharge(sensorID, reco_digit.isUStrip(), stripNo, 22500)
74 stripT0 = self.pulse_cal.getPeakTime(sensorID, reco_digit.isUStrip(), stripNo)
75 stripWidth = self.pulse_cal.getWidth(sensorID, reco_digit.isUStrip(), stripNo)
76 s += f
'{"y"} {stripGain:.3f} {stripNoise:.3f} {stripWidth} {stripT0:.3f} '
79 samples = shaper_digit.getSamples()
80 for iSample
in range(6):
81 s += f
'{samples[iSample]} '
84 s += f
'{reco_digit.getCharge():.3f} {reco_digit.getTime():.3f} {reco_digit.getChi2Ndf():.3f}'
89 """ Close the output file."""
93 def decode(self, vxdid):
94 """ Utility to decode sensor IDs """
98 result.append(vxdid // f)
103 def three_test(self, digit, threshold):
104 ''' 3-samples digit test '''
107 for sample
in digit.getSamples():
110 elif sample >= threshold:
114 return (counter >= 3)
A (simplified) python wrapper for StoreArray.
a (simplified) python wrapper for StoreObjPtr.
This class defines the dbobject and the method to access SVD calibrations from the noise local runs.
This class defines the dbobject and the methods to access the SVD calibrations from the local runs pr...
static GeoCache & getInstance()
Return a reference to the singleton instance.
def __init__(self, filename='dumped_digits.txt')
vxdid_factors
Factors for decoding VXDId's.
outfile
Input file object.