From e6238544a3c6a1c9ffa8f80459c2c50ccfbe5c79 Mon Sep 17 00:00:00 2001 From: gputnam Date: Sun, 30 Apr 2023 16:28:08 -0500 Subject: [PATCH 01/11] Update ICARUS WireCell configurations to make more parameters configurable by fcl. Add in config for 'fit' field responses. --- fcl/detsim/detsim_2d_icarus_fitFR.fcl | 3 + .../detsimmodules_wirecell_ICARUS.fcl | 25 +++ .../icarus/icarus_tools.jsonnet | 170 ++++++++++++++++++ .../TPC/ICARUSWireCell/icarus/params.jsonnet | 9 +- .../ICARUSWireCell/icarus/simparams.jsonnet | 17 +- .../icarus/wcls-decode-to-sig.jsonnet | 2 +- ...pc-sim-drift-simchannel-omit-noise.jsonnet | 2 +- ...wcls-multitpc-sim-drift-simchannel.jsonnet | 49 ++++- .../icarus/wcls-sim-drift-simchannel.jsonnet | 2 +- 9 files changed, 254 insertions(+), 25 deletions(-) create mode 100644 fcl/detsim/detsim_2d_icarus_fitFR.fcl create mode 100644 icaruscode/TPC/ICARUSWireCell/icarus/icarus_tools.jsonnet diff --git a/fcl/detsim/detsim_2d_icarus_fitFR.fcl b/fcl/detsim/detsim_2d_icarus_fitFR.fcl new file mode 100644 index 000000000..0efb5f5af --- /dev/null +++ b/fcl/detsim/detsim_2d_icarus_fitFR.fcl @@ -0,0 +1,3 @@ +#include "detsim_2d_icarus.fcl" + +physics.producers.daq: @local::icarus_simwire_wirecell_fitSR diff --git a/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl b/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl index 4a801d6f6..14361e6c5 100644 --- a/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl +++ b/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl @@ -34,6 +34,7 @@ icarus_simwire_wirecell: // Make available parameters via Jsonnet's std.extVar() params: { files_fields: "garfield-icarus-fnal-rev1.json.bz2" + file_rcresp: "" # use the RCResponse by default } structs: { # load values from simulationservices_icarus.fcl @@ -49,9 +50,33 @@ icarus_simwire_wirecell: # Scaling Parameters from int and coh noise components int_noise_scale: 1.0 coh_noise_scale: 1.09 + + # Gain and shaping time + gain0: 14.9654 # mV/fC + gain1: 14.9654 # mV/fC + gain2: 14.9654 # mV/fC + + shaping0: 1.3 # us + shaping1: 1.3 # us + shaping2: 1.3 # us + + # Time offsets for truth matching + time_offset_u: 1.0 # us + time_offset_v: 1.0 # us + time_offset_y: 1.0 # us + } } } +icarus_simwire_wirecell_fitSR: @local::icarus_simwire_wirecell +# Add in the ER tail +icarus_simwire_wirecell_fitSR.wcls_main.params.file_rcresp: "icarus_fnal_rc_tail.json" +# Add in the tuned field responses +icarus_simwire_wirecell_fitSR.wcls_main.params.files_fields: "icarus_fnal_fit_ks.json.bz2" +# futz with shaping+gain values +icarus_simwire_wirecell_fitSR.wcls_main.structs.gain2: 13.2390 # mV/fC +icarus_simwire_wirecell_fitSR.wcls_main.structs.shaping1: 1.45 # us + END_PROLOG diff --git a/icaruscode/TPC/ICARUSWireCell/icarus/icarus_tools.jsonnet b/icaruscode/TPC/ICARUSWireCell/icarus/icarus_tools.jsonnet new file mode 100644 index 000000000..8435fb3db --- /dev/null +++ b/icaruscode/TPC/ICARUSWireCell/icarus/icarus_tools.jsonnet @@ -0,0 +1,170 @@ +// This file provides a function which takes a params object (see +// ../params/) and returns a data structure with a number of +// sub-objects that may configure various WCT "tool" type componets +// which are not INodes. + +// Some attributes are merely default and you may wish to override +// them. For example, the default IDFT FftwDFT and to instead ues +// TorchDFT you may do something like: +// +// local default_tools = tools_maker(params) +// local tools = std.mergePatch(default_tools, +// {dft: {type: "TorchDFT", data: {device: "gpu"}}}); +// + +local wc = import "wirecell.jsonnet"; + +function(params) +{ + // The IRandom pRNG + random : { + type: "Random", + data: { + generator: "default", + seeds: [0,1,2,3,4], + } + }, + // The IDFT FFT implementation + dft : { + type: "FftwDFT", + }, + + // One FR per field file. + fields : std.mapWithIndex(function (n, fname) { + type: "FieldResponse", + name: "field%d"%n, + data: { filename: fname } + }, params.files.fields), + + field: $.fields[0], // the nominal field + + // The number of ticks for response waveforms. For simulation + // this must be enlarged beyond what is wanted in the output + // readout in order to accept catch early activity into the first + // few readout ticks. When responses are used to deconvolve then + // this should best be shortened. Note: sigproc at time of + // writing did not use components for Elec or RC so are not + // currently subject to this config. + local sim_response_binning = { + tick: params.daq.tick, + nticks: params.sim.ductor.nticks, // MUST match ductor + }, + + perchanresp : { + type: "PerChannelResponse", + data: { + filename: params.files.chresp, + } + }, + // It's a little awkward to NOT use PerChannelResponse because you + // need to give an empty string to a component that wants to use + // it an an empty list to the "uses". Here we package that little + // "if" branch. It's a general pattern not specific to this + // object. Might want to make wc.tn() convert "null" into "" and + // g.uses() convert [null] into []. + perchanresp_nameuses : if std.type(params.files.chresp) == 'null' + then {name:"", uses:[]} + else {name:wc.tn(self.perchanresp), uses:[self.perchanresp]}, + + + wires : { + type: "WireSchemaFile", + data: { filename: params.files.wires } + }, + + elec_resp : std.mapWithIndex(function (n, e) { + type: if std.objectHas(e, "type") + then e.type + else "ColdElecResponse", // default + data: sim_response_binning { + shaping: e.shaping, + gain: e.gain, + postgain: e.postgain, + filename: if std.objectHas(e, "filename") + then e.filename + else "" + }, + }, params.elec), + + rc_resp : { + type: if std.objectHas(params, 'rc_resp') && std.objectHas(params.rc_resp, "type") + then params.rc_resp.type + else "RCResponse", // default + data: std.prune(sim_response_binning { + width: if std.objectHas(params, 'rc_resp') && std.objectHas(params.rc_resp, 'width') + then params.rc_resp.width else null, + + filename: if std.objectHas(params, 'rc_resp') && std.objectHas(params.rc_resp, 'filename') + then params.rc_resp.filename else null, + + postgain: if std.objectHas(params, 'rc_resp') && std.objectHas(params.rc_resp, 'postgain') + then params.rc_resp.postgain else null, + + start: if std.objectHas(params, 'rc_resp') && std.objectHas(params.rc_resp, 'start') + then params.rc_resp.start else null, + }) + }, + + + sys_resp : { + type: "ResponseSys", + data: sim_response_binning { + start: params.sys_resp.start, + magnitude: params.sys_resp.magnitude, + time_smear: params.sys_resp.time_smear, + } + }, + + // there is one trio of PIRs (one per wire plane in a face) for + // each field response. WARNING/fixme: this sets the default DFT + // with no way to override! This config structure needs a redo! + pirs : std.mapWithIndex(function (n, fr) [ + { + type: "PlaneImpactResponse", + name : "PIR%splane%d" % [fr.name, plane], + data : sim_response_binning { + plane: plane, + dft: wc.tn($.dft), + field_response: wc.tn(fr), + // note twice we give rc so we have rc^2 in the final convolution + short_responses: if params.sys_status == false + then [wc.tn($.elec_resp[n])] + else [wc.tn($.elec_resp[n]), wc.tn($.sys_resp)], + overall_short_padding: if std.objectHas(params, 'overall_short_padding') + then params.overall_short_padding + else if params.sys_status == false + then 0.1*wc.ms + // cover the full time range of the convolved short responses + else 0.1*wc.ms - params.sys_resp.start, + // long_responses: [wc.tn($.rc_resp), wc.tn($.rc_resp)], + long_responses: if std.objectHas(params, 'rc_resp') + then std.makeArray(params.rc_resp.rc_layers, function(x) wc.tn($.rc_resp)) + else [wc.tn($.rc_resp), wc.tn($.rc_resp)], + long_padding: 1.5*wc.ms, + }, + uses: [$.dft, fr, $.elec_resp[n], $.rc_resp, $.sys_resp], + } for plane in [0,1,2]], $.fields), + + // One anode per detector "volume" + anodes : [{ + type : "AnodePlane", + name : vol.name, + data : { + // This ID is used to pick out which wires in the + // WireSchema belong to this anode plane. + ident : vol.wires, + nimpacts: params.sim.nimpacts, + // The wire schema file + wire_schema: wc.tn($.wires), + + faces : vol.faces, + }, + uses: [$.wires], + } for vol in params.det.volumes], + + // Arbitrarily call out the first anode to make single-anode + // detector config slightly cleaner. + anode: $.anodes[0], + +} + diff --git a/icaruscode/TPC/ICARUSWireCell/icarus/params.jsonnet b/icaruscode/TPC/ICARUSWireCell/icarus/params.jsonnet index 8c14af849..9acd1faba 100644 --- a/icaruscode/TPC/ICARUSWireCell/icarus/params.jsonnet +++ b/icaruscode/TPC/ICARUSWireCell/icarus/params.jsonnet @@ -84,15 +84,16 @@ base { fullscale: [0.8*wc.millivolt, 3.3*wc.volt], }, - elec: super.elec { + elec: [super.elec { type: "WarmElecResponse", - // gain: 17.8075*wc.mV/wc.fC, // 0.027 fC/(ADC*us) - // Set gain to (roughly) match data ADC values (docdb 25161) + // Old values: + // ICARUS nominal: 17.8075*wc.mV/wc.fC // 0.027 fC/(ADC*us) + // Match data ADC values (docdb 25161): 14.9654*wc.mV/wc.fC, // 0.0321 fC/(ADC*us) gain: 14.9654*wc.mV/wc.fC, // 0.0321 fC/(ADC*us) shaping: 1.3*wc.us, postgain: 1.0, start: 0, - }, + }, for _ in [0, 1, 2]], sim: super.sim { diff --git a/icaruscode/TPC/ICARUSWireCell/icarus/simparams.jsonnet b/icaruscode/TPC/ICARUSWireCell/icarus/simparams.jsonnet index 80e53eebb..dd9b0619b 100644 --- a/icaruscode/TPC/ICARUSWireCell/icarus/simparams.jsonnet +++ b/icaruscode/TPC/ICARUSWireCell/icarus/simparams.jsonnet @@ -39,15 +39,6 @@ base { // chresp: null, //}, - // This sets a relative gain at the input to the ADC. Note, if - // you are looking to fix SimDepoSource, you are in the wrong - // place. See the "scale" parameter of wcls.input.depos() defined - // in pgrapher/common/ui/wcls/nodes.jsonnet. - elec: super.elec { - // postgain: 1.0, - // shaping: 2.2 * wc.us, - }, - sys_status: false, sys_resp: { // overall_short_padding should take into account this offset "start". @@ -56,8 +47,8 @@ base { time_smear: 1.0 * wc.us, }, - rc_resp: { - width: 1.1*wc.ms, - rc_layers: 1, - } + rc_resp: { + width: 1.1*wc.ms, + rc_layers: 1, + } } diff --git a/icaruscode/TPC/ICARUSWireCell/icarus/wcls-decode-to-sig.jsonnet b/icaruscode/TPC/ICARUSWireCell/icarus/wcls-decode-to-sig.jsonnet index 5fe7ec897..f7ecc2f79 100644 --- a/icaruscode/TPC/ICARUSWireCell/icarus/wcls-decode-to-sig.jsonnet +++ b/icaruscode/TPC/ICARUSWireCell/icarus/wcls-decode-to-sig.jsonnet @@ -41,7 +41,7 @@ local params = params_init { }, }; -local tools_maker = import 'pgrapher/common/tools.jsonnet'; +local tools_maker = import 'pgrapher/experiment/icarus/icarus_tools.jsonnet'; local tools = tools_maker(params); local wcls_maker = import 'pgrapher/ui/wcls/nodes.jsonnet'; diff --git a/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel-omit-noise.jsonnet b/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel-omit-noise.jsonnet index 0fd6b5521..de5bbfdd9 100644 --- a/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel-omit-noise.jsonnet +++ b/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel-omit-noise.jsonnet @@ -7,7 +7,7 @@ local f = import 'pgrapher/common/funcs.jsonnet'; local wc = import 'wirecell.jsonnet'; local io = import 'pgrapher/common/fileio.jsonnet'; -local tools_maker = import 'pgrapher/common/tools.jsonnet'; +local tools_maker = import 'pgrapher/experiment/icarus/tools.jsonnet'; // local params = import 'pgrapher/experiment/icarus/simparams.jsonnet'; local base = import 'pgrapher/experiment/icarus/simparams.jsonnet'; local params = base { diff --git a/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel.jsonnet b/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel.jsonnet index 0d90c1e46..227f17e9d 100644 --- a/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel.jsonnet +++ b/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel.jsonnet @@ -7,9 +7,29 @@ local f = import 'pgrapher/common/funcs.jsonnet'; local wc = import 'wirecell.jsonnet'; local io = import 'pgrapher/common/fileio.jsonnet'; -local tools_maker = import 'pgrapher/common/tools.jsonnet'; +local tools_maker = import 'pgrapher/experiment/icarus/icarus_tools.jsonnet'; // local params = import 'pgrapher/experiment/icarus/simparams.jsonnet'; local base = import 'pgrapher/experiment/icarus/simparams.jsonnet'; + +// load the electronics response parameters +local er_params = [ + { + gain: std.extVar('gain0')*wc.mV/wc.fC, + shaping: std.extVar('shaping0')*wc.us, + }, + + { + gain: std.extVar('gain1')*wc.mV/wc.fC, + shaping: std.extVar('shaping1')*wc.us, + }, + + { + gain: std.extVar('gain2')*wc.mV/wc.fC, + shaping: std.extVar('shaping2')*wc.us, + }, +]; + + local params = base { lar: super.lar { // Longitudinal diffusion constant @@ -24,6 +44,25 @@ local params = base { files: super.files { fields: [ std.extVar('files_fields'), ], }, + + rc_resp: if std.extVar('file_rcresp') != "" then + { + // "icarus_fnal_rc_tail.json" + filename: std.extVar('file_rcresp'), + postgain: 1.0, + start: 0.0, + tick: 0.4*wc.us, + nticks: 4255, + type: "JsonElecResponse", + rc_layers: 1 + } + else super.rc_resp, + + elec: std.mapWithIndex(function (n, e) + e + { + gain: er_params[n].gain, + shaping: er_params[n].shaping, + }, super.elec), }; local tools = tools_maker(params); @@ -181,15 +220,15 @@ local wcls_simchannel_sink = g.pnode({ // GP: The shaping time of the electronics response (1.3us) shifts the peak // of the field response time. Eyeballing simulation times, it does this - // by a bit less than the 1.3us. + // by a bit less than the 1.3us (1us). // // N.B. for future: there is likely an additional offset on the two induction // planes due to where the deconvolution precisely defines where the "peak" // of the pulse is. One may want to refine these parameters to account for that. // This perturbation shouldn't be more than a tick or two. - u_time_offset: 1.0 * wc.us, - v_time_offset: 1.0 * wc.us, - y_time_offset: 1.0 * wc.us, + u_time_offset: std.extVar('time_offset_u') * wc.us, + v_time_offset: std.extVar('time_offset_v') * wc.us, + y_time_offset: std.extVar('time_offset_y') * wc.us, g4_ref_time: -1500 * wc.us, // G4RefTime from detectorclocks_icarus.fcl use_energy: true, diff --git a/icaruscode/TPC/ICARUSWireCell/icarus/wcls-sim-drift-simchannel.jsonnet b/icaruscode/TPC/ICARUSWireCell/icarus/wcls-sim-drift-simchannel.jsonnet index 3c67b55ab..9571169b4 100644 --- a/icaruscode/TPC/ICARUSWireCell/icarus/wcls-sim-drift-simchannel.jsonnet +++ b/icaruscode/TPC/ICARUSWireCell/icarus/wcls-sim-drift-simchannel.jsonnet @@ -11,7 +11,7 @@ local f = import 'pgrapher/common/funcs.jsonnet'; local wc = import 'wirecell.jsonnet'; local io = import 'pgrapher/common/fileio.jsonnet'; -local tools_maker = import 'pgrapher/common/tools.jsonnet'; +local tools_maker = import 'pgrapher/experiment/icarus/tools.jsonnet'; local params = import 'pgrapher/experiment/icarus/simparams.jsonnet'; local tools = tools_maker(params); From dff55125ea9c50c8e5bf20f92633a080fa2d543f Mon Sep 17 00:00:00 2001 From: gputnam Date: Tue, 2 May 2023 17:11:30 -0500 Subject: [PATCH 02/11] Fix jsonnet so each plane can have independent gain+shaping. Tune collection gain. --- .../ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl | 2 +- .../TPC/ICARUSWireCell/icarus/icarus_tools.jsonnet | 7 ++++--- .../icarus/wcls-multitpc-sim-drift-simchannel.jsonnet | 11 +++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl b/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl index 14361e6c5..899cbf58b 100644 --- a/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl +++ b/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl @@ -75,7 +75,7 @@ icarus_simwire_wirecell_fitSR.wcls_main.params.file_rcresp: "icarus_fnal_rc_tail # Add in the tuned field responses icarus_simwire_wirecell_fitSR.wcls_main.params.files_fields: "icarus_fnal_fit_ks.json.bz2" # futz with shaping+gain values -icarus_simwire_wirecell_fitSR.wcls_main.structs.gain2: 13.2390 # mV/fC +icarus_simwire_wirecell_fitSR.wcls_main.structs.gain2: 12.4915 # mV/fC icarus_simwire_wirecell_fitSR.wcls_main.structs.shaping1: 1.45 # us diff --git a/icaruscode/TPC/ICARUSWireCell/icarus/icarus_tools.jsonnet b/icaruscode/TPC/ICARUSWireCell/icarus/icarus_tools.jsonnet index 8435fb3db..2e0d72a04 100644 --- a/icaruscode/TPC/ICARUSWireCell/icarus/icarus_tools.jsonnet +++ b/icaruscode/TPC/ICARUSWireCell/icarus/icarus_tools.jsonnet @@ -76,6 +76,7 @@ function(params) type: if std.objectHas(e, "type") then e.type else "ColdElecResponse", // default + name: "Plane%iElectronicsResponse" % n, data: sim_response_binning { shaping: e.shaping, gain: e.gain, @@ -128,8 +129,8 @@ function(params) field_response: wc.tn(fr), // note twice we give rc so we have rc^2 in the final convolution short_responses: if params.sys_status == false - then [wc.tn($.elec_resp[n])] - else [wc.tn($.elec_resp[n]), wc.tn($.sys_resp)], + then [wc.tn($.elec_resp[plane])] + else [wc.tn($.elec_resp[plane]), wc.tn($.sys_resp)], overall_short_padding: if std.objectHas(params, 'overall_short_padding') then params.overall_short_padding else if params.sys_status == false @@ -142,7 +143,7 @@ function(params) else [wc.tn($.rc_resp), wc.tn($.rc_resp)], long_padding: 1.5*wc.ms, }, - uses: [$.dft, fr, $.elec_resp[n], $.rc_resp, $.sys_resp], + uses: [$.dft, fr, $.elec_resp[plane], $.rc_resp, $.sys_resp], } for plane in [0,1,2]], $.fields), // One anode per detector "volume" diff --git a/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel.jsonnet b/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel.jsonnet index 227f17e9d..395c5ba5b 100644 --- a/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel.jsonnet +++ b/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel.jsonnet @@ -29,7 +29,6 @@ local er_params = [ }, ]; - local params = base { lar: super.lar { // Longitudinal diffusion constant @@ -58,11 +57,11 @@ local params = base { } else super.rc_resp, - elec: std.mapWithIndex(function (n, e) - e + { - gain: er_params[n].gain, - shaping: er_params[n].shaping, - }, super.elec), + elec: std.mapWithIndex(function (n, eparam) + super.elec[0] + { + gain: eparam.gain, + shaping: eparam.shaping, + }, er_params), }; local tools = tools_maker(params); From 2c4bf37e9f17c4509d250c2b2e58e5ba83253784 Mon Sep 17 00:00:00 2001 From: gputnam Date: Tue, 16 May 2023 14:40:32 -0500 Subject: [PATCH 03/11] Tune gain on all three planes. --- .../TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl b/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl index 899cbf58b..4f71a190d 100644 --- a/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl +++ b/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl @@ -74,8 +74,10 @@ icarus_simwire_wirecell_fitSR: @local::icarus_simwire_wirecell icarus_simwire_wirecell_fitSR.wcls_main.params.file_rcresp: "icarus_fnal_rc_tail.json" # Add in the tuned field responses icarus_simwire_wirecell_fitSR.wcls_main.params.files_fields: "icarus_fnal_fit_ks.json.bz2" -# futz with shaping+gain values -icarus_simwire_wirecell_fitSR.wcls_main.structs.gain2: 12.4915 # mV/fC +# futz with shaping+gain values (note these are really just scale factors and should not be taken literally) +icarus_simwire_wirecell_fitSR.wcls_main.structs.gain0: 9.87267438 # mV/fC +icarus_simwire_wirecell_fitSR.wcls_main.structs.gain1: 12.13244978 # mV/fC +icarus_simwire_wirecell_fitSR.wcls_main.structs.gain2: 13.0261362 # mV/fC icarus_simwire_wirecell_fitSR.wcls_main.structs.shaping1: 1.45 # us From e665b16ca6375b15884d02557ddf3717e0b13de3 Mon Sep 17 00:00:00 2001 From: gputnam Date: Tue, 16 May 2023 14:40:41 -0500 Subject: [PATCH 04/11] Typo fixes. --- .../icarus/wcls-multitpc-sim-drift-simchannel.jsonnet | 2 +- icaruscode/TPC/ICARUSWireCell/icarus/wct-sim-check.jsonnet | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel.jsonnet b/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel.jsonnet index 395c5ba5b..1ed8feb43 100644 --- a/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel.jsonnet +++ b/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel.jsonnet @@ -58,7 +58,7 @@ local params = base { else super.rc_resp, elec: std.mapWithIndex(function (n, eparam) - super.elec[0] + { + super.elec[n] + { gain: eparam.gain, shaping: eparam.shaping, }, er_params), diff --git a/icaruscode/TPC/ICARUSWireCell/icarus/wct-sim-check.jsonnet b/icaruscode/TPC/ICARUSWireCell/icarus/wct-sim-check.jsonnet index d474dd0b4..5d1e26576 100644 --- a/icaruscode/TPC/ICARUSWireCell/icarus/wct-sim-check.jsonnet +++ b/icaruscode/TPC/ICARUSWireCell/icarus/wct-sim-check.jsonnet @@ -7,7 +7,7 @@ local f = import 'pgrapher/common/funcs.jsonnet'; local wc = import 'wirecell.jsonnet'; local io = import 'pgrapher/common/fileio.jsonnet'; -local tools_maker = import 'pgrapher/common/tools.jsonnet'; +local tools_maker = import 'pgrapher/experiment/icarus/icarus_tools.jsonnet'; local params = import 'pgrapher/experiment/icarus/simparams.jsonnet'; local tools = tools_maker(params); From 4b83fd340fc033ce968e7232904096f91cb5f3d2 Mon Sep 17 00:00:00 2001 From: gputnam Date: Tue, 16 May 2023 23:40:13 -0500 Subject: [PATCH 05/11] Update calorimetry constant for tuned signal shape simulation. --- icaruscode/TPC/Calorimetry/calorimetryICARUS.fcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/icaruscode/TPC/Calorimetry/calorimetryICARUS.fcl b/icaruscode/TPC/Calorimetry/calorimetryICARUS.fcl index 449fda020..0e5bc1560 100644 --- a/icaruscode/TPC/Calorimetry/calorimetryICARUS.fcl +++ b/icaruscode/TPC/Calorimetry/calorimetryICARUS.fcl @@ -9,7 +9,7 @@ icarus_calorimetryalgmc: @local::standard_calorimetryalgmc # Calorimetry constants from G. Putnam (Nov 2022) # Informed by MC calibration -- docdb 28639. # NOTE: needs to be revisted if/when the data processing is updated -icarus_calorimetryalgmc.CalAreaConstants: [0.01343, 0.01338, 0.01219] +icarus_calorimetryalgmc.CalAreaConstants: [0.01343, 0.01338, 0.01276] icarus_calorimetryalgdata.CalAreaConstants: @local::icarus_data_calconst icarus_calorimetryalgdata.CaloDoLifeTimeCorrection: false # handled by NormTools From cdd24a20cf91968db6b7934c5b39559da7b24fd4 Mon Sep 17 00:00:00 2001 From: gputnam Date: Wed, 17 May 2023 12:46:45 -0500 Subject: [PATCH 06/11] Tune gain to match Mikes ADC plots --- .../TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl b/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl index 4f71a190d..9c6993c62 100644 --- a/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl +++ b/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl @@ -75,8 +75,8 @@ icarus_simwire_wirecell_fitSR.wcls_main.params.file_rcresp: "icarus_fnal_rc_tail # Add in the tuned field responses icarus_simwire_wirecell_fitSR.wcls_main.params.files_fields: "icarus_fnal_fit_ks.json.bz2" # futz with shaping+gain values (note these are really just scale factors and should not be taken literally) -icarus_simwire_wirecell_fitSR.wcls_main.structs.gain0: 9.87267438 # mV/fC -icarus_simwire_wirecell_fitSR.wcls_main.structs.gain1: 12.13244978 # mV/fC +icarus_simwire_wirecell_fitSR.wcls_main.structs.gain0: 10.2636323 # mV/fC +icarus_simwire_wirecell_fitSR.wcls_main.structs.gain1: 12.1420344 # mV/fC icarus_simwire_wirecell_fitSR.wcls_main.structs.gain2: 13.0261362 # mV/fC icarus_simwire_wirecell_fitSR.wcls_main.structs.shaping1: 1.45 # us From 84f7b87c289de9ac127df337fab4f9326d17f8e5 Mon Sep 17 00:00:00 2001 From: gputnam Date: Wed, 17 May 2023 16:51:24 -0500 Subject: [PATCH 07/11] Fix cal constant in the correct place --- fcl/caf/cafmaker_add_detsim2d_icarus.fcl | 5 ++++- icaruscode/TPC/Calorimetry/calorimetryICARUS.fcl | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/fcl/caf/cafmaker_add_detsim2d_icarus.fcl b/fcl/caf/cafmaker_add_detsim2d_icarus.fcl index f766c1f57..d51c1ec3d 100644 --- a/fcl/caf/cafmaker_add_detsim2d_icarus.fcl +++ b/fcl/caf/cafmaker_add_detsim2d_icarus.fcl @@ -10,5 +10,8 @@ physics.producers.mcreco.G4ModName: @erase physics.producers.mcreco.MCParticleLabel: "largeant" physics.producers.mcreco.SimChannelLabel: "daq:simpleSC" -this_cal_constants: [1.343e-2, 1.338e-2, 0.01227] +# Mini production, pre signal shape tuning +# this_cal_constants: [1.343e-2, 1.338e-2, 0.01227] +# Post signal shape tuning +this_cal_constants: [1.343e-2, 1.338e-2, 0.01276] #include "set_caf_calconst.fcl" diff --git a/icaruscode/TPC/Calorimetry/calorimetryICARUS.fcl b/icaruscode/TPC/Calorimetry/calorimetryICARUS.fcl index 0e5bc1560..449fda020 100644 --- a/icaruscode/TPC/Calorimetry/calorimetryICARUS.fcl +++ b/icaruscode/TPC/Calorimetry/calorimetryICARUS.fcl @@ -9,7 +9,7 @@ icarus_calorimetryalgmc: @local::standard_calorimetryalgmc # Calorimetry constants from G. Putnam (Nov 2022) # Informed by MC calibration -- docdb 28639. # NOTE: needs to be revisted if/when the data processing is updated -icarus_calorimetryalgmc.CalAreaConstants: [0.01343, 0.01338, 0.01276] +icarus_calorimetryalgmc.CalAreaConstants: [0.01343, 0.01338, 0.01219] icarus_calorimetryalgdata.CalAreaConstants: @local::icarus_data_calconst icarus_calorimetryalgdata.CaloDoLifeTimeCorrection: false # handled by NormTools From 3296b673148c6d051fdf69c82314e79de8df2290 Mon Sep 17 00:00:00 2001 From: gputnam Date: Thu, 18 May 2023 13:47:31 -0500 Subject: [PATCH 08/11] Add in stage1 reco files with correct truth matching label for 2D drift. --- .../Stage1/Run2/stage1_run2_icarus_MC_detsim2d.fcl | 11 +++++++++++ .../Run2/stage1_run2_icarus_MC_slimout_detsim2d.fcl | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100644 fcl/reco/Stage1/Run2/stage1_run2_icarus_MC_detsim2d.fcl create mode 100644 fcl/reco/Stage1/Run2/stage1_run2_icarus_MC_slimout_detsim2d.fcl diff --git a/fcl/reco/Stage1/Run2/stage1_run2_icarus_MC_detsim2d.fcl b/fcl/reco/Stage1/Run2/stage1_run2_icarus_MC_detsim2d.fcl new file mode 100644 index 000000000..cbb1cf55b --- /dev/null +++ b/fcl/reco/Stage1/Run2/stage1_run2_icarus_MC_detsim2d.fcl @@ -0,0 +1,11 @@ +#include "stage1_run2_icarus_MC.fcl" + +# In the 2D-detsim, SimChannel objects are made by the WireCell +# drift simulation (daq), not LArG4 (largeant). Thus, we need +# to overwrite the truth matching labels in the calibration ntuple maker + +# Used in backtracker service +services.BackTrackerService.BackTracker.SimChannelModuleLabel: "daq:simpleSC" + +physics.analyzers.caloskimE.SimChannelproducer: "daq:simpleSC" +physics.analyzers.caloskimW.SimChannelproducer: "daq:simpleSC" diff --git a/fcl/reco/Stage1/Run2/stage1_run2_icarus_MC_slimout_detsim2d.fcl b/fcl/reco/Stage1/Run2/stage1_run2_icarus_MC_slimout_detsim2d.fcl new file mode 100644 index 000000000..8a5aa604f --- /dev/null +++ b/fcl/reco/Stage1/Run2/stage1_run2_icarus_MC_slimout_detsim2d.fcl @@ -0,0 +1,11 @@ +#include "stage1_run2_icarus_MC_slimout.fcl" + +# In the 2D-detsim, SimChannel objects are made by the WireCell +# drift simulation (daq), not LArG4 (largeant). Thus, we need +# to overwrite the truth matching labels in the calibration ntuple maker + +# Used in backtracker service +services.BackTrackerService.BackTracker.SimChannelModuleLabel: "daq:simpleSC" + +physics.analyzers.caloskimE.SimChannelproducer: "daq:simpleSC" +physics.analyzers.caloskimW.SimChannelproducer: "daq:simpleSC" From af395489675cf501dbb734042d2c02b64bb3c888 Mon Sep 17 00:00:00 2001 From: gputnam Date: Thu, 18 May 2023 14:02:34 -0500 Subject: [PATCH 09/11] Revert "Add in stage1 reco files with correct truth matching label for 2D drift." This reverts commit bc9bb19090bb9e96735dff2ac43610d42cdd366e. --- .../Stage1/Run2/stage1_run2_icarus_MC_detsim2d.fcl | 11 ----------- .../Run2/stage1_run2_icarus_MC_slimout_detsim2d.fcl | 11 ----------- 2 files changed, 22 deletions(-) delete mode 100644 fcl/reco/Stage1/Run2/stage1_run2_icarus_MC_detsim2d.fcl delete mode 100644 fcl/reco/Stage1/Run2/stage1_run2_icarus_MC_slimout_detsim2d.fcl diff --git a/fcl/reco/Stage1/Run2/stage1_run2_icarus_MC_detsim2d.fcl b/fcl/reco/Stage1/Run2/stage1_run2_icarus_MC_detsim2d.fcl deleted file mode 100644 index cbb1cf55b..000000000 --- a/fcl/reco/Stage1/Run2/stage1_run2_icarus_MC_detsim2d.fcl +++ /dev/null @@ -1,11 +0,0 @@ -#include "stage1_run2_icarus_MC.fcl" - -# In the 2D-detsim, SimChannel objects are made by the WireCell -# drift simulation (daq), not LArG4 (largeant). Thus, we need -# to overwrite the truth matching labels in the calibration ntuple maker - -# Used in backtracker service -services.BackTrackerService.BackTracker.SimChannelModuleLabel: "daq:simpleSC" - -physics.analyzers.caloskimE.SimChannelproducer: "daq:simpleSC" -physics.analyzers.caloskimW.SimChannelproducer: "daq:simpleSC" diff --git a/fcl/reco/Stage1/Run2/stage1_run2_icarus_MC_slimout_detsim2d.fcl b/fcl/reco/Stage1/Run2/stage1_run2_icarus_MC_slimout_detsim2d.fcl deleted file mode 100644 index 8a5aa604f..000000000 --- a/fcl/reco/Stage1/Run2/stage1_run2_icarus_MC_slimout_detsim2d.fcl +++ /dev/null @@ -1,11 +0,0 @@ -#include "stage1_run2_icarus_MC_slimout.fcl" - -# In the 2D-detsim, SimChannel objects are made by the WireCell -# drift simulation (daq), not LArG4 (largeant). Thus, we need -# to overwrite the truth matching labels in the calibration ntuple maker - -# Used in backtracker service -services.BackTrackerService.BackTracker.SimChannelModuleLabel: "daq:simpleSC" - -physics.analyzers.caloskimE.SimChannelproducer: "daq:simpleSC" -physics.analyzers.caloskimW.SimChannelproducer: "daq:simpleSC" From 4b6805985df23b3688a59eee175c61ff2d6032fa Mon Sep 17 00:00:00 2001 From: gputnam Date: Mon, 22 May 2023 19:28:13 -0500 Subject: [PATCH 10/11] Fix gain value --- fcl/caf/cafmaker_add_detsim2d_icarus.fcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fcl/caf/cafmaker_add_detsim2d_icarus.fcl b/fcl/caf/cafmaker_add_detsim2d_icarus.fcl index d51c1ec3d..c3f8fe0e0 100644 --- a/fcl/caf/cafmaker_add_detsim2d_icarus.fcl +++ b/fcl/caf/cafmaker_add_detsim2d_icarus.fcl @@ -13,5 +13,5 @@ physics.producers.mcreco.SimChannelLabel: "daq:simpleSC" # Mini production, pre signal shape tuning # this_cal_constants: [1.343e-2, 1.338e-2, 0.01227] # Post signal shape tuning -this_cal_constants: [1.343e-2, 1.338e-2, 0.01276] +this_cal_constants: [1.343e-2, 1.338e-2, 0.01262] #include "set_caf_calconst.fcl" From bb0984b1891c2d3471d1efb6e2a1293c289a2dc6 Mon Sep 17 00:00:00 2001 From: gputnam Date: Mon, 22 May 2023 21:15:56 -0500 Subject: [PATCH 11/11] Fix gain one more time... --- fcl/caf/cafmaker_add_detsim2d_icarus.fcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fcl/caf/cafmaker_add_detsim2d_icarus.fcl b/fcl/caf/cafmaker_add_detsim2d_icarus.fcl index c3f8fe0e0..969eb4e7a 100644 --- a/fcl/caf/cafmaker_add_detsim2d_icarus.fcl +++ b/fcl/caf/cafmaker_add_detsim2d_icarus.fcl @@ -13,5 +13,5 @@ physics.producers.mcreco.SimChannelLabel: "daq:simpleSC" # Mini production, pre signal shape tuning # this_cal_constants: [1.343e-2, 1.338e-2, 0.01227] # Post signal shape tuning -this_cal_constants: [1.343e-2, 1.338e-2, 0.01262] +this_cal_constants: [1.343e-2, 1.338e-2, 0.01285] #include "set_caf_calconst.fcl"