25 print(
'usage: basf2', argvs[0],
26 '-i <file_root> (pocket|local) <slot> <channel> <output_dir>')
31 channel = int(argvs[3])
34 print(
'data type:', datatype,
' slot:', slot,
' calibration channel:', channel,
35 ' output to:', outdir)
38 b2.set_log_level(b2.LogLevel.ERROR)
41 main = b2.create_path()
45 roinput = b2.register_module(
'RootInput')
46 main.add_module(roinput)
49 if datatype ==
'pocket':
50 print(
'pocket DAQ data assumed')
51 converter = b2.register_module(
'Convert2RawDet')
52 main.add_module(converter)
55 main.add_module(
'TOPGeometryParInitializer')
58 unpack = b2.register_module(
'TOPUnpacker')
59 main.add_module(unpack)
62 converter = b2.register_module(
'TOPRawDigitConverter')
63 converter.param(
'useSampleTimeCalibration',
False)
64 converter.param(
'useChannelT0Calibration',
False)
65 converter.param(
'useModuleT0Calibration',
False)
66 converter.param(
'useCommonT0Calibration',
False)
67 converter.param(
'calibrationChannel', channel)
68 converter.param(
'calpulseHeightMin', 200)
69 converter.param(
'calpulseHeightMax', 900)
70 converter.param(
'calpulseWidthMin', 0.5)
71 converter.param(
'calpulseWidthMax', 4.0)
72 converter.param(
'minPulseWidth', 0.5)
73 converter.param(
'lookBackWindows', 30)
74 main.add_module(converter)
77 calib = b2.register_module(
'TOPTimeBaseCalibrator')
78 calib.param(
'moduleID', slot)
79 calib.param(
'method', 1)
80 calib.param(
'directoryName', outdir)
81 calib.logging.log_level = b2.LogLevel.INFO
82 main.add_module(calib)
85 progress = b2.register_module(
'Progress')
86 main.add_module(progress)
93 print(b2.statistics(b2.statistics.TERM))