Skip to content

Commit b325800

Browse files
Initial commit
1 parent 4a1735f commit b325800

9 files changed

Lines changed: 50 additions & 13 deletions

sbndcode/JobConfigurations/dnnroi/standard_detsim_sbnd_bothrois.fcl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66

77
#include "standard_detsim_sbnd.fcl"
88

9-
physics.producers.simtpc2d: @local::sbnd_wcls_simsp_bothrois
9+
physics.producers.simtpc2d: @local::sbnd_wcls_simsp_bothrois
10+
physics.producers.simtpc2d.wcls_main.params.wc_device: "cpu"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# File: standard_detsim_sbnd_bothrois.fcl
2+
# Authors: Mun Jung Jung (munjung@uchicago.edu)
3+
4+
# runs WC 2D signal processing during detsim using both traditional and DNN-based ROI finding
5+
# create three Wire products: simtpc2d:gauss, simtpc2d:wiener (from traditional), simtpc2d:dnnsp (from DNN)
6+
7+
#include "standard_detsim_sbnd.fcl"
8+
9+
physics.producers.simtpc2d: @local::sbnd_wcls_simsp_bothrois
10+
physics.producers.simtpc2d.wcls_main.params.wc_device: "gpu"
11+
physics.producers.simtpc2d.wcls_main.plugins: [@sequence::sbnd_wcls_simsp_dnnroi.wcls_main.plugins, "WireCellCuda"]

sbndcode/JobConfigurations/dnnroi/standard_detsim_sbnd_dnnroi.fcl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77

88
#include "standard_detsim_sbnd.fcl"
99

10-
physics.producers.simtpc2d: @local::sbnd_wcls_simsp_dnnroi
10+
physics.producers.simtpc2d: @local::sbnd_wcls_simsp_dnnroi
11+
physics.producers.simtpc2d.wcls_main.params.wc_device: "cpu"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# File: standard_detsim_sbnd_dnnroi.fcl
2+
# Authors: Mun Jung Jung (munjung@uchicago.edu)
3+
4+
# runs WC 2D signal processing during detsim using only DNN-based ROI finding
5+
# create one Wire product: simtpc2d:dnnsp
6+
7+
8+
#include "standard_detsim_sbnd.fcl"
9+
10+
physics.producers.simtpc2d: @local::sbnd_wcls_simsp_dnnroi
11+
physics.producers.simtpc2d.wcls_main.params.wc_device: "gpu"
12+
physics.producers.simtpc2d.wcls_main.plugins: [@sequence::sbnd_wcls_simsp_dnnroi.wcls_main.plugins, "WireCellCuda"]

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
//local epoch = std.extVar('epoch'); // eg "dynamic", "after", "before", "perfect"
2424
local sigoutform = std.extVar('signal_output_form'); // eg "sparse" or "dense"
25+
local wc_device = std.extVar('wc_device');
2526
local raw_input_label = std.extVar('raw_input_label'); // eg "daq"
2627
local use_paramresp = std.extVar('use_paramresp'); // eg "true" or "false"
2728
local roi = std.extVar('roi');
@@ -49,9 +50,9 @@ local params = data_params {
4950
},
5051
};
5152

52-
53-
local tools = tools_maker(params);
54-
53+
local default_tools = tools_maker(params);
54+
local tools = if wc_device == 'gpu' then std.mergePatch(default_tools,
55+
{dft: {type: "TorchDFT", data: {device: wc_device}}}) else default_tools;
5556

