15 from ROOT
import Belle2
20 """A simple module to check SVD digit fits."""
22 def __init__(self, filename='dumped_digits.txt'):
23 """Initialize the module"""
40 """ Tasks at the start of a run """
43 'EventNo Layer Ladder Sensor Side StripNo TimeTrigger ' +
44 'GoodStrip Gain Noise Width TimeShift ' +
45 'Sample0 Sample1 Sample2 Sample3 Sample4 Sample5 Charge TimeFit Chi2\n')
48 """Cycle through RecoDigit/ShaperDigit pairs and dump the corresponding data"""
52 event_number = evt_info.getEvent()
53 mode_byte = svd_evt_info.getModeByte()
56 for reco_digit
in reco_digits:
58 shaper_digit = reco_digit.getRelatedTo(
'SVDShaperDigits')
63 [layer, ladder, sensor] = self.decode(reco_digit.getRawSensorID())
64 s +=
'{event} {layer} {ladder} {sensor} {side} {strip} '.format(
69 side=(
'u' if reco_digit.isUStrip()
else 'v'),
70 strip=reco_digit.getCellID()
72 sensorID = reco_digit.getSensorID()
73 stripNo = reco_digit.getCellID()
75 triggerBin = ord(mode_byte.getTriggerBin())
76 triggerTime = 0.25 * 31.44 * (-4 + triggerBin + 0.5)
77 s +=
'{trigger:.3f} '.format(trigger=triggerTime)
79 stripNoise = self.noise_cal.getNoise(sensorID, reco_digit.isUStrip(), stripNo)
80 stripGain = 22500 / self.pulse_cal.getADCFromCharge(sensorID, reco_digit.isUStrip(), stripNo, 22500)
82 stripT0 = self.pulse_cal.getPeakTime(sensorID, reco_digit.isUStrip(), stripNo)
83 stripWidth = self.pulse_cal.getWidth(sensorID, reco_digit.isUStrip(), stripNo)
84 s +=
'{mask} {gain:.3f} {noise:.3f} {width} {delay:.3f} '.format(
93 samples = shaper_digit.getSamples()
94 for iSample
in range(6):
95 s +=
'{0} '.format(samples[iSample])
98 s +=
'{amplitude:.3f} {time:.3f} {chi2:.3f}'.format(
99 amplitude=reco_digit.getCharge(),
100 time=reco_digit.getTime(),
101 chi2=reco_digit.getChi2Ndf()
108 """ Close the output file."""
112 def decode(self, vxdid):
113 """ Utility to decode sensor IDs """
117 result.append(vxdid // f)
122 def three_test(self, digit, threshold):
123 ''' 3-samples digit test '''
126 for sample
in digit.getSamples():
129 elif sample >= threshold:
133 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.