Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate 2D Signal Processing into ICARUS Reconstruction #777

Draft
wants to merge 38 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
73b82b0
Split signal procesing by cryostat. Enable logging from WireCell. Ena…
gputnam Jul 9, 2024
f5227da
Disaple outputCommands in stage0
gputnam Jul 9, 2024
72a9a15
Fix Ind0 gain in signal processing.
gputnam Jul 9, 2024
bb6b1b0
Save all WireCell frames. Turn on plane-protection and roi-refinement.
gputnam Jul 9, 2024
b144321
Digitize WCLS output (??)
gputnam Jul 9, 2024
7826835
Save H5 output in WireCell signal simulation.
gputnam Jul 9, 2024
54edc8a
Add DepoSplat jsonnet config.
gputnam Jul 29, 2024
088831a
Add fcl to produce DepoSplats
gputnam Jul 29, 2024
3ed7147
Fhicl-dump'd wirecell configuration.
gputnam Jul 29, 2024
ec41a64
Update configurations. Make filter parameters configurable. First pas…
gputnam Aug 16, 2024
79a2d5f
Add twofaced jsonnet
gputnam Sep 16, 2024
0693e9b
Integrate 2D signal processing into ICARUS reconstruction. Add in new…
gputnam Nov 4, 2024
d55573f
Don't save output file for SC only detsim.
gputnam Nov 4, 2024
42b7970
Move default signal shape detsim to nominal front induction plane.
gputnam Nov 4, 2024
0b00a55
Fix gain in front induction deconvolution (not clear if this is actua…
gputnam Nov 4, 2024
8689123
Add in analyzer module for signal processing performance.
gputnam Nov 4, 2024
ac5ce68
Update hit finding parameters to 2D hits (which have smaller amplitud…
gputnam Nov 4, 2024
b4a8a60
Remove junk files accidentally included in merge.
gputnam Nov 4, 2024
640a6f5
Remove old jsonnet files.
gputnam Nov 4, 2024
19f4d5d
Reorganize configurations. Add in signal processing (SP) ana.
gputnam Nov 5, 2024
8d8d211
Remove SPAna from being run by default. Add output drop commands back…
gputnam Nov 5, 2024
3804ec3
Make two-faced signal porcessing configuration the default. Remove ol…
gputnam Nov 5, 2024
54059bb
Update default jsonnet to two-faced SP.
gputnam Nov 5, 2024
def2ea8
Remove SPana from default stage0 configs
gputnam Nov 5, 2024
b904153
Drop extra products in 1D SP config.
gputnam Nov 5, 2024
1f6b703
Revert nits in stage0 2D SP config.
gputnam Nov 5, 2024
deca7ef
Add data SP configs for E+W and for DNN.
gputnam Nov 5, 2024
7a66108
Set hit finder wires correctly for DNN configs.
gputnam Nov 6, 2024
48fbc45
Move hit-finder updates into overrides for 2D hit finding.
gputnam Nov 7, 2024
e118aac
Only create necessary frames.
gputnam Nov 13, 2024
f381893
Only save needed frames for DNN. Add in chunking.
gputnam Nov 13, 2024
4f83c19
fcl typo fix
gputnam Nov 13, 2024
8ba40ea
Compilation fix for new recob::Hit
gputnam Nov 13, 2024
5e35da2
Fix chunking.
gputnam Nov 20, 2024
e8e6b6a
Update DNN ROI Model.
gputnam Nov 20, 2024
6df73e5
Map planes to views correctly. Disble gzip compression (doesn't work …
gputnam Dec 4, 2024
f9269f2
Make SPAna default to 2D SP. Fix art tags.
gputnam Dec 4, 2024
0d92d36
Typo fix.
gputnam Jan 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions fcl/detsim/detsim_2d_icarus_SConly.fcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "detsim_2d_icarus.fcl"

physics.producers.tpcsim: @local::icarus_simwire_wirecell_SConly

physics.simulate: ["rns", "tpcsim"]
physics.stream: []
outputs: {}

process_name: TPCSim
2 changes: 1 addition & 1 deletion fcl/detsim/detsim_2d_icarus_fitFR.fcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "detsim_2d_icarus.fcl"

physics.producers.daq: @local::icarus_simwire_wirecell_fitSR
physics.producers.daq.wcls_main.configs: ["pgrapher/experiment/icarus/wcls-multitpc-sim-drift-simchannel.jsonnet"]
physics.producers.daq: @local::icarus_simwire_wirecell_fitSR_P0nom
15 changes: 15 additions & 0 deletions fcl/reco/Definitions/sp_filter_parameters.fcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
BEGIN_PROLOG
Wiener_tight_U_sigma: 0.065
Wiener_tight_U_power: 4.4
Wiener_tight_V_sigma: 0.065
Wiener_tight_V_power: 2.6
Wiener_tight_W_sigma: 0.07
Wiener_tight_W_power: 3.4

Wire_ind_sigma: 0.4
Wire_col_sigma: 2.2

Gaus_wide_sigma: 0.06

gain_ADC_per_e: 0.01214 # ADC / e-. For frame_scale
END_PROLOG
153 changes: 141 additions & 12 deletions fcl/reco/Definitions/stage0_icarus_defs.fcl

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions fcl/reco/Stage0/Run2/stage0E_run2_wc_icarus.fcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include "stage0_run2_wc_icarus.fcl"

physics.path: [
filterdataintegrity,
@sequence::icarus_stage0_PMT,
@sequence::icarus_stage0_CRT,
daqTPCROI,
@sequence::icarus_stage0_multiTPC_2d_TPC_E,
@sequence::icarus_stage0_EastHits2d_TPC
]
10 changes: 10 additions & 0 deletions fcl/reco/Stage0/Run2/stage0E_run2_wc_icarus_mc.fcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include "stage0_run2_wc_icarus_mc.fcl"

# Run the PMT+CRT stage0, initial TPC and East 2D deconv
physics.path: [ @sequence::icarus_stage0_mc_PMT,
MCDecodeTPCROI,
@sequence::icarus_stage0_2d_multiTPC_E,
@sequence::icarus_stage0_mc_crt
]

process_name: MCstage0E
14 changes: 14 additions & 0 deletions fcl/reco/Stage0/Run2/stage0E_run2_wcdnn_icarus.fcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include "stage0E_run2_wc_icarus.fcl"
#
# Turn on PCA noise suppression
# physics.producers.MCDecodeTPCROI.DecoderTool.DenoiserType: "pca"

physics.producers.decon2droiEE.wcls_main.configs: ["pgrapher/experiment/icarus/wcls-decode-to-sig-twofaced-dnnroi.jsonnet"]
physics.producers.decon2droiEW.wcls_main.configs: ["pgrapher/experiment/icarus/wcls-decode-to-sig-twofaced-dnnroi.jsonnet"]
physics.producers.decon2droiWE.wcls_main.configs: ["pgrapher/experiment/icarus/wcls-decode-to-sig-twofaced-dnnroi.jsonnet"]
physics.producers.decon2droiWW.wcls_main.configs: ["pgrapher/experiment/icarus/wcls-decode-to-sig-twofaced-dnnroi.jsonnet"]

physics.producers.gaushit2dTPCEE.CalDataModuleLabel: "decon2droiEE:dnnsp"
physics.producers.gaushit2dTPCEW.CalDataModuleLabel: "decon2droiEW:dnnsp"
physics.producers.gaushit2dTPCWE.CalDataModuleLabel: "decon2droiWE:dnnsp"
physics.producers.gaushit2dTPCWW.CalDataModuleLabel: "decon2droiWW:dnnsp"
14 changes: 14 additions & 0 deletions fcl/reco/Stage0/Run2/stage0E_run2_wcdnn_icarus_mc.fcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include "stage0E_run2_wc_icarus_mc.fcl"
#
# Turn on PCA noise suppression
# physics.producers.MCDecodeTPCROI.DecoderTool.DenoiserType: "pca"

physics.producers.decon2droiEE.wcls_main.configs: ["pgrapher/experiment/icarus/wcls-decode-to-sig-twofaced-dnnroi.jsonnet"]
physics.producers.decon2droiEW.wcls_main.configs: ["pgrapher/experiment/icarus/wcls-decode-to-sig-twofaced-dnnroi.jsonnet"]
physics.producers.decon2droiWE.wcls_main.configs: ["pgrapher/experiment/icarus/wcls-decode-to-sig-twofaced-dnnroi.jsonnet"]
physics.producers.decon2droiWW.wcls_main.configs: ["pgrapher/experiment/icarus/wcls-decode-to-sig-twofaced-dnnroi.jsonnet"]

physics.producers.gaushit2dTPCEE.CalDataModuleLabel: "decon2droiEE:dnnsp"
physics.producers.gaushit2dTPCEW.CalDataModuleLabel: "decon2droiEW:dnnsp"
physics.producers.gaushit2dTPCWE.CalDataModuleLabel: "decon2droiWE:dnnsp"
physics.producers.gaushit2dTPCWW.CalDataModuleLabel: "decon2droiWW:dnnsp"
8 changes: 8 additions & 0 deletions fcl/reco/Stage0/Run2/stage0W_run2_wc_icarus.fcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include "stage0_run2_wc_icarus.fcl"

physics.path: [
@sequence::icarus_stage0_multiTPC_2d_TPC_W,
@sequence::icarus_stage0_WestHits2d_TPC
]

process_name: stage0W
6 changes: 6 additions & 0 deletions fcl/reco/Stage0/Run2/stage0W_run2_wc_icarus_mc.fcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "stage0_run2_wc_icarus_mc.fcl"

# Run the West 2D deconv and finish TPC stage0
physics.path: [@sequence::icarus_stage0_2d_multiTPC_W]

process_name: MCstage0W
14 changes: 14 additions & 0 deletions fcl/reco/Stage0/Run2/stage0W_run2_wcdnn_icarus.fcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include "stage0W_run2_wc_icarus.fcl"

# Turn on PCA noise suppression
# physics.producers.MCDecodeTPCROI.DecoderTool.DenoiserType: "pca"

physics.producers.decon2droiEE.wcls_main.configs: ["pgrapher/experiment/icarus/wcls-decode-to-sig-twofaced-dnnroi.jsonnet"]
physics.producers.decon2droiEW.wcls_main.configs: ["pgrapher/experiment/icarus/wcls-decode-to-sig-twofaced-dnnroi.jsonnet"]
physics.producers.decon2droiWE.wcls_main.configs: ["pgrapher/experiment/icarus/wcls-decode-to-sig-twofaced-dnnroi.jsonnet"]
physics.producers.decon2droiWW.wcls_main.configs: ["pgrapher/experiment/icarus/wcls-decode-to-sig-twofaced-dnnroi.jsonnet"]

physics.producers.gaushit2dTPCEE.CalDataModuleLabel: "decon2droiEE:dnnsp"
physics.producers.gaushit2dTPCEW.CalDataModuleLabel: "decon2droiEW:dnnsp"
physics.producers.gaushit2dTPCWE.CalDataModuleLabel: "decon2droiWE:dnnsp"
physics.producers.gaushit2dTPCWW.CalDataModuleLabel: "decon2droiWW:dnnsp"
14 changes: 14 additions & 0 deletions fcl/reco/Stage0/Run2/stage0W_run2_wcdnn_icarus_mc.fcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include "stage0W_run2_wc_icarus_mc.fcl"

# Turn on PCA noise suppression
# physics.producers.MCDecodeTPCROI.DecoderTool.DenoiserType: "pca"

physics.producers.decon2droiEE.wcls_main.configs: ["pgrapher/experiment/icarus/wcls-decode-to-sig-twofaced-dnnroi.jsonnet"]
physics.producers.decon2droiEW.wcls_main.configs: ["pgrapher/experiment/icarus/wcls-decode-to-sig-twofaced-dnnroi.jsonnet"]
physics.producers.decon2droiWE.wcls_main.configs: ["pgrapher/experiment/icarus/wcls-decode-to-sig-twofaced-dnnroi.jsonnet"]
physics.producers.decon2droiWW.wcls_main.configs: ["pgrapher/experiment/icarus/wcls-decode-to-sig-twofaced-dnnroi.jsonnet"]

physics.producers.gaushit2dTPCEE.CalDataModuleLabel: "decon2droiEE:dnnsp"
physics.producers.gaushit2dTPCEW.CalDataModuleLabel: "decon2droiEW:dnnsp"
physics.producers.gaushit2dTPCWE.CalDataModuleLabel: "decon2droiWE:dnnsp"
physics.producers.gaushit2dTPCWW.CalDataModuleLabel: "decon2droiWW:dnnsp"
33 changes: 0 additions & 33 deletions fcl/reco/Stage0/Run2/stage0_run2_wc_icarus.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -32,39 +32,6 @@ outputs.rootOutput.outputCommands: ["keep *_*_*_*",
"keep *_daq_ICARUSTriggerV*_*"
]

# Add below as per Gray Putnam (should we move to jsonnet files?)
physics.producers.decon2droiEE.wcls_main.structs.gain0: 17.05212
physics.producers.decon2droiEW.wcls_main.structs.gain0: 17.05212
physics.producers.decon2droiWE.wcls_main.structs.gain0: 17.05212
physics.producers.decon2droiWW.wcls_main.structs.gain0: 17.05212


physics.producers.decon2droiEE.wcls_main.structs.gain1: 12.1420344
physics.producers.decon2droiEW.wcls_main.structs.gain1: 12.1420344
physics.producers.decon2droiWE.wcls_main.structs.gain1: 12.1420344
physics.producers.decon2droiWW.wcls_main.structs.gain1: 12.1420344

physics.producers.decon2droiEE.wcls_main.structs.gain2: 13.0261362
physics.producers.decon2droiEW.wcls_main.structs.gain2: 13.0261362
physics.producers.decon2droiWE.wcls_main.structs.gain2: 13.0261362
physics.producers.decon2droiWW.wcls_main.structs.gain2: 13.0261362


physics.producers.decon2droiEE.wcls_main.structs.shaping0: 1.3
physics.producers.decon2droiEW.wcls_main.structs.shaping0: 1.3
physics.producers.decon2droiWE.wcls_main.structs.shaping0: 1.3
physics.producers.decon2droiWW.wcls_main.structs.shaping0: 1.3

physics.producers.decon2droiEE.wcls_main.structs.shaping1: 1.45
physics.producers.decon2droiEW.wcls_main.structs.shaping1: 1.45
physics.producers.decon2droiWE.wcls_main.structs.shaping1: 1.45
physics.producers.decon2droiWW.wcls_main.structs.shaping1: 1.45

physics.producers.decon2droiEE.wcls_main.structs.shaping2: 1.3
physics.producers.decon2droiEW.wcls_main.structs.shaping2: 1.3
physics.producers.decon2droiWE.wcls_main.structs.shaping2: 1.3
physics.producers.decon2droiWW.wcls_main.structs.shaping2: 1.3

services.message.destinations :
{
STDCOUT:
Expand Down
35 changes: 0 additions & 35 deletions fcl/reco/Stage0/Run2/stage0_run2_wc_icarus_mc.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -40,45 +40,10 @@ physics.producers.ophit.InputModule: "opdaq"
physics.producers.MCDecodeTPCROI.FragmentsLabelVec: ["daq:TPCWW","daq:TPCWE","daq:TPCEW","daq:TPCEE"]
physics.producers.MCDecodeTPCROI.OutInstanceLabelVec: ["PHYSCRATEDATATPCWW", "PHYSCRATEDATATPCWE", "PHYSCRATEDATATPCEW", "PHYSCRATEDATATPCEE"]

physics.producers.decon1droi.RawDigitLabelVec: ["MCDecodeTPCROI:PHYSCRATEDATATPCWW","MCDecodeTPCROI:PHYSCRATEDATATPCWE","MCDecodeTPCROI:PHYSCRATEDATATPCEW","MCDecodeTPCROI:PHYSCRATEDATATPCEE"]

physics.producers.decon2droiEE.wcls_main.params.raw_input_label: "MCDecodeTPCROI:PHYSCRATEDATATPCEE"
physics.producers.decon2droiEW.wcls_main.params.raw_input_label: "MCDecodeTPCROI:PHYSCRATEDATATPCEW"
physics.producers.decon2droiWE.wcls_main.params.raw_input_label: "MCDecodeTPCROI:PHYSCRATEDATATPCWE"
physics.producers.decon2droiWW.wcls_main.params.raw_input_label: "MCDecodeTPCROI:PHYSCRATEDATATPCWW"

# As per Gray Putname...
physics.producers.decon2droiEE.wcls_main.structs.gain0: 17.05212
physics.producers.decon2droiEW.wcls_main.structs.gain0: 17.05212
physics.producers.decon2droiWE.wcls_main.structs.gain0: 17.05212
physics.producers.decon2droiWW.wcls_main.structs.gain0: 17.05212


physics.producers.decon2droiEE.wcls_main.structs.gain1: 12.1420344
physics.producers.decon2droiEW.wcls_main.structs.gain1: 12.1420344
physics.producers.decon2droiWE.wcls_main.structs.gain1: 12.1420344
physics.producers.decon2droiWW.wcls_main.structs.gain1: 12.1420344

physics.producers.decon2droiEE.wcls_main.structs.gain2: 13.0261362
physics.producers.decon2droiEW.wcls_main.structs.gain2: 13.0261362
physics.producers.decon2droiWE.wcls_main.structs.gain2: 13.0261362
physics.producers.decon2droiWW.wcls_main.structs.gain2: 13.0261362


physics.producers.decon2droiEE.wcls_main.structs.shaping0: 1.3
physics.producers.decon2droiEW.wcls_main.structs.shaping0: 1.3
physics.producers.decon2droiWE.wcls_main.structs.shaping0: 1.3
physics.producers.decon2droiWW.wcls_main.structs.shaping0: 1.3

physics.producers.decon2droiEE.wcls_main.structs.shaping1: 1.45
physics.producers.decon2droiEW.wcls_main.structs.shaping1: 1.45
physics.producers.decon2droiWE.wcls_main.structs.shaping1: 1.45
physics.producers.decon2droiWW.wcls_main.structs.shaping1: 1.45

physics.producers.decon2droiEE.wcls_main.structs.shaping2: 1.3
physics.producers.decon2droiEW.wcls_main.structs.shaping2: 1.3
physics.producers.decon2droiWE.wcls_main.structs.shaping2: 1.3
physics.producers.decon2droiWW.wcls_main.structs.shaping2: 1.3

# restore legacy G4 labels
physics.producers.mcophit.SimPhotonsProducer: "largeant"
14 changes: 14 additions & 0 deletions fcl/reco/Stage0/Run2/stage0_run2_wcdnn_icarus.fcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include "stage0_run2_wc_icarus.fcl"

# Turn on PCA noise suppression
# physics.producers.MCDecodeTPCROI.DecoderTool.DenoiserType: "pca"

physics.producers.decon2droiEE.wcls_main.configs: ["pgrapher/experiment/icarus/wcls-decode-to-sig-twofaced-dnnroi.jsonnet"]
physics.producers.decon2droiEW.wcls_main.configs: ["pgrapher/experiment/icarus/wcls-decode-to-sig-twofaced-dnnroi.jsonnet"]
physics.producers.decon2droiWE.wcls_main.configs: ["pgrapher/experiment/icarus/wcls-decode-to-sig-twofaced-dnnroi.jsonnet"]
physics.producers.decon2droiWW.wcls_main.configs: ["pgrapher/experiment/icarus/wcls-decode-to-sig-twofaced-dnnroi.jsonnet"]

physics.producers.gaushit2dTPCEE.CalDataModuleLabel: "decon2droiEE:dnnsp"
physics.producers.gaushit2dTPCEW.CalDataModuleLabel: "decon2droiEW:dnnsp"
physics.producers.gaushit2dTPCWE.CalDataModuleLabel: "decon2droiWE:dnnsp"
physics.producers.gaushit2dTPCWW.CalDataModuleLabel: "decon2droiWW:dnnsp"
14 changes: 14 additions & 0 deletions fcl/reco/Stage0/Run2/stage0_run2_wcdnn_icarus_mc.fcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include "stage0_run2_wc_icarus_mc.fcl"

# Turn on PCA noise suppression
# physics.producers.MCDecodeTPCROI.DecoderTool.DenoiserType: "pca"

physics.producers.decon2droiEE.wcls_main.configs: ["pgrapher/experiment/icarus/wcls-decode-to-sig-twofaced-dnnroi.jsonnet"]
physics.producers.decon2droiEW.wcls_main.configs: ["pgrapher/experiment/icarus/wcls-decode-to-sig-twofaced-dnnroi.jsonnet"]
physics.producers.decon2droiWE.wcls_main.configs: ["pgrapher/experiment/icarus/wcls-decode-to-sig-twofaced-dnnroi.jsonnet"]
physics.producers.decon2droiWW.wcls_main.configs: ["pgrapher/experiment/icarus/wcls-decode-to-sig-twofaced-dnnroi.jsonnet"]

physics.producers.gaushit2dTPCEE.CalDataModuleLabel: "decon2droiEE:dnnsp"
physics.producers.gaushit2dTPCEW.CalDataModuleLabel: "decon2droiEW:dnnsp"
physics.producers.gaushit2dTPCWE.CalDataModuleLabel: "decon2droiWE:dnnsp"
physics.producers.gaushit2dTPCWW.CalDataModuleLabel: "decon2droiWW:dnnsp"
1 change: 1 addition & 0 deletions icaruscode/TPC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ add_subdirectory(SignalProcessing)
add_subdirectory(Simulation)
add_subdirectory(Tracking)
add_subdirectory(ICARUSWireCell)
add_subdirectory(SPAna)
12 changes: 10 additions & 2 deletions icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ icarus_simwire_wirecell:
{
tool_type: WCLS
apps: ["Pgrapher"]
// logsinks: ["stdout"]
logsinks: ["stdout"]
// loglevels: ["magnify:debug"]
plugins: ["WireCellPgraph", "WireCellGen","WireCellSio","WireCellRoot","WireCellLarsoft"]
loglevels: ["debug", "pgraph:info"]
plugins: ["WireCellPgraph", "WireCellGen","WireCellSio","WireCellRoot","WireCellLarsoft", "WireCellHio"]
// needs to be found via your WIRECELL_PATH
configs: ["pgrapher/experiment/icarus/wcls-multitpc-sim-drift-simchannel-refactored.jsonnet"]
// Contract note: these exact "type:name" must be used to identify
Expand Down Expand Up @@ -75,6 +76,13 @@ icarus_simwire_wirecell:
}
}

# SimChannel only (SConly) CONFIG
icarus_simwire_wirecell_SConly: @local::icarus_simwire_wirecell
icarus_simwire_wirecell_SConly.wcls_main.configs: ["pgrapher/experiment/icarus/wcls-multitpc-sim-drift-simchannel-true.jsonnet"]
icarus_simwire_wirecell_SConly.wcls_main.outputers:[
"wclsDepoFluxWriter:postdrift"
]

# TUNED FR CONFIG
icarus_simwire_wirecell_fitSR: @local::icarus_simwire_wirecell
# Add in the ER tail
Expand Down
107 changes: 107 additions & 0 deletions icaruscode/TPC/ICARUSWireCell/icarus/dnnroi.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
// This produces a function to configure DNN-ROI for one APA given
// anode and torch service (ts) objects.
//
// The prefix is prepended to all internal node names if uniqueness
// beyond anode ID is needed. The output_scale allows for an ad-hoc
// scaling of dnnroi output. The U and W planes will go through
// dnnroi while hte W plane will be shunted. What comes out will be a
// unified frame with frame tag "dnnspN" where "N" is the anode ID.

local wc = import "wirecell.jsonnet";
local pg = import "pgraph.jsonnet";

function (anode, ts_u, ts_v, prefix="dnnroi", output_scale=1.0, nchunk_u=2, nchunk_v=4)
local apaid = anode.data.ident;
local prename = prefix + std.toString(apaid);
local intags = ['loose_lf%d'%apaid, // 'mp2_roi%d'%apaid,
'mp3_roi%d'%apaid];

local dnnroi_u = pg.pnode({
type: "DNNROIFinding",
name: prename+"u",
data: {
anode: wc.tn(anode),
plane: 0,
intags: intags,
decon_charge_tag: "decon%d" %apaid,
outtag: "dnnsp%du"%apaid,
output_scale: output_scale,
forward: wc.tn(ts_u),
tick_per_slice: 8,
nchunks: nchunk_u
}
}, nin=1, nout=1, uses=[ts_u, anode]);
local dnnroi_v = pg.pnode({
type: "DNNROIFinding",
name: prename+"v",
data: {
anode: wc.tn(anode),
plane: 1,
intags: intags,
decon_charge_tag: "decon%d" %apaid,
outtag: "dnnsp%dv"%apaid,
output_scale: output_scale,
forward: wc.tn(ts_v),
tick_per_slice: 8,
nchunks: nchunk_v
}
}, nin=1, nout=1, uses=[ts_v, anode]);
local dnnroi_w = pg.pnode({
type: "PlaneSelector",
name: prename+"w",
data: {
anode: wc.tn(anode),
plane: 2,
tags: ["gauss%d"%apaid],
tag_rules: [{
frame: {".*":"DNNROIFinding"},
trace: {["gauss%d"%apaid]:"dnnsp%dw"%apaid},
}],
}
}, nin=1, nout=1, uses=[anode]);

local dnnpipes = [dnnroi_u, dnnroi_v, dnnroi_w];
local dnnfanout = pg.pnode({
type: "FrameFanout",
name: prename,
data: {
multiplicity: 3
}
}, nin=1, nout=3);

local dnnfanin = pg.pnode({
type: "FrameFanin",
name: prename,
data: {
multiplicity: 3,
tag_rules: [{
frame: {".*": "dnnsp%d%s" % [apaid,plane]},
trace: {".*": "dnnsp%d%s" % [apaid,plane]},
} for plane in ["u", "v", "w"]]
},
}, nin=3, nout=1);

local retagger = pg.pnode({
type: "Retagger",
name: 'dnnroi%d' % apaid,
data: {
// Note: retagger keeps tag_rules an array to be like frame fanin/fanout.
tag_rules: [{
// Retagger also handles "frame" and "trace" like fanin/fanout
// merge separately all traces like gaussN to gauss.
frame: {
".*": "dnnsp%d" % apaid
},
merge: {
["dnnsp%d." % apaid]: "dnnsp%d" % apaid
},
}],
},
}, nin=1, nout=1);

pg.intern(innodes=[dnnfanout],
outnodes=[retagger],
centernodes=dnnpipes+[dnnfanin],
edges=[pg.edge(dnnfanout, dnnpipes[ind], ind, 0) for ind in [0,1,2]] +
[pg.edge(dnnpipes[ind], dnnfanin, 0, ind) for ind in [0,1,2]] +
[pg.edge(dnnfanin, retagger, 0, 0)])
6 changes: 6 additions & 0 deletions icaruscode/TPC/ICARUSWireCell/icarus/funcs.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ local g = import 'pgraph.jsonnet';
anode_channels(n):: std.flattenArrays([std.range(startch[n][w], startch[n][w]+wireplanes[w]) for w in std.range(0,2)]),
// anode_channels(n):: std.range(1056 * (n % 2) + 13312 * (n - n % 2) / 2, 1056 * (n % 2 + 1) - 1 + 13312 * (n - n % 2) / 2) + std.range(1056 * 2 + 13312 * (n - n % 2) / 2, 13312 - 1 + 13312 * (n - n % 2) / 2),

// Channels on each anode, in the "two-faced" configuration
anode_channels_twofaced(n):: std.range(startch[2*n][0], startch[2*n][0]+wireplanes[0]) +
std.range(startch[2*n+1][0], startch[2*n+1][0]+wireplanes[0]) +
std.range(startch[2*n][1], startch[2*n][1]+wireplanes[1]) +
std.range(startch[2*n][2], startch[2*n][2]+wireplanes[2]),

// Return the number of split (1 or 2) for an anode
anode_split(ident):: (ident%100 - ident%10)/10,

Expand Down
Loading