5657
local mega_anode = {
5758
type: 'MegaAnodePlane',
@@ -217,7 +218,7 @@ local ts_p0 = {
217218
tick_per_slice: tick_per_slice,
218219
data: {
219220
model: dnnroi_model_p0,
220-
device: "cpu",
221+
device: wc_device,
221222
concurrency: 1,
222223
},
223224
};
@@ -228,7 +229,7 @@ local ts_p1 = {
228229
tick_per_slice: tick_per_slice,
229230
data: {
230231
model: dnnroi_model_p1,
231-
device: "cpu",
232+
device: wc_device,
232233
concurrency: 1,
233234
},
234235
};

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222

2323
local epoch = std.extVar('epoch'); // eg "dynamic", "after", "before", "perfect"
24+
local wc_device = std.extVar('wc_device');
2425
local sigoutform = std.extVar('signal_output_form'); // eg "sparse" or "dense"
2526
local raw_input_label = std.extVar('raw_input_label'); // eg "daq"
2627
local use_dnnroi = std.extVar('use_dnnroi');
@@ -32,7 +33,9 @@ local dnnroi_model_p1 = std.extVar('dnnroi_model_p1');
3233
local g = import 'pgraph.jsonnet';
3334
local f = import 'pgrapher/experiment/sbnd/funcs.jsonnet';
3435
local wc = import 'wirecell.jsonnet';
35-
local tools_maker = import 'pgrapher/common/tools.jsonnet';
36+
local default_tools = tools_maker(params);
37+
local tools = if wc_device == 'gpu' then std.mergePatch(default_tools,
38+
{dft: {type: "TorchDFT", data: {device: wc_device}}}) else default_tools;
3639

3740
local simu_params = import 'simparams.jsonnet';
3841
local params = simu_params;
@@ -180,7 +183,7 @@ local ts_p0 = {
180183
tick_per_slice: tick_per_slice,
181184
data: {
182185
model: dnnroi_model_p0,
183-
device: "cpu",
186+
device: wc_device,
184187
concurrency: 1,
185188
},
186189
};
@@ -191,7 +194,7 @@ local ts_p1 = {
191194
tick_per_slice: tick_per_slice,
192195
data: {
193196
model: dnnroi_model_p1,
194-
device: "cpu",
197+
device: wc_device,
195198
concurrency: 1,
196199
},
197200
};

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ local dnnroi_model_p1 = std.extVar('dnnroi_model_p1');
1414
local g = import 'pgraph.jsonnet';
1515
local f = import 'pgrapher/common/funcs.jsonnet';
1616
local wc = import 'wirecell.jsonnet';
17+
local wc_device = std.extVar('wc_device');
1718
local io = import 'pgrapher/common/fileio.jsonnet';
1819
local tools_maker = import 'pgrapher/common/tools.jsonnet';
1920

@@ -39,7 +40,9 @@ local params = base {
3940
}
4041
};
4142

42-
local tools = tools_maker(params);
43+
local default_tools = tools_maker(params);
44+
local tools = if wc_device == 'gpu' then std.mergePatch(default_tools,
45+
{dft: {type: "TorchDFT", data: {device: wc_device}}}) else default_tools;
4346
local sim_maker = import 'pgrapher/experiment/sbnd/sim.jsonnet';
4447
local sim = sim_maker(params, tools);
4548
local nanodes = std.length(tools.anodes);
@@ -317,7 +320,7 @@ local ts_p0 = {
317320
tick_per_slice: tick_per_slice,
318321
data: {
319322
model: dnnroi_model_p0,
320-
device: "cpu",
323+
device: wc_device,
321324
concurrency: 1,
322325
},
323326
};
@@ -328,7 +331,7 @@ local ts_p1 = {
328331
tick_per_slice: tick_per_slice,
329332
data: {
330333
model: dnnroi_model_p1,
331-
device: "cpu",
334+
device: wc_device,
332335
concurrency: 1,
333336
},
334337
};

sbndcode/WireCell/wcsimsp_sbnd.fcl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ sbnd_wcls_sp.wcls_main.params : {
116116
# This locates the input raw::RawDigit collection in the art::Event
117117
raw_input_label: "daq"
118118

119+
# if dnnroi is used, this device will be used
120+
wc_device: "cpu"
121+
119122
# Set "data" vs. "sim". The epoch below probably should follow suit.
120123
reality: "sim"
121124

sbndcode/WireCell/wcsp_data_sbnd.fcl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ sbnd_wcls_sp_data.wcls_main.outputers: ["wclsFrameSaver:spsaver"]
4141
sbnd_wcls_sp_data.wcls_main.params : {
4242
# This locates the input raw::RawDigit collection in the art::Event
4343
raw_input_label: "daq"
44+
# if dnnroi is used, this device will be used
45+
wc_device: "cpu"
4446

4547
# if epoch is "dynamic" you MUST add
4648
# "wclsMultiChannelNoiseDB" to "inputers" and must NOT

0 commit comments

Comments
 (0)