From 5cb14c3ed066bdf7e45b1955dd4b48fe97fb2132 Mon Sep 17 00:00:00 2001 From: Henry Lay Date: Thu, 20 Feb 2025 08:12:04 -0600 Subject: [PATCH 1/3] Change ADC saturation value to match data --- sbndcode/CRT/CRTSimulation/crtsimmodules_sbnd.fcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbndcode/CRT/CRTSimulation/crtsimmodules_sbnd.fcl b/sbndcode/CRT/CRTSimulation/crtsimmodules_sbnd.fcl index 2d9acb68e..ca546268b 100644 --- a/sbndcode/CRT/CRTSimulation/crtsimmodules_sbnd.fcl +++ b/sbndcode/CRT/CRTSimulation/crtsimmodules_sbnd.fcl @@ -58,7 +58,7 @@ standard_sbnd_crtsimparams: { # Minimum time between energy deposits that SiPMs can resolve [ns] SipmTimeResponse: 2.0 - AdcSaturation: 4095 + AdcSaturation: 4089 DeadTime: 22000 From 6220ac49bff507347a458c0b284887e7eb0cac50 Mon Sep 17 00:00:00 2001 From: Henry Lay Date: Thu, 20 Feb 2025 08:13:41 -0600 Subject: [PATCH 2/3] Use saturation to correctly label strip hits --- sbndcode/CRT/CRTReco/CRTStripHitProducer_module.cc | 4 +++- sbndcode/CRT/CRTReco/crtrecoproducers_sbnd.fcl | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sbndcode/CRT/CRTReco/CRTStripHitProducer_module.cc b/sbndcode/CRT/CRTReco/CRTStripHitProducer_module.cc index 1f212abd1..fe536a734 100644 --- a/sbndcode/CRT/CRTReco/CRTStripHitProducer_module.cc +++ b/sbndcode/CRT/CRTReco/CRTStripHitProducer_module.cc @@ -62,6 +62,7 @@ class sbnd::crt::CRTStripHitProducer : public art::EDProducer { std::string fFEBDataModuleLabel; uint16_t fADCThreshold; + uint16_t fADCSaturation; std::vector fErrorCoeff; bool fAllowFlag1; bool fApplyTs0Window; @@ -88,6 +89,7 @@ sbnd::crt::CRTStripHitProducer::CRTStripHitProducer(fhicl::ParameterSet const& p : EDProducer{p} , fFEBDataModuleLabel(p.get("FEBDataModuleLabel")) , fADCThreshold(p.get("ADCThreshold")) + , fADCSaturation(p.get("ADCSaturation")) , fErrorCoeff(p.get>("ErrorCoeff")) , fAllowFlag1(p.get("AllowFlag1")) , fApplyTs0Window(p.get("ApplyTs0Window")) @@ -290,7 +292,7 @@ std::vector sbnd::crt::CRTStripHitProducer::CreateStripH if(pos - err < 0) err = pos; - stripHits.emplace_back(offline_channel_id, t0, t1, ref_time_s, pos, err, adc1, adc2); + stripHits.emplace_back(offline_channel_id, t0, t1, ref_time_s, pos, err, adc1, adc2, fADCSaturation); } } diff --git a/sbndcode/CRT/CRTReco/crtrecoproducers_sbnd.fcl b/sbndcode/CRT/CRTReco/crtrecoproducers_sbnd.fcl index 9aa8e2a26..2de95131c 100644 --- a/sbndcode/CRT/CRTReco/crtrecoproducers_sbnd.fcl +++ b/sbndcode/CRT/CRTReco/crtrecoproducers_sbnd.fcl @@ -6,6 +6,7 @@ crtstriphitproducer_sbnd: { FEBDataModuleLabel: "crtsim" ADCThreshold: 60 + ADCSaturation: @local::sbnd_crtsim.DetSimParams.AdcSaturation ErrorCoeff: [ 0.26, -0.27, 0.025 ] AllowFlag1: false ApplyTs0Window: false From 2215cc314f4306603724241360c5a5eaebe025e1 Mon Sep 17 00:00:00 2001 From: Henry Lay Date: Wed, 18 Feb 2026 08:03:03 -0600 Subject: [PATCH 3/3] Manually check saturation --- sbndcode/CRT/CRTReco/CRTStripHitProducer_module.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sbndcode/CRT/CRTReco/CRTStripHitProducer_module.cc b/sbndcode/CRT/CRTReco/CRTStripHitProducer_module.cc index fe536a734..93eb61bfa 100644 --- a/sbndcode/CRT/CRTReco/CRTStripHitProducer_module.cc +++ b/sbndcode/CRT/CRTReco/CRTStripHitProducer_module.cc @@ -275,6 +275,10 @@ std::vector sbnd::crt::CRTStripHitProducer::CreateStripH const uint16_t adc1 = sipm1.pedestal < sipm_adcs[adc_i] ? sipm_adcs[adc_i] - sipm1.pedestal : 0; const uint16_t adc2 = sipm2.pedestal < sipm_adcs[adc_i+1] ? sipm_adcs[adc_i+1] - sipm2.pedestal : 0; + // Saturated? + const bool sat1 = sipm_adcs[adc_i] == fADCSaturation; + const bool sat2 = sipm_adcs[adc_i+1] == fADCSaturation; + // Keep hit if both SiPMs above threshold if(adc1 > fADCThreshold && adc2 > fADCThreshold) { @@ -292,7 +296,7 @@ std::vector sbnd::crt::CRTStripHitProducer::CreateStripH if(pos - err < 0) err = pos; - stripHits.emplace_back(offline_channel_id, t0, t1, ref_time_s, pos, err, adc1, adc2, fADCSaturation); + stripHits.emplace_back(offline_channel_id, t0, t1, ref_time_s, pos, err, adc1, adc2, sat1, sat2); } }