diff --git a/icaruscode/Decode/DaqDecoderICARUSTPCwROI_module.cc b/icaruscode/Decode/DaqDecoderICARUSTPCwROI_module.cc index ffd08ab21..77e2a73b0 100644 --- a/icaruscode/Decode/DaqDecoderICARUSTPCwROI_module.cc +++ b/icaruscode/Decode/DaqDecoderICARUSTPCwROI_module.cc @@ -692,7 +692,7 @@ void DaqDecoderICARUSTPCwROI::processSingleFragment(size_t ConcurrentRawDigitCol::iterator newObjItr = concurrentRawDigitCol.emplace_back(channel,wvfm.size(),wvfm); - newObjItr->SetPedestal(localPedestal,localFullRMS); + newObjItr->SetPedestal(decoderTool->getPedestalVals()[chanIdx]+localPedestal,localFullRMS); // And, finally, the ROIs const icarus_signal_processing::VectorBool& chanROIs = decoderTool->getROIVals()[chanIdx]; diff --git a/icaruscode/Decode/DecoderTools/TPCNoiseFilter1D_tool.cc b/icaruscode/Decode/DecoderTools/TPCNoiseFilter1D_tool.cc index c5e590b24..c9cb45d9e 100644 --- a/icaruscode/Decode/DecoderTools/TPCNoiseFilter1D_tool.cc +++ b/icaruscode/Decode/DecoderTools/TPCNoiseFilter1D_tool.cc @@ -379,7 +379,7 @@ void TPCNoiseFilter1DMC::process_fragment(detinfo::DetectorClocksData const&, std::copy(dataArray[idx].begin(),dataArray[idx].end(),rawDataVec.begin()); - Eigen::Vector2f meanPos; + Eigen::Vector2f meanPos({0.,0.}); Eigen::Matrix2f eigenVectors {{0.,0.},{0.,0.}}; Eigen::Vector2f eigenValues {0.,0.}; @@ -395,6 +395,9 @@ void TPCNoiseFilter1DMC::process_fragment(detinfo::DetectorClocksData const&, fNumTruncBins[idx], fRangeBins[idx]); + // Make sure we correct for low frequency offset if it was run + fPedestalVals[idx] += meanPos[1]; + if (fRemoveBadRMS && (fFullRMSVals[idx] < 2.5 || fFullRMSVals[idx] > 40.)) std::fill(fSelectVals[idx].begin(),fSelectVals[idx].end(),true); // Convolve with a filter function