Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
3cab2e9
fix sim label for PDFastSim
mvicenzi May 22, 2025
b6c5c1a
detsim_opdetonly_icarus.fcl: simulate only optical detector digitization
PetrilloAtWork Feb 8, 2025
ae195e1
Changed determination of the end of single photoelectron response tem…
PetrilloAtWork Feb 8, 2025
b129249
Updated `FastGaussianNoiseGeneratorAlg` documentation
PetrilloAtWork Apr 12, 2025
3f467fb
SelectCathodeCrossingGenParticles: selects generated events with part…
PetrilloAtWork Jun 17, 2025
0dc5ec4
Merge branch 'mvicenzi/quick_fix' into feature/mvicenzi_repro_step1
mvicenzi Oct 28, 2025
0d3e9ff
make MC2-var4 tune standard
mvicenzi Oct 29, 2025
1428556
simulate pmt timing delays in mc
mvicenzi Oct 29, 2025
9d43105
disable pmt mc noise for overlays
mvicenzi Oct 29, 2025
d655888
add ophituncorrected + ophit flow for mc
mvicenzi Oct 30, 2025
6f0342b
update stage0 flow for overlays
mvicenzi Oct 30, 2025
7e655c6
small fix
mvicenzi Nov 3, 2025
8726590
prelimanary reco gain tuning
mvicenzi Nov 4, 2025
0fe2b8e
add SPRRun3, make SPRRun2 default
mvicenzi Nov 10, 2025
a138d80
nullify flash calibration
mvicenzi Nov 10, 2025
e9a9bea
add run3 opdet tune, make run2 default
mvicenzi Nov 10, 2025
e918fe8
change run3->run4, update gain
mvicenzi Nov 12, 2025
677563f
Merge branch 'release/SBN2025A' into feature/mvicenzi_repro_step1
mvicenzi Nov 12, 2025
99f4413
add run4 detsim fhicls
mvicenzi Nov 13, 2025
b90cfb5
first attempt at detsim reprocessing fhicl
mvicenzi Nov 18, 2025
468cb3f
fix typo
mvicenzi Nov 18, 2025
9667657
Tell CMake of sbnalg dependency
PetrilloAtWork Nov 18, 2025
8c1e40b
Trigger simulation modules: support input tag with process name
PetrilloAtWork Nov 18, 2025
937b4b6
Apply suggestions from GIT Copilot code review
PetrilloAtWork Nov 19, 2025
ab9ecf2
Merge pull request #870 from PetrilloAtWork/feature/gp_LVDSgatesFix
mvicenzi Nov 19, 2025
a80e88b
fix to detsim reprocessing
mvicenzi Nov 19, 2025
fe5e072
reprocessing opdetonly overlay fhicl
mvicenzi Nov 19, 2025
2142449
leave default tags
mvicenzi Nov 19, 2025
0c07aeb
add initial recalibrator module
mvicenzi Dec 3, 2025
16be497
fix compilation for recalibrator
mvicenzi Dec 3, 2025
8dfa2db
link online corrections service to recalibrator
mvicenzi Dec 4, 2025
d96f212
link locally-provided old timing corrections
mvicenzi Dec 4, 2025
76c5cd0
fix timing recalibration
mvicenzi Dec 4, 2025
46942ec
remove custom config, fixed indentation
mvicenzi Dec 4, 2025
8d29faa
chop off flat waveform tail in overlays
mvicenzi Dec 4, 2025
23005d1
restore legacy defaults for backward compatibility
mvicenzi Dec 4, 2025
2f8cf32
fixed documentation
mvicenzi Dec 4, 2025
d18c784
add opdetonly MCstage0 fhicls for reprocessing
mvicenzi Dec 5, 2025
28f94e0
fix stage0 reprocessing fhicls
mvicenzi Dec 8, 2025
86cb353
adjust stage1 compatibility
mvicenzi Dec 8, 2025
09ea82e
add data reprocessing fhicl(s)
mvicenzi Dec 8, 2025
5af5235
update file names
mvicenzi Dec 8, 2025
d7b1c3a
ICARUSFlashFinder: added Doxygen-style header
PetrilloAtWork Dec 18, 2025
d91e636
ICARUSFlashFinder: turned into shared module
PetrilloAtWork Dec 18, 2025
4a92ddf
ICARUSFlashFinder: FHiCL configuration validation
PetrilloAtWork Dec 18, 2025
e433639
ICARUSFlashFinder: code updates
PetrilloAtWork Dec 18, 2025
93fcc2c
ICARUSFlashFinder: removed hit recalibration (PECalib)
PetrilloAtWork Dec 18, 2025
4d8d9f4
dump_opflashes_icarus.fcl: dump reconstructed flashes on text file
PetrilloAtWork Dec 18, 2025
15541a4
Adopting corrections from GitHub Copilot
PetrilloAtWork Dec 18, 2025
a019654
Removed obsolete icarus_flashcalib.fcl
PetrilloAtWork Dec 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ find_package(ifdhc REQUIRED )
find_package(ifdh_art REQUIRED )
find_package(Range-v3 REQUIRED )
find_package(sbnobj REQUIRED )
find_package(sbnalg REQUIRED )
find_package(icarus_signal_processing REQUIRED )
find_package(icarusalg REQUIRED )
find_package(icarusutil REQUIRED )
Expand Down
1 change: 1 addition & 0 deletions fcl/detsim/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# add underlying subfolders
add_subdirectory(SBNNoise)
add_subdirectory(partial)
add_subdirectory(commissioning)
add_subdirectory(archive)

