9 #include "art/Framework/Core/EDProducer.h"
10 #include "art/Framework/Principal/Event.h"
11 #include "art/Framework/Principal/Handle.h"
12 #include "art/Framework/Services/Registry/ServiceHandle.h"
13 #include "art/Persistency/Common/PtrMaker.h"
14 #include "art/Utilities/ToolMacros.h"
15 #include "art/Utilities/make_tool.h"
16 #include "cetlib/cpu_timer.h"
17 #include "fhiclcpp/ParameterSet.h"
18 #include "messagefacility/MessageLogger/MessageLogger.h"
23 #include "sbndaq-artdaq-core/Overlays/ICARUS/PhysCrateFragment.hh"
27 #include "icarus_signal_processing/WaveformTools.h"
28 #include "icarus_signal_processing/Denoising.h"
29 #include "icarus_signal_processing/Filters/FFTFilterFunctions.h"
63 virtual void configure(
const fhicl::ParameterSet&)
override;
72 const icarus_signal_processing::ArrayFloat&,
73 const size_t&)
override;
218 fThreshold = pset.get<std::vector<float> >(
"Threshold", std::vector<float>()={5.0,3.5,3.5});
221 fFilterModeVec = pset.get<std::vector<std::string>>(
"FilterModeVec", std::vector<std::string>()={
"e",
"g",
"d"});
226 fGeometry = art::ServiceHandle<geo::Geometry const>{}.get();
230 std::cout <<
"TPCNoiseFilter1D configure, fUseFFTFilter: " << fUseFFTFilter << std::endl;
234 for(
int plane = 0; plane < 3; plane++)
238 fFFTFilterFunctionVec.emplace_back(std::make_unique<icarus_signal_processing::WindowFFTFilter>(fFFTSigmaValsVec[plane], fFFTCutoffValsVec[plane]));
240 std::cout <<
"TPCDecoderFilter1D FFT setup for plane " << plane <<
", SigmaVals: " << fFFTSigmaValsVec[plane].first <<
"/" << fFFTSigmaValsVec[plane].second <<
", cutoff: " << fFFTCutoffValsVec[plane].first <<
"/" << fFFTCutoffValsVec[plane].second << std::endl;
249 const icarus_signal_processing::ArrayFloat& dataArray,
250 const size_t& coherentNoiseGrouping)
252 cet::cpu_timer theClockTotal;
254 theClockTotal.start();
257 unsigned int numChannels = dataArray.size();
258 unsigned int numTicks = dataArray[0].size();
260 if (
fSelectVals.size() < numChannels)
fSelectVals.resize(numChannels, icarus_signal_processing::VectorBool(numTicks));
261 if (
fROIVals.size() < numChannels)
fROIVals.resize(numChannels, icarus_signal_processing::VectorBool(numTicks));
281 icarus_signal_processing::Denoiser1D denoiser;
282 icarus_signal_processing::WaveformTools<float> waveformTools;
285 for(
size_t idx = 0; idx < numChannels; idx++)
287 icarus_signal_processing::VectorFloat& pedCorDataVec =
fPedCorWaveforms[idx];
297 unsigned int plane = channelPlaneVec[idx].second % 3;
320 std::cout <<
"***** FOUND NO MATCH FOR TYPE: " <<
fFilterModeVec[plane] <<
", plane " << plane <<
" DURING INITIALIZATION OF FILTER FUNCTIONS IN TPCNoiseFilter1DMC" << std::endl;
325 waveformTools.getPedestalCorrectedWaveform(dataArray[idx],
351 coherentNoiseGrouping,
355 theClockTotal.stop();
357 double totalTime = theClockTotal.accumulated_real_time();
359 mf::LogDebug(
"TPCNoiseFilter1DMC") <<
" *totalTime: " << totalTime << std::endl;
size_t fCoherentNoiseOffset
std::vector< std::string > fFilterModeVec
icarus_signal_processing::VectorInt fChannelIDVec
icarus_signal_processing::ArrayFloat fPedCorWaveforms
const icarus_signal_processing::ArrayFloat & getRawWaveforms() const override
Recover the pedestal subtracted waveforms.
icarus_signal_processing::ArrayFloat fRawWaveforms
std::vector< std::pair< float, float >> FloatPairVec
icarus_signal_processing::ArrayFloat fCorrectedMedians
size_t fStructuringElement
icarus_signal_processing::ArrayBool fSelectVals
virtual void process_fragment(detinfo::DetectorClocksData const &, const daq::INoiseFilter::ChannelPlaneVec &, const icarus_signal_processing::ArrayFloat &, const size_t &) override
Given a set of recob hits, run DBscan to form 3D clusters.
This provides an art tool interface definition for tools which "decode" artdaq fragments into LArSoft...
icarus_signal_processing::ArrayBool fROIVals
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
~TPCNoiseFilter1DMC()
Destructor.
icarus_signal_processing::ArrayFloat fIntrinsicRMS
icarus_signal_processing::VectorInt fRangeBins
TPCNoiseFilter1DMC class definiton.
float fSigmaForTruncation
const icarus_signal_processing::ArrayFloat & getPedCorWaveforms() const override
Recover the pedestal subtracted waveforms.
auto end(FixedBins< T, C > const &) noexcept
icarus_signal_processing::FFTFilterFunctionVec fFFTFilterFunctionVec
void fill(const art::PtrVector< recob::Hit > &hits, int only_plane)
icarus_signal_processing::VectorFloat fThresholdVec
icarus_signal_processing::ArrayFloat fWaveLessCoherent
virtual void configure(const fhicl::ParameterSet &) override
Interface for configuring the particular algorithm tool.
icarus_signal_processing::FilterFunctionVec fFilterFunctionVec
The geometry of one entire detector, as served by art.
FloatPairVec fFFTCutoffValsVec
icarus_signal_processing::VectorFloat fPedestalVals
IDecoderFilter interface class definiton.
std::vector< float > fThreshold
const geo::Geometry * fGeometry
auto begin(FixedBins< T, C > const &) noexcept
const icarus_signal_processing::VectorFloat & getFullRMSVals() const override
Recover the full RMS before coherent noise.
icarus_signal_processing::VectorInt fNumTruncBins
const icarus_signal_processing::ArrayBool & getSelectionVals() const override
Recover the selection values.
icarus_signal_processing::VectorFloat fTruncRMSVals
const icarus_signal_processing::ArrayBool & getROIVals() const override
Recover the ROI values.
Contains all timing reference information for the detector.
const icarus_signal_processing::ArrayFloat & getWaveLessCoherent() const override
Recover the waveforms less coherent noise.
TPCNoiseFilter1DMC(fhicl::ParameterSet const &pset)
Constructor.
const icarus_signal_processing::ArrayFloat & getCorrectedMedians() const override
Recover the correction median values.
const icarus_signal_processing::VectorInt & getNumTruncBins() const override
Recover the number of bins after truncation.
const icarus_signal_processing::VectorFloat & getTruncRMSVals() const override
Recover the truncated RMS noise.
const icarus_signal_processing::VectorFloat & getPedestalVals() const override
Recover the pedestals for each channel.
icarus_signal_processing::ArrayFloat fMorphedWaveforms
const icarus_signal_processing::VectorInt & getChannelIDs() const override
Recover the channels for the processed fragment.
const icarus_signal_processing::ArrayFloat & getMorphedWaveforms() const override
Recover the morphological filter waveforms.
art framework interface to geometry description
BEGIN_PROLOG could also be cout
icarus_signal_processing::VectorFloat fFullRMSVals
std::vector< ChannelPlanePair > ChannelPlaneVec
FloatPairVec fFFTSigmaValsVec
const icarus_signal_processing::ArrayFloat & getIntrinsicRMS() const override
Recover the "intrinsic" RMS.