From 13d9bc75ba1d4585359f7ca3744cdd5ff1b92c0d Mon Sep 17 00:00:00 2001 From: fgalizzi Date: Mon, 29 Dec 2025 03:51:37 -0600 Subject: [PATCH 1/6] Make PEperOpDet NOpDet-long --- duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc b/duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc index 1515339f..63cc8e64 100644 --- a/duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc +++ b/duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc @@ -47,7 +47,8 @@ namespace solar double TimeSum = 0; double PE = 0; double MaxPE = 0; - std::vector PEperOpDet; + size_t NOpDets = art::ServiceHandle()->NOpDets(); + std::vector PEperOpDet(NOpDets, 0.); double FastToTotal = 1; double X = 0; double Y = 0; @@ -74,7 +75,7 @@ namespace solar if (PDSHit->PE() > MaxPE) MaxPE = PDSHit->PE(); - PEperOpDet.push_back(PDSHit->PE()); + PEperOpDet[PDSHit->OpChannel()] += PDSHit->PE(); if (fOpHitTimeVariable == "StartTime") TimeSum += PDSHit->StartTime() * TickPeriod * PDSHit->PE(); else // Default to PeakTime @@ -509,4 +510,4 @@ namespace solar return false; } -} // namespace solar \ No newline at end of file +} // namespace solar From 684a0448af7fe161b336a865a126448f03b9a0ac Mon Sep 17 00:00:00 2001 From: fgalizzi Date: Mon, 19 Jan 2026 12:37:39 -0600 Subject: [PATCH 2/6] Fix confilcs --- duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc b/duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc index 2d844de1..8720a064 100644 --- a/duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc +++ b/duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc @@ -53,8 +53,7 @@ namespace solar double Amplitude = 0; double PE = 0; double MaxPE = 0; - size_t NOpDets = art::ServiceHandle()->NOpDets(); - std::vector PEperOpDet(NOpDets, 0.); + std::vector PEperOpDet = {}; double FastToTotal = 1; double X = 0; double Y = 0; From 93c6046edc47dfd82f0fb5a07dc1300bbbe56338 Mon Sep 17 00:00:00 2001 From: fgalizzi Date: Tue, 20 Jan 2026 02:12:06 -0600 Subject: [PATCH 3/6] Fix conflicts --- duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc b/duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc index 8720a064..f34ab2cf 100644 --- a/duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc +++ b/duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc @@ -613,8 +613,7 @@ namespace solar return false; } - void AdjOpHitsUtils::GetOpHitWaveforms(const std::vector> &OpHitVector, - std::vector> &OpHitWvfVector, std::vector &OpHitWvfValid, art::Event const &evt) + void AdjOpHitsUtils::GetOpHitWaveforms(const std::vector> &OpHitVector, std::vector> &OpHitWvfVector, std::vector &OpHitWvfValid, art::Event const &evt) { // Define a function to get the OpHit waveforms that correspond to each OpHit in the input vector // Get the OpDetWaveform handle art::Handle> opDetWvfHandle; From 36d25dcf94fd97007453b1e637698c1355b20cd6 Mon Sep 17 00:00:00 2001 From: fgalizzi Date: Wed, 21 Jan 2026 06:56:56 -0600 Subject: [PATCH 4/6] Fix conflict on PEperOpDet size --- duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc b/duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc index f34ab2cf..5e1203fa 100644 --- a/duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc +++ b/duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc @@ -53,7 +53,8 @@ namespace solar double Amplitude = 0; double PE = 0; double MaxPE = 0; - std::vector PEperOpDet = {}; + size_t NOpDets = art::ServiceHandle()->NOpDets(); + std::vector PEperOpDet(NOpDets, 0.); double FastToTotal = 1; double X = 0; double Y = 0; From 69136b337060951380acd3ff64fc1b96838f5b77 Mon Sep 17 00:00:00 2001 From: fgalizzi Date: Wed, 21 Jan 2026 07:28:14 -0600 Subject: [PATCH 5/6] Getting Sergio's REMOVE INVALID WVF MESSAGE FROM MAIN OUTPUT AND FILL WITH EMPTY ARRAYS commit --- duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc b/duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc index 5e1203fa..447c33f5 100644 --- a/duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc +++ b/duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc @@ -622,7 +622,7 @@ namespace solar auto const clockData = art::ServiceHandle()->DataFor(evt); if (!opDetWvfHandle.isValid()) { - ProducerUtils::PrintInColor("Invalid OpDetWaveform handle", ProducerUtils::GetColor("red"), "Error"); + ProducerUtils::PrintInColor("Invalid OpDetWaveform handle", ProducerUtils::GetColor("red"), "Debug"); for (size_t i = 0; i < OpHitVector.size(); i++) { OpHitWvfVector.push_back(art::Ptr()); // Fill with a null pointer to keep the indices consistent @@ -659,6 +659,7 @@ namespace solar break; } } + if (!found) { ProducerUtils::PrintInColor("No matching OpDetWaveform found for OpHit channel " + ProducerUtils::str(int(opChannel)), ProducerUtils::GetColor("red"), "Debug"); @@ -666,6 +667,7 @@ namespace solar OpHitWvfValid.push_back(false); } } + return; } @@ -678,7 +680,12 @@ namespace solar auto const clockData = art::ServiceHandle()->DataFor(evt); if (!opWvfHandle.isValid()) { - ProducerUtils::PrintInColor("Invalid OpWaveform handle", ProducerUtils::GetColor("red"), "Error"); + ProducerUtils::PrintInColor("Invalid OpWaveform handle", ProducerUtils::GetColor("red"), "Debug"); + for (size_t i = 0; i < OpHitVector.size(); i++) + { + OpHitWvfVector.push_back(art::Ptr()); // Fill with a null pointer to keep the indices consistent + OpHitWvfValid.push_back(false); + } return; } From 0d4c172921fac82d559070c244842a823ef6849d Mon Sep 17 00:00:00 2001 From: fgalizzi Date: Wed, 8 Apr 2026 11:15:48 -0500 Subject: [PATCH 6/6] Fix: OpChannel->OpDet for VD --- duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc b/duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc index 447c33f5..687eadbc 100644 --- a/duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc +++ b/duneopdet/LowEPDSUtils/AdjOpHitsUtils.cc @@ -109,7 +109,7 @@ namespace solar TimeMax = thisTime; } - PEperOpDet[PDSHit->OpChannel()] += PDSHit->PE(); + PEperOpDet[wireReadout.OpDetFromOpChannel(PDSHit->OpChannel())] += PDSHit->PE(); Idx++; }