Expand Down
4 changes: 2 additions & 2 deletions fcl/detsim/commissioning/run4642like_detsim_icarus.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#

#include "services_common_icarus.fcl"
#include "opdetsim_pmt_icarus.fcl"
#include "pmtsimulation_icarus.fcl"
#include "rootoutput_icarus.fcl"

process_name: DetSim4642
Expand All @@ -38,7 +38,7 @@ services: @local::icarus_common_services # from services_common_icarus.fcl
physics: {
producers: {
opdaq: {
@table::icarus_simpmt_noise # from opdetsim_pmt_icarus.fcl
@table::icarus_pmtsimulationalg_202202_noise # from pmtsimulation_icarus.fcl

#
# enabled readout window
Expand Down
4 changes: 2 additions & 2 deletions fcl/detsim/commissioning/run4759like_detsim_icarus.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#

#include "services_common_icarus.fcl"
#include "opdetsim_pmt_icarus.fcl"
#include "pmtsimulation_icarus.fcl"
#include "rootoutput_icarus.fcl"

process_name: DetSim4759
Expand All @@ -38,7 +38,7 @@ services: @local::icarus_common_services # from services_common_icarus.fcl
physics: {
producers: {
opdaq: {
@table::icarus_simpmt_noise # from opdetsim_pmt_icarus.fcl
@table::icarus_pmtsimulationalg_202202_noise # from pmtsimulation_icarus.fcl

#
# enabled readout window
Expand Down
4 changes: 4 additions & 0 deletions fcl/detsim/detsim_2d_icarus_refactored_Run4.fcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include "detsim_2d_icarus_refactored.fcl"

# Run3/4 optical tune
physics.producers.opdaq: @local::icarus_simpmt_run4
3 changes: 3 additions & 0 deletions fcl/detsim/detsim_2d_icarus_refactored_overlay.fcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#include "detsim_2d_icarus_refactored.fcl"

physics.producers.daq: @local::icarus_simwire_wirecell_shifted_overlay

# turn off mc noise on pmt waveforms
physics.producers.opdaq: @local::icarus_simpmt_nonoise
4 changes: 4 additions & 0 deletions fcl/detsim/detsim_2d_icarus_refactored_overlay_Run4.fcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include "detsim_2d_icarus_refactored_overlay.fcl"

# Run3/4 optical tune (with no noise)
physics.producers.opdaq: @local::icarus_simpmt_run4_nonoise
3 changes: 3 additions & 0 deletions fcl/detsim/detsim_2d_icarus_refactored_yzsim_Run4.fcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#include "detsim_2d_icarus_refactored_yzsim.fcl"

physics.producers.daq.wcls_main.params.YZScaleMapJson: "yzmap_gain_icarus_v4_run4.json"

# Run3/4 optical tune
physics.producers.opdaq: @local::icarus_simpmt_run4
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#include "detsim_2d_icarus_refactored_yzsim_notrigger.fcl"

physics.producers.daq: @local::icarus_simwire_wirecell_yz_overlay

# turn off mc noise on pmt waveforms
physics.producers.opdaq: @local::icarus_simpmt_nonoise
3 changes: 3 additions & 0 deletions fcl/detsim/detsim_2d_icarus_refactored_yzsim_overlay.fcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#include "detsim_2d_icarus_refactored_yzsim.fcl"

physics.producers.daq: @local::icarus_simwire_wirecell_yz_overlay

# turn off mc noise on pmt waveforms
physics.producers.opdaq: @local::icarus_simpmt_nonoise
3 changes: 3 additions & 0 deletions fcl/detsim/detsim_2d_icarus_refactored_yzsim_overlay_Run4.fcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#include "detsim_2d_icarus_refactored_yzsim_overlay.fcl"

physics.producers.daq.wcls_main.params.YZScaleMapJson: "yzmap_gain_icarus_v4_run4.json"

# Run3/4 optical tune (with no noise)
physics.producers.opdaq: @local::icarus_simpmt_run4_nonoise
8 changes: 8 additions & 0 deletions fcl/detsim/partial/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Install fcl files in /job subdirectory.
install_fhicl()

# Also put a copy in the source tree.

FILE(GLOB fcl_files *.fcl)
install_source( EXTRAS ${fcl_files} )

40 changes: 40 additions & 0 deletions fcl/detsim/partial/detsim_opdetonly_icarus.fcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#
# File: detsim_opdetonly_icarus.fcl
# Purpose: Simulation of the optical detector response.
# Date: January 27, 2025
# Author: Gianluca Petrillo (petrillo@slac.stanford.edu)
#
# This job configuration runs the standard detector simulation, like
# `detsim_1d_icarus.fcl` does, but only for the optical detector.
#
#
# Output
# -------
#
# * `std::vector<raw::OpDetWaveform>` (`opdaq`): raw PMT waveforms
#
#
#
#
# Changes
# --------
#
# 20250127 (petrillo@slac.stanford.edu) [v1.0]
# original version (from `detsim_1d_icarus.fcl`)
#

#include "detsim_1d_icarus.fcl"

process_name: OpDetSim

services.DetPedestalService: @erase
services.ChannelStatusService: @erase
services.IICARUSChannelMap: @erase
services.SignalShapingICARUSService: @erase

# run only the `opdaq` module:
physics.producers: {
opdaq: @local::physics.producers.opdaq # simplify configuration removing all other producers
}
physics.simulate: [ opdaq ]

Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
#include "detsim_2d_icarus_refactored.fcl"

process_name: OpDetSim

services.DetPedestalService: @erase
services.ChannelStatusService: @erase
services.SignalShapingICARUSService: @erase

source.inputCommands: [
"keep *",

# `stage0` comes from decoding data: should be kept!
# `MCstage0` comes running stage0 on the overlay products:
# so pmt/trigger/crt stuff should be thrown out!
# note: I would really like to drop these things as well:
# "drop raw::OpDetWaveform*_opdaq_*_*", # drop old MC waveforms (if any)
# "drop *_pmtfixedthrinit_*_*", # drop triggersim product
# "drop *_pmtlvdsgatesinit_*_*", # drop triggersim product
# "drop *_pmttriggerwindowsinit_*_*", # drop triggersim product
# "drop *_triggersimgatesinit_*_*", # drop triggersim product
# "drop *_emuTriggerUnshifted_*_*", # drop triggersim product
# but I can't: it triggers art genocidal insticts thus removing all
# downstream products in the dependency tree that we still need.

"drop raw::OpDetWaveform*_shifted_*_*", # drop old MC (shifted) waveforms (if any)
"drop *_overlayOpWaveforms_*_*", # drop old Overlay waveforms (if any)
"drop *_ophit*_*_*", # drop MCstage0 ophits
"drop *_mcophit_*_*", # drop MCstageo mcophit
"drop *_opflash*_*_*", # drop MCsstage0 east/west opflashes

"drop *_pmtfixedthr_*_*", # drop MCstage0 trigger product
"drop *_pmtlvdsgates_*_*", # drop MCstage0 trigger product
"drop *_pmtlvdsgates_*_*", # drop MCstage0 trigger product
"drop *_pmtbaselines_*_MCstage0", # drop MCstage0 baselines, not stage0!
"drop *_pmttriggerwindows_*_*", # drop MCstage0 trigger product
"drop *_emuTrigger_*_*", # drop MCstage0 trigger product

"drop *_crtdaq_*_*", # drop CRT detsim product
"drop *_mccrthit_*_*", # drop CRT mc hits
"drop *_overlayCRTHit_*_*", # drop CRT overlay hits
"drop *_crttrack_*_*", # drop CRT tracks (MCstage0)
"drop *_crtpmt_*_*" # drop CRTPMT matches (MCstage0)
]

# Running only the optical/trigger/crt modules
# Simplify configuration removing all other producers (tpc)

physics.producers: {

# opdaq Run-1/2 tune for overlays (no noise)
opdaq: @local::icarus_simpmt_run2_nonoise

# triggersim producers
@table::icarus_shifting_triggersim.producers

# crt hits
crtdaq: @local::icarus_crtsim

}

# since some "old" products need to be kept in the tree
# we have products with the same tag, and different process_name
# make sure to select exactly what you need!

# build waveforms from simPhotons (already shifted)
physics.producers.opdaq.InputModule: "shifted::DetSim"

# make sure the triggersim chain used the "new" products
# instead of the "old" ones which I cannot drop on input
physics.producers.pmtfixedthrinit.OpticalWaveforms: "opdaq::OpDetSim" # this was re-generated with same tag
physics.producers.pmtlvdsgatesinit.TriggerGatesTag: "pmtfixedthrinit::OpDetSim" # this was re-generated with same tag
physics.producers.pmttriggerwindowsinit.TriggerGatesTag: "pmtlvdsgatesinit::OpDetSim" # this was re-generated with same tag
physics.producers.triggersimgatesinit.BeamGateTag: "beamgate" # keep using old Gen product
physics.producers.emuTriggerUnshifted.BeamGates: "triggersimgatesinit::OpDetSim" # this was re-generated with same tag
physics.producers.emuTriggerUnshifted.TriggerGatesTag: "pmttriggerwindowsinit::OpDetSim" # this was re-generated with same tag

# need to update the shifting module to pick up new labels
# some were regenerated (tag still good), others were previously shifted
# applying a second shift is okay: everything is consistent
# (eg. waveforms made from `shifted` photons)
# NOTE: still shifing energy deposits although tpc info not regenerated
# however forced to use `filtersed` as `shifted` has been consumed

physics.producers.shifted.InputTriggerLabel: "emuTriggerUnshifted::OpDetSim" # this was re-generated with same tag
physics.producers.shifted.InitAuxDetSimChannelLabel: "shifted::DetSim" # need to start from previously-shifted, not `genericcrt`
physics.producers.shifted.InitBeamGateInfoLabel: "triggersimgatesinit::OpDetSim" # this was re-generated with same tag
physics.producers.shifted.InitSimEnergyDepositLabel: "filtersed::DetSim" # need to start from previously-shifted, but `shifted` no longer available
physics.producers.shifted.InitSimEnergyDepositLiteLabel: "filtersed::DetSim" # need to start from previously-shifted, but `shifted` no longer available
physics.producers.shifted.InitSimPhotonsLabel: "shifted::DetSim" # need to start from previously-shifted, not `pdfastsim`
physics.producers.shifted.InitWaveformLabel: "opdaq::OpDetSim" # this was re-generated with same tag

# need to update shiting of priorSCE deposits:
# this is important if future reprocessings will need to regenerate SimPhotons

physics.producers.shiftedpriorSCE.InputTriggerLabel: "emuTriggerUnshifted::OpDetSim" # this was re-generated with same tag
physics.producers.shiftedpriorSCE.InitSimEnergyDepositLabel: "shiftedpriorSCE::DetSim" # need to start from previously-shifted, not `ionization:priorSCE`

# and finally make sure the crtsim also uses the newly shifted products
physics.producers.crtsim.G4ModuleLabel: "shifted::OpDetSim"

# The reprocessing flow is the following:
# - build new pmt waveforms from photons
# - simulate the trigger
# - shift all products to the trigger:
# -- we are shifting photons, pmt waveforms, energy depositis, aux sim channels
# -- note: since tpc is not re-simulated, no longer fully coherent with trigger time
# - build CRT data from aux sim channels

physics.simulate: [ opdaq, @sequence::icarus_shifting_triggersim.path, crtdaq ]


# drop duplicate produtcs in output
# this doesn't trigger art genocidal instincts

outputs.rootoutput.outputCommands: [
"keep *",

# drop `opdaq`, but keep `shifted` for overlaying
"drop *_opdaq_*_*",

# drop old trigger products now that new ones exist
# specify the old process name "DetSim"
"drop *_pmtfixedthrinit_*_DetSim",
"drop *_pmtlvdsgatesinit_*_DetSim",
"drop *_pmttriggerwindowsinit_*_DetSim",
"drop *_triggersimgatesinit_*_DetSim",
"drop *_emuTriggerUnshifted_*_DetSim",

# drop old "shifted" products since we shifted things again
"drop sim::SimEnergyDeposits_filtersed_*_DetSim", # this has been regenerated into `shifted`
# mcreco looks for `filtersed` in stage1: potentially can be changed to look for `shifted`?
# however since tpc reco products are not shifted, better to keep old deposits for that matching
# "drop sim::SimEnergyDepositLites_filtersed_*_DetSim", # this has been regenerated into `shifted`
"drop sim::SimEnergyDeposits_shiftedpriorSCE_*_DetSim", # this has been regenerated into the same tag
"drop sim::AuxDetSimChannel_shifted_*_DetSim", # this has been regenerated into the same tag
"drop sim::SimPhotons_shifted_*_DetSim", # this has been regenerated into the same tag
"drop sim::BeamGateInfo_shifted_*_DetSim" # this has been regenerated into the same tag

]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "detsim_opdetonly_icarus_overlay_reprocessing_run2.fcl"

# switch to Run-4 tune
physics.producers.opdaq: @local::icarus_simpmt_run4_nonoise
physics.producers.opdaq.InputModule: "shifted::DetSim"
4 changes: 2 additions & 2 deletions fcl/g4/PDFastSim_icarus.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ icarus_vis_timing_parameterization:
# standard configuration
icarus_pdfastsim_pvs: @local::standard_pdfastsim_pvs

icarus_pdfastsim_pvs.SimulationLabel: "ionization"
icarus_pdfastsim_pvs.SimulationLabel: "ionization:priorSCE"
icarus_pdfastsim_pvs.IncludePropTime: true
icarus_pdfastsim_pvs.ScintTimeTool.SlowDecayTime: 1300.0

Expand All @@ -166,4 +166,4 @@ icarus_pdfastsim_pvs.VUVTiming: @local::photon_propagation_timing_icarus
icarus_pdfastsim_pvs.VISTiming: @local::icarus_vis_timing_parameterization


END_PROLOG
END_PROLOG
5 changes: 4 additions & 1 deletion fcl/overlays/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Install fcl files in /job subdirectory.
# add subdirectories
add_subdirectory(partial)

# Install fcl files

install_fhicl()

Expand Down
8 changes: 8 additions & 0 deletions fcl/overlays/partial/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Install fcl files in /job subdirectory.
install_fhicl()

# Also put a copy in the source tree.

FILE(GLOB fcl_files *.fcl)
install_source( EXTRAS ${fcl_files} )

25 changes: 25 additions & 0 deletions fcl/overlays/partial/overlay_opdetonly_waveforms_reprocessing.fcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include "overlay_waveforms.fcl"

process_name: OpOverlay

# only perform PMT and CRT overlays after their detsim reprocessing
# previous reprocessing step should have cleaned-up duplicates already
# so technically no need to update any tag names w.r.t the default file

#physics.producers.mccrthit.CrtModuleLabel: "crtdaq" # from previous reprocessing
#physics.producers.mccrthit.TriggerLabel: "daqTrigger"

#physics.producers.overlayOpWaveforms.PMTWaveDataLabel: "daqPMT" # from data decoding
#phsyics.producers.overlayOpWaveforms.PMTWaveSimLabel: "shifted" # from previous reprocessing
#phsyics.producers.overlayOpWaveforms.PMTWaveBaseLabel: "pmtbaselines" # from data decoding

#physics.producers.overlayCRTHit.CRTHitInputLabels: ["crthit", # from data decoding
# "mccrthit"] # from current process

# process includes:
# - make crt hits on mc
# - overlay pmt waveforms
# - overlay crt hits

physics.reco: [ mccrthit, overlayOpWaveforms, overlayCRTHit]

2 changes: 1 addition & 1 deletion fcl/reco/Definitions/enable_overlay_sp.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ physics.producers.MCDecodeTPCROI.FragmentsLabelVec: ["overlayTPCRawWW", "overlay
physics.producers.pmtbaselines.OpticalWaveforms: "overlayOpWaveforms"
physics.producers.pmtfixedthr.OpticalWaveforms: "overlayOpWaveforms"
physics.producers.opdetonbeam.OpticalWaveforms: "overlayOpWaveforms"
physics.producers.ophit.InputModule: "overlayOpWaveforms"
physics.producers.ophituncorrected.InputModule: "overlayOpWaveforms"
physics.producers.crttrack.DataLabelHits: "overlayCRTHit"
physics.producers.crtpmt.CrtHitModuleLabel: "overlayCRTHit"
2 changes: 1 addition & 1 deletion fcl/reco/Definitions/stage0_icarus_defs.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "timing_icarus.fcl"
#include "timing_beam.fcl"
#include "icarus_ophitfinder.fcl"
#include "ophit-recalibrator.fcl"
#include "icarus_flashfinder.fcl"
#include "trigger_emulation_icarus.fcl"
#include "crt_decoderdefs_icarus.fcl"
Expand Down Expand Up @@ -123,7 +124,6 @@ icarus_stage0_producers:
ophitfull: @local::icarus_ophit_timing_correction
opflashCryoE: @local::ICARUSSimpleFlashDataCryoE
opflashCryoW: @local::ICARUSSimpleFlashDataCryoW

daqPMTonbeam: @local::copyPMTonBeam

### Beam timing
Expand Down
Loading