-
Notifications
You must be signed in to change notification settings - Fork 0
/
sp.jsonnet
84 lines (72 loc) · 3.11 KB
/
sp.jsonnet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
local wc = import "wirecell.jsonnet";
local pg = import "pgraph.jsonnet";
// Signal processing.
//
// Note, spfilt are a list of filter objects which MUST match
// hard-wired names in the C++, sorry. See, eg
// pgrapher/experiment/pdsp/sp-filters.jsonnet.
function(anode, fieldresp, elecresp, spfilt, adcpermv, perchan=null) {
local apaid = anode.data.ident,
// if perchan file name is given we need to add this to a
// "uses" list and to set the name in OmnibusSigProc.
local pcresp = {
type: "PerChannelResponse",
data: {
filename: perchan
}
},
local pcname = if std.type(perchan) == 'null' then "" else wc.tn(pcresp),
local pcuses = if std.type(perchan) == 'null' then [] else [pcresp],
local sigproc = pg.pnode({
type: 'OmnibusSigProc',
name: 'sigproc%d' % apaid,
data: {
/**
* Optimized SP parameters (May 2019)
* Associated tuning in sp-filters.jsonnet
*/
anode: wc.tn(anode),
field_response: wc.tn(fieldresp),
elecresponse: wc.tn(elecresp),
ftoffset: 0.0, // default 0.0
ctoffset: 1.0*wc.microsecond, // default -8.0
per_chan_resp: pcname,
fft_flag: 0, // 1 is faster but higher memory, 0 is slightly slower but lower memory
postgain: 1.0, // default 1.2
ADC_mV: adcpermv, // 4096 / (1400.0 * wc.mV),
troi_col_th_factor: 5.0, // default 5
troi_ind_th_factor: 3.0, // default 3
lroi_rebin: 6, // default 6
lroi_th_factor: 3.5, // default 3.5
lroi_th_factor1: 0.7, // default 0.7
lroi_jump_one_bin: 1, // default 0
r_th_factor: 3.0, // default 3
r_fake_signal_low_th: 375, // default 500
r_fake_signal_high_th: 750, // default 1000
r_fake_signal_low_th_ind_factor: 1.0, // default 1
r_fake_signal_high_th_ind_factor: 1.0, // default 1
r_th_peak: 3.0, // default 3.0
r_sep_peak: 6.0, // default 6.0
r_low_peak_sep_threshold_pre: 1200, // default 1200
// frame tags
wiener_tag: 'wiener%d' % apaid,
wiener_threshold_tag: 'threshold%d' % apaid,
decon_charge_tag: 'decon_charge%d' % apaid,
gauss_tag: 'gauss%d' % apaid,
use_roi_debug_mode: false,
tight_lf_tag: 'tight_lf%d' % apaid,
loose_lf_tag: 'loose_lf%d' % apaid,
cleanup_roi_tag: 'cleanup_roi%d' % apaid,
break_roi_loop1_tag: 'break_roi_1st%d' % apaid,
break_roi_loop2_tag: 'break_roi_2nd%d' % apaid,
shrink_roi_tag: 'shrink_roi%d' % apaid,
extend_roi_tag: 'extend_roi%d' % apaid,
use_multi_plane_protection: false,
mp3_roi_tag: 'mp3_roi%d' % apaid,
mp2_roi_tag: 'mp2_roi%d' % apaid,
isWrapped: false,
// process_planes: [0, 2],
}
}, nin=1, nout=1, uses=[anode, fieldresp, elecresp] + pcuses + spfilt),
res: sigproc
}.res