From aa0e95a8265654acefc29aed318e2eb5c7ca943d Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Fri, 16 May 2025 11:11:48 -0500 Subject: [PATCH 01/31] Reorganize standard fcls. Update to new MC path. Add in overlay path. --- fcl/standard/CMakeLists.txt | 11 ++++------- fcl/standard/data/CMakeLists.txt | 8 ++++++++ fcl/standard/{ => data}/standard_data_caf_icarus.fcl | 0 .../{ => data}/standard_data_larcv_icarus.fcl | 0 .../{ => data}/standard_data_stage0_icarus.fcl | 0 .../{ => data}/standard_data_stage1_icarus.fcl | 0 .../{ => data}/standard_data_stage1larcv_icarus.fcl | 0 fcl/standard/mc/CMakeLists.txt | 8 ++++++++ fcl/standard/mc/standard_mc_all_detsim_icarus.fcl | 1 + .../{ => mc}/standard_mc_all_larcv_icarus.fcl | 0 fcl/standard/mc/standard_mc_all_stage0_icarus.fcl | 1 + fcl/standard/mc/standard_mc_all_stage1_icarus.fcl | 1 + .../{ => mc}/standard_mc_beamcosmics_caf_icarus.fcl | 0 fcl/standard/mc/standard_mc_beamcosmics_g4_icarus.fcl | 1 + .../{ => mc}/standard_mc_intime_caf_icarus.fcl | 0 fcl/standard/mc/standard_mc_intime_g4_icarus.fcl | 1 + .../standard_mc_mpvmpr_stage1larcv_icarus.fcl | 0 fcl/standard/overlay/CMakeLists.txt | 8 ++++++++ fcl/standard/overlay/standard_overlay_caf_iarus.fcl | 1 + .../overlay/standard_overlay_detsim_icarus.fcl | 1 + .../overlay/standard_overlay_overlay_icarus.fcl | 1 + .../overlay/standard_overlay_stage0_icarus.fcl | 1 + .../overlay/standard_overlay_stage1_icarus.fcl | 1 + fcl/standard/standard_mc_all_detsim_icarus.fcl | 1 - fcl/standard/standard_mc_all_stage0_icarus.fcl | 1 - fcl/standard/standard_mc_all_stage1_icarus.fcl | 1 - fcl/standard/standard_mc_all_stage1larcv_icarus.fcl | 1 - fcl/standard/standard_mc_beamcosmics_g4_icarus.fcl | 1 - fcl/standard/standard_mc_intime_g4_icarus.fcl | 1 - 29 files changed, 38 insertions(+), 13 deletions(-) create mode 100644 fcl/standard/data/CMakeLists.txt rename fcl/standard/{ => data}/standard_data_caf_icarus.fcl (100%) rename fcl/standard/{ => data}/standard_data_larcv_icarus.fcl (100%) rename fcl/standard/{ => data}/standard_data_stage0_icarus.fcl (100%) rename fcl/standard/{ => data}/standard_data_stage1_icarus.fcl (100%) rename fcl/standard/{ => data}/standard_data_stage1larcv_icarus.fcl (100%) create mode 100644 fcl/standard/mc/CMakeLists.txt create mode 100644 fcl/standard/mc/standard_mc_all_detsim_icarus.fcl rename fcl/standard/{ => mc}/standard_mc_all_larcv_icarus.fcl (100%) create mode 100644 fcl/standard/mc/standard_mc_all_stage0_icarus.fcl create mode 100644 fcl/standard/mc/standard_mc_all_stage1_icarus.fcl rename fcl/standard/{ => mc}/standard_mc_beamcosmics_caf_icarus.fcl (100%) create mode 100644 fcl/standard/mc/standard_mc_beamcosmics_g4_icarus.fcl rename fcl/standard/{ => mc}/standard_mc_intime_caf_icarus.fcl (100%) create mode 100644 fcl/standard/mc/standard_mc_intime_g4_icarus.fcl rename fcl/standard/{ => mc}/standard_mc_mpvmpr_stage1larcv_icarus.fcl (100%) create mode 100644 fcl/standard/overlay/CMakeLists.txt create mode 100644 fcl/standard/overlay/standard_overlay_caf_iarus.fcl create mode 100644 fcl/standard/overlay/standard_overlay_detsim_icarus.fcl create mode 100644 fcl/standard/overlay/standard_overlay_overlay_icarus.fcl create mode 100644 fcl/standard/overlay/standard_overlay_stage0_icarus.fcl create mode 100644 fcl/standard/overlay/standard_overlay_stage1_icarus.fcl delete mode 100644 fcl/standard/standard_mc_all_detsim_icarus.fcl delete mode 100644 fcl/standard/standard_mc_all_stage0_icarus.fcl delete mode 100644 fcl/standard/standard_mc_all_stage1_icarus.fcl delete mode 100644 fcl/standard/standard_mc_all_stage1larcv_icarus.fcl delete mode 100644 fcl/standard/standard_mc_beamcosmics_g4_icarus.fcl delete mode 100644 fcl/standard/standard_mc_intime_g4_icarus.fcl diff --git a/fcl/standard/CMakeLists.txt b/fcl/standard/CMakeLists.txt index 9714229ee..178294463 100644 --- a/fcl/standard/CMakeLists.txt +++ b/fcl/standard/CMakeLists.txt @@ -1,8 +1,5 @@ -# Install fcl files +cet_enable_asserts() -install_fhicl() - -# Also put a copy in the source tree. - -FILE(GLOB fcl_files *.fcl) -install_source( EXTRAS ${fcl_files} ) +add_subdirectory(mc) +add_subdirectory(data) +add_subdirectory(overlay) diff --git a/fcl/standard/data/CMakeLists.txt b/fcl/standard/data/CMakeLists.txt new file mode 100644 index 000000000..9714229ee --- /dev/null +++ b/fcl/standard/data/CMakeLists.txt @@ -0,0 +1,8 @@ +# Install fcl files + +install_fhicl() + +# Also put a copy in the source tree. + +FILE(GLOB fcl_files *.fcl) +install_source( EXTRAS ${fcl_files} ) diff --git a/fcl/standard/standard_data_caf_icarus.fcl b/fcl/standard/data/standard_data_caf_icarus.fcl similarity index 100% rename from fcl/standard/standard_data_caf_icarus.fcl rename to fcl/standard/data/standard_data_caf_icarus.fcl diff --git a/fcl/standard/standard_data_larcv_icarus.fcl b/fcl/standard/data/standard_data_larcv_icarus.fcl similarity index 100% rename from fcl/standard/standard_data_larcv_icarus.fcl rename to fcl/standard/data/standard_data_larcv_icarus.fcl diff --git a/fcl/standard/standard_data_stage0_icarus.fcl b/fcl/standard/data/standard_data_stage0_icarus.fcl similarity index 100% rename from fcl/standard/standard_data_stage0_icarus.fcl rename to fcl/standard/data/standard_data_stage0_icarus.fcl diff --git a/fcl/standard/standard_data_stage1_icarus.fcl b/fcl/standard/data/standard_data_stage1_icarus.fcl similarity index 100% rename from fcl/standard/standard_data_stage1_icarus.fcl rename to fcl/standard/data/standard_data_stage1_icarus.fcl diff --git a/fcl/standard/standard_data_stage1larcv_icarus.fcl b/fcl/standard/data/standard_data_stage1larcv_icarus.fcl similarity index 100% rename from fcl/standard/standard_data_stage1larcv_icarus.fcl rename to fcl/standard/data/standard_data_stage1larcv_icarus.fcl diff --git a/fcl/standard/mc/CMakeLists.txt b/fcl/standard/mc/CMakeLists.txt new file mode 100644 index 000000000..9714229ee --- /dev/null +++ b/fcl/standard/mc/CMakeLists.txt @@ -0,0 +1,8 @@ +# Install fcl files + +install_fhicl() + +# Also put a copy in the source tree. + +FILE(GLOB fcl_files *.fcl) +install_source( EXTRAS ${fcl_files} ) diff --git a/fcl/standard/mc/standard_mc_all_detsim_icarus.fcl b/fcl/standard/mc/standard_mc_all_detsim_icarus.fcl new file mode 100644 index 000000000..4b81669ba --- /dev/null +++ b/fcl/standard/mc/standard_mc_all_detsim_icarus.fcl @@ -0,0 +1 @@ +#include "detsim_2d_icarus_refactored_yzsim.fcl" diff --git a/fcl/standard/standard_mc_all_larcv_icarus.fcl b/fcl/standard/mc/standard_mc_all_larcv_icarus.fcl similarity index 100% rename from fcl/standard/standard_mc_all_larcv_icarus.fcl rename to fcl/standard/mc/standard_mc_all_larcv_icarus.fcl diff --git a/fcl/standard/mc/standard_mc_all_stage0_icarus.fcl b/fcl/standard/mc/standard_mc_all_stage0_icarus.fcl new file mode 100644 index 000000000..c90fdc3b2 --- /dev/null +++ b/fcl/standard/mc/standard_mc_all_stage0_icarus.fcl @@ -0,0 +1 @@ +#include "stage0_run2_wcdnn_icarus_mc.fcl" diff --git a/fcl/standard/mc/standard_mc_all_stage1_icarus.fcl b/fcl/standard/mc/standard_mc_all_stage1_icarus.fcl new file mode 100644 index 000000000..7f5fe82b0 --- /dev/null +++ b/fcl/standard/mc/standard_mc_all_stage1_icarus.fcl @@ -0,0 +1 @@ +#include "stage1_run2_icarus_MC.fcl" diff --git a/fcl/standard/standard_mc_beamcosmics_caf_icarus.fcl b/fcl/standard/mc/standard_mc_beamcosmics_caf_icarus.fcl similarity index 100% rename from fcl/standard/standard_mc_beamcosmics_caf_icarus.fcl rename to fcl/standard/mc/standard_mc_beamcosmics_caf_icarus.fcl diff --git a/fcl/standard/mc/standard_mc_beamcosmics_g4_icarus.fcl b/fcl/standard/mc/standard_mc_beamcosmics_g4_icarus.fcl new file mode 100644 index 000000000..a42168087 --- /dev/null +++ b/fcl/standard/mc/standard_mc_beamcosmics_g4_icarus.fcl @@ -0,0 +1 @@ +#include "larg4_icarus_cosmics_sce.fcl" diff --git a/fcl/standard/standard_mc_intime_caf_icarus.fcl b/fcl/standard/mc/standard_mc_intime_caf_icarus.fcl similarity index 100% rename from fcl/standard/standard_mc_intime_caf_icarus.fcl rename to fcl/standard/mc/standard_mc_intime_caf_icarus.fcl diff --git a/fcl/standard/mc/standard_mc_intime_g4_icarus.fcl b/fcl/standard/mc/standard_mc_intime_g4_icarus.fcl new file mode 100644 index 000000000..e3695ae4b --- /dev/null +++ b/fcl/standard/mc/standard_mc_intime_g4_icarus.fcl @@ -0,0 +1 @@ +#include "larg4_icarus_intime_sce.fcl" diff --git a/fcl/standard/standard_mc_mpvmpr_stage1larcv_icarus.fcl b/fcl/standard/mc/standard_mc_mpvmpr_stage1larcv_icarus.fcl similarity index 100% rename from fcl/standard/standard_mc_mpvmpr_stage1larcv_icarus.fcl rename to fcl/standard/mc/standard_mc_mpvmpr_stage1larcv_icarus.fcl diff --git a/fcl/standard/overlay/CMakeLists.txt b/fcl/standard/overlay/CMakeLists.txt new file mode 100644 index 000000000..9714229ee --- /dev/null +++ b/fcl/standard/overlay/CMakeLists.txt @@ -0,0 +1,8 @@ +# Install fcl files + +install_fhicl() + +# Also put a copy in the source tree. + +FILE(GLOB fcl_files *.fcl) +install_source( EXTRAS ${fcl_files} ) diff --git a/fcl/standard/overlay/standard_overlay_caf_iarus.fcl b/fcl/standard/overlay/standard_overlay_caf_iarus.fcl new file mode 100644 index 000000000..ff0de4039 --- /dev/null +++ b/fcl/standard/overlay/standard_overlay_caf_iarus.fcl @@ -0,0 +1 @@ +#include "cafmakerjob_icarus_detsim2d_systtools_and_fluxwgt_overlay.fcl" diff --git a/fcl/standard/overlay/standard_overlay_detsim_icarus.fcl b/fcl/standard/overlay/standard_overlay_detsim_icarus.fcl new file mode 100644 index 000000000..d5a62b5cc --- /dev/null +++ b/fcl/standard/overlay/standard_overlay_detsim_icarus.fcl @@ -0,0 +1 @@ +#include "detsim_2d_icarus_refactored_overlay.fcl" diff --git a/fcl/standard/overlay/standard_overlay_overlay_icarus.fcl b/fcl/standard/overlay/standard_overlay_overlay_icarus.fcl new file mode 100644 index 000000000..6d70a1ace --- /dev/null +++ b/fcl/standard/overlay/standard_overlay_overlay_icarus.fcl @@ -0,0 +1 @@ +#include "overlay_waveforms.fcl" diff --git a/fcl/standard/overlay/standard_overlay_stage0_icarus.fcl b/fcl/standard/overlay/standard_overlay_stage0_icarus.fcl new file mode 100644 index 000000000..d91fab811 --- /dev/null +++ b/fcl/standard/overlay/standard_overlay_stage0_icarus.fcl @@ -0,0 +1 @@ +#include "stage0_run2_wc_icarus_overlay.fcl" diff --git a/fcl/standard/overlay/standard_overlay_stage1_icarus.fcl b/fcl/standard/overlay/standard_overlay_stage1_icarus.fcl new file mode 100644 index 000000000..2ec9c1f23 --- /dev/null +++ b/fcl/standard/overlay/standard_overlay_stage1_icarus.fcl @@ -0,0 +1 @@ +#include "stage1_run2_icarus_overlay.fcl" diff --git a/fcl/standard/standard_mc_all_detsim_icarus.fcl b/fcl/standard/standard_mc_all_detsim_icarus.fcl deleted file mode 100644 index 13685eafc..000000000 --- a/fcl/standard/standard_mc_all_detsim_icarus.fcl +++ /dev/null @@ -1 +0,0 @@ -#include "detsim_2d_icarus_refactored.fcl" diff --git a/fcl/standard/standard_mc_all_stage0_icarus.fcl b/fcl/standard/standard_mc_all_stage0_icarus.fcl deleted file mode 100644 index feb8aca63..000000000 --- a/fcl/standard/standard_mc_all_stage0_icarus.fcl +++ /dev/null @@ -1 +0,0 @@ -#include "stage0_run2_icarus_mc.fcl" diff --git a/fcl/standard/standard_mc_all_stage1_icarus.fcl b/fcl/standard/standard_mc_all_stage1_icarus.fcl deleted file mode 100644 index 86d4b0eba..000000000 --- a/fcl/standard/standard_mc_all_stage1_icarus.fcl +++ /dev/null @@ -1 +0,0 @@ -#include "stage1_run2_1d_icarus_MC.fcl" diff --git a/fcl/standard/standard_mc_all_stage1larcv_icarus.fcl b/fcl/standard/standard_mc_all_stage1larcv_icarus.fcl deleted file mode 100644 index caf161ca4..000000000 --- a/fcl/standard/standard_mc_all_stage1larcv_icarus.fcl +++ /dev/null @@ -1 +0,0 @@ -#include "stage1_run2_1d_larcv_icarus_MC.fcl" diff --git a/fcl/standard/standard_mc_beamcosmics_g4_icarus.fcl b/fcl/standard/standard_mc_beamcosmics_g4_icarus.fcl deleted file mode 100644 index 687f1fe35..000000000 --- a/fcl/standard/standard_mc_beamcosmics_g4_icarus.fcl +++ /dev/null @@ -1 +0,0 @@ -#include "larg4_icarus_cosmics_sce_2d_drift.fcl" diff --git a/fcl/standard/standard_mc_intime_g4_icarus.fcl b/fcl/standard/standard_mc_intime_g4_icarus.fcl deleted file mode 100644 index 05c30a5c9..000000000 --- a/fcl/standard/standard_mc_intime_g4_icarus.fcl +++ /dev/null @@ -1 +0,0 @@ -#include "larg4_icarus_intime_sce_2d_drift.fcl" From d45b9f50aa7c44031aef41fe436746c9ff5578ca Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Fri, 16 May 2025 11:12:38 -0500 Subject: [PATCH 02/31] Fhicl file to convert ChannelROIs back into Wires --- fcl/reco/CMakeLists.txt | 1 + fcl/reco/wires/CMakeLists.txt | 3 ++ fcl/reco/wires/restorewires_icarus.fcl | 60 ++++++++++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 fcl/reco/wires/CMakeLists.txt create mode 100644 fcl/reco/wires/restorewires_icarus.fcl diff --git a/fcl/reco/CMakeLists.txt b/fcl/reco/CMakeLists.txt index de9682fc7..565e07219 100644 --- a/fcl/reco/CMakeLists.txt +++ b/fcl/reco/CMakeLists.txt @@ -13,6 +13,7 @@ add_subdirectory(ForCITests) #add_subdirectory(archive) add_subdirectory(Definitions) add_subdirectory(larcv) +add_subdirectory(wires) add_subdirectory(ntuple) add_subdirectory(Stage0) add_subdirectory(Stage1) diff --git a/fcl/reco/wires/CMakeLists.txt b/fcl/reco/wires/CMakeLists.txt new file mode 100644 index 000000000..2bda0f610 --- /dev/null +++ b/fcl/reco/wires/CMakeLists.txt @@ -0,0 +1,3 @@ +cet_enable_asserts() + +install_fhicl() diff --git a/fcl/reco/wires/restorewires_icarus.fcl b/fcl/reco/wires/restorewires_icarus.fcl new file mode 100644 index 000000000..723c92e43 --- /dev/null +++ b/fcl/reco/wires/restorewires_icarus.fcl @@ -0,0 +1,60 @@ +# Configuration for running the Calibration NTupler +# on a stage-1 reco file +# +#include "services_common_icarus.fcl" +#include "wirechannelroiconverters_sbn.fcl" + +process_name: ntuple + +services: +{ + @table::icarus_wirecalibration_services +} + +#source is a root file +source: +{ + module_type: RootInput + maxEvents: 10 # Number of events to create + saveMemoryObjectThreshold: 0 +} + +# only do analysis +physics: +{ + + producers: { + channel2wire: @local::channelroitowire + } + + filters: {} + + analyzers: + { + } + + out: [rootOutput] + reco: [channel2wire] + trigger_paths: [reco] + end_paths: [out] +} + +physics.producers.channel2wire.WireModuleLabelVec: ["wire2channelroi2d:PHYSCRATEDATATPCEE", "wire2channelroi2d:PHYSCRATEDATATPCEW", "wire2channelroi2d:PHYSCRATEDATATPCWE", "wire2channelroi2d:PHYSCRATEDATATPCWW"] +physics.producers.channel2wire.OutInstanceLabelVec: ["PHYSCRATEDATATPCWW","PHYSCRATEDATATPCWE","PHYSCRATEDATATPCEW","PHYSCRATEDATATPCEE"] + +physics.analyzers.caloskimE.SelectEvents: [ ] +physics.analyzers.caloskimW.SelectEvents: [ ] +physics.analyzers.simpleLightAna.SelectEvents: [ ] +physics.analyzers.supera.SelectEvents: [ ] + +outputs: +{ + rootOutput: + { + module_type: RootOutput + dataTier: "reconstructed" + compressionLevel: 1 + saveMemoryObjectThreshold: 0 + fileName: "%ifb_%tc-%p.root" + } +} From cb50ecb3ec2624ca0402f13c85eb18faf5d7f9f3 Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Fri, 16 May 2025 11:13:14 -0500 Subject: [PATCH 03/31] Fix input label for MC stage0. --- fcl/reco/Stage0/mc/stage0_run2_wc_icarus_mc.fcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fcl/reco/Stage0/mc/stage0_run2_wc_icarus_mc.fcl b/fcl/reco/Stage0/mc/stage0_run2_wc_icarus_mc.fcl index c10e139a1..ed15d7f0d 100644 --- a/fcl/reco/Stage0/mc/stage0_run2_wc_icarus_mc.fcl +++ b/fcl/reco/Stage0/mc/stage0_run2_wc_icarus_mc.fcl @@ -36,7 +36,7 @@ outputs.rootOutput.outputCommands: ["keep *_*_*_*", "keep *_daq_simpleSC*_*"] # Set the expected input for ophit -physics.producers.ophit.InputModule: "opdaq" +physics.producers.ophit.InputModule: "shifted" # Set up for the single module mutliple TPC mode... physics.producers.MCDecodeTPCROI.FragmentsLabelVec: ["daq:TPCWW","daq:TPCWE","daq:TPCEW","daq:TPCEE"] From 1339362cabca9a8ccca760da9909a3eba4afccd5 Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Sat, 17 May 2025 12:23:05 -0500 Subject: [PATCH 04/31] Get non-YZ detsim configs working. Add in overlay option to non-YZ sim. --- fcl/detsim/detsim_2d_icarus_refactored.fcl | 2 +- .../detsim_2d_icarus_refactored_overlay.fcl | 3 +++ .../detsimmodules_wirecell_ICARUS.fcl | 8 ++++++++ ...titpc-sim-drift-simchannel-refactored.jsonnet | 16 +++++++++++++--- 4 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 fcl/detsim/detsim_2d_icarus_refactored_overlay.fcl diff --git a/fcl/detsim/detsim_2d_icarus_refactored.fcl b/fcl/detsim/detsim_2d_icarus_refactored.fcl index 993ce8586..799170d15 100644 --- a/fcl/detsim/detsim_2d_icarus_refactored.fcl +++ b/fcl/detsim/detsim_2d_icarus_refactored.fcl @@ -19,7 +19,7 @@ physics: { crtdaq: @local::icarus_crtsim opdaq: @local::icarus_simpmt - daq: @local::icarus_simwire_wirecell_filtersed + daq: @local::icarus_simwire_wirecell_shifted rns: { module_type: "RandomNumberSaver" } } # producers diff --git a/fcl/detsim/detsim_2d_icarus_refactored_overlay.fcl b/fcl/detsim/detsim_2d_icarus_refactored_overlay.fcl new file mode 100644 index 000000000..bf9754683 --- /dev/null +++ b/fcl/detsim/detsim_2d_icarus_refactored_overlay.fcl @@ -0,0 +1,3 @@ +#include "detsim_2d_icarus_refactored.fcl" + +physics.producers.daq: @local::icarus_simwire_wirecell_shifted_overlay diff --git a/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl b/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl index 6bc7c326f..093261634 100644 --- a/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl +++ b/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl @@ -81,6 +81,14 @@ icarus_simwire_wirecell_SConly.wcls_main.outputers:[ icarus_simwire_wirecell_shifted: @local::icarus_simwire_wirecell icarus_simwire_wirecell_shifted.wcls_main.params.SimEnergyDepositLabel: "shifted" +icarus_simwire_wirecell_shifted_overlay: @local::icarus_simwire_wirecell_shifted +icarus_simwire_wirecell_shifted_overlay.wcls_main.structs.coh_noise_scale: 0.0 # disable noise +icarus_simwire_wirecell_shifted_overlay.wcls_main.structs.int_noise_scale: 0.0 # ditto +icarus_simwire_wirecell_shifted_overlay.wcls_main.structs.overlay_drifter: true +icarus_simwire_wirecell_shifted_overlay.wcls_main.plugins: [@sequence::icarus_simwire_wirecell_shifted_overlay.wcls_main.plugins, "WireCellICARUSDrifter"] +icarus_simwire_wirecell_shifted_overlay.wcls_main.inputers: ["wclsSimDepoSetSource:electron", "wclsICARUSDrifter:drifter"] +icarus_simwire_wirecell_shifted_overlay.wcls_main.params.cathode_input_format: "scalar" + icarus_simwire_wirecell_filtersed: @local::icarus_simwire_wirecell icarus_simwire_wirecell_filtersed.wcls_main.params.SimEnergyDepositLabel: "filtersed" diff --git a/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel-refactored.jsonnet b/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel-refactored.jsonnet index e5a0210df..663f19860 100644 --- a/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel-refactored.jsonnet +++ b/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel-refactored.jsonnet @@ -166,12 +166,22 @@ local wcls_output = { sp_thresholds: wcls.output.thresholds(name='spthresholds', tags=['threshold']), }; -//local deposio = io.numpy.depos(output); -local drifter = sim.drifter; +local overlay_drifter = std.extVar("overlay_drifter"); + +local drifter = if overlay_drifter then { + local xregions = wc.unique_list(std.flattenArrays([v.faces for v in params.det.volumes])), + type: "wclsICARUSDrifter", + name: "drifter", + data: params.lar + sim.overlay_drifter_data { + TPC: 0, + charge_scale: 1 + }, + } else sim.drifter; + local setdrifter = g.pnode({ type: 'DepoSetDrifter', data: { - drifter: "Drifter" + drifter: wc.tn(drifter) } }, nin=1, nout=1, uses=[drifter]); From 8d5d447a6f49c67d85943b9d6d8243fdfc0d3fcd Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Sat, 17 May 2025 12:24:30 -0500 Subject: [PATCH 05/31] Tune sim-reco timing offsets to 2D deconv. --- .../TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl b/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl index 093261634..5da3c8673 100644 --- a/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl +++ b/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl @@ -62,11 +62,10 @@ icarus_simwire_wirecell: shaping1: 1.45 # us shaping2: 1.3 # us - # Time offsets for truth matching - time_offset_u: 0.0 # us - time_offset_v: 0.0 # us - time_offset_y: 0.0 # us - + # Time offsets for truth matching -- tuned to 2D deconvolution output + time_offset_u: 1.81 # us + time_offset_v: 2.08 # us + time_offset_y: 1.82 # us } } } From a75c82ed22742a0dd0983eb0c2b695087788931e Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Tue, 20 May 2025 11:34:10 -0500 Subject: [PATCH 06/31] Fix ophit label. --- fcl/reco/Stage0/mc/stage0_run2_icarus_mc.fcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fcl/reco/Stage0/mc/stage0_run2_icarus_mc.fcl b/fcl/reco/Stage0/mc/stage0_run2_icarus_mc.fcl index 8e8085d25..3456eee69 100644 --- a/fcl/reco/Stage0/mc/stage0_run2_icarus_mc.fcl +++ b/fcl/reco/Stage0/mc/stage0_run2_icarus_mc.fcl @@ -38,7 +38,7 @@ outputs.rootOutput.outputCommands: ["keep *_*_*_*", "keep *_daq_simpleSC*_*"] # Set the expected input for ophit -physics.producers.ophit.InputModule: "opdaq" +physics.producers.ophit.InputModule: "shifted" # Note the default assumption is that our detector simulation input will come from the WireCell 2D drift simulation, a la 'daq' # If we are running the 1D drift simulation we need to switch to using: From 5f4c23e7cc3fceb3469d4c7ab5ab4b320bd507ed Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Wed, 21 May 2025 12:48:15 -0500 Subject: [PATCH 07/31] Add partial fcls back into icaruscode --- fcl/reco/Stage0/data/CMakeLists.txt | 2 + fcl/reco/Stage0/data/partial/CMakeLists.txt | 1 + .../Stage0/data/partial/decodePMT_icarus.fcl | 145 ++++++++++++++++++ .../partial/decodePMT_icarus_incomplete.fcl | 15 ++ .../partial/decodePMT_icarus_standalone.fcl | 69 +++++++++ .../partial/decodePMT_icarus_treeonly.fcl | 68 ++++++++ .../data/partial/decodeTrigger_icarus.fcl | 56 +++++++ .../partial/stage0_run2_icarus_opdetonly.fcl | 19 +++ 8 files changed, 375 insertions(+) create mode 100644 fcl/reco/Stage0/data/partial/CMakeLists.txt create mode 100644 fcl/reco/Stage0/data/partial/decodePMT_icarus.fcl create mode 100644 fcl/reco/Stage0/data/partial/decodePMT_icarus_incomplete.fcl create mode 100644 fcl/reco/Stage0/data/partial/decodePMT_icarus_standalone.fcl create mode 100644 fcl/reco/Stage0/data/partial/decodePMT_icarus_treeonly.fcl create mode 100644 fcl/reco/Stage0/data/partial/decodeTrigger_icarus.fcl create mode 100644 fcl/reco/Stage0/data/partial/stage0_run2_icarus_opdetonly.fcl diff --git a/fcl/reco/Stage0/data/CMakeLists.txt b/fcl/reco/Stage0/data/CMakeLists.txt index 2bda0f610..9b8e98380 100644 --- a/fcl/reco/Stage0/data/CMakeLists.txt +++ b/fcl/reco/Stage0/data/CMakeLists.txt @@ -1,3 +1,5 @@ +add_subdirectory(partial) + cet_enable_asserts() install_fhicl() diff --git a/fcl/reco/Stage0/data/partial/CMakeLists.txt b/fcl/reco/Stage0/data/partial/CMakeLists.txt new file mode 100644 index 000000000..13355789a --- /dev/null +++ b/fcl/reco/Stage0/data/partial/CMakeLists.txt @@ -0,0 +1 @@ +install_fhicl() diff --git a/fcl/reco/Stage0/data/partial/decodePMT_icarus.fcl b/fcl/reco/Stage0/data/partial/decodePMT_icarus.fcl new file mode 100644 index 000000000..d22be3e79 --- /dev/null +++ b/fcl/reco/Stage0/data/partial/decodePMT_icarus.fcl @@ -0,0 +1,145 @@ +# +# File: decodePMT_icarus.fcl +# Purpose: PMT readout fragment decoding for studies in ICARUS. +# Author: Gianluca Petrillo (petrillo@slac.stanford.edu) +# Date: May 12, 2021 +# +# +# PMT waveform decoding is performed, extensive debugging messages are +# included in the `debug.log` log file, and ROOT trees are produced for studies. +# This configuration, as is, is not meant for production. +# +# +# Input +# ------ +# +# * artDAQ fragments from all 24 PMT readout boards, named +# `daq:ContainerCAENV1730` +# * trigger fragment `daq:ICARUSTriggerUDP` (will be decoded as well) +# * DAQ configuration as FHiCL in the art/ROOT input file +# +# This configuration requires a data fragment for each PMT readout board +# which is mentioned in `physics.producers.daqPMT.DecoderTool.BoardSetup`, +# which by default is all 24. If the input run misses some PMT readout boards, +# use `decodePMT_icarus_incomplete.fcl` instead. +# +# +# Output +# ------- +# +# Only new data products are written in the art/ROOT output file, including: +# +# * `daqPMT` (std::vector): decoded waveforms, +# with our best reconstruction for their time stamps in LArSoft reference +# +# +# The `Trees-*.root` file (from `TFileService`) includes ROOT tree +# `PMTfragments`. +# +# +# +# Service configuration +# ---------------------- +# +# * `DetectorClocksService` is essential to assign a correct waveform timestamp +# * `Geometry` service bundle is required by `DetectorClocksService` +# * `IICARUSChannelMap` to relate PMT fragment IDs to channels +# * `TFileService` used to write trees (not needed if all trees are disabled) +# +# + + +# ------------------------------------------------------------------------------ +#include "services_common_icarus.fcl" +#include "channelmapping_icarus.fcl" +#include "timing_icarus.fcl" + +#include "rootoutput_icarus.fcl" +#include "decoderdefs_icarus.fcl" + +# ------------------------------------------------------------------------------ +process_name: DecodePMT + + +# ------------------------------------------------------------------------------ +services: { + + @table::icarus_art_services + message: @local::icarus_message_services_interactive_debug + + @table::icarus_geometry_services + DetectorClocksService: @local::icarus_detectorclocks + IICARUSChannelMap: @local::icarus_channelmappinggservice + IPMTTimingCorrectionService: @local::icarus_pmttimingservice + + TFileService: { fileName: "Trees-%ifb_%tc-%p.root" } +} + + +# ------------------------------------------------------------------------------ +physics: { + + producers: { + + triggerconfig: @local::extractTriggerConfig + pmtconfig: @local::extractPMTconfig + + daqTrigger: @local::decodeTriggerAutodetect + + daqPMT: @local::decodePMT + + } + + decoding: [ triggerconfig, pmtconfig, daqTrigger, daqPMT ] + streams: [ rootoutput ] +} + + +# ------------------------------------------------------------------------------ +outputs: { + rootoutput: { + @table::icarus_rootoutput + dataTier: "decoded" + fileProperties: { maxInputFiles: 1 } + checkFileName: false + compressionLevel: 501 + + outputCommands: [ "drop *_*_*_*", "keep *_*_*_DecodePMT" ] + } # rootoutput +} # outputs + + +# ------------------------------------------------------------------------------ + +physics.producers.daqTrigger.DecoderTool.Decoders[0].ToolConfig.TrigConfigLabel: triggerconfig +physics.producers.daqTrigger.DecoderTool.Decoders[1].ToolConfig.TrigConfigLabel: triggerconfig +physics.producers.daqTrigger.DecoderTool.Decoders[2].ToolConfig.TrigConfigLabel: triggerconfig +physics.producers.daqPMT.PMTconfigTag: pmtconfig # required +physics.producers.daqPMT.TriggerTag: daqTrigger # required + +# services.Geometry.Name: icarus_splitwires # for runs < 548x + +# +# customization of PMT decoding +# + +physics.producers.daqPMT.SurviveExceptions: false +physics.producers.daqPMT.DiagnosticOutput: true +physics.producers.daqPMT.PacketDump: false +physics.producers.daqPMT.RequireKnownBoards: true +physics.producers.daqPMT.RequireBoardConfig: true +physics.producers.daqPMT.DataTrees: [ "PMTfragments" ] + +# +# customization of trigger decoding +# + +physics.producers.daqTrigger.DecoderTool.Decoders[0].ToolConfig.DiagnosticOutput: true +physics.producers.daqTrigger.DecoderTool.Decoders[1].ToolConfig.DiagnosticOutput: true +physics.producers.daqTrigger.DecoderTool.Decoders[2].ToolConfig.DiagnosticOutput: true +physics.producers.daqTrigger.DecoderTool.Decoders[0].ToolConfig.Debug: false +physics.producers.daqTrigger.DecoderTool.Decoders[1].ToolConfig.Debug: false +physics.producers.daqTrigger.DecoderTool.Decoders[2].ToolConfig.Debug: false + + +# ------------------------------------------------------------------------------ diff --git a/fcl/reco/Stage0/data/partial/decodePMT_icarus_incomplete.fcl b/fcl/reco/Stage0/data/partial/decodePMT_icarus_incomplete.fcl new file mode 100644 index 000000000..038a09480 --- /dev/null +++ b/fcl/reco/Stage0/data/partial/decodePMT_icarus_incomplete.fcl @@ -0,0 +1,15 @@ +# +# File: decodePMT_icarus_incomplete.fcl +# Purpose: PMT readout fragment decoding for studies in ICARUS. +# Author: Gianluca Petrillo (petrillo@slac.stanford.edu) +# Date: May 12, 2021 +# +# This is a version of `decodePMT_icarus.fcl` which will ignore missing PMT +# readout fragments. +# +# See the documentation on `decodePMT_icarus.fcl` for everything else. +# + +#include "decodePMT_icarus.fcl" + +physics.producers.daqPMT.RequireBoardConfig: false diff --git a/fcl/reco/Stage0/data/partial/decodePMT_icarus_standalone.fcl b/fcl/reco/Stage0/data/partial/decodePMT_icarus_standalone.fcl new file mode 100644 index 000000000..fa70378a8 --- /dev/null +++ b/fcl/reco/Stage0/data/partial/decodePMT_icarus_standalone.fcl @@ -0,0 +1,69 @@ +# +# File: decodePMT_icarus_standalone.fcl +# Purpose: PMT readout fragment decoding for studies in ICARUS. +# Author: Gianluca Petrillo (petrillo@slac.stanford.edu) +# Date: June 10, 2021 +# +# This configuration expects only PMT fragments, and not even all of them: +# as a consequence many timestamp corrections will be skipped. +# PMT waveform decoding is performed, extensive debugging messages are +# included in the `debug.log` log file, and ROOT trees are produced for studies. +# This configuration, as is, is not meant for production. +# +# +# Input +# ------ +# +# * artDAQ fragments from PMT readout boards, named +# `daq:ContainerCAENV1730` or `daq:CAENV1730` (not both!) +# +# +# Output +# ------- +# +# Only new data products are written in the art/ROOT output file, including: +# +# * `daqPMT` (std::vector): decoded waveforms, +# with our best reconstruction for their time stamps in LArSoft reference +# +# +# The `Trees-*.root` file (from `TFileService`) includes ROOT tree +# `PMTfragments`. +# +# +# +# Service configuration +# ---------------------- +# +# * `DetectorClocksService` is essential to assign a correct waveform timestamp +# * `Geometry` service bundle is required by `DetectorClocksService` +# * `IICARUSChannelMap` to relate PMT fragment IDs to channels +# * `TFileService` used to write trees (not needed if all trees are disabled) +# +# + + +# ------------------------------------------------------------------------------ +#include "decodePMT_icarus.fcl" + + +# ------------------------------------------------------------------------------ +physics.decoding: [ daqPMT ] + + +# ------------------------------------------------------------------------------ + +physics.producers.daqPMT.PMTconfigTag: @erase # required +physics.producers.daqPMT.TriggerTag: @erase # required + +# +# customization of PMT decoding +# + +physics.producers.daqPMT.SurviveExceptions: false +physics.producers.daqPMT.DiagnosticOutput: true +physics.producers.daqPMT.PacketDump: true +physics.producers.daqPMT.RequireKnownBoards: false +physics.producers.daqPMT.RequireBoardConfig: false + +# ------------------------------------------------------------------------------ diff --git a/fcl/reco/Stage0/data/partial/decodePMT_icarus_treeonly.fcl b/fcl/reco/Stage0/data/partial/decodePMT_icarus_treeonly.fcl new file mode 100644 index 000000000..5e34eefad --- /dev/null +++ b/fcl/reco/Stage0/data/partial/decodePMT_icarus_treeonly.fcl @@ -0,0 +1,68 @@ +# +# File: decodePMT_icarus_treeonly.fcl +# Purpose: Runs PMT decoding to build a PMT diagnostic tree. +# Author: Gianluca Petrillo (petrillo@slac.stanford.edu) +# Date: September 25, 2022 +# +# It does not save any waveform. +# +# Input +# ------ +# +# * artDAQ fragments from all 24 PMT readout boards, named +# `daq:ContainerCAENV1730` (or any standard ICARUS name) +# * trigger fragment (autodetected among ICARUS standard names) +# * DAQ configuration as FHiCL in the art/ROOT input file +# +# This configuration requires a data fragment for each PMT readout board +# which is mentioned in `physics.producers.daqPMT.DecoderTool.BoardSetup`, +# which by default is all 24. +# +# +# Output +# ------- +# +# In the plain ROOT output file (names `Tree-....root`) a diagnostic tree +# is stored with one entry per PMT data fragment (see `decodePMT_icarus.fcl` +# and the decoder module `DaqDecodeICARUSPMT`), as `daqPMT/PMTfragments`. +# +# All standard trigger and PMT decoding data products are produced with the +# standard names (`daqTrigger` and `daqPMT` respectively). +# The noticeable exception is PMT raw waveforms not the corrections: +# neither are saved. +# +# The log file also dump the trigger information. +# +# + + +# ------------------------------------------------------------------------------ +#include "decodePMT_icarus.fcl" + +# add a trigger dumper to the output on console +physics.analyzers.dumptrigger: { + module_type: DumpTrigger + TriggerTag: "daqTrigger" +} + +physics.dumpers: [ dumptrigger ] +physics.end_paths: [ streams, dumpers ] + +outputs.rootoutput.fileProperties: @erase # don't go one output file per input file +outputs.rootoutput.outputCommands: [ + @sequence::outputs.rootoutput.outputCommands + , "drop raw::OpDetWaveforms_daqPMT_*_DecodePMT" +] + +# disable abundant output on console and the optical waveforms +physics.producers.daqPMT.SaveCorrectionsFrom: [] +physics.producers.daqPMT.DiagnosticOutput: false +physics.producers.daqTrigger.DecoderTool.Decoders[0].ToolConfig.DiagnosticOutput: false +physics.producers.daqTrigger.DecoderTool.Decoders[1].ToolConfig.DiagnosticOutput: false +physics.producers.daqTrigger.DecoderTool.Decoders[2].ToolConfig.DiagnosticOutput: false + +services.message.destinations.LogDebugFile: @erase +services.message.destinations.LogSeeds: @erase +services.TimeTracker: {} # no DB file +services.MemoryTracker: @erase + diff --git a/fcl/reco/Stage0/data/partial/decodeTrigger_icarus.fcl b/fcl/reco/Stage0/data/partial/decodeTrigger_icarus.fcl new file mode 100644 index 000000000..d041c0023 --- /dev/null +++ b/fcl/reco/Stage0/data/partial/decodeTrigger_icarus.fcl @@ -0,0 +1,56 @@ +#include "services_common_icarus.fcl" +#include "channelmapping_icarus.fcl" +#include "rootoutput_icarus.fcl" +#include "decoderdefs_icarus.fcl" + +process_name: DecodeTrg + +services: { + + @table::icarus_art_services + message: @local::icarus_message_services_interactive_debug + + @table::icarus_geometry_services + DetectorClocksService: @local::icarus_detectorclocks + IICARUSChannelMap: @local::icarus_channelmappinggservice # from channelmapping_icarus.fcl +} + + +physics: { + + producers: { + +// pmtconfig: @local::extractPMTconfig + triggerconfig: @local::extractTriggerConfig + + daqTrigger: @local::decodeTriggerAutodetect + +// daqPMT: @local::decodePMT + + } + +// decoding: [ PMTconfig, triggerconfig, daqTrigger, daqPMT ] + decoding: [ triggerconfig, daqTrigger ] + streams: [ rootoutput ] +} + +outputs: { + rootoutput: { + @table::icarus_rootoutput + dataTier: "decoded" + fileProperties: { maxInputFiles: 1 } + checkFileName: false + compressionLevel: 501 + + outputCommands: [ "drop *_*_*_*", "keep *_*_*_DecodeTrg" ] + } # rootoutput +} # outputs + + +physics.producers.daqTrigger.DecoderTool.TrigConfigLabel: triggerconfig +physics.producers.daqTrigger.DecoderTool.Decoders[0].ToolConfig.DiagnosticOutput: true +physics.producers.daqTrigger.DecoderTool.Decoders[0].ToolConfig.Debug: true +physics.producers.daqTrigger.DecoderTool.Decoders[1].ToolConfig.DiagnosticOutput: true +physics.producers.daqTrigger.DecoderTool.Decoders[1].ToolConfig.Debug: true +physics.producers.daqTrigger.DecoderTool.Decoders[2].ToolConfig.DiagnosticOutput: true +physics.producers.daqTrigger.DecoderTool.Decoders[2].ToolConfig.Debug: true diff --git a/fcl/reco/Stage0/data/partial/stage0_run2_icarus_opdetonly.fcl b/fcl/reco/Stage0/data/partial/stage0_run2_icarus_opdetonly.fcl new file mode 100644 index 000000000..a7abf2d87 --- /dev/null +++ b/fcl/reco/Stage0/data/partial/stage0_run2_icarus_opdetonly.fcl @@ -0,0 +1,19 @@ +# +# File: stage0_run2_icarus_opdetonly.fcl +# Purpose: Runs the optical detector and trigger reconstruction parts of Stage0 +# Author: Gianluca Petrillo (petrillo@slac.stanford.edu) +# Date: August 29, 2023 +# +# Written for icaruscode v09_72_00_05p1. +# + +#include "stage0_run2_icarus.fcl" + +source.maxEvents: @erase + +physics.path: [ @sequence::icarus_stage0_PMT ] + +physics.end_paths: [ streamROOT ] + +# be unstoppable +physics.producers.daqPMT.SurviveExceptions: true From e73e67655e1cabcba426dcc19a77f7107ee3317d Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Fri, 16 May 2025 11:11:48 -0500 Subject: [PATCH 08/31] Reorganize standard fcls. Update to new MC path. Add in overlay path. --- fcl/standard/CMakeLists.txt | 11 ++++------- fcl/standard/data/CMakeLists.txt | 8 ++++++++ fcl/standard/{ => data}/standard_data_caf_icarus.fcl | 0 .../{ => data}/standard_data_larcv_icarus.fcl | 0 .../{ => data}/standard_data_stage0_icarus.fcl | 0 .../{ => data}/standard_data_stage1_icarus.fcl | 0 .../{ => data}/standard_data_stage1larcv_icarus.fcl | 0 fcl/standard/mc/CMakeLists.txt | 8 ++++++++ fcl/standard/mc/standard_mc_all_detsim_icarus.fcl | 1 + .../{ => mc}/standard_mc_all_larcv_icarus.fcl | 0 fcl/standard/mc/standard_mc_all_stage0_icarus.fcl | 1 + fcl/standard/mc/standard_mc_all_stage1_icarus.fcl | 1 + .../{ => mc}/standard_mc_beamcosmics_caf_icarus.fcl | 0 fcl/standard/mc/standard_mc_beamcosmics_g4_icarus.fcl | 1 + .../{ => mc}/standard_mc_intime_caf_icarus.fcl | 0 fcl/standard/mc/standard_mc_intime_g4_icarus.fcl | 1 + .../standard_mc_mpvmpr_stage1larcv_icarus.fcl | 0 fcl/standard/overlay/CMakeLists.txt | 8 ++++++++ fcl/standard/overlay/standard_overlay_caf_iarus.fcl | 1 + .../overlay/standard_overlay_detsim_icarus.fcl | 1 + .../overlay/standard_overlay_overlay_icarus.fcl | 1 + .../overlay/standard_overlay_stage0_icarus.fcl | 1 + .../overlay/standard_overlay_stage1_icarus.fcl | 1 + fcl/standard/standard_mc_all_detsim_icarus.fcl | 1 - fcl/standard/standard_mc_all_stage0_icarus.fcl | 1 - fcl/standard/standard_mc_all_stage1_icarus.fcl | 1 - fcl/standard/standard_mc_all_stage1larcv_icarus.fcl | 1 - fcl/standard/standard_mc_beamcosmics_g4_icarus.fcl | 1 - fcl/standard/standard_mc_intime_g4_icarus.fcl | 1 - 29 files changed, 38 insertions(+), 13 deletions(-) create mode 100644 fcl/standard/data/CMakeLists.txt rename fcl/standard/{ => data}/standard_data_caf_icarus.fcl (100%) rename fcl/standard/{ => data}/standard_data_larcv_icarus.fcl (100%) rename fcl/standard/{ => data}/standard_data_stage0_icarus.fcl (100%) rename fcl/standard/{ => data}/standard_data_stage1_icarus.fcl (100%) rename fcl/standard/{ => data}/standard_data_stage1larcv_icarus.fcl (100%) create mode 100644 fcl/standard/mc/CMakeLists.txt create mode 100644 fcl/standard/mc/standard_mc_all_detsim_icarus.fcl rename fcl/standard/{ => mc}/standard_mc_all_larcv_icarus.fcl (100%) create mode 100644 fcl/standard/mc/standard_mc_all_stage0_icarus.fcl create mode 100644 fcl/standard/mc/standard_mc_all_stage1_icarus.fcl rename fcl/standard/{ => mc}/standard_mc_beamcosmics_caf_icarus.fcl (100%) create mode 100644 fcl/standard/mc/standard_mc_beamcosmics_g4_icarus.fcl rename fcl/standard/{ => mc}/standard_mc_intime_caf_icarus.fcl (100%) create mode 100644 fcl/standard/mc/standard_mc_intime_g4_icarus.fcl rename fcl/standard/{ => mc}/standard_mc_mpvmpr_stage1larcv_icarus.fcl (100%) create mode 100644 fcl/standard/overlay/CMakeLists.txt create mode 100644 fcl/standard/overlay/standard_overlay_caf_iarus.fcl create mode 100644 fcl/standard/overlay/standard_overlay_detsim_icarus.fcl create mode 100644 fcl/standard/overlay/standard_overlay_overlay_icarus.fcl create mode 100644 fcl/standard/overlay/standard_overlay_stage0_icarus.fcl create mode 100644 fcl/standard/overlay/standard_overlay_stage1_icarus.fcl delete mode 100644 fcl/standard/standard_mc_all_detsim_icarus.fcl delete mode 100644 fcl/standard/standard_mc_all_stage0_icarus.fcl delete mode 100644 fcl/standard/standard_mc_all_stage1_icarus.fcl delete mode 100644 fcl/standard/standard_mc_all_stage1larcv_icarus.fcl delete mode 100644 fcl/standard/standard_mc_beamcosmics_g4_icarus.fcl delete mode 100644 fcl/standard/standard_mc_intime_g4_icarus.fcl diff --git a/fcl/standard/CMakeLists.txt b/fcl/standard/CMakeLists.txt index 9714229ee..178294463 100644 --- a/fcl/standard/CMakeLists.txt +++ b/fcl/standard/CMakeLists.txt @@ -1,8 +1,5 @@ -# Install fcl files +cet_enable_asserts() -install_fhicl() - -# Also put a copy in the source tree. - -FILE(GLOB fcl_files *.fcl) -install_source( EXTRAS ${fcl_files} ) +add_subdirectory(mc) +add_subdirectory(data) +add_subdirectory(overlay) diff --git a/fcl/standard/data/CMakeLists.txt b/fcl/standard/data/CMakeLists.txt new file mode 100644 index 000000000..9714229ee --- /dev/null +++ b/fcl/standard/data/CMakeLists.txt @@ -0,0 +1,8 @@ +# Install fcl files + +install_fhicl() + +# Also put a copy in the source tree. + +FILE(GLOB fcl_files *.fcl) +install_source( EXTRAS ${fcl_files} ) diff --git a/fcl/standard/standard_data_caf_icarus.fcl b/fcl/standard/data/standard_data_caf_icarus.fcl similarity index 100% rename from fcl/standard/standard_data_caf_icarus.fcl rename to fcl/standard/data/standard_data_caf_icarus.fcl diff --git a/fcl/standard/standard_data_larcv_icarus.fcl b/fcl/standard/data/standard_data_larcv_icarus.fcl similarity index 100% rename from fcl/standard/standard_data_larcv_icarus.fcl rename to fcl/standard/data/standard_data_larcv_icarus.fcl diff --git a/fcl/standard/standard_data_stage0_icarus.fcl b/fcl/standard/data/standard_data_stage0_icarus.fcl similarity index 100% rename from fcl/standard/standard_data_stage0_icarus.fcl rename to fcl/standard/data/standard_data_stage0_icarus.fcl diff --git a/fcl/standard/standard_data_stage1_icarus.fcl b/fcl/standard/data/standard_data_stage1_icarus.fcl similarity index 100% rename from fcl/standard/standard_data_stage1_icarus.fcl rename to fcl/standard/data/standard_data_stage1_icarus.fcl diff --git a/fcl/standard/standard_data_stage1larcv_icarus.fcl b/fcl/standard/data/standard_data_stage1larcv_icarus.fcl similarity index 100% rename from fcl/standard/standard_data_stage1larcv_icarus.fcl rename to fcl/standard/data/standard_data_stage1larcv_icarus.fcl diff --git a/fcl/standard/mc/CMakeLists.txt b/fcl/standard/mc/CMakeLists.txt new file mode 100644 index 000000000..9714229ee --- /dev/null +++ b/fcl/standard/mc/CMakeLists.txt @@ -0,0 +1,8 @@ +# Install fcl files + +install_fhicl() + +# Also put a copy in the source tree. + +FILE(GLOB fcl_files *.fcl) +install_source( EXTRAS ${fcl_files} ) diff --git a/fcl/standard/mc/standard_mc_all_detsim_icarus.fcl b/fcl/standard/mc/standard_mc_all_detsim_icarus.fcl new file mode 100644 index 000000000..4b81669ba --- /dev/null +++ b/fcl/standard/mc/standard_mc_all_detsim_icarus.fcl @@ -0,0 +1 @@ +#include "detsim_2d_icarus_refactored_yzsim.fcl" diff --git a/fcl/standard/standard_mc_all_larcv_icarus.fcl b/fcl/standard/mc/standard_mc_all_larcv_icarus.fcl similarity index 100% rename from fcl/standard/standard_mc_all_larcv_icarus.fcl rename to fcl/standard/mc/standard_mc_all_larcv_icarus.fcl diff --git a/fcl/standard/mc/standard_mc_all_stage0_icarus.fcl b/fcl/standard/mc/standard_mc_all_stage0_icarus.fcl new file mode 100644 index 000000000..c90fdc3b2 --- /dev/null +++ b/fcl/standard/mc/standard_mc_all_stage0_icarus.fcl @@ -0,0 +1 @@ +#include "stage0_run2_wcdnn_icarus_mc.fcl" diff --git a/fcl/standard/mc/standard_mc_all_stage1_icarus.fcl b/fcl/standard/mc/standard_mc_all_stage1_icarus.fcl new file mode 100644 index 000000000..7f5fe82b0 --- /dev/null +++ b/fcl/standard/mc/standard_mc_all_stage1_icarus.fcl @@ -0,0 +1 @@ +#include "stage1_run2_icarus_MC.fcl" diff --git a/fcl/standard/standard_mc_beamcosmics_caf_icarus.fcl b/fcl/standard/mc/standard_mc_beamcosmics_caf_icarus.fcl similarity index 100% rename from fcl/standard/standard_mc_beamcosmics_caf_icarus.fcl rename to fcl/standard/mc/standard_mc_beamcosmics_caf_icarus.fcl diff --git a/fcl/standard/mc/standard_mc_beamcosmics_g4_icarus.fcl b/fcl/standard/mc/standard_mc_beamcosmics_g4_icarus.fcl new file mode 100644 index 000000000..a42168087 --- /dev/null +++ b/fcl/standard/mc/standard_mc_beamcosmics_g4_icarus.fcl @@ -0,0 +1 @@ +#include "larg4_icarus_cosmics_sce.fcl" diff --git a/fcl/standard/standard_mc_intime_caf_icarus.fcl b/fcl/standard/mc/standard_mc_intime_caf_icarus.fcl similarity index 100% rename from fcl/standard/standard_mc_intime_caf_icarus.fcl rename to fcl/standard/mc/standard_mc_intime_caf_icarus.fcl diff --git a/fcl/standard/mc/standard_mc_intime_g4_icarus.fcl b/fcl/standard/mc/standard_mc_intime_g4_icarus.fcl new file mode 100644 index 000000000..e3695ae4b --- /dev/null +++ b/fcl/standard/mc/standard_mc_intime_g4_icarus.fcl @@ -0,0 +1 @@ +#include "larg4_icarus_intime_sce.fcl" diff --git a/fcl/standard/standard_mc_mpvmpr_stage1larcv_icarus.fcl b/fcl/standard/mc/standard_mc_mpvmpr_stage1larcv_icarus.fcl similarity index 100% rename from fcl/standard/standard_mc_mpvmpr_stage1larcv_icarus.fcl rename to fcl/standard/mc/standard_mc_mpvmpr_stage1larcv_icarus.fcl diff --git a/fcl/standard/overlay/CMakeLists.txt b/fcl/standard/overlay/CMakeLists.txt new file mode 100644 index 000000000..9714229ee --- /dev/null +++ b/fcl/standard/overlay/CMakeLists.txt @@ -0,0 +1,8 @@ +# Install fcl files + +install_fhicl() + +# Also put a copy in the source tree. + +FILE(GLOB fcl_files *.fcl) +install_source( EXTRAS ${fcl_files} ) diff --git a/fcl/standard/overlay/standard_overlay_caf_iarus.fcl b/fcl/standard/overlay/standard_overlay_caf_iarus.fcl new file mode 100644 index 000000000..ff0de4039 --- /dev/null +++ b/fcl/standard/overlay/standard_overlay_caf_iarus.fcl @@ -0,0 +1 @@ +#include "cafmakerjob_icarus_detsim2d_systtools_and_fluxwgt_overlay.fcl" diff --git a/fcl/standard/overlay/standard_overlay_detsim_icarus.fcl b/fcl/standard/overlay/standard_overlay_detsim_icarus.fcl new file mode 100644 index 000000000..d5a62b5cc --- /dev/null +++ b/fcl/standard/overlay/standard_overlay_detsim_icarus.fcl @@ -0,0 +1 @@ +#include "detsim_2d_icarus_refactored_overlay.fcl" diff --git a/fcl/standard/overlay/standard_overlay_overlay_icarus.fcl b/fcl/standard/overlay/standard_overlay_overlay_icarus.fcl new file mode 100644 index 000000000..6d70a1ace --- /dev/null +++ b/fcl/standard/overlay/standard_overlay_overlay_icarus.fcl @@ -0,0 +1 @@ +#include "overlay_waveforms.fcl" diff --git a/fcl/standard/overlay/standard_overlay_stage0_icarus.fcl b/fcl/standard/overlay/standard_overlay_stage0_icarus.fcl new file mode 100644 index 000000000..d91fab811 --- /dev/null +++ b/fcl/standard/overlay/standard_overlay_stage0_icarus.fcl @@ -0,0 +1 @@ +#include "stage0_run2_wc_icarus_overlay.fcl" diff --git a/fcl/standard/overlay/standard_overlay_stage1_icarus.fcl b/fcl/standard/overlay/standard_overlay_stage1_icarus.fcl new file mode 100644 index 000000000..2ec9c1f23 --- /dev/null +++ b/fcl/standard/overlay/standard_overlay_stage1_icarus.fcl @@ -0,0 +1 @@ +#include "stage1_run2_icarus_overlay.fcl" diff --git a/fcl/standard/standard_mc_all_detsim_icarus.fcl b/fcl/standard/standard_mc_all_detsim_icarus.fcl deleted file mode 100644 index 13685eafc..000000000 --- a/fcl/standard/standard_mc_all_detsim_icarus.fcl +++ /dev/null @@ -1 +0,0 @@ -#include "detsim_2d_icarus_refactored.fcl" diff --git a/fcl/standard/standard_mc_all_stage0_icarus.fcl b/fcl/standard/standard_mc_all_stage0_icarus.fcl deleted file mode 100644 index feb8aca63..000000000 --- a/fcl/standard/standard_mc_all_stage0_icarus.fcl +++ /dev/null @@ -1 +0,0 @@ -#include "stage0_run2_icarus_mc.fcl" diff --git a/fcl/standard/standard_mc_all_stage1_icarus.fcl b/fcl/standard/standard_mc_all_stage1_icarus.fcl deleted file mode 100644 index 86d4b0eba..000000000 --- a/fcl/standard/standard_mc_all_stage1_icarus.fcl +++ /dev/null @@ -1 +0,0 @@ -#include "stage1_run2_1d_icarus_MC.fcl" diff --git a/fcl/standard/standard_mc_all_stage1larcv_icarus.fcl b/fcl/standard/standard_mc_all_stage1larcv_icarus.fcl deleted file mode 100644 index caf161ca4..000000000 --- a/fcl/standard/standard_mc_all_stage1larcv_icarus.fcl +++ /dev/null @@ -1 +0,0 @@ -#include "stage1_run2_1d_larcv_icarus_MC.fcl" diff --git a/fcl/standard/standard_mc_beamcosmics_g4_icarus.fcl b/fcl/standard/standard_mc_beamcosmics_g4_icarus.fcl deleted file mode 100644 index 687f1fe35..000000000 --- a/fcl/standard/standard_mc_beamcosmics_g4_icarus.fcl +++ /dev/null @@ -1 +0,0 @@ -#include "larg4_icarus_cosmics_sce_2d_drift.fcl" diff --git a/fcl/standard/standard_mc_intime_g4_icarus.fcl b/fcl/standard/standard_mc_intime_g4_icarus.fcl deleted file mode 100644 index 05c30a5c9..000000000 --- a/fcl/standard/standard_mc_intime_g4_icarus.fcl +++ /dev/null @@ -1 +0,0 @@ -#include "larg4_icarus_intime_sce_2d_drift.fcl" From 4729a40e8d559fe0f7f871a31767e55285292642 Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Fri, 16 May 2025 11:12:38 -0500 Subject: [PATCH 09/31] Fhicl file to convert ChannelROIs back into Wires --- fcl/reco/CMakeLists.txt | 1 + fcl/reco/wires/CMakeLists.txt | 3 ++ fcl/reco/wires/restorewires_icarus.fcl | 60 ++++++++++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 fcl/reco/wires/CMakeLists.txt create mode 100644 fcl/reco/wires/restorewires_icarus.fcl diff --git a/fcl/reco/CMakeLists.txt b/fcl/reco/CMakeLists.txt index de9682fc7..565e07219 100644 --- a/fcl/reco/CMakeLists.txt +++ b/fcl/reco/CMakeLists.txt @@ -13,6 +13,7 @@ add_subdirectory(ForCITests) #add_subdirectory(archive) add_subdirectory(Definitions) add_subdirectory(larcv) +add_subdirectory(wires) add_subdirectory(ntuple) add_subdirectory(Stage0) add_subdirectory(Stage1) diff --git a/fcl/reco/wires/CMakeLists.txt b/fcl/reco/wires/CMakeLists.txt new file mode 100644 index 000000000..2bda0f610 --- /dev/null +++ b/fcl/reco/wires/CMakeLists.txt @@ -0,0 +1,3 @@ +cet_enable_asserts() + +install_fhicl() diff --git a/fcl/reco/wires/restorewires_icarus.fcl b/fcl/reco/wires/restorewires_icarus.fcl new file mode 100644 index 000000000..723c92e43 --- /dev/null +++ b/fcl/reco/wires/restorewires_icarus.fcl @@ -0,0 +1,60 @@ +# Configuration for running the Calibration NTupler +# on a stage-1 reco file +# +#include "services_common_icarus.fcl" +#include "wirechannelroiconverters_sbn.fcl" + +process_name: ntuple + +services: +{ + @table::icarus_wirecalibration_services +} + +#source is a root file +source: +{ + module_type: RootInput + maxEvents: 10 # Number of events to create + saveMemoryObjectThreshold: 0 +} + +# only do analysis +physics: +{ + + producers: { + channel2wire: @local::channelroitowire + } + + filters: {} + + analyzers: + { + } + + out: [rootOutput] + reco: [channel2wire] + trigger_paths: [reco] + end_paths: [out] +} + +physics.producers.channel2wire.WireModuleLabelVec: ["wire2channelroi2d:PHYSCRATEDATATPCEE", "wire2channelroi2d:PHYSCRATEDATATPCEW", "wire2channelroi2d:PHYSCRATEDATATPCWE", "wire2channelroi2d:PHYSCRATEDATATPCWW"] +physics.producers.channel2wire.OutInstanceLabelVec: ["PHYSCRATEDATATPCWW","PHYSCRATEDATATPCWE","PHYSCRATEDATATPCEW","PHYSCRATEDATATPCEE"] + +physics.analyzers.caloskimE.SelectEvents: [ ] +physics.analyzers.caloskimW.SelectEvents: [ ] +physics.analyzers.simpleLightAna.SelectEvents: [ ] +physics.analyzers.supera.SelectEvents: [ ] + +outputs: +{ + rootOutput: + { + module_type: RootOutput + dataTier: "reconstructed" + compressionLevel: 1 + saveMemoryObjectThreshold: 0 + fileName: "%ifb_%tc-%p.root" + } +} From b3946e996f90855f0b515be44a5596c202680dd7 Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Fri, 16 May 2025 11:13:14 -0500 Subject: [PATCH 10/31] Fix input label for MC stage0. --- fcl/reco/Stage0/mc/stage0_run2_wc_icarus_mc.fcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fcl/reco/Stage0/mc/stage0_run2_wc_icarus_mc.fcl b/fcl/reco/Stage0/mc/stage0_run2_wc_icarus_mc.fcl index c10e139a1..ed15d7f0d 100644 --- a/fcl/reco/Stage0/mc/stage0_run2_wc_icarus_mc.fcl +++ b/fcl/reco/Stage0/mc/stage0_run2_wc_icarus_mc.fcl @@ -36,7 +36,7 @@ outputs.rootOutput.outputCommands: ["keep *_*_*_*", "keep *_daq_simpleSC*_*"] # Set the expected input for ophit -physics.producers.ophit.InputModule: "opdaq" +physics.producers.ophit.InputModule: "shifted" # Set up for the single module mutliple TPC mode... physics.producers.MCDecodeTPCROI.FragmentsLabelVec: ["daq:TPCWW","daq:TPCWE","daq:TPCEW","daq:TPCEE"] From 8d76950b5e46bf2449956f183868831c9951325a Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Sat, 17 May 2025 12:23:05 -0500 Subject: [PATCH 11/31] Get non-YZ detsim configs working. Add in overlay option to non-YZ sim. --- fcl/detsim/detsim_2d_icarus_refactored.fcl | 2 +- .../detsim_2d_icarus_refactored_overlay.fcl | 3 +++ .../detsimmodules_wirecell_ICARUS.fcl | 8 ++++++++ ...titpc-sim-drift-simchannel-refactored.jsonnet | 16 +++++++++++++--- 4 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 fcl/detsim/detsim_2d_icarus_refactored_overlay.fcl diff --git a/fcl/detsim/detsim_2d_icarus_refactored.fcl b/fcl/detsim/detsim_2d_icarus_refactored.fcl index 993ce8586..799170d15 100644 --- a/fcl/detsim/detsim_2d_icarus_refactored.fcl +++ b/fcl/detsim/detsim_2d_icarus_refactored.fcl @@ -19,7 +19,7 @@ physics: { crtdaq: @local::icarus_crtsim opdaq: @local::icarus_simpmt - daq: @local::icarus_simwire_wirecell_filtersed + daq: @local::icarus_simwire_wirecell_shifted rns: { module_type: "RandomNumberSaver" } } # producers diff --git a/fcl/detsim/detsim_2d_icarus_refactored_overlay.fcl b/fcl/detsim/detsim_2d_icarus_refactored_overlay.fcl new file mode 100644 index 000000000..bf9754683 --- /dev/null +++ b/fcl/detsim/detsim_2d_icarus_refactored_overlay.fcl @@ -0,0 +1,3 @@ +#include "detsim_2d_icarus_refactored.fcl" + +physics.producers.daq: @local::icarus_simwire_wirecell_shifted_overlay diff --git a/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl b/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl index 6bc7c326f..093261634 100644 --- a/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl +++ b/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl @@ -81,6 +81,14 @@ icarus_simwire_wirecell_SConly.wcls_main.outputers:[ icarus_simwire_wirecell_shifted: @local::icarus_simwire_wirecell icarus_simwire_wirecell_shifted.wcls_main.params.SimEnergyDepositLabel: "shifted" +icarus_simwire_wirecell_shifted_overlay: @local::icarus_simwire_wirecell_shifted +icarus_simwire_wirecell_shifted_overlay.wcls_main.structs.coh_noise_scale: 0.0 # disable noise +icarus_simwire_wirecell_shifted_overlay.wcls_main.structs.int_noise_scale: 0.0 # ditto +icarus_simwire_wirecell_shifted_overlay.wcls_main.structs.overlay_drifter: true +icarus_simwire_wirecell_shifted_overlay.wcls_main.plugins: [@sequence::icarus_simwire_wirecell_shifted_overlay.wcls_main.plugins, "WireCellICARUSDrifter"] +icarus_simwire_wirecell_shifted_overlay.wcls_main.inputers: ["wclsSimDepoSetSource:electron", "wclsICARUSDrifter:drifter"] +icarus_simwire_wirecell_shifted_overlay.wcls_main.params.cathode_input_format: "scalar" + icarus_simwire_wirecell_filtersed: @local::icarus_simwire_wirecell icarus_simwire_wirecell_filtersed.wcls_main.params.SimEnergyDepositLabel: "filtersed" diff --git a/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel-refactored.jsonnet b/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel-refactored.jsonnet index e5a0210df..663f19860 100644 --- a/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel-refactored.jsonnet +++ b/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel-refactored.jsonnet @@ -166,12 +166,22 @@ local wcls_output = { sp_thresholds: wcls.output.thresholds(name='spthresholds', tags=['threshold']), }; -//local deposio = io.numpy.depos(output); -local drifter = sim.drifter; +local overlay_drifter = std.extVar("overlay_drifter"); + +local drifter = if overlay_drifter then { + local xregions = wc.unique_list(std.flattenArrays([v.faces for v in params.det.volumes])), + type: "wclsICARUSDrifter", + name: "drifter", + data: params.lar + sim.overlay_drifter_data { + TPC: 0, + charge_scale: 1 + }, + } else sim.drifter; + local setdrifter = g.pnode({ type: 'DepoSetDrifter', data: { - drifter: "Drifter" + drifter: wc.tn(drifter) } }, nin=1, nout=1, uses=[drifter]); From eb123e683b005f4783e858292c384b86f4ac4bc7 Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Sat, 17 May 2025 12:24:30 -0500 Subject: [PATCH 12/31] Tune sim-reco timing offsets to 2D deconv. --- .../TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl b/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl index 093261634..5da3c8673 100644 --- a/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl +++ b/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl @@ -62,11 +62,10 @@ icarus_simwire_wirecell: shaping1: 1.45 # us shaping2: 1.3 # us - # Time offsets for truth matching - time_offset_u: 0.0 # us - time_offset_v: 0.0 # us - time_offset_y: 0.0 # us - + # Time offsets for truth matching -- tuned to 2D deconvolution output + time_offset_u: 1.81 # us + time_offset_v: 2.08 # us + time_offset_y: 1.82 # us } } } From 4cad74f24f0a726c0f91b97da61df6ba718c3f4f Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Tue, 20 May 2025 11:34:10 -0500 Subject: [PATCH 13/31] Fix ophit label. --- fcl/reco/Stage0/mc/stage0_run2_icarus_mc.fcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fcl/reco/Stage0/mc/stage0_run2_icarus_mc.fcl b/fcl/reco/Stage0/mc/stage0_run2_icarus_mc.fcl index 8e8085d25..3456eee69 100644 --- a/fcl/reco/Stage0/mc/stage0_run2_icarus_mc.fcl +++ b/fcl/reco/Stage0/mc/stage0_run2_icarus_mc.fcl @@ -38,7 +38,7 @@ outputs.rootOutput.outputCommands: ["keep *_*_*_*", "keep *_daq_simpleSC*_*"] # Set the expected input for ophit -physics.producers.ophit.InputModule: "opdaq" +physics.producers.ophit.InputModule: "shifted" # Note the default assumption is that our detector simulation input will come from the WireCell 2D drift simulation, a la 'daq' # If we are running the 1D drift simulation we need to switch to using: From 1e245e86dcba3b08e2891ae0b2f20b86f5a2bd45 Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Wed, 21 May 2025 12:48:15 -0500 Subject: [PATCH 14/31] Add partial fcls back into icaruscode --- fcl/reco/Stage0/data/CMakeLists.txt | 2 + fcl/reco/Stage0/data/partial/CMakeLists.txt | 1 + .../Stage0/data/partial/decodePMT_icarus.fcl | 145 ++++++++++++++++++ .../partial/decodePMT_icarus_incomplete.fcl | 15 ++ .../partial/decodePMT_icarus_standalone.fcl | 69 +++++++++ .../partial/decodePMT_icarus_treeonly.fcl | 68 ++++++++ .../data/partial/decodeTrigger_icarus.fcl | 56 +++++++ .../partial/stage0_run2_icarus_opdetonly.fcl | 19 +++ 8 files changed, 375 insertions(+) create mode 100644 fcl/reco/Stage0/data/partial/CMakeLists.txt create mode 100644 fcl/reco/Stage0/data/partial/decodePMT_icarus.fcl create mode 100644 fcl/reco/Stage0/data/partial/decodePMT_icarus_incomplete.fcl create mode 100644 fcl/reco/Stage0/data/partial/decodePMT_icarus_standalone.fcl create mode 100644 fcl/reco/Stage0/data/partial/decodePMT_icarus_treeonly.fcl create mode 100644 fcl/reco/Stage0/data/partial/decodeTrigger_icarus.fcl create mode 100644 fcl/reco/Stage0/data/partial/stage0_run2_icarus_opdetonly.fcl diff --git a/fcl/reco/Stage0/data/CMakeLists.txt b/fcl/reco/Stage0/data/CMakeLists.txt index 2bda0f610..9b8e98380 100644 --- a/fcl/reco/Stage0/data/CMakeLists.txt +++ b/fcl/reco/Stage0/data/CMakeLists.txt @@ -1,3 +1,5 @@ +add_subdirectory(partial) + cet_enable_asserts() install_fhicl() diff --git a/fcl/reco/Stage0/data/partial/CMakeLists.txt b/fcl/reco/Stage0/data/partial/CMakeLists.txt new file mode 100644 index 000000000..13355789a --- /dev/null +++ b/fcl/reco/Stage0/data/partial/CMakeLists.txt @@ -0,0 +1 @@ +install_fhicl() diff --git a/fcl/reco/Stage0/data/partial/decodePMT_icarus.fcl b/fcl/reco/Stage0/data/partial/decodePMT_icarus.fcl new file mode 100644 index 000000000..d22be3e79 --- /dev/null +++ b/fcl/reco/Stage0/data/partial/decodePMT_icarus.fcl @@ -0,0 +1,145 @@ +# +# File: decodePMT_icarus.fcl +# Purpose: PMT readout fragment decoding for studies in ICARUS. +# Author: Gianluca Petrillo (petrillo@slac.stanford.edu) +# Date: May 12, 2021 +# +# +# PMT waveform decoding is performed, extensive debugging messages are +# included in the `debug.log` log file, and ROOT trees are produced for studies. +# This configuration, as is, is not meant for production. +# +# +# Input +# ------ +# +# * artDAQ fragments from all 24 PMT readout boards, named +# `daq:ContainerCAENV1730` +# * trigger fragment `daq:ICARUSTriggerUDP` (will be decoded as well) +# * DAQ configuration as FHiCL in the art/ROOT input file +# +# This configuration requires a data fragment for each PMT readout board +# which is mentioned in `physics.producers.daqPMT.DecoderTool.BoardSetup`, +# which by default is all 24. If the input run misses some PMT readout boards, +# use `decodePMT_icarus_incomplete.fcl` instead. +# +# +# Output +# ------- +# +# Only new data products are written in the art/ROOT output file, including: +# +# * `daqPMT` (std::vector): decoded waveforms, +# with our best reconstruction for their time stamps in LArSoft reference +# +# +# The `Trees-*.root` file (from `TFileService`) includes ROOT tree +# `PMTfragments`. +# +# +# +# Service configuration +# ---------------------- +# +# * `DetectorClocksService` is essential to assign a correct waveform timestamp +# * `Geometry` service bundle is required by `DetectorClocksService` +# * `IICARUSChannelMap` to relate PMT fragment IDs to channels +# * `TFileService` used to write trees (not needed if all trees are disabled) +# +# + + +# ------------------------------------------------------------------------------ +#include "services_common_icarus.fcl" +#include "channelmapping_icarus.fcl" +#include "timing_icarus.fcl" + +#include "rootoutput_icarus.fcl" +#include "decoderdefs_icarus.fcl" + +# ------------------------------------------------------------------------------ +process_name: DecodePMT + + +# ------------------------------------------------------------------------------ +services: { + + @table::icarus_art_services + message: @local::icarus_message_services_interactive_debug + + @table::icarus_geometry_services + DetectorClocksService: @local::icarus_detectorclocks + IICARUSChannelMap: @local::icarus_channelmappinggservice + IPMTTimingCorrectionService: @local::icarus_pmttimingservice + + TFileService: { fileName: "Trees-%ifb_%tc-%p.root" } +} + + +# ------------------------------------------------------------------------------ +physics: { + + producers: { + + triggerconfig: @local::extractTriggerConfig + pmtconfig: @local::extractPMTconfig + + daqTrigger: @local::decodeTriggerAutodetect + + daqPMT: @local::decodePMT + + } + + decoding: [ triggerconfig, pmtconfig, daqTrigger, daqPMT ] + streams: [ rootoutput ] +} + + +# ------------------------------------------------------------------------------ +outputs: { + rootoutput: { + @table::icarus_rootoutput + dataTier: "decoded" + fileProperties: { maxInputFiles: 1 } + checkFileName: false + compressionLevel: 501 + + outputCommands: [ "drop *_*_*_*", "keep *_*_*_DecodePMT" ] + } # rootoutput +} # outputs + + +# ------------------------------------------------------------------------------ + +physics.producers.daqTrigger.DecoderTool.Decoders[0].ToolConfig.TrigConfigLabel: triggerconfig +physics.producers.daqTrigger.DecoderTool.Decoders[1].ToolConfig.TrigConfigLabel: triggerconfig +physics.producers.daqTrigger.DecoderTool.Decoders[2].ToolConfig.TrigConfigLabel: triggerconfig +physics.producers.daqPMT.PMTconfigTag: pmtconfig # required +physics.producers.daqPMT.TriggerTag: daqTrigger # required + +# services.Geometry.Name: icarus_splitwires # for runs < 548x + +# +# customization of PMT decoding +# + +physics.producers.daqPMT.SurviveExceptions: false +physics.producers.daqPMT.DiagnosticOutput: true +physics.producers.daqPMT.PacketDump: false +physics.producers.daqPMT.RequireKnownBoards: true +physics.producers.daqPMT.RequireBoardConfig: true +physics.producers.daqPMT.DataTrees: [ "PMTfragments" ] + +# +# customization of trigger decoding +# + +physics.producers.daqTrigger.DecoderTool.Decoders[0].ToolConfig.DiagnosticOutput: true +physics.producers.daqTrigger.DecoderTool.Decoders[1].ToolConfig.DiagnosticOutput: true +physics.producers.daqTrigger.DecoderTool.Decoders[2].ToolConfig.DiagnosticOutput: true +physics.producers.daqTrigger.DecoderTool.Decoders[0].ToolConfig.Debug: false +physics.producers.daqTrigger.DecoderTool.Decoders[1].ToolConfig.Debug: false +physics.producers.daqTrigger.DecoderTool.Decoders[2].ToolConfig.Debug: false + + +# ------------------------------------------------------------------------------ diff --git a/fcl/reco/Stage0/data/partial/decodePMT_icarus_incomplete.fcl b/fcl/reco/Stage0/data/partial/decodePMT_icarus_incomplete.fcl new file mode 100644 index 000000000..038a09480 --- /dev/null +++ b/fcl/reco/Stage0/data/partial/decodePMT_icarus_incomplete.fcl @@ -0,0 +1,15 @@ +# +# File: decodePMT_icarus_incomplete.fcl +# Purpose: PMT readout fragment decoding for studies in ICARUS. +# Author: Gianluca Petrillo (petrillo@slac.stanford.edu) +# Date: May 12, 2021 +# +# This is a version of `decodePMT_icarus.fcl` which will ignore missing PMT +# readout fragments. +# +# See the documentation on `decodePMT_icarus.fcl` for everything else. +# + +#include "decodePMT_icarus.fcl" + +physics.producers.daqPMT.RequireBoardConfig: false diff --git a/fcl/reco/Stage0/data/partial/decodePMT_icarus_standalone.fcl b/fcl/reco/Stage0/data/partial/decodePMT_icarus_standalone.fcl new file mode 100644 index 000000000..fa70378a8 --- /dev/null +++ b/fcl/reco/Stage0/data/partial/decodePMT_icarus_standalone.fcl @@ -0,0 +1,69 @@ +# +# File: decodePMT_icarus_standalone.fcl +# Purpose: PMT readout fragment decoding for studies in ICARUS. +# Author: Gianluca Petrillo (petrillo@slac.stanford.edu) +# Date: June 10, 2021 +# +# This configuration expects only PMT fragments, and not even all of them: +# as a consequence many timestamp corrections will be skipped. +# PMT waveform decoding is performed, extensive debugging messages are +# included in the `debug.log` log file, and ROOT trees are produced for studies. +# This configuration, as is, is not meant for production. +# +# +# Input +# ------ +# +# * artDAQ fragments from PMT readout boards, named +# `daq:ContainerCAENV1730` or `daq:CAENV1730` (not both!) +# +# +# Output +# ------- +# +# Only new data products are written in the art/ROOT output file, including: +# +# * `daqPMT` (std::vector): decoded waveforms, +# with our best reconstruction for their time stamps in LArSoft reference +# +# +# The `Trees-*.root` file (from `TFileService`) includes ROOT tree +# `PMTfragments`. +# +# +# +# Service configuration +# ---------------------- +# +# * `DetectorClocksService` is essential to assign a correct waveform timestamp +# * `Geometry` service bundle is required by `DetectorClocksService` +# * `IICARUSChannelMap` to relate PMT fragment IDs to channels +# * `TFileService` used to write trees (not needed if all trees are disabled) +# +# + + +# ------------------------------------------------------------------------------ +#include "decodePMT_icarus.fcl" + + +# ------------------------------------------------------------------------------ +physics.decoding: [ daqPMT ] + + +# ------------------------------------------------------------------------------ + +physics.producers.daqPMT.PMTconfigTag: @erase # required +physics.producers.daqPMT.TriggerTag: @erase # required + +# +# customization of PMT decoding +# + +physics.producers.daqPMT.SurviveExceptions: false +physics.producers.daqPMT.DiagnosticOutput: true +physics.producers.daqPMT.PacketDump: true +physics.producers.daqPMT.RequireKnownBoards: false +physics.producers.daqPMT.RequireBoardConfig: false + +# ------------------------------------------------------------------------------ diff --git a/fcl/reco/Stage0/data/partial/decodePMT_icarus_treeonly.fcl b/fcl/reco/Stage0/data/partial/decodePMT_icarus_treeonly.fcl new file mode 100644 index 000000000..5e34eefad --- /dev/null +++ b/fcl/reco/Stage0/data/partial/decodePMT_icarus_treeonly.fcl @@ -0,0 +1,68 @@ +# +# File: decodePMT_icarus_treeonly.fcl +# Purpose: Runs PMT decoding to build a PMT diagnostic tree. +# Author: Gianluca Petrillo (petrillo@slac.stanford.edu) +# Date: September 25, 2022 +# +# It does not save any waveform. +# +# Input +# ------ +# +# * artDAQ fragments from all 24 PMT readout boards, named +# `daq:ContainerCAENV1730` (or any standard ICARUS name) +# * trigger fragment (autodetected among ICARUS standard names) +# * DAQ configuration as FHiCL in the art/ROOT input file +# +# This configuration requires a data fragment for each PMT readout board +# which is mentioned in `physics.producers.daqPMT.DecoderTool.BoardSetup`, +# which by default is all 24. +# +# +# Output +# ------- +# +# In the plain ROOT output file (names `Tree-....root`) a diagnostic tree +# is stored with one entry per PMT data fragment (see `decodePMT_icarus.fcl` +# and the decoder module `DaqDecodeICARUSPMT`), as `daqPMT/PMTfragments`. +# +# All standard trigger and PMT decoding data products are produced with the +# standard names (`daqTrigger` and `daqPMT` respectively). +# The noticeable exception is PMT raw waveforms not the corrections: +# neither are saved. +# +# The log file also dump the trigger information. +# +# + + +# ------------------------------------------------------------------------------ +#include "decodePMT_icarus.fcl" + +# add a trigger dumper to the output on console +physics.analyzers.dumptrigger: { + module_type: DumpTrigger + TriggerTag: "daqTrigger" +} + +physics.dumpers: [ dumptrigger ] +physics.end_paths: [ streams, dumpers ] + +outputs.rootoutput.fileProperties: @erase # don't go one output file per input file +outputs.rootoutput.outputCommands: [ + @sequence::outputs.rootoutput.outputCommands + , "drop raw::OpDetWaveforms_daqPMT_*_DecodePMT" +] + +# disable abundant output on console and the optical waveforms +physics.producers.daqPMT.SaveCorrectionsFrom: [] +physics.producers.daqPMT.DiagnosticOutput: false +physics.producers.daqTrigger.DecoderTool.Decoders[0].ToolConfig.DiagnosticOutput: false +physics.producers.daqTrigger.DecoderTool.Decoders[1].ToolConfig.DiagnosticOutput: false +physics.producers.daqTrigger.DecoderTool.Decoders[2].ToolConfig.DiagnosticOutput: false + +services.message.destinations.LogDebugFile: @erase +services.message.destinations.LogSeeds: @erase +services.TimeTracker: {} # no DB file +services.MemoryTracker: @erase + diff --git a/fcl/reco/Stage0/data/partial/decodeTrigger_icarus.fcl b/fcl/reco/Stage0/data/partial/decodeTrigger_icarus.fcl new file mode 100644 index 000000000..d041c0023 --- /dev/null +++ b/fcl/reco/Stage0/data/partial/decodeTrigger_icarus.fcl @@ -0,0 +1,56 @@ +#include "services_common_icarus.fcl" +#include "channelmapping_icarus.fcl" +#include "rootoutput_icarus.fcl" +#include "decoderdefs_icarus.fcl" + +process_name: DecodeTrg + +services: { + + @table::icarus_art_services + message: @local::icarus_message_services_interactive_debug + + @table::icarus_geometry_services + DetectorClocksService: @local::icarus_detectorclocks + IICARUSChannelMap: @local::icarus_channelmappinggservice # from channelmapping_icarus.fcl +} + + +physics: { + + producers: { + +// pmtconfig: @local::extractPMTconfig + triggerconfig: @local::extractTriggerConfig + + daqTrigger: @local::decodeTriggerAutodetect + +// daqPMT: @local::decodePMT + + } + +// decoding: [ PMTconfig, triggerconfig, daqTrigger, daqPMT ] + decoding: [ triggerconfig, daqTrigger ] + streams: [ rootoutput ] +} + +outputs: { + rootoutput: { + @table::icarus_rootoutput + dataTier: "decoded" + fileProperties: { maxInputFiles: 1 } + checkFileName: false + compressionLevel: 501 + + outputCommands: [ "drop *_*_*_*", "keep *_*_*_DecodeTrg" ] + } # rootoutput +} # outputs + + +physics.producers.daqTrigger.DecoderTool.TrigConfigLabel: triggerconfig +physics.producers.daqTrigger.DecoderTool.Decoders[0].ToolConfig.DiagnosticOutput: true +physics.producers.daqTrigger.DecoderTool.Decoders[0].ToolConfig.Debug: true +physics.producers.daqTrigger.DecoderTool.Decoders[1].ToolConfig.DiagnosticOutput: true +physics.producers.daqTrigger.DecoderTool.Decoders[1].ToolConfig.Debug: true +physics.producers.daqTrigger.DecoderTool.Decoders[2].ToolConfig.DiagnosticOutput: true +physics.producers.daqTrigger.DecoderTool.Decoders[2].ToolConfig.Debug: true diff --git a/fcl/reco/Stage0/data/partial/stage0_run2_icarus_opdetonly.fcl b/fcl/reco/Stage0/data/partial/stage0_run2_icarus_opdetonly.fcl new file mode 100644 index 000000000..a7abf2d87 --- /dev/null +++ b/fcl/reco/Stage0/data/partial/stage0_run2_icarus_opdetonly.fcl @@ -0,0 +1,19 @@ +# +# File: stage0_run2_icarus_opdetonly.fcl +# Purpose: Runs the optical detector and trigger reconstruction parts of Stage0 +# Author: Gianluca Petrillo (petrillo@slac.stanford.edu) +# Date: August 29, 2023 +# +# Written for icaruscode v09_72_00_05p1. +# + +#include "stage0_run2_icarus.fcl" + +source.maxEvents: @erase + +physics.path: [ @sequence::icarus_stage0_PMT ] + +physics.end_paths: [ streamROOT ] + +# be unstoppable +physics.producers.daqPMT.SurviveExceptions: true From 4f5f72cb78ab8b12acc4aff066b5af095cd4c8ca Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Fri, 30 May 2025 04:13:22 -0500 Subject: [PATCH 15/31] Prune simChannelROI from 1D SP fcl. --- fcl/reco/Stage0/mc/stage0_run2_icarus_mc.fcl | 1 - 1 file changed, 1 deletion(-) diff --git a/fcl/reco/Stage0/mc/stage0_run2_icarus_mc.fcl b/fcl/reco/Stage0/mc/stage0_run2_icarus_mc.fcl index 3456eee69..374fddd02 100644 --- a/fcl/reco/Stage0/mc/stage0_run2_icarus_mc.fcl +++ b/fcl/reco/Stage0/mc/stage0_run2_icarus_mc.fcl @@ -16,7 +16,6 @@ physics.producers: { @table::icarus_stage0_producers physics.path: [ @sequence::icarus_stage0_mc_PMT, MCDecodeTPCROI, @sequence::icarus_stage0_multiTPC, - simChannelROI, @sequence::icarus_stage0_mc_crthit, @sequence::icarus_stage0_mc_crtreco ] From f37a12f8787602532255105b66addbcf8c125bb3 Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Fri, 30 May 2025 04:13:40 -0500 Subject: [PATCH 16/31] Fix database tags. --- .../calibration_database_TPC_TagSets_icarus.fcl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fcl/configurations/calibration_database_TPC_TagSets_icarus.fcl b/fcl/configurations/calibration_database_TPC_TagSets_icarus.fcl index bbc6c92c6..828e8d8a3 100644 --- a/fcl/configurations/calibration_database_TPC_TagSets_icarus.fcl +++ b/fcl/configurations/calibration_database_TPC_TagSets_icarus.fcl @@ -19,7 +19,7 @@ TPC_CalibrationTags_Oct2023: { ## - Files decoded with release >=v09_66_02 should use v3r2 TPC_CalibrationTags_Feb2024: { - tpc_channelstatus_data: "v3r4" + tpc_channelstatus_data: "v3r2" tpc_elifetime_data: "v2r1" tpc_dqdxcalibration_data: "v2r1" tpc_yz_correction_data: "v2r1" @@ -27,9 +27,10 @@ TPC_CalibrationTags_Feb2024: { } ## TPC_CalibrationTags_Feb2024 but updating tpc_yz_correction_data to tpc_yz_correction_allplanes_data +## Update to mask out additional bad noisy channels TPC_CalibrationTags_Jan2025: { - tpc_channelstatus_data: "v3r2" + tpc_channelstatus_data: "v3r4" tpc_elifetime_data: "v2r1" tpc_dqdxcalibration_data: "v2r1" tpc_yz_correction_allplanes_data: "v1r0" From 41ff587b9b6534f14b3041734b22ff15db599a87 Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Fri, 30 May 2025 08:37:09 -0500 Subject: [PATCH 17/31] Simple detsim jsonnet bugfix. --- .../wcls-multitpc-sim-drift-simchannel-refactored.jsonnet | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel-refactored.jsonnet b/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel-refactored.jsonnet index 663f19860..84e574bcb 100644 --- a/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel-refactored.jsonnet +++ b/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel-refactored.jsonnet @@ -171,7 +171,6 @@ local overlay_drifter = std.extVar("overlay_drifter"); local drifter = if overlay_drifter then { local xregions = wc.unique_list(std.flattenArrays([v.faces for v in params.det.volumes])), type: "wclsICARUSDrifter", - name: "drifter", data: params.lar + sim.overlay_drifter_data { TPC: 0, charge_scale: 1 @@ -181,7 +180,7 @@ local drifter = if overlay_drifter then { local setdrifter = g.pnode({ type: 'DepoSetDrifter', data: { - drifter: wc.tn(drifter) + drifter: if overlay_drifter then "wclsICARUSDrifter" else "Drifter" } }, nin=1, nout=1, uses=[drifter]); From 59f69c43623e2df8ceccb6d1bd4c55874de25c56 Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Sun, 1 Jun 2025 11:12:26 -0500 Subject: [PATCH 18/31] Remove mcreco from CAF stage. --- fcl/caf/cafmaker_add_detsim2d_icarus.fcl | 6 ------ fcl/caf/cafmaker_defs.fcl | 7 ++----- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/fcl/caf/cafmaker_add_detsim2d_icarus.fcl b/fcl/caf/cafmaker_add_detsim2d_icarus.fcl index 005c164a6..11c7f0aba 100644 --- a/fcl/caf/cafmaker_add_detsim2d_icarus.fcl +++ b/fcl/caf/cafmaker_add_detsim2d_icarus.fcl @@ -4,12 +4,6 @@ physics.producers.cafmaker.SimChannelLabel: "merge" # 2D, YZ sim # SimChannel's get re-made by 2D drift simulation -- use these to backtrack services.BackTrackerService.BackTracker.SimChannelModuleLabel: "merge" -# MCReco also needs correct SimChannels -# need to use new config names to make MCParticle/SimChannel labels different -physics.producers.mcreco.G4ModName: @erase -physics.producers.mcreco.MCParticleLabel: "largeant" -physics.producers.mcreco.SimChannelLabel: "merge" - # Mini production, pre signal shape tuning # this_cal_constants: [1.343e-2, 1.338e-2, 0.01227] # Post signal shape tuning, post gain fixing diff --git a/fcl/caf/cafmaker_defs.fcl b/fcl/caf/cafmaker_defs.fcl index ad8a5d17c..b6c84fb54 100644 --- a/fcl/caf/cafmaker_defs.fcl +++ b/fcl/caf/cafmaker_defs.fcl @@ -14,7 +14,6 @@ #include "eventweight_genie_sbn.fcl" #include "eventweight_genie_systtools.fcl" #include "eventweight_flux_sbn.fcl" -#include "mcreco.fcl" #include "mcsproducer.fcl" #include "rangeproducer.fcl" #include "flashmatch_simple_icarus.fcl" @@ -87,8 +86,6 @@ recoana_datacalo_producers.vertexStubCryoW.NormTools: @local::icarus_calonormtoo # Producers for making analysis level products recoana_caf_preprocess_producers: { - mcreco: @local::standard_mcreco - pandoraTrackMCSCryoE: @local::mcs_sbn pandoraTrackMCSCryoW: @local::mcs_sbn @@ -228,7 +225,7 @@ caf_preprocess_sce_producers: { } # Sequences -caf_preprocess_sequence: [ mcreco, +caf_preprocess_sequence: [ # Calorimetry pandoraCaloGausCryoE, pandoraCaloGausCryoW, pandoraPidGausCryoE, pandoraPidGausCryoW, @@ -258,7 +255,7 @@ caf_preprocess_data_sequence: [ caf_preprocess_evtw_sequence: [@sequence::caf_preprocess_sequence, rns, genieweight, fluxweight] -caf_preprocess_sce_sequence: [ mcreco, +caf_preprocess_sce_sequence: [ # Run the SCE correction pandoraGausSCECryoE, pandoraGausSCECryoW, # Then remake tracks From 73cc5109d0c4298db5ec79a5b16d435c08740543 Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Sun, 1 Jun 2025 11:12:48 -0500 Subject: [PATCH 19/31] Stage1+CAF configs for non-YZ detsim. --- fcl/caf/cafmakerjob_icarus_detsim2d_overlay_simpledet.fcl | 4 ++++ fcl/caf/cafmakerjob_icarus_detsim2d_simpledet.fcl | 4 ++++ fcl/reco/Stage1/mc/stage1_run2_icarus_MC_simpledet.fcl | 6 ++++++ .../Stage1/overlay/stage1_run2_icarus_overlay_simpledet.fcl | 6 ++++++ 4 files changed, 20 insertions(+) create mode 100644 fcl/caf/cafmakerjob_icarus_detsim2d_overlay_simpledet.fcl create mode 100644 fcl/caf/cafmakerjob_icarus_detsim2d_simpledet.fcl create mode 100644 fcl/reco/Stage1/mc/stage1_run2_icarus_MC_simpledet.fcl create mode 100644 fcl/reco/Stage1/overlay/stage1_run2_icarus_overlay_simpledet.fcl diff --git a/fcl/caf/cafmakerjob_icarus_detsim2d_overlay_simpledet.fcl b/fcl/caf/cafmakerjob_icarus_detsim2d_overlay_simpledet.fcl new file mode 100644 index 000000000..fe75e0903 --- /dev/null +++ b/fcl/caf/cafmakerjob_icarus_detsim2d_overlay_simpledet.fcl @@ -0,0 +1,4 @@ +#include "cafmakerjob_icarus_detsim2d_overlay.fcl" + +physics.producers.cafmaker.SimChannelLabel: "daq:simpleSC" +services.BackTrackerService.BackTracker.SimChannelModuleLabel: "daq:simpleSC" diff --git a/fcl/caf/cafmakerjob_icarus_detsim2d_simpledet.fcl b/fcl/caf/cafmakerjob_icarus_detsim2d_simpledet.fcl new file mode 100644 index 000000000..1c8b09582 --- /dev/null +++ b/fcl/caf/cafmakerjob_icarus_detsim2d_simpledet.fcl @@ -0,0 +1,4 @@ +#include "cafmakerjob_icarus_detsim2d.fcl" + +physics.producers.cafmaker.SimChannelLabel: "daq:simpleSC" +services.BackTrackerService.BackTracker.SimChannelModuleLabel: "daq:simpleSC" diff --git a/fcl/reco/Stage1/mc/stage1_run2_icarus_MC_simpledet.fcl b/fcl/reco/Stage1/mc/stage1_run2_icarus_MC_simpledet.fcl new file mode 100644 index 000000000..788f343ed --- /dev/null +++ b/fcl/reco/Stage1/mc/stage1_run2_icarus_MC_simpledet.fcl @@ -0,0 +1,6 @@ +#include "stage1_run2_icarus_MC.fcl" + +physics.producers.mcreco.SimChannelLabel: "shifted" +physics.analyzers.caloskimE.SimChannelproducer: "daq:simpleSC" +physics.analyzers.caloskimW.SimChannelproducer: "daq:simpleSC" +services.BackTrackerService.BackTracker.SimChannelModuleLabel: "daq:simpleSC" diff --git a/fcl/reco/Stage1/overlay/stage1_run2_icarus_overlay_simpledet.fcl b/fcl/reco/Stage1/overlay/stage1_run2_icarus_overlay_simpledet.fcl new file mode 100644 index 000000000..4a8aafe51 --- /dev/null +++ b/fcl/reco/Stage1/overlay/stage1_run2_icarus_overlay_simpledet.fcl @@ -0,0 +1,6 @@ +#include "stage1_run2_icarus_overlay.fcl" + +physics.producers.mcreco.SimChannelLabel: "sedlite" +physics.analyzers.caloskimE.SimChannelproducer: "daq:simpleSC" +physics.analyzers.caloskimW.SimChannelproducer: "daq:simpleSC" +services.BackTrackerService.BackTracker.SimChannelModuleLabel: "daq:simpleSC" From 32c965f7c6fe42d917cf4ff7477ab7d52ae1354b Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Sun, 1 Jun 2025 11:13:08 -0500 Subject: [PATCH 20/31] Ignore mcreco logging. --- fcl/reco/Stage0/mc/stage0_run2_icarus_mc.fcl | 4 ++++ fcl/reco/Stage0/mc/stage0_run2_wc_icarus_mc.fcl | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/fcl/reco/Stage0/mc/stage0_run2_icarus_mc.fcl b/fcl/reco/Stage0/mc/stage0_run2_icarus_mc.fcl index 374fddd02..cc45acfaa 100644 --- a/fcl/reco/Stage0/mc/stage0_run2_icarus_mc.fcl +++ b/fcl/reco/Stage0/mc/stage0_run2_icarus_mc.fcl @@ -63,3 +63,7 @@ physics.producers.purityana1.RawModuleLabel: ["MCDecodeTPCROI:PHYSCRATEDATATPC # restore legacy G4 labels physics.producers.mcophit.SimPhotonsProducer: "shifted" + +# avoid huge log files +services.message.destinations.LogErrorFile.categories.SimDriftElectrons: { limit: 0 } +services.message.destinations.LogStandardOut.categories.SimDriftElectrons: { limit: 0 } diff --git a/fcl/reco/Stage0/mc/stage0_run2_wc_icarus_mc.fcl b/fcl/reco/Stage0/mc/stage0_run2_wc_icarus_mc.fcl index ed15d7f0d..93e2ef003 100644 --- a/fcl/reco/Stage0/mc/stage0_run2_wc_icarus_mc.fcl +++ b/fcl/reco/Stage0/mc/stage0_run2_wc_icarus_mc.fcl @@ -55,3 +55,7 @@ physics.producers.purityana1.RawModuleLabel: ["MCDecodeTPCROI:PHYSCRATEDATATPC # restore legacy G4 labels physics.producers.mcophit.SimPhotonsProducer: "shifted" + +# avoid huge log files +services.message.destinations.LogErrorFile.categories.SimDriftElectrons: { limit: 0 } +services.message.destinations.LogStandardOut.categories.SimDriftElectrons: { limit: 0 } From 9fd7afb33ba3bd68a138161bc07ee1d54e55309c Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Wed, 4 Jun 2025 03:54:04 -0500 Subject: [PATCH 21/31] Correctly disable mcreco logging. --- fcl/reco/Stage0/mc/stage0_run2_icarus_mc.fcl | 4 ---- fcl/reco/Stage0/mc/stage0_run2_wc_icarus_mc.fcl | 4 ---- fcl/reco/Stage1/mc/stage1_run2_icarus_MC.fcl | 4 ++++ 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/fcl/reco/Stage0/mc/stage0_run2_icarus_mc.fcl b/fcl/reco/Stage0/mc/stage0_run2_icarus_mc.fcl index cc45acfaa..374fddd02 100644 --- a/fcl/reco/Stage0/mc/stage0_run2_icarus_mc.fcl +++ b/fcl/reco/Stage0/mc/stage0_run2_icarus_mc.fcl @@ -63,7 +63,3 @@ physics.producers.purityana1.RawModuleLabel: ["MCDecodeTPCROI:PHYSCRATEDATATPC # restore legacy G4 labels physics.producers.mcophit.SimPhotonsProducer: "shifted" - -# avoid huge log files -services.message.destinations.LogErrorFile.categories.SimDriftElectrons: { limit: 0 } -services.message.destinations.LogStandardOut.categories.SimDriftElectrons: { limit: 0 } diff --git a/fcl/reco/Stage0/mc/stage0_run2_wc_icarus_mc.fcl b/fcl/reco/Stage0/mc/stage0_run2_wc_icarus_mc.fcl index 93e2ef003..ed15d7f0d 100644 --- a/fcl/reco/Stage0/mc/stage0_run2_wc_icarus_mc.fcl +++ b/fcl/reco/Stage0/mc/stage0_run2_wc_icarus_mc.fcl @@ -55,7 +55,3 @@ physics.producers.purityana1.RawModuleLabel: ["MCDecodeTPCROI:PHYSCRATEDATATPC # restore legacy G4 labels physics.producers.mcophit.SimPhotonsProducer: "shifted" - -# avoid huge log files -services.message.destinations.LogErrorFile.categories.SimDriftElectrons: { limit: 0 } -services.message.destinations.LogStandardOut.categories.SimDriftElectrons: { limit: 0 } diff --git a/fcl/reco/Stage1/mc/stage1_run2_icarus_MC.fcl b/fcl/reco/Stage1/mc/stage1_run2_icarus_MC.fcl index 0009c0806..0db3cffcb 100644 --- a/fcl/reco/Stage1/mc/stage1_run2_icarus_MC.fcl +++ b/fcl/reco/Stage1/mc/stage1_run2_icarus_MC.fcl @@ -118,6 +118,10 @@ services.message.destinations : limit: -1 reportEvery: 1 } + SimDriftElectrons: + { + limit: 0 + } } } } From c3f0a8fbcd00e40754e09712b74e2135c559c868 Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Wed, 18 Jun 2025 14:30:31 -0500 Subject: [PATCH 22/31] Fix ctoffset to match RawDigit/Deconvolved collection hit time. --- icaruscode/TPC/ICARUSWireCell/icarus/sp.jsonnet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/icaruscode/TPC/ICARUSWireCell/icarus/sp.jsonnet b/icaruscode/TPC/ICARUSWireCell/icarus/sp.jsonnet index 10650e6bd..96a4a7d78 100644 --- a/icaruscode/TPC/ICARUSWireCell/icarus/sp.jsonnet +++ b/icaruscode/TPC/ICARUSWireCell/icarus/sp.jsonnet @@ -24,7 +24,7 @@ function(params, tools, override = {}) { dft: wc.tn(tools.dft), field_response: wc.tn(tools.field), ftoffset: 0.0, // default 0.0 - ctoffset: 0.5*wc.microsecond, //2.0*wc.microsecond, // default -8.0 + ctoffset: 1.3*wc.microsecond, //2.0*wc.microsecond, // default -8.0 per_chan_resp: pc.name, fft_flag: 0, // 1 is faster but higher memory, 0 is slightly slower but lower memory elecresponse : wc.tn(tools.elec_resp[2]), From 99234c31f6c8b471e63e17ce3c5497d9034234b4 Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Wed, 30 Jul 2025 21:16:07 -0500 Subject: [PATCH 23/31] Update overlay reco to use same calibrations as data reco. --- fcl/caf/cafmaker_add_overlay_icarus.fcl | 4 ++++ fcl/caf/cafmakerjob_icarus_detsim2d_overlay.fcl | 9 +++++---- ..._icarus_detsim2d_systtools_and_fluxwgt_overlay.fcl | 11 ++++++++--- 3 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 fcl/caf/cafmaker_add_overlay_icarus.fcl diff --git a/fcl/caf/cafmaker_add_overlay_icarus.fcl b/fcl/caf/cafmaker_add_overlay_icarus.fcl new file mode 100644 index 000000000..fda521683 --- /dev/null +++ b/fcl/caf/cafmaker_add_overlay_icarus.fcl @@ -0,0 +1,4 @@ +services.BackTrackerService.BackTracker.OverrideRealData: true +services.ParticleInventoryService.ParticleInventory.OverrideRealData: true + +physics.producers.cafmaker.OverrideRealData: true diff --git a/fcl/caf/cafmakerjob_icarus_detsim2d_overlay.fcl b/fcl/caf/cafmakerjob_icarus_detsim2d_overlay.fcl index 171ce0b0b..f8d4e8652 100644 --- a/fcl/caf/cafmakerjob_icarus_detsim2d_overlay.fcl +++ b/fcl/caf/cafmakerjob_icarus_detsim2d_overlay.fcl @@ -1,7 +1,8 @@ #include "cafmakerjob_icarus.fcl" -#include "cafmaker_add_detsim2d_icarus.fcl" -services.BackTrackerService.BackTracker.OverrideRealData: true -services.ParticleInventoryService.ParticleInventory.OverrideRealData: true +# overwrite the producers to use data versions +physics.producers: @local::caf_preprocess_data_producers +physics.runprod: [ @sequence::caf_preprocess_data_sequence, cafmaker] -physics.producers.cafmaker.OverrideRealData: true +#include "cafmaker_add_detsim2d_icarus.fcl" +#include "cafmaker_add_overlay_icarus.fcl" diff --git a/fcl/caf/cafmakerjob_icarus_detsim2d_systtools_and_fluxwgt_overlay.fcl b/fcl/caf/cafmakerjob_icarus_detsim2d_systtools_and_fluxwgt_overlay.fcl index ded9909e6..8577537b5 100644 --- a/fcl/caf/cafmakerjob_icarus_detsim2d_systtools_and_fluxwgt_overlay.fcl +++ b/fcl/caf/cafmakerjob_icarus_detsim2d_systtools_and_fluxwgt_overlay.fcl @@ -1,5 +1,10 @@ #include "cafmakerjob_icarus_detsim2d_systtools_and_fluxwgt.fcl" -services.BackTrackerService.BackTracker.OverrideRealData: true -services.ParticleInventoryService.ParticleInventory.OverrideRealData: true -physics.producers.cafmaker.OverrideRealData: true +# overwrite the producers to use data versions +physics.producers: @local::caf_preprocess_data_producers +physics.runprod: [ @sequence::caf_preprocess_data_sequence, rns, systtools, fluxweight, cafmaker] + +physics.producers.cafmaker.SystWeightLabels: ["systtools", "fluxweight"] + + +#include "cafmaker_add_overlay_icarus.fcl" From c04a6918e1d18efa7f30bf9d79dda6bbcad3283b Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Wed, 30 Jul 2025 21:17:48 -0500 Subject: [PATCH 24/31] Update calibrations for 2D+DNN signal processing for Run 2. --- ...calibration_database_GlobalTags_icarus.fcl | 2 +- ...alibration_database_TPC_TagSets_icarus.fcl | 11 ++ icaruscode/TPC/Calorimetry/CMakeLists.txt | 2 + .../NormalizeTPCPerPlaneSQL_tool.cc | 121 ++++++++++++++ .../Calorimetry/NormalizeTPCPerPlane_tool.cc | 158 ++++++++++++++++++ .../TPC/Calorimetry/normtools_icarus.fcl | 12 +- 6 files changed, 299 insertions(+), 7 deletions(-) create mode 100644 icaruscode/TPC/Calorimetry/NormalizeTPCPerPlaneSQL_tool.cc create mode 100644 icaruscode/TPC/Calorimetry/NormalizeTPCPerPlane_tool.cc diff --git a/fcl/configurations/calibration_database_GlobalTags_icarus.fcl b/fcl/configurations/calibration_database_GlobalTags_icarus.fcl index 5d080878d..03f5d89a5 100644 --- a/fcl/configurations/calibration_database_GlobalTags_icarus.fcl +++ b/fcl/configurations/calibration_database_GlobalTags_icarus.fcl @@ -5,7 +5,7 @@ BEGIN_PROLOG ICARUS_Calibration_GlobalTags: { - @table::TPC_CalibrationTags_Jan2025 + @table::TPC_CalibrationTags_Jul2025 @table::PMT_CalibrationTags_Run3_Feb2025 @table::CRT_CalibrationTags_Oct2023 } diff --git a/fcl/configurations/calibration_database_TPC_TagSets_icarus.fcl b/fcl/configurations/calibration_database_TPC_TagSets_icarus.fcl index 828e8d8a3..99d15c020 100644 --- a/fcl/configurations/calibration_database_TPC_TagSets_icarus.fcl +++ b/fcl/configurations/calibration_database_TPC_TagSets_icarus.fcl @@ -37,4 +37,15 @@ TPC_CalibrationTags_Jan2025: { } +## TPC_CalibrationTags_Jul2024 +# Update to 2D deconv tags. Change TPC equalization to be per-plane +TPC_CalibrationTags_Jul2025: { + + tpc_channelstatus_data: "v3r4" + tpc_elifetime_data: "v3r0" + tpc_dqdxcalibration_allplanes_data: "v1r0" + tpc_yz_correction_allplanes_data: "v2r0" + +} + END_PROLOG diff --git a/icaruscode/TPC/Calorimetry/CMakeLists.txt b/icaruscode/TPC/Calorimetry/CMakeLists.txt index a3b1709c5..45b214a16 100644 --- a/icaruscode/TPC/Calorimetry/CMakeLists.txt +++ b/icaruscode/TPC/Calorimetry/CMakeLists.txt @@ -47,6 +47,8 @@ cet_build_plugin(NormalizeDriftSQLite art::tool LIBRARIES ${TOOL_LIBRARIES}) cet_build_plugin(NormalizeDrift art::tool LIBRARIES ${TOOL_LIBRARIES}) cet_build_plugin(NormalizeTPCSQL art::tool LIBRARIES ${TOOL_LIBRARIES}) cet_build_plugin(NormalizeTPC art::tool LIBRARIES ${TOOL_LIBRARIES}) +cet_build_plugin(NormalizeTPCPerPlaneSQL art::tool LIBRARIES ${TOOL_LIBRARIES}) +cet_build_plugin(NormalizeTPCPerPlane art::tool LIBRARIES ${TOOL_LIBRARIES}) cet_build_plugin(NormalizeTPCLocal art::tool LIBRARIES ${TOOL_LIBRARIES}) cet_build_plugin(NormalizeWire art::tool LIBRARIES ${TOOL_LIBRARIES}) cet_build_plugin(NormalizeYZSQL art::tool LIBRARIES ${TOOL_LIBRARIES}) diff --git a/icaruscode/TPC/Calorimetry/NormalizeTPCPerPlaneSQL_tool.cc b/icaruscode/TPC/Calorimetry/NormalizeTPCPerPlaneSQL_tool.cc new file mode 100644 index 000000000..6ed734b13 --- /dev/null +++ b/icaruscode/TPC/Calorimetry/NormalizeTPCPerPlaneSQL_tool.cc @@ -0,0 +1,121 @@ +// Framework Includes +#include "art/Framework/Core/EDProducer.h" +#include "art/Framework/Principal/Event.h" +#include "art/Framework/Principal/Handle.h" +#include "art/Framework/Services/Registry/ServiceHandle.h" +#include "art/Persistency/Common/PtrMaker.h" +#include "art/Utilities/ToolMacros.h" +#include "cetlib/cpu_timer.h" +#include "fhiclcpp/ParameterSet.h" +#include "messagefacility/MessageLogger/MessageLogger.h" + +#include "larevt/CalibrationDBI/Providers/DBFolder.h" + +// Tool include +#include "larreco/Calorimetry/INormalizeCharge.h" + +// Services +#include "lardata/DetectorInfoServices/DetectorClocksService.h" + +// Lab helpers +#include "wda.h" + +// C++ +#include + +namespace icarus { + namespace calo { + +class NormalizeTPCPerPlaneSQL : public INormalizeCharge +{ +public: + NormalizeTPCPerPlaneSQL(fhicl::ParameterSet const &pset); + + void configure(const fhicl::ParameterSet& pset) override; + double Normalize(double dQdx, const art::Event &e, const recob::Hit &h, const geo::Point_t &location, const geo::Vector_t &direction, double t0) override; + +private: + // Configuration + std::string fDBFileName; + std::string fDBTag; + bool fVerbose; + + lariov::DBFolder fDB; + + // Class to hold data from DB + class ScaleInfo { + public: + std::map scale; + }; + + // Helpers + ScaleInfo GetScaleInfo(uint64_t run); + + // Cache run requests + std::map fScaleInfos; +}; + +DEFINE_ART_CLASS_TOOL(NormalizeTPCPerPlaneSQL) + + } // end namespace calo +} // end namespace icarus + + +icarus::calo::NormalizeTPCPerPlaneSQL::NormalizeTPCPerPlaneSQL(fhicl::ParameterSet const &pset): + fDBFileName(pset.get("DBFileName")), + fDBTag(pset.get("DBTag")), + fVerbose(pset.get("Verbose", false)), + fDB(fDBFileName, "", "", fDBTag, true, false) {} + +void icarus::calo::NormalizeTPCPerPlaneSQL::configure(const fhicl::ParameterSet& pset) {} + +icarus::calo::NormalizeTPCPerPlaneSQL::ScaleInfo icarus::calo::NormalizeTPCPerPlaneSQL::GetScaleInfo(uint64_t run) { + // check the cache + if (fScaleInfos.count(run)) { + return fScaleInfos.at(run); + } + + // Look up the run + // + // Translate the run into a fake "timestamp" + fDB.UpdateData((run+1000000000)*1000000000); + + // Collect the run info + ScaleInfo thisscale; + + // Iterate over the rows + for (unsigned ch = 0; ch < 12; ch++) { + double scale; + fDB.GetNamedChannelData(ch, "scale", scale); + + thisscale.scale[ch] = scale; + } + // Set the cache + fScaleInfos[run] = thisscale; + + return thisscale; +} + +double icarus::calo::NormalizeTPCPerPlaneSQL::Normalize(double dQdx, const art::Event &e, + const recob::Hit &hit, const geo::Point_t &location, const geo::Vector_t &direction, double t0) { + // Get the info + ScaleInfo i = GetScaleInfo(e.id().runID().run()); + + // Lookup the TPC, cryo + unsigned tpc = hit.WireID().TPC; + unsigned cryo = hit.WireID().Cryostat; + unsigned plane = hit.WireID().Plane; + + // Get the TPC-Plane index + unsigned itpc_plane = 2*cryo + tpc/2 + plane*4; + + double scale = 1; + + // TODO: what to do if no scale is found? throw an exception?? + if (i.scale.count(itpc_plane)) scale = i.scale.at(itpc_plane); + + if (fVerbose) std::cout << "NormalizeTPCPerPlaneSQL Tool -- Data at Cryo: " << cryo << " TPC: " << tpc << " Plane: " << plane << " itpc_plane: " << itpc_plane << " scale: " << scale << std::endl; + + return dQdx * scale; +} + diff --git a/icaruscode/TPC/Calorimetry/NormalizeTPCPerPlane_tool.cc b/icaruscode/TPC/Calorimetry/NormalizeTPCPerPlane_tool.cc new file mode 100644 index 000000000..6e61f7a6f --- /dev/null +++ b/icaruscode/TPC/Calorimetry/NormalizeTPCPerPlane_tool.cc @@ -0,0 +1,158 @@ +// Framework Includes +#include "art/Framework/Core/EDProducer.h" +#include "art/Framework/Principal/Event.h" +#include "art/Framework/Principal/Handle.h" +#include "art/Framework/Services/Registry/ServiceHandle.h" +#include "art/Persistency/Common/PtrMaker.h" +#include "art/Utilities/ToolMacros.h" +#include "cetlib/cpu_timer.h" +#include "fhiclcpp/ParameterSet.h" +#include "messagefacility/MessageLogger/MessageLogger.h" + +// Tool include +#include "larreco/Calorimetry/INormalizeCharge.h" + +// Services +#include "lardata/DetectorInfoServices/DetectorClocksService.h" + +// Lab helpers +#include "wda.h" + +// C++ +#include + +namespace icarus { + namespace calo { + +class NormalizeTPC : public INormalizeCharge +{ +public: + NormalizeTPC(fhicl::ParameterSet const &pset); + + void configure(const fhicl::ParameterSet& pset) override; + double Normalize(double dQdx, const art::Event &e, const recob::Hit &h, const geo::Point_t &location, const geo::Vector_t &direction, double t0) override; + +private: + // Configuration + int fTimeout; + std::string fURL; + bool fVerbose; + + // Class to hold data from DB + class ScaleInfo { + public: + std::map scale; + }; + + // Helpers + ScaleInfo GetScaleInfo(uint64_t run); + std::string URL(uint64_t run); + + // Cache run requests + std::map fScaleInfos; +}; + +DEFINE_ART_CLASS_TOOL(NormalizeTPC) + + } // end namespace calo +} // end namespace icarus + + +icarus::calo::NormalizeTPC::NormalizeTPC(fhicl::ParameterSet const &pset) { + this->configure(pset); +} + +void icarus::calo::NormalizeTPC::configure(const fhicl::ParameterSet& pset) { + fURL = pset.get("URL"); + fTimeout = pset.get("Timeout"); + fVerbose = pset.get("Verbose", false); +} + +std::string icarus::calo::NormalizeTPC::URL(uint64_t run) { + return fURL + std::to_string(run); +} + +icarus::calo::NormalizeTPC::ScaleInfo icarus::calo::NormalizeTPC::GetScaleInfo(uint64_t run) { + // check the cache + if (fScaleInfos.count(run)) { + return fScaleInfos.at(run); + } + + // Otherwise, look it up + int error = 0; + std::string url = URL(run); + + if (fVerbose) std::cout << "NormalizeTPC Tool -- New Scale info, requesting data from url:\n" << url << std::endl; + + Dataset d = getDataWithTimeout(url.c_str(), "", fTimeout, &error); + if (error) { + throw cet::exception("NormalizeTPC") << "Calibration Database access failed. URL: (" << url << ") Error Code: " << error; + } + + if (fVerbose) std::cout << "NormalizeTPC Tool -- Received HTTP response:\n" << getHTTPmessage(d) << std::endl; + + if (getHTTPstatus(d) != 200) { + throw cet::exception("NormalizeTPC") + << "Calibration Database access failed. URL: (" << url + << "). HTTP error status: " << getHTTPstatus(d) << ". HTTP error message: " << getHTTPmessage(d); + } + + // Collect the run info + ScaleInfo thisscale; + + // Number of rows + int n_tuple = getNtuples(d); + if (n_tuple < 0) { + throw cet::exception("NormalizeTPC") << "Calibration Database access failed. URL: (" << url << ") Bad Tuple Number: " << n_tuple; + } + + // Iterate over the rows + // The first 4 are metadata + for (unsigned row = 4; row < (unsigned)n_tuple; row++) { + Tuple tup = getTuple(d, row); + + int err = 0; + // Get the itpc number + int ch = getLongValue(tup, 0, &err); + if (error) { + throw cet::exception("NormalizeTPC") << "Calibration Database access failed. URL: (" << url << ") Failed on tuple access, row: " << row << ", col 0. Error Code: " << error; + } + + // and the scale + double scale = getDoubleValue(tup, 3, &err); + if (error) { + throw cet::exception("NormalizeTPC") << "Calibration Database access failed. URL: (" << url << ") Failed on tuple access, row: " << row << ", col 1. Error Code: " << error; + } + + thisscale.scale[ch] = scale; + } + + // Set the cache + fScaleInfos[run] = thisscale; + + return thisscale; +} + +double icarus::calo::NormalizeTPC::Normalize(double dQdx, const art::Event &e, + const recob::Hit &hit, const geo::Point_t &location, const geo::Vector_t &direction, double t0) { + // Get the info + ScaleInfo i = GetScaleInfo(e.id().runID().run()); + + // Lookup the TPC, cryo + unsigned tpc = hit.WireID().TPC; + unsigned cryo = hit.WireID().Cryostat; + unsigned plane = hit.WireID().Plane; + + // Get the TPC-Plane index + unsigned itpc_plane = 2*cryo + tpc/2 + plane*4; + + double scale = 1; + + // TODO: what to do if no scale is found? throw an exception?? + if (i.scale.count(itpc_plane)) scale = i.scale.at(itpc_plane); + + if (fVerbose) std::cout << "NormalizeTPCPerPlaneSQL Tool -- Data at Cryo: " << cryo << " TPC: " << tpc << " Plane: " << plane << " itpc_plane: " << itpc_plane << " scale: " << scale << std::endl; + + return dQdx * scale; +} + diff --git a/icaruscode/TPC/Calorimetry/normtools_icarus.fcl b/icaruscode/TPC/Calorimetry/normtools_icarus.fcl index 2a69eb647..5443186cf 100644 --- a/icaruscode/TPC/Calorimetry/normtools_icarus.fcl +++ b/icaruscode/TPC/Calorimetry/normtools_icarus.fcl @@ -24,9 +24,9 @@ yznorm: { } tpcgain: { - tool_type: NormalizeTPC + tool_type: NormalizeTPCPerPlane Timeout: 200 - URL: "https://dbdata0vm.fnal.gov:9443/icarus_con_prod/app/data?f=tpc_dqdxcalibration_data&t=" + URL: "https://dbdata0vm.fnal.gov:9443/icarus_con_prod/app/data?f=tpc_dqdxcalibration_allplanes_data&t=" Verbose: false } @@ -38,9 +38,9 @@ driftnorm_sql: { } tpcgain_sql: { - tool_type: NormalizeTPCSQL - DBFileName: tpc_dqdxcalibration_data - DBTag: @local::ICARUS_Calibration_GlobalTags.tpc_dqdxcalibration_data + tool_type: NormalizeTPCPerPlaneSQL + DBFileName: tpc_dqdxcalibration_allplanes_data + DBTag: @local::ICARUS_Calibration_GlobalTags.tpc_dqdxcalibration_allplanes_data Verbose: false } @@ -59,7 +59,7 @@ yznorm_sql: { } #icarus_calonormtools: [@local::driftnorm, @local::yznorm, @local::tpcgain] - icarus_calonormtools: [@local::driftnorm_sql, @local::yznorm_sql, @local::tpcgain_sql] +icarus_calonormtools: [@local::driftnorm_sql, @local::yznorm_sql, @local::tpcgain_sql] # Gain with angular dep. recombination. Measurement from: https://arxiv.org/pdf/2407.12969 # Assume equal on planes -- this is __wrong__ -- will need to be fixed when they are calibrated From ef8076ebf0ac7a6b2dac6104146e99a742077de1 Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Wed, 30 Jul 2025 21:19:13 -0500 Subject: [PATCH 25/31] Update reco1 processing chain. Pandora gets hits with 'long hits', combined (not cluster3D'd) between TPCs. SPINE gets hits with 'pulse trains', run through cluster 3D. --- fcl/reco/Definitions/stage1_icarus_defs.fcl | 37 ++++++++++-- .../HitFinder/HitMerger_module.cc | 58 ++++++++++++++++++- .../HitFinder/hitfindermodules_icarus.fcl | 10 ++++ 3 files changed, 98 insertions(+), 7 deletions(-) diff --git a/fcl/reco/Definitions/stage1_icarus_defs.fcl b/fcl/reco/Definitions/stage1_icarus_defs.fcl index 22b46744c..d5b1255c6 100644 --- a/fcl/reco/Definitions/stage1_icarus_defs.fcl +++ b/fcl/reco/Definitions/stage1_icarus_defs.fcl @@ -43,6 +43,10 @@ icarus_stage1_producers: cluster3DCryoW: @local::icarus_cluster3d cluster3DCryoE: @local::icarus_cluster3d + ### Hit combiner + combineHitsCryoE: @local::icarus_hitmerger_cryoE + combineHitsCryoW: @local::icarus_hitmerger_cryoW + ### pandora pandoraGausCryoW: @local::icarus_pandora pandoraTrackGausCryoW: @local::icarus_pandoraTrackCreation @@ -192,11 +196,17 @@ icarus_WestHits_TPC: [ gaushit1dTPCWW, gaushit1dTPCWE ] icarus_EastHits2d_TPC: [ gaushit2dTPCEW, - gaushit2dTPCEE + gaushit2dTPCEE, + combineHitsCryoE, + gaushitPT2dTPCEW, + gaushitPT2dTPCEE ] icarus_WestHits2d_TPC: [ gaushit2dTPCWW, - gaushit2dTPCWE + gaushit2dTPCWE, + combineHitsCryoW, + gaushitPT2dTPCWW, + gaushitPT2dTPCWE ] # Set up filtering of cluster3D hits by cryostat @@ -314,6 +324,16 @@ icarus_stage1_producers.gaushit2dTPCWW.HitFinderToolVec.CandidateHitsPlane1.RoiT icarus_stage1_producers.gaushit2dTPCWW.HitFinderToolVec.CandidateHitsPlane2.RoiThreshold: 5. icarus_stage1_producers.gaushit2dTPCWW.HitFilterAlg.MinPulseHeight: [3., 3., 3.] +# Setup version of hit finder's with Pulse Trains ("PT"s) enabled +icarus_stage1_producers.gaushitPT2dTPCEE: @local::icarus_stage1_producers.gaushit2dTPCEE +icarus_stage1_producers.gaushitPT2dTPCEE.LongMaxHits: [25, 25, 25] +icarus_stage1_producers.gaushitPT2dTPCEW: @local::icarus_stage1_producers.gaushit2dTPCEW +icarus_stage1_producers.gaushitPT2dTPCEW.LongMaxHits: [25, 25, 25] +icarus_stage1_producers.gaushitPT2dTPCWE: @local::icarus_stage1_producers.gaushit2dTPCWE +icarus_stage1_producers.gaushitPT2dTPCWE.LongMaxHits: [25, 25, 25] +icarus_stage1_producers.gaushitPT2dTPCWW: @local::icarus_stage1_producers.gaushit2dTPCWW +icarus_stage1_producers.gaushitPT2dTPCWW.LongMaxHits: [25, 25, 25] + ## Overrides for filtering of cluster3D hits icarus_stage1_filters.TPCHitFilterCryoW.HitDataLabelVec: ["cluster3DCryoW"] icarus_stage1_filters.TPCHitFilterCryoW.MaximumHits: 60000 @@ -323,7 +343,8 @@ icarus_stage1_filters.TPCHitFilterCryoE.MaximumHits: 60000 ## Definitions for running the 3D clustering by Cryostat icarus_stage1_producers.cluster3DCryoW.MakeSpacePointsOnly: true -icarus_stage1_producers.cluster3DCryoW.Hit3DBuilderAlg.HitFinderTagVec: ["gaushit2dTPCWW", "gaushit2dTPCWE"] +# use the "PT" (pulse train) hits as input to cluster3D +icarus_stage1_producers.cluster3DCryoW.Hit3DBuilderAlg.HitFinderTagVec: ["gaushitPT2dTPCWW", "gaushitPT2dTPCWE"] icarus_stage1_producers.cluster3DCryoW.Hit3DBuilderAlg.PulseHeightFraction: 0. #0.75 #0.25 icarus_stage1_producers.cluster3DCryoW.Hit3DBuilderAlg.PHLowSelection: 0. #4.0 # 20. icarus_stage1_producers.cluster3DCryoW.Hit3DBuilderAlg.MaxHitChiSquare: 1000000. @@ -331,7 +352,7 @@ icarus_stage1_producers.cluster3DCryoW.Hit3DBuilderAlg.MaxMythicalChiSquare: icarus_stage1_producers.cluster3DCryoW.Hit3DBuilderAlg.OutputHistograms: false icarus_stage1_producers.cluster3DCryoE.MakeSpacePointsOnly: true -icarus_stage1_producers.cluster3DCryoE.Hit3DBuilderAlg.HitFinderTagVec: ["gaushit2dTPCEW", "gaushit2dTPCEE"] +icarus_stage1_producers.cluster3DCryoE.Hit3DBuilderAlg.HitFinderTagVec: ["gaushitPT2dTPCEW", "gaushitPT2dTPCEE"] icarus_stage1_producers.cluster3DCryoE.Hit3DBuilderAlg.PulseHeightFraction: 0. #0.75 #0.25 icarus_stage1_producers.cluster3DCryoE.Hit3DBuilderAlg.PHLowSelection: 0. #4.0 # 20. icarus_stage1_producers.cluster3DCryoE.Hit3DBuilderAlg.MaxHitChiSquare: 1000000. @@ -339,13 +360,17 @@ icarus_stage1_producers.cluster3DCryoE.Hit3DBuilderAlg.MaxMythicalChiSquare: icarus_stage1_producers.cluster3DCryoE.Hit3DBuilderAlg.OutputHistograms: false ### Definitions for a pandora by cryostat -icarus_stage1_producers.pandoraGausCryoW.HitFinderModuleLabel: "cluster3DCryoW" +icarus_stage1_producers.pandoraGausCryoW.HitFinderModuleLabel: "combineHitsCryoW" +# icarus_stage1_producers.pandoraGausCryoW.HitFinderModuleLabel: "" +# icarus_stage1_producers.pandoraGausCryoW.HitCollectionTool.OverrhideHitLabels: ["gaushit2dTPCWW", "gaushit2dTPCWE"] icarus_stage1_producers.pandoraTrackGausCryoW.PFParticleLabel: "pandoraGausCryoW" icarus_stage1_producers.pandoraTrackGausCryoW.UseAllParticles: true icarus_stage1_producers.pandoraKalmanTrackGausCryoW.inputCollection: "pandoraGausCryoW" icarus_stage1_producers.pandoraKalmanTrackGausCryoW.trackInputTag: "pandoraTrackGausCryoW" -icarus_stage1_producers.pandoraGausCryoE.HitFinderModuleLabel: "cluster3DCryoE" +icarus_stage1_producers.pandoraGausCryoE.HitFinderModuleLabel: "combineHitsCryoE" +# icarus_stage1_producers.pandoraGausCryoE.HitFinderModuleLabel: "" +# icarus_stage1_producers.pandoraGausCryoE.HitCollectionTool.OverrhideHitLabels: ["gaushit2dTPCEW", "gaushit2dTPCEE"] icarus_stage1_producers.pandoraTrackGausCryoE.PFParticleLabel: "pandoraGausCryoE" icarus_stage1_producers.pandoraTrackGausCryoE.UseAllParticles: true icarus_stage1_producers.pandoraKalmanTrackGausCryoE.inputCollection: "pandoraGausCryoE" diff --git a/icaruscode/TPC/SignalProcessing/HitFinder/HitMerger_module.cc b/icaruscode/TPC/SignalProcessing/HitFinder/HitMerger_module.cc index 993b74ed3..90a6d9856 100644 --- a/icaruscode/TPC/SignalProcessing/HitFinder/HitMerger_module.cc +++ b/icaruscode/TPC/SignalProcessing/HitFinder/HitMerger_module.cc @@ -37,6 +37,8 @@ #include "lardata/DetectorInfoServices/DetectorPropertiesService.h" #include "lardata/DetectorInfoServices/LArPropertiesService.h" +#include "sbnobj/ICARUS/TPC/ChannelROI.h" + class HitMerger : public art::EDProducer { public: @@ -62,8 +64,13 @@ class HitMerger : public art::EDProducer /** * @brief Create raw::RawDigit to recob::Hit associations */ - void makeRawDigitAssns(const art::Event&, art::Assns&, RecobHitToPtrMap&) const; + + /** + * @brief Create recob::ChannelROI to recob::Hit associatins + */ + void makeChanROIAssns(const art::Event&, art::Assns&, RecobHitToPtrMap&) const; + // define vector for hits to make sure of uniform use using HitPtrVector = std::vector>; @@ -87,6 +94,7 @@ HitMerger::HitMerger(fhicl::ParameterSet const & pset) : EDProducer{pset} produces< std::vector>(); produces< art::Assns>(); produces< art::Assns>(); + produces< art::Assns>(); // Report. mf::LogInfo("HitMerger") << "HitMerger configured\n"; @@ -139,6 +147,9 @@ void HitMerger::produce(art::Event & evt) /// Associations with raw digits. std::unique_ptr> rawDigitAssns(new art::Assns); + /// Associations with channel ROIs. + std::unique_ptr> chanROIAssns(new art::Assns); + RecobHitToPtrMap recobHitToPtrMap; // Use this handy art utility to make art::Ptr objects to the new recob::Hits for use in the output phase @@ -172,11 +183,14 @@ void HitMerger::produce(art::Event & evt) makeWireAssns(evt, *wireAssns, recobHitToPtrMap); makeRawDigitAssns(evt, *rawDigitAssns, recobHitToPtrMap); + + makeChanROIAssns(evt, *chanROIAssns, recobHitToPtrMap); // Move everything into the event evt.put(std::move(outputHitPtrVec)); evt.put(std::move(wireAssns)); evt.put(std::move(rawDigitAssns)); + evt.put(std::move(chanROIAssns)); return; } @@ -264,6 +278,48 @@ void HitMerger::makeRawDigitAssns(const art::Event& evt, art::Assns &chanROIAssns, RecobHitToPtrMap& recobHitPtrMap) const +{ + // Let's make sure the input associations container is empty + chanROIAssns = art::Assns(); + + // First task is to recover all of the previous chanROI <--> hit associations and map them by channel number + // Create the temporary container + std::unordered_map> channelToChanROIMap; + + // Go through the list of input sources and fill out the map + for(const auto& inputTag : HitMergerfHitProducerLabelVec) + { + art::ValidHandle> hitHandle = evt.getValidHandle>(inputTag); + + art::FindOneP hitToChanROIAssns(hitHandle, evt, inputTag); + + if (hitToChanROIAssns.isValid()) + { + for(size_t chanROIIdx = 0; chanROIIdx < hitToChanROIAssns.size(); chanROIIdx++) + { + art::Ptr chanROI = hitToChanROIAssns.at(chanROIIdx); + + channelToChanROIMap[chanROI->Channel()] = chanROI; + } + } + } + + // Now fill the container + for(const auto& hitPtrPair : recobHitPtrMap) + { + raw::ChannelID_t channel = hitPtrPair.first->Channel(); + + std::unordered_map>::iterator chanChanROIItr = channelToChanROIMap.find(channel); + + if (!(chanChanROIItr != channelToChanROIMap.end())) continue; + + chanROIAssns.addSingle(chanChanROIItr->second, hitPtrPair.second); + } + + return; +} //---------------------------------------------------------------------------- /// End job method. diff --git a/icaruscode/TPC/SignalProcessing/HitFinder/hitfindermodules_icarus.fcl b/icaruscode/TPC/SignalProcessing/HitFinder/hitfindermodules_icarus.fcl index 5df56b46b..edb1b18e9 100644 --- a/icaruscode/TPC/SignalProcessing/HitFinder/hitfindermodules_icarus.fcl +++ b/icaruscode/TPC/SignalProcessing/HitFinder/hitfindermodules_icarus.fcl @@ -123,5 +123,15 @@ icarus_hitconverter: DaignosticOutput: false } +icarus_hitmerger_cryoE: { + module_type: HitMerger + HitProducerLabelVec: ["gaushit2dTPCEW", "gaushit2dTPCEE"] +} + +icarus_hitmerger_cryoW: { + module_type: HitMerger + HitProducerLabelVec: ["gaushit2dTPCWW", "gaushit2dTPCWE"] +} + END_PROLOG From 2f30b6c800f8c626d0c00bdfd0171d393705459f Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Wed, 30 Jul 2025 21:19:54 -0500 Subject: [PATCH 26/31] Tune transverse diffusion constant. --- fcl/services/simulationservices_icarus.fcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fcl/services/simulationservices_icarus.fcl b/fcl/services/simulationservices_icarus.fcl index b5e4d9718..788d1a4f4 100644 --- a/fcl/services/simulationservices_icarus.fcl +++ b/fcl/services/simulationservices_icarus.fcl @@ -16,7 +16,7 @@ BEGIN_PROLOG icarus_largeantparameters: @local::standard_largeantparameters # from simulationservices.fcl icarus_largeantparameters.UseCustomPhysics: true icarus_largeantparameters.LongitudinalDiffusion: 4.0e-9 #in cm^2/ns -icarus_largeantparameters.TransverseDiffusion: 8.8e-9 #in cm^2/ns +icarus_largeantparameters.TransverseDiffusion: 7.5e-9 #in cm^2/ns icarus_largeantparameters.ElectronClusterSize: 20.0 #number of ionization electrons to drift in a unit icarus_largeantparameters.EnabledPhysics: [ "Em", "SynchrotronAndGN", "Ion", "Hadron", "Decay", "HadronElastic", "Stopping" From 77f4d330e48e25abe13eef67d060a2534e741f11 Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Wed, 30 Jul 2025 21:20:18 -0500 Subject: [PATCH 27/31] Tune MC gain and sim-reco timing offsets. --- .../detsimmodules_wirecell_ICARUS.fcl | 12 +++---- ...-drift-simchannel-yzsim-refactored.jsonnet | 32 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl b/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl index 5da3c8673..5aa603e41 100644 --- a/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl +++ b/icaruscode/TPC/ICARUSWireCell/detsimmodules_wirecell_ICARUS.fcl @@ -54,18 +54,18 @@ icarus_simwire_wirecell: overlay_drifter: false # default drifter by default # Gain and shaping time - gain0: 17.05212 # mV/fC - gain1: 12.6181926 # mV/fC - gain2: 13.0261362 # mV/fC + gain0: 17.9488 # mV/fC + gain1: 12.4317 # mV/fC + gain2: 14.0976 # mV/fC shaping0: 1.3 # us shaping1: 1.45 # us shaping2: 1.3 # us # Time offsets for truth matching -- tuned to 2D deconvolution output - time_offset_u: 1.81 # us - time_offset_v: 2.08 # us - time_offset_y: 1.82 # us + time_offset_u: 2.53 # us + time_offset_v: 2.41 # us + time_offset_y: 2.53 # us } } } diff --git a/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel-yzsim-refactored.jsonnet b/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel-yzsim-refactored.jsonnet index db363894c..ec6a74c84 100644 --- a/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel-yzsim-refactored.jsonnet +++ b/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel-yzsim-refactored.jsonnet @@ -44,22 +44,22 @@ local params = base { // fields: [ std.extVar('files_fields'), ] fields: [ - "icarus_fnal_fit_ks_P0nom_P1bin0.json.bz2", - "icarus_fnal_fit_ks_P0nom_P1bin1.json.bz2", - "icarus_fnal_fit_ks_P0nom_P1bin2.json.bz2", - "icarus_fnal_fit_ks_P0nom_P1bin3.json.bz2", - "icarus_fnal_fit_ks_P0nom_P1bin4.json.bz2", - "icarus_fnal_fit_ks_P0nom_P1bin5.json.bz2", - "icarus_fnal_fit_ks_P0nom_P1bin6.json.bz2", - "icarus_fnal_fit_ks_P0nom_P1bin7.json.bz2", - "icarus_fnal_fit_ks_P0nom_P1bin8.json.bz2", - "icarus_fnal_fit_ks_P0nom_P1bin9.json.bz2", - "icarus_fnal_fit_ks_P0nom_P1bin10.json.bz2", - "icarus_fnal_fit_ks_P0nom_P1bin11.json.bz2", - "icarus_fnal_fit_ks_P0nom_P1bin12.json.bz2", - "icarus_fnal_fit_ks_P0nom_P1bin13.json.bz2", - "icarus_fnal_fit_ks_P0nom_P1bin14.json.bz2", - "icarus_fnal_fit_ks_P0nom_P1bin15.json.bz2"] + "icarus_fnal_fit_ks_P0nom_P1bin0_shifted.json.bz2", + "icarus_fnal_fit_ks_P0nom_P1bin1_shifted.json.bz2", + "icarus_fnal_fit_ks_P0nom_P1bin2_shifted.json.bz2", + "icarus_fnal_fit_ks_P0nom_P1bin3_shifted.json.bz2", + "icarus_fnal_fit_ks_P0nom_P1bin4_shifted.json.bz2", + "icarus_fnal_fit_ks_P0nom_P1bin5_shifted.json.bz2", + "icarus_fnal_fit_ks_P0nom_P1bin6_shifted.json.bz2", + "icarus_fnal_fit_ks_P0nom_P1bin7_shifted.json.bz2", + "icarus_fnal_fit_ks_P0nom_P1bin8_shifted.json.bz2", + "icarus_fnal_fit_ks_P0nom_P1bin9_shifted.json.bz2", + "icarus_fnal_fit_ks_P0nom_P1bin10_shifted.json.bz2", + "icarus_fnal_fit_ks_P0nom_P1bin11_shifted.json.bz2", + "icarus_fnal_fit_ks_P0nom_P1bin12_shifted.json.bz2", + "icarus_fnal_fit_ks_P0nom_P1bin13_shifted.json.bz2", + "icarus_fnal_fit_ks_P0nom_P1bin14_shifted.json.bz2", + "icarus_fnal_fit_ks_P0nom_P1bin15_shifted.json.bz2"] }, rc_resp: if std.extVar('file_rcresp') != "" then From 87f3e5be67152b22aa9ce085447344581a66d814 Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Wed, 30 Jul 2025 21:24:09 -0500 Subject: [PATCH 28/31] Fix stage0 mc no trigger simulation fcl file. --- fcl/reco/Stage0/mc/stage0_run2_wc_icarus_mc_notriggersim.fcl | 1 + 1 file changed, 1 insertion(+) diff --git a/fcl/reco/Stage0/mc/stage0_run2_wc_icarus_mc_notriggersim.fcl b/fcl/reco/Stage0/mc/stage0_run2_wc_icarus_mc_notriggersim.fcl index 9d738f348..54f81872a 100644 --- a/fcl/reco/Stage0/mc/stage0_run2_wc_icarus_mc_notriggersim.fcl +++ b/fcl/reco/Stage0/mc/stage0_run2_wc_icarus_mc_notriggersim.fcl @@ -1,6 +1,7 @@ #include "stage0_run2_wc_icarus_mc.fcl" # restore non-shifted labels +physics.producers.ophit.InputModule: "opdaq" physics.producers.emuTrigger.BeamGates: "beamgate" physics.producers.mcophit.SimPhotonsProducer: "pdfastsim" physics.producers.opdetonbeam.Waveforms: "opdaq" From e0a5831f9caf095a7acef3c1f66eb51b6b37cdd6 Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Tue, 17 Jun 2025 08:39:38 -0500 Subject: [PATCH 29/31] Disable pusle trains. --- .../SignalProcessing/HitFinder/hitfindermodules_icarus.fcl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/icaruscode/TPC/SignalProcessing/HitFinder/hitfindermodules_icarus.fcl b/icaruscode/TPC/SignalProcessing/HitFinder/hitfindermodules_icarus.fcl index edb1b18e9..093524b07 100644 --- a/icaruscode/TPC/SignalProcessing/HitFinder/hitfindermodules_icarus.fcl +++ b/icaruscode/TPC/SignalProcessing/HitFinder/hitfindermodules_icarus.fcl @@ -17,7 +17,7 @@ icarus_hitfinder: MaxMultiHit: 3 # maximum hits for multi fit Chi2NDF: 10. # maximum Chisquared / NDF allowed for a hit to be saved (Set very high by default) LongPulseWidth: [ 16, 16, 16] # max widths for hits in long pulse trains - LongMaxHits: [ 10, 10, 10] # max number hits in long pulse trains + LongMaxHits: [ 1, 1, 1] # max number hits in long pulse trains MinWidth: 1. MaxWidthMult: 3. FittingRange: 35 @@ -35,7 +35,7 @@ mixed_hitfinder: MaxMultiHit: 3 # maximum hits for multi fit Chi2NDF: 10. # maximum Chisquared / NDF allowed for a hit to be saved (Set very high by default) LongPulseWidth: [ 16, 16, 16] # max widths for hits in long pulse trains - LongMaxHits: [ 10, 10, 10] # max number hits in long pulse trains + LongMaxHits: [ 1, 1, 1] # max number hits in long pulse trains MinWidth: 1. MaxWidthMult: 3. FittingRange: 35 @@ -70,7 +70,7 @@ gaus_hitfinder_icarus.Chi2NDF: gaus_hitfinder_icarus.PeakFitter.MinWidth: 1 gaus_hitfinder_icarus.PeakFitter.FloatBaseline: false gaus_hitfinder_icarus.PeakFitter.tool_type: "PeakFitterMrqdt" -gaus_hitfinder_icarus.LongMaxHits: [25, 25, 25] +gaus_hitfinder_icarus.LongMaxHits: [1, 1, 1] gaus_hitfinder_icarus.LongPulseWidth: [10, 10, 10] # Keeping these here even though not used in case we want to know working values for testing @@ -114,6 +114,7 @@ gausshit_sbn.HitFinderToolVec.CandidateHitsPlane1.RoiThreshold: gausshit_sbn.HitFinderToolVec.CandidateHitsPlane2: @local::candhitfinder_standard gausshit_sbn.HitFinderToolVec.CandidateHitsPlane2.Plane: 2 gausshit_sbn.HitFinderToolVec.CandidateHitsPlane2.RoiThreshold: 9. +gausshit_sbn.LongMaxHits: [ 1, 1, 1] # disable pulse trains icarus_hitconverter: { From c6fcff69a7ef9160102881bd682179e229f34c81 Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Fri, 1 Aug 2025 15:33:39 -0500 Subject: [PATCH 30/31] Update to new YZ gain map. --- .../wcls-multitpc-sim-drift-simchannel-yzsim-refactored.jsonnet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel-yzsim-refactored.jsonnet b/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel-yzsim-refactored.jsonnet index ec6a74c84..42b0e9eba 100644 --- a/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel-yzsim-refactored.jsonnet +++ b/icaruscode/TPC/ICARUSWireCell/icarus/wcls-multitpc-sim-drift-simchannel-yzsim-refactored.jsonnet @@ -221,7 +221,7 @@ local scalers = [{ type: "Scaler", name: "scaler%d" %n, //%std.floor(n/45), data: params.lar { - yzmap_scale_filename: 'yzmap_gain_icarus_v3_run2.json', + yzmap_scale_filename: 'yzmap_gain_icarus_v4_run2.json', bin_width: 10*wc.cm, tpc_width: 1500*wc.mm, bin_height: 10*wc.cm, From 279266f95f541d8e999f10257fc9997f3efce52a Mon Sep 17 00:00:00 2001 From: Gray Putnam Date: Fri, 1 Aug 2025 16:07:19 -0500 Subject: [PATCH 31/31] Revert "Tune transverse diffusion constant." This reverts commit 2f30b6c800f8c626d0c00bdfd0171d393705459f. --- fcl/services/simulationservices_icarus.fcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fcl/services/simulationservices_icarus.fcl b/fcl/services/simulationservices_icarus.fcl index 788d1a4f4..b5e4d9718 100644 --- a/fcl/services/simulationservices_icarus.fcl +++ b/fcl/services/simulationservices_icarus.fcl @@ -16,7 +16,7 @@ BEGIN_PROLOG icarus_largeantparameters: @local::standard_largeantparameters # from simulationservices.fcl icarus_largeantparameters.UseCustomPhysics: true icarus_largeantparameters.LongitudinalDiffusion: 4.0e-9 #in cm^2/ns -icarus_largeantparameters.TransverseDiffusion: 7.5e-9 #in cm^2/ns +icarus_largeantparameters.TransverseDiffusion: 8.8e-9 #in cm^2/ns icarus_largeantparameters.ElectronClusterSize: 20.0 #number of ionization electrons to drift in a unit icarus_largeantparameters.EnabledPhysics: [ "Em", "SynchrotronAndGN", "Ion", "Hadron", "Decay", "HadronElastic", "Stopping"