Skip to content

Commit 1e9a0fd

Browse files
authored
Merge pull request #429 from SBNSoftware/feature/lynnt_wirecell_cfgs
Add Signal Processing only fcl + configuration
2 parents 397c72e + 3381f16 commit 1e9a0fd

6 files changed

Lines changed: 167 additions & 383 deletions

File tree

sbndcode/WireCell/cfg/pgrapher/experiment/sbnd/wcls-nf-sp.jsonnet

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,32 @@
2323
local epoch = std.extVar('epoch'); // eg "dynamic", "after", "before", "perfect"
2424
local reality = std.extVar('reality');
2525
local sigoutform = std.extVar('signal_output_form'); // eg "sparse" or "dense"
26-
27-
28-
local wc = import 'wirecell.jsonnet';
29-
local g = import 'pgraph.jsonnet';
30-
3126
local raw_input_label = std.extVar('raw_input_label'); // eg "daq"
3227

28+
local g = import 'pgraph.jsonnet';
29+
local f = import 'pgrapher/experiment/sbnd/funcs.jsonnet';
30+
local wc = import 'wirecell.jsonnet';
31+
local tools_maker = import 'pgrapher/common/tools.jsonnet';
3332

3433
local data_params = import 'params.jsonnet';
3534
local simu_params = import 'simparams.jsonnet';
3635
local params = if reality == 'data' then data_params else simu_params;
3736

38-
39-
local tools_maker = import 'pgrapher/common/tools.jsonnet';
4037
local tools = tools_maker(params);
38+
local nanodes = std.length(tools.anodes);
39+
local anode_iota = std.range(0, nanodes - 1);
40+
41+
local mega_anode = {
42+
type: 'MegaAnodePlane',
43+
name: 'meganodes',
44+
data: {
45+
anodes_tn: [wc.tn(anode) for anode in tools.anodes],
46+
},
47+
};
4148

4249
local wcls_maker = import 'pgrapher/ui/wcls/nodes.jsonnet';
4350
local wcls = wcls_maker(params, tools);
4451

45-
local sp_maker = import 'pgrapher/experiment/sbnd/sp.jsonnet';
46-
47-
4852
// Collect the WC/LS input converters for use below. Make sure the
4953
// "name" argument matches what is used in the FHiCL that loads this
5054
// file. In particular if there is no ":" in the inputer then name
@@ -65,13 +69,7 @@ local wcls_input = {
6569
// Collect all the wc/ls output converters for use below. Note the
6670
// "name" MUST match what is used in theh "outputers" parameter in the
6771
// FHiCL that loads this file.
68-
local mega_anode = {
69-
type: 'MegaAnodePlane',
70-
name: 'meganodes',
71-
data: {
72-
anodes_tn: [wc.tn(anode) for anode in tools.anodes],
73-
},
74-
};
72+
7573
local wcls_output = {
7674
// The noise filtered "ADC" values. These are truncated for
7775
// art::Event but left as floats for the WCT SP. Note, the tag
@@ -99,38 +97,28 @@ local wcls_output = {
9997
type: 'wclsFrameSaver',
10098
name: 'spsaver',
10199
data: {
102-
// anode: wc.tn(tools.anode),
103100
anode: wc.tn(mega_anode),
104101
digitize: false, // true means save as RawDigit, else recob::Wire
105102
frame_tags: ['gauss', 'wiener'],
106103

107104
// this may be needed to convert the decon charge [units:e-] to be consistent with the LArSoft default ?unit? e.g. decon charge * 0.005 --> "charge value" to GaussHitFinder
108105
frame_scale: [0.02, 0.02],
109-
nticks: params.daq.nticks,
106+
nticks: params.daq.nticks,
110107
chanmaskmaps: [],
111-
//nticks: ,
112108
},
113109
}, nin=1, nout=1, uses=[mega_anode]),
114110
};
115111

116-
117112
local perfect = import 'pgrapher/experiment/sbnd/chndb-perfect.jsonnet';
118-
//local base = import 'chndb-base_sbnd.jsonnet';
113+
//local base = import 'pgrapher/experiment/sbnd/chndb-base_sbnd.jsonnet';
119114

120115
local chndb = [{
121116
type: 'OmniChannelNoiseDB',
122117
name: 'ocndbperfect%d' % n,
123118
data: perfect(params, tools.anodes[n], tools.field, n){dft:wc.tn(tools.dft)},
124119
// data: base(params, tools.anodes[n], tools.field, n){dft:wc.tn(tools.dft)},
125120
uses: [tools.anodes[n], tools.field, tools.dft],
126-
} for n in std.range(0, std.length(tools.anodes) - 1)];
127-
128-
129-
local nf_maker = import 'pgrapher/experiment/sbnd/nf.jsonnet';
130-
local nf_pipes = [nf_maker(params, tools.anodes[n], chndb[n], n, name='nf%d' % n) for n in std.range(0, std.length(tools.anodes) - 1)];
131-
132-
local sp = sp_maker(params, tools, { sparse: sigoutform == 'sparse' });
133-
local sp_pipes = [sp.make_sigproc(a) for a in tools.anodes];
121+
} for n in anode_iota];
134122

