24 print(
'usage: basf2', argvs[0],
25 '-i <file_root> (pocket|local) <slot> <channel> <output_dir>')
30channel = int(argvs[3])
33print(
'data type:', datatype,
' slot:', slot,
' calibration channel:', channel,
34 ' output to:', outdir)
37b2.set_log_level(b2.LogLevel.ERROR)
40main = b2.create_path()
43roinput = b2.register_module(
'RootInput')
44main.add_module(roinput)
47if datatype ==
'pocket':
48 print(
'pocket DAQ data assumed')
49 converter = b2.register_module(
'Convert2RawDet')
50 main.add_module(converter)
53main.add_module(
'TOPGeometryParInitializer')
56unpack = b2.register_module(
'TOPUnpacker')
57main.add_module(unpack)
60converter = b2.register_module(
'TOPRawDigitConverter')
61converter.param(
'useSampleTimeCalibration',
False)
62converter.param(
'useChannelT0Calibration',
False)
63converter.param(
'useModuleT0Calibration',
False)
64converter.param(
'useCommonT0Calibration',
False)
65converter.param(
'calibrationChannel', channel)
66converter.param(
'calpulseHeightMin', 200)
67converter.param(
'calpulseHeightMax', 900)
68converter.param(
'calpulseWidthMin', 0.5)
69converter.param(
'calpulseWidthMax', 4.0)
70converter.param(
'minPulseWidth', 0.5)
71converter.param(
'lookBackWindows', 30)
72main.add_module(converter)
75calib = b2.register_module(
'TOPTimeBaseCalibrator')
76calib.param(
'moduleID', slot)
77calib.param(
'method', 1)
78calib.param(
'directoryName', outdir)
79calib.logging.log_level = b2.LogLevel.INFO
83progress = b2.register_module(
'Progress')
84main.add_module(progress)
91print(b2.statistics(b2.statistics.TERM))