135123
local chsel_pipes = [
136124
g.pnode({
@@ -144,6 +132,13 @@ local chsel_pipes = [
144132
for n in std.range(0, std.length(tools.anodes) - 1)
145133
];
146134

135+
local nf_maker = import 'pgrapher/experiment/sbnd/nf.jsonnet';
136+
local nf_pipes = [nf_maker(params, tools.anodes[n], chndb[n], n, name='nf%d' % n) for n in std.range(0, std.length(tools.anodes) - 1)];
137+
138+
local sp_maker = import 'pgrapher/experiment/sbnd/sp.jsonnet';
139+
local sp = sp_maker(params, tools, { sparse: sigoutform == 'sparse' });
140+
local sp_pipes = [sp.make_sigproc(a) for a in tools.anodes];
141+
147142
local magoutput = 'sbnd-data-check.root';
148143
local magnify = import 'pgrapher/experiment/sbnd/magnify-sinks.jsonnet';
149144
local sinks = magnify(tools, magoutput);
@@ -165,7 +160,6 @@ local nfsp_pipes = [
165160
for n in std.range(0, std.length(tools.anodes) - 1)
166161
];
167162

168-
local f = import 'pgrapher/experiment/sbnd/funcs.jsonnet';
169163
local fanpipe = f.fanpipe('FrameFanout', nfsp_pipes, 'FrameFanin', 'sn_mag_nf');
170164

171165
local retagger = g.pnode({

sbndcode/WireCell/cfg/pgrapher/experiment/sbnd/wcls-sim-drift-depoflux-nf-sp.jsonnet

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ local sim = sim_maker(params, tools);
3737
local nanodes = std.length(tools.anodes);
3838
local anode_iota = std.range(0, nanodes - 1);
3939

40+
local mega_anode = {
41+
type: 'MegaAnodePlane',
42+
name: 'meganodes',
43+
data: {
44+
anodes_tn: [wc.tn(anode) for anode in tools.anodes],
45+
},
46+
};
47+
4048
local wcls_maker = import "pgrapher/ui/wcls/nodes.jsonnet";
4149
local wcls = wcls_maker(params, tools);
4250

@@ -58,13 +66,7 @@ local wcls_input_sim = {
5866
// Collect all the wc/ls output converters for use below. Note the
5967
// "name" MUST match what is used in theh "outputers" parameter in the
6068
// FHiCL that loads this file.
61-
local mega_anode = {
62-
type: 'MegaAnodePlane',
63-
name: 'meganodes',
64-
data: {
65-
anodes_tn: [wc.tn(anode) for anode in tools.anodes],
66-
},
67-
};
69+
6870
local wcls_output_sim = {
6971
// ADC output from simulation
7072
// sim_digits: wcls.output.digits(name="simdigits", tags=["orig"]),

sbndcode/WireCell/wcsimsp_sbnd.fcl

Lines changed: 80 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,99 @@
11
BEGIN_PROLOG
22

3-
sbnd_wcls_simsp: {
3+
sbnd_wcls: {
44
module_type : WireCellToolkit
55
wcls_main: {
6+
tool_type: "WCLS"
67
apps: ["TbbFlow"]
78

89
## Uncomment the following lines for debugging
910
# loglevels: ["debug", "pgraph:info"]
1011
# logsinks: ["stdout"]
1112

12-
## Libraries in which to look for WCT components
13-
plugins: ["WireCellGen", "WireCellSigProc", "WireCellRoot", "WireCellPgraph", "WireCellLarsoft", "WireCellTbb"]
14-
15-
## The tool marshals the art::Event to these visitors before.
16-
## See notes below in params.
17-
18-
inputers: ["wclsSimDepoSetSource:"]
19-
20-
outputers: [
21-
"wclsDepoFluxWriter:postdrift",
22-
# "wclsFrameSaver:simdigits" , # <- by default, do not save RawDigits. Uncomment this line to save RawDigits and set
23-
"wclsFrameSaver:spsaver"
24-
]
25-
2613
## This sets the "main" Jsonnet file which provides the
2714
## configuration for the Wire-Cell Toolkit components. It is
2815
## take as relative to entries in WIRECELL_PATH.
29-
configs: ["pgrapher/experiment/sbnd/wcls-sim-drift-depoflux-nf-sp.jsonnet"]
30-
31-
32-
## Set the "external variables" required by the Jsonnet.
33-
params : {
34-
## This locates the input SimEnergyDeposits in the art::Event
35-
inputTag: "ionandscint:"
36-
37-
## Set "data" vs. "sim". The epoch below probably should follow suit.
38-
# reality: "data"
39-
reality: "sim"
40-
41-
## if epoch is "dynamic" you MUST add
42-
## "wclsMultiChannelNoiseDB" to "inputers" and must NOT
43-
## add it if not "dynamic"
44-
# epoch: "dynamic"
45-
epoch: "perfect"
46-
# epoch: "after"
16+
configs: []
4717

48-
49-
## Save output signal waveforms (recob::Wire) in "sparse" or "dense" form
50-
signal_output_form: "sparse"
51-
52-
## If save_simdigits="false", comment line with "wclsFrameSaver:simdigits" in outputers
53-
## If save_simdigits="true", uncomment line with "wclsFrameSaver:simdigits" in outputers
54-
## this is whether or not to save raw digits!!!
55-
save_simdigits: "false"
56-
57-
## Set the waveform sample length, eg, 6000, 15000, "auto"
58-
# nsample: 6000
59-
60-
save_track_id: "true"
61-
62-
}
63-
64-
structs: {
65-
## Longitudinal diffusion constant [cm2/s]
66-
DL: 4.0
67-
## Transverse diffusion constant [cm2/s]
68-
DT: 8.8
69-
## Electron lifetime [ms]
70-
lifetime: 10.0
71-
## Electron drift speed, assumes 0.5 kV/cm and 88.4 K. Units: mm/us
72-
driftSpeed: 1.563
73-
}
18+
## Libraries in which to look for WCT components
19+
plugins: ["WireCellGen", "WireCellSigProc", "WireCellRoot", "WireCellPgraph", "WireCellLarsoft", "WireCellTbb"]
20+
inputers: []
21+
outputers: []
7422

75-
tool_type: "WCLS"
76-
23+
## Set the "external variables" required by the Jsonnet.
24+
params: {}
25+
structs: {}
7726
}
7827
}
7928

29+
# ------------------------------------------------------------------------------------ #
30+
31+
## Configuration for 2D Sim + Signal Processing
32+
sbnd_wcls_simsp: @local::sbnd_wcls
33+
sbnd_wcls_simsp.wcls_main.configs: ["pgrapher/experiment/sbnd/wcls-sim-drift-depoflux-nf-sp.jsonnet"]
34+
sbnd_wcls_simsp.wcls_main.inputers: ["wclsSimDepoSetSource:"]
35+
sbnd_wcls_simsp.wcls_main.outputers:["wclsDepoFluxWriter:postdrift",
36+
# "wclsFrameSaver:simdigits" , # <- by default, do not save RawDigits. Uncomment this line to save RawDigits and set
37+
"wclsFrameSaver:spsaver"
38+
]
39+
sbnd_wcls_simsp.wcls_main.params: {
40+
## This locates the input SimEnergyDeposits in the art::Event
41+
inputTag: "ionandscint:"
42+
43+
## Set "data" vs. "sim". The epoch below probably should follow suit.
44+
reality: "sim"
45+
46+
## if epoch is "dynamic" you MUST add
47+
## "wclsMultiChannelNoiseDB" to "inputers" and must NOT
48+
## add it if not "dynamic"
49+
epoch: "perfect"
50+
51+
## Save output signal waveforms (recob::Wire) in "sparse" or "dense" form
52+
signal_output_form: "sparse"
53+
54+
## If save_simdigits="false", comment line with "wclsFrameSaver:simdigits" in outputers
55+
## If save_simdigits="true", uncomment line with "wclsFrameSaver:simdigits" in outputers
56+
## this is whether or not to save raw digits!!!
57+
save_simdigits: "false"
58+
59+
save_track_id: "true"
60+
}
61+
62+
sbnd_wcls_simsp.wcls_main.structs: {
63+
## Longitudinal diffusion constant [cm2/s]
64+
DL: 4.0
65+
## Transverse diffusion constant [cm2/s]
66+
DT: 8.8
67+
## Electron lifetime [ms]
68+
lifetime: 10.0
69+
## Electron drift speed, assumes 0.5 kV/cm and 88.4 K. Units: mm/us
70+
driftSpeed: 1.563
71+
}
72+
73+
# ------------------------------------------------------------------------------------ #
74+
75+
## Configuration for **Signal processing ONLY**
76+
sbnd_wcls_sp: @local::sbnd_wcls
77+
sbnd_wcls_sp.wcls_main.configs: ["pgrapher/experiment/sbnd/wcls-nf-sp.jsonnet"]
78+
sbnd_wcls_sp.wcls_main.inputers: ["wclsRawFrameSource"
79+
# To use wclsMultiChannelNoiseDB you must also put epoch:dynamic below
80+
# and you must have geo::Geometry service in your environment.
81+
# ,"wclsMultiChannelNoiseDB"
82+
]
83+
sbnd_wcls_sp.wcls_main.outputers: ["wclsFrameSaver:spsaver"]
84+
sbnd_wcls_sp.wcls_main.params : {
85+
# This locates the input raw::RawDigit collection in the art::Event
86+
raw_input_label: "daq"
87+
88+
# Set "data" vs. "sim". The epoch below probably should follow suit.
89+
reality: "sim"
90+
91+
# if epoch is "dynamic" you MUST add
92+
# "wclsMultiChannelNoiseDB" to "inputers" and must NOT
93+
# add it if not "dynamic"
94+
epoch: "perfect"
95+
96+
# Save output signal waveforms (recob::Wire) in "sparse" or "dense" form
97+
signal_output_form: "sparse"
98+
}
8099
END_PROLOG

0 commit comments

Comments
 (0)