All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Types | Private Attributes | List of all members
daq::TPCNoiseFilterCannyMC Class Reference

TPCNoiseFilterCannyMC class definiton. More...

Inheritance diagram for daq::TPCNoiseFilterCannyMC:
daq::INoiseFilter

Public Member Functions

 TPCNoiseFilterCannyMC (fhicl::ParameterSet const &pset)
 Constructor. More...
 
 ~TPCNoiseFilterCannyMC ()
 Destructor. More...
 
virtual void configure (const fhicl::ParameterSet &) override
 Interface for configuring the particular algorithm tool. More...
 
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. More...
 
const
icarus_signal_processing::VectorInt & 
getChannelIDs () const override
 Recover the channels for the processed fragment. More...
 
const
icarus_signal_processing::ArrayBool & 
getSelectionVals () const override
 Recover the selection values. More...
 
const
icarus_signal_processing::ArrayBool & 
getROIVals () const override
 Recover the ROI values. More...
 
const
icarus_signal_processing::ArrayFloat & 
getRawWaveforms () const override
 Recover the pedestal subtracted waveforms. More...
 
const
icarus_signal_processing::ArrayFloat & 
getPedCorWaveforms () const override
 Recover the pedestal subtracted waveforms. More...
 
const
icarus_signal_processing::ArrayFloat & 
getIntrinsicRMS () const override
 Recover the "intrinsic" RMS. More...
 
const
icarus_signal_processing::ArrayFloat & 
getCorrectedMedians () const override
 Recover the correction median values. More...
 
const
icarus_signal_processing::ArrayFloat & 
getWaveLessCoherent () const override
 Recover the waveforms less coherent noise. More...
 
const
icarus_signal_processing::ArrayFloat & 
getMorphedWaveforms () const override
 Recover the morphological filter waveforms. More...
 
const
icarus_signal_processing::VectorFloat & 
getPedestalVals () const override
 Recover the pedestals for each channel. More...
 
const
icarus_signal_processing::VectorFloat & 
getFullRMSVals () const override
 Recover the full RMS before coherent noise. More...
 
const
icarus_signal_processing::VectorFloat & 
getTruncRMSVals () const override
 Recover the truncated RMS noise. More...
 
const
icarus_signal_processing::VectorInt & 
getNumTruncBins () const override
 Recover the number of bins after truncation. More...
 
- Public Member Functions inherited from daq::INoiseFilter
virtual ~INoiseFilter () noexcept=default
 Virtual Destructor. More...
 

Private Types

using FloatPairVec = std::vector< std::pair< float, float >>
 

Private Attributes

float fSigmaForTruncation
 
bool fUseFFTFilter
 
bool fDiagnosticOutput
 
FloatPairVec fFFTSigmaValsVec
 
FloatPairVec fFFTCutoffValsVec
 
std::vector< std::string > fFilterModeVec
 
std::vector< size_t > fStructuringElement
 Structuring element for morphological filter. More...
 
std::vector< float > fThreshold
 Threshold to apply for saving signal. More...
 
unsigned int fButterworthOrder
 Order parameter for Butterworth filter. More...
 
unsigned int fButterworthThreshold
 Threshold for Butterworth filter. More...
 
unsigned int fMorph2DStructuringElementX
 Structuring element in X. More...
 
unsigned int fMorph2DStructuringElementY
 Structuring element in Y. More...
 
unsigned int fCoherentNoiseGrouping
 Number of consecutive channels in coherent noise subtraction. More...
 
unsigned int fCoherentNoiseOffset
 Offset for the midplane... More...
 
unsigned int fMorphologicalWindow
 Window size for filter. More...
 
float fCoherentThresholdFactor
 Threshold factor for coherent noise removal. More...
 
unsigned int fADFilter_SX
 
unsigned int fADFilter_SY
 
float fSigma_x
 
float fSigma_y
 
float fSigma_r
 
float fLowThreshold
 
float fHighThreshold
 
unsigned int fBinaryDilation_SX
 
unsigned int fBinaryDilation_SY
 
icarus_signal_processing::VectorInt fChannelIDVec
 
icarus_signal_processing::ArrayBool fSelectVals
 
icarus_signal_processing::ArrayBool fROIVals
 
icarus_signal_processing::ArrayFloat fRawWaveforms
 
icarus_signal_processing::ArrayFloat fPedCorWaveforms
 
icarus_signal_processing::ArrayFloat fIntrinsicRMS
 
icarus_signal_processing::ArrayFloat fCorrectedMedians
 
icarus_signal_processing::ArrayFloat fWaveLessCoherent
 
icarus_signal_processing::ArrayFloat fMorphedWaveforms
 
icarus_signal_processing::VectorFloat fPedestalVals
 
icarus_signal_processing::VectorFloat fFullRMSVals
 
icarus_signal_processing::VectorFloat fTruncRMSVals
 
icarus_signal_processing::VectorInt fNumTruncBins
 
icarus_signal_processing::VectorInt fRangeBins
 
icarus_signal_processing::VectorFloat fThresholdVec
 
icarus_signal_processing::FilterFunctionVec fFilterFunctionVec
 
const geo::GeometryfGeometry
 
icarus_signal_processing::FFTFilterFunctionVec fFFTFilterFunctionVec
 
std::unique_ptr
< icarus_signal_processing::IFFTFilterFunction > 
fButterworthFilter
 
std::unique_ptr
< icarus_signal_processing::IMorphologicalFunctions2D > 
fMorphologicalFilter
 
std::unique_ptr
< icarus_signal_processing::IDenoiser2D > 
fDenoiser2D
 
std::unique_ptr
< icarus_signal_processing::BilateralFilters > 
fBilateralFilters
 
std::unique_ptr
< icarus_signal_processing::EdgeDetection > 
fEdgeDetection
 
std::unique_ptr
< icarus_signal_processing::IROIFinder2D > 
fROIFinder2D
 

Additional Inherited Members

- Public Types inherited from daq::INoiseFilter
using ChannelPlanePair = std::pair< unsigned int, unsigned int >
 Given a set of recob hits, run DBscan to form 3D clusters. More...
 
using ChannelPlaneVec = std::vector< ChannelPlanePair >
 

Detailed Description

TPCNoiseFilterCannyMC class definiton.

Definition at line 48 of file TPCNoiseFilterCanny_tool.cc.

Member Typedef Documentation

using daq::TPCNoiseFilterCannyMC::FloatPairVec = std::vector<std::pair<float,float>>
private

Definition at line 147 of file TPCNoiseFilterCanny_tool.cc.

Constructor & Destructor Documentation

daq::TPCNoiseFilterCannyMC::TPCNoiseFilterCannyMC ( fhicl::ParameterSet const &  pset)
explicit

Constructor.

Parameters
pset

Definition at line 223 of file TPCNoiseFilterCanny_tool.cc.

224 {
225  this->configure(pset);
226 
227  fSelectVals.clear();
228  fROIVals.clear();
229  fRawWaveforms.clear();
230  fPedCorWaveforms.clear();
231  fIntrinsicRMS.clear();
232  fCorrectedMedians.clear();
233  fWaveLessCoherent.clear();
234  fMorphedWaveforms.clear();
235 
236  fPedestalVals.clear();
237  fFullRMSVals.clear();
238  fTruncRMSVals.clear();
239  fNumTruncBins.clear();
240  fRangeBins.clear();
241 
242  return;
243 }
icarus_signal_processing::VectorFloat fTruncRMSVals
icarus_signal_processing::VectorFloat fFullRMSVals
icarus_signal_processing::ArrayFloat fPedCorWaveforms
icarus_signal_processing::ArrayBool fROIVals
icarus_signal_processing::VectorFloat fPedestalVals
icarus_signal_processing::ArrayFloat fCorrectedMedians
virtual void configure(const fhicl::ParameterSet &) override
Interface for configuring the particular algorithm tool.
icarus_signal_processing::ArrayFloat fIntrinsicRMS
icarus_signal_processing::ArrayFloat fWaveLessCoherent
icarus_signal_processing::VectorInt fRangeBins
icarus_signal_processing::ArrayBool fSelectVals
icarus_signal_processing::VectorInt fNumTruncBins
icarus_signal_processing::ArrayFloat fMorphedWaveforms
icarus_signal_processing::ArrayFloat fRawWaveforms
daq::TPCNoiseFilterCannyMC::~TPCNoiseFilterCannyMC ( )

Destructor.

Definition at line 247 of file TPCNoiseFilterCanny_tool.cc.

248 {
249 }

Member Function Documentation

void daq::TPCNoiseFilterCannyMC::configure ( const fhicl::ParameterSet &  pset)
overridevirtual

Interface for configuring the particular algorithm tool.

Parameters
ParameterSetThe input set of parameters for configuration

Implements daq::INoiseFilter.

Definition at line 252 of file TPCNoiseFilterCanny_tool.cc.

253 {
254  fSigmaForTruncation = pset.get<float >("NSigmaForTrucation", 3.5);
255  fCoherentNoiseGrouping = pset.get<size_t >("CoherentGrouping", 64);
256  fUseFFTFilter = pset.get<bool >("UseFFTFilter", true);
257  fDiagnosticOutput = pset.get<bool >("DiagnosticOutput", false);
258  fFilterModeVec = pset.get<std::vector<std::string>>("FilterModeVec", std::vector<std::string>()={"e","g","d"});
259 
260  fFFTSigmaValsVec = pset.get<FloatPairVec >("FFTSigmaVals", FloatPairVec()={{1.5,20.}, {1.5,20.}, {2.0,20.}});
261  fFFTCutoffValsVec = pset.get<FloatPairVec >("FFTCutoffVals", FloatPairVec()={{8.,800.}, {8.,800.}, {0.0,800.}});
262 
263  // Recover parameters for noise/ROI
264  fStructuringElement = pset.get<std::vector<size_t> >("StructuringElement", std::vector<size_t>()={8,16});
265  fThreshold = pset.get<std::vector<float> >("Threshold", std::vector<float>()={2.75,2.75,2.75});
266 
267  fButterworthOrder = pset.get<unsigned int >("ButterworthOrder", 2);
268  fButterworthThreshold = pset.get<unsigned int >("ButterworthThreshld", 30);
269 
270  //fButterworthFilter = std::make_unique<icarus_signal_processing::HighPassButterworthFilter>(fButterworthThreshold,fButterworthOrder,4096);
271  fButterworthFilter = std::make_unique<icarus_signal_processing::NoFFTFilter>();
272 
273  fMorph2DStructuringElementX = pset.get<unsigned int >("Morph2DStructuringElementX", 7);
274  fMorph2DStructuringElementY = pset.get<unsigned int >("Morph2DStructuringElementX", 28);
275 
276  fMorphologicalFilter = std::make_unique<icarus_signal_processing::Dilation2D>(fMorph2DStructuringElementX,fMorph2DStructuringElementY);
277 
278  fCoherentNoiseOffset = pset.get<unsigned int >("CoherentNoiseOffset", 24);
279  fMorphologicalWindow = pset.get<unsigned int >("MorphologicalWindow", 10);
280  fCoherentThresholdFactor = pset.get<float >("CoherentThresholdFactor", 2.5);
281 
283 
284  //fDenoiser2D = std::make_unique<icarus_signal_processing::Denoiser2D_Hough>(fMorphologicalFilter.get(), fThresholdVec, fCoherentNoiseGrouping, fCoherentNoiseOffset, fMorphologicalWindow);
285  fDenoiser2D = std::make_unique<icarus_signal_processing::Denoiser2D>(fMorphologicalFilter.get(), fThresholdVec, fCoherentNoiseGrouping, fMorphologicalWindow);
286 
287  fADFilter_SX = pset.get<unsigned int >("ADFilter_SX", 7);
288  fADFilter_SY = pset.get<unsigned int >("ADFilter_SY", 7);
289  fSigma_x = pset.get<float >("Sigma_x", 10.0);
290  fSigma_y = pset.get<float >("Sigma_y", 10.0);
291  fSigma_r = pset.get<float >("Sigma_r", 30.0);
292 
293  fLowThreshold = pset.get<float >("LowThreshold", 10.0);
294  fHighThreshold = pset.get<float >("HighThreshold", 20.0);
295 
296  fBinaryDilation_SX = pset.get<unsigned int >("BinaryDilation_SX", 31);
297  fBinaryDilation_SY = pset.get<unsigned int >("BinaryDilation_SY", 31);
298 
299  fBilateralFilters = std::make_unique<icarus_signal_processing::BilateralFilters>();
300  fEdgeDetection = std::make_unique<icarus_signal_processing::EdgeDetection>();
301 
302  fROIFinder2D = std::make_unique<icarus_signal_processing::ROICannyFilter>(fButterworthFilter.get(),
303  fDenoiser2D.get(),
304  fBilateralFilters.get(),
305  fEdgeDetection.get(),
306  fADFilter_SX,
307  fADFilter_SY,
308  fSigma_x,
309  fSigma_y,
310  fSigma_r,
315 
316  fGeometry = art::ServiceHandle<geo::Geometry const>{}.get();
317 
318  fFFTFilterFunctionVec.clear();
319 
320  if (fUseFFTFilter)
321  {
322  for(int plane = 0; plane < 3; plane++)
323  {
324  if (plane < 2) fFFTFilterFunctionVec.emplace_back(std::make_unique<icarus_signal_processing::WindowFFTFilter>(fFFTSigmaValsVec[plane], fFFTCutoffValsVec[plane]));
325  else fFFTFilterFunctionVec.emplace_back(std::make_unique<icarus_signal_processing::NoFFTFilter>());
326  }
327  }
328 
329  return;
330 }
std::vector< std::pair< float, float >> FloatPairVec
unsigned int fButterworthThreshold
Threshold for Butterworth filter.
unsigned int fCoherentNoiseOffset
Offset for the midplane...
std::unique_ptr< icarus_signal_processing::IMorphologicalFunctions2D > fMorphologicalFilter
std::unique_ptr< icarus_signal_processing::BilateralFilters > fBilateralFilters
unsigned int fCoherentNoiseGrouping
Number of consecutive channels in coherent noise subtraction.
std::unique_ptr< icarus_signal_processing::IFFTFilterFunction > fButterworthFilter
unsigned int fButterworthOrder
Order parameter for Butterworth filter.
unsigned int fMorphologicalWindow
Window size for filter.
std::vector< std::string > fFilterModeVec
std::unique_ptr< icarus_signal_processing::EdgeDetection > fEdgeDetection
icarus_signal_processing::FFTFilterFunctionVec fFFTFilterFunctionVec
icarus_signal_processing::VectorFloat fThresholdVec
std::vector< size_t > fStructuringElement
Structuring element for morphological filter.
std::unique_ptr< icarus_signal_processing::IROIFinder2D > fROIFinder2D
float fCoherentThresholdFactor
Threshold factor for coherent noise removal.
std::vector< float > fThreshold
Threshold to apply for saving signal.
unsigned int fMorph2DStructuringElementY
Structuring element in Y.
std::unique_ptr< icarus_signal_processing::IDenoiser2D > fDenoiser2D
unsigned int fMorph2DStructuringElementX
Structuring element in X.
const icarus_signal_processing::VectorInt& daq::TPCNoiseFilterCannyMC::getChannelIDs ( ) const
inlineoverridevirtual

Recover the channels for the processed fragment.

Implements daq::INoiseFilter.

Definition at line 83 of file TPCNoiseFilterCanny_tool.cc.

83 {return fChannelIDVec;}
icarus_signal_processing::VectorInt fChannelIDVec
const icarus_signal_processing::ArrayFloat& daq::TPCNoiseFilterCannyMC::getCorrectedMedians ( ) const
inlineoverridevirtual

Recover the correction median values.

Implements daq::INoiseFilter.

Definition at line 113 of file TPCNoiseFilterCanny_tool.cc.

113 {return fCorrectedMedians;};
icarus_signal_processing::ArrayFloat fCorrectedMedians
const icarus_signal_processing::VectorFloat& daq::TPCNoiseFilterCannyMC::getFullRMSVals ( ) const
inlineoverridevirtual

Recover the full RMS before coherent noise.

Implements daq::INoiseFilter.

Definition at line 133 of file TPCNoiseFilterCanny_tool.cc.

133 {return fFullRMSVals;};
icarus_signal_processing::VectorFloat fFullRMSVals
const icarus_signal_processing::ArrayFloat& daq::TPCNoiseFilterCannyMC::getIntrinsicRMS ( ) const
inlineoverridevirtual

Recover the "intrinsic" RMS.

Implements daq::INoiseFilter.

Definition at line 108 of file TPCNoiseFilterCanny_tool.cc.

108 {return fIntrinsicRMS;};
icarus_signal_processing::ArrayFloat fIntrinsicRMS
const icarus_signal_processing::ArrayFloat& daq::TPCNoiseFilterCannyMC::getMorphedWaveforms ( ) const
inlineoverridevirtual

Recover the morphological filter waveforms.

Implements daq::INoiseFilter.

Definition at line 123 of file TPCNoiseFilterCanny_tool.cc.

123 {return fMorphedWaveforms;};
icarus_signal_processing::ArrayFloat fMorphedWaveforms
const icarus_signal_processing::VectorInt& daq::TPCNoiseFilterCannyMC::getNumTruncBins ( ) const
inlineoverridevirtual

Recover the number of bins after truncation.

Implements daq::INoiseFilter.

Definition at line 143 of file TPCNoiseFilterCanny_tool.cc.

143 {return fNumTruncBins;};
icarus_signal_processing::VectorInt fNumTruncBins
const icarus_signal_processing::ArrayFloat& daq::TPCNoiseFilterCannyMC::getPedCorWaveforms ( ) const
inlineoverridevirtual

Recover the pedestal subtracted waveforms.

Implements daq::INoiseFilter.

Definition at line 103 of file TPCNoiseFilterCanny_tool.cc.

103 {return fPedCorWaveforms;};
icarus_signal_processing::ArrayFloat fPedCorWaveforms
const icarus_signal_processing::VectorFloat& daq::TPCNoiseFilterCannyMC::getPedestalVals ( ) const
inlineoverridevirtual

Recover the pedestals for each channel.

Implements daq::INoiseFilter.

Definition at line 128 of file TPCNoiseFilterCanny_tool.cc.

128 {return fPedestalVals;};
icarus_signal_processing::VectorFloat fPedestalVals
const icarus_signal_processing::ArrayFloat& daq::TPCNoiseFilterCannyMC::getRawWaveforms ( ) const
inlineoverridevirtual

Recover the pedestal subtracted waveforms.

Implements daq::INoiseFilter.

Definition at line 98 of file TPCNoiseFilterCanny_tool.cc.

98 {return fRawWaveforms;};
icarus_signal_processing::ArrayFloat fRawWaveforms
const icarus_signal_processing::ArrayBool& daq::TPCNoiseFilterCannyMC::getROIVals ( ) const
inlineoverridevirtual

Recover the ROI values.

Implements daq::INoiseFilter.

Definition at line 93 of file TPCNoiseFilterCanny_tool.cc.

93 {return fROIVals;};
icarus_signal_processing::ArrayBool fROIVals
const icarus_signal_processing::ArrayBool& daq::TPCNoiseFilterCannyMC::getSelectionVals ( ) const
inlineoverridevirtual

Recover the selection values.

Implements daq::INoiseFilter.

Definition at line 88 of file TPCNoiseFilterCanny_tool.cc.

88 {return fSelectVals;};
icarus_signal_processing::ArrayBool fSelectVals
const icarus_signal_processing::VectorFloat& daq::TPCNoiseFilterCannyMC::getTruncRMSVals ( ) const
inlineoverridevirtual

Recover the truncated RMS noise.

Implements daq::INoiseFilter.

Definition at line 138 of file TPCNoiseFilterCanny_tool.cc.

138 {return fTruncRMSVals;};
icarus_signal_processing::VectorFloat fTruncRMSVals
const icarus_signal_processing::ArrayFloat& daq::TPCNoiseFilterCannyMC::getWaveLessCoherent ( ) const
inlineoverridevirtual

Recover the waveforms less coherent noise.

Implements daq::INoiseFilter.

Definition at line 118 of file TPCNoiseFilterCanny_tool.cc.

118 {return fWaveLessCoherent;};
icarus_signal_processing::ArrayFloat fWaveLessCoherent
void daq::TPCNoiseFilterCannyMC::process_fragment ( detinfo::DetectorClocksData const &  ,
const daq::INoiseFilter::ChannelPlaneVec channelPlaneVec,
const icarus_signal_processing::ArrayFloat &  dataArray,
const size_t &  coherentNoiseGrouping 
)
overridevirtual

Given a set of recob hits, run DBscan to form 3D clusters.

Parameters
fragmentThe artdaq fragment to process

Implements daq::INoiseFilter.

Definition at line 332 of file TPCNoiseFilterCanny_tool.cc.

336 {
337  cet::cpu_timer theClockTotal;
338 
339  theClockTotal.start();
340 
341  // Recover the number of channels and ticks
342  unsigned int numChannels = dataArray.size();
343  unsigned int numTicks = dataArray[0].size();
344 
345  if (fSelectVals.size() < numChannels) fSelectVals.resize(numChannels, icarus_signal_processing::VectorBool(numTicks));
346  if (fROIVals.size() < numChannels) fROIVals.resize(numChannels, icarus_signal_processing::VectorBool(numTicks));
347  if (fRawWaveforms.size() < numChannels) fRawWaveforms.resize(numChannels, icarus_signal_processing::VectorFloat(numTicks));
348  if (fPedCorWaveforms.size() < numChannels) fPedCorWaveforms.resize(numChannels, icarus_signal_processing::VectorFloat(numTicks));
349  if (fIntrinsicRMS.size() < numChannels) fIntrinsicRMS.resize(numChannels, icarus_signal_processing::VectorFloat(numTicks));
350  if (fCorrectedMedians.size() < numChannels) fCorrectedMedians.resize(numChannels, icarus_signal_processing::VectorFloat(numTicks));
351  if (fWaveLessCoherent.size() < numChannels) fWaveLessCoherent.resize(numChannels, icarus_signal_processing::VectorFloat(numTicks));
352  if (fMorphedWaveforms.size() < numChannels) fMorphedWaveforms.resize(numChannels, icarus_signal_processing::VectorFloat(numTicks));
353 
354  if (fChannelIDVec.size() < numChannels) fChannelIDVec.resize(numChannels);
355  if (fPedestalVals.size() < numChannels) fPedestalVals.resize(numChannels);
356  if (fFullRMSVals.size() < numChannels) fFullRMSVals.resize(numChannels);
357  if (fTruncRMSVals.size() < numChannels) fTruncRMSVals.resize(numChannels);
358  if (fNumTruncBins.size() < numChannels) fNumTruncBins.resize(numChannels);
359  if (fRangeBins.size() < numChannels) fRangeBins.resize(numChannels);
360 
361  if (fThresholdVec.size() < numChannels) fThresholdVec.resize(numChannels / coherentNoiseGrouping);
362 
363  if (fFilterFunctionVec.size() < numChannels) fFilterFunctionVec.resize(numChannels);
364 
365  std::cout <<" -->process_fragment with " << numChannels << " channels and " << numTicks << " ticks, array sizes: " << fCorrectedMedians.size() << ", " << fCorrectedMedians[1].size() << std::endl;
366 
367  icarus_signal_processing::Denoiser1D denoiser;
368  icarus_signal_processing::WaveformTools<float> waveformTools;
369 
370  // Make a pass throught to do pedestal corrections and get raw waveform information
371  for(size_t idx = 0; idx < numChannels; idx++)
372  {
373  icarus_signal_processing::VectorFloat& pedCorDataVec = fPedCorWaveforms[idx];
374 
375  // Keep track of the channel
376  fChannelIDVec[idx] = channelPlaneVec[idx].first;
377 
378  // We need to recover info on which plane we have
379  std::vector<geo::WireID> widVec = fGeometry->ChannelToWire(fChannelIDVec[idx]);
380 
381  // Handle the filter function to use for this channel
382  unsigned int plane = widVec[0].Plane;
383 
384  // Set the threshold which toggles between planes
385  fThresholdVec[idx / coherentNoiseGrouping] = fThreshold[plane];
386 
387  switch(fFilterModeVec[plane][0])
388  {
389  case 'd' :
390  fFilterFunctionVec[idx] = std::make_unique<icarus_signal_processing::Dilation1D>(fStructuringElement[1]);
391  break;
392  case 'e' :
393  fFilterFunctionVec[idx] = std::make_unique<icarus_signal_processing::Erosion1D>(fStructuringElement[1]);
394  break;
395  case 'g' :
396  fFilterFunctionVec[idx] = std::make_unique<icarus_signal_processing::Gradient1D>(fStructuringElement[1]);
397  break;
398  case 'a' :
399  fFilterFunctionVec[idx] = std::make_unique<icarus_signal_processing::Average1D>(fStructuringElement[1]);
400  break;
401  case 'm' :
402  fFilterFunctionVec[idx] = std::make_unique<icarus_signal_processing::Median1D>(fStructuringElement[1]);
403  break;
404  default:
405  std::cout << "***** FOUND NO MATCH FOR TYPE: " << fFilterModeVec[plane] << ", plane " << plane << " DURING INITIALIZATION OF FILTER FUNCTIONS IN TPCNoiseFilterCannyMC" << std::endl;
406  break;
407  }
408 
409  // Now determine the pedestal and correct for it
410  waveformTools.getPedestalCorrectedWaveform(dataArray[idx],
411  pedCorDataVec,
413  fPedestalVals[idx],
414  fFullRMSVals[idx],
415  fTruncRMSVals[idx],
416  fNumTruncBins[idx],
417  fRangeBins[idx]);
418 
419  // Convolve with a filter function
420  if (fUseFFTFilter) (*fFFTFilterFunctionVec[plane])(pedCorDataVec);
421  }
422 
423  icarus_signal_processing::ArrayFloat finalErosion(numChannels,icarus_signal_processing::VectorFloat(numTicks,0.));
424 
425  std::cout << " --> calling icarus_signal_processing code" << std::endl;
426 
427  // Now pass the entire data array to the denoisercoherent
428  (*fROIFinder2D)(fPedCorWaveforms,fRawWaveforms,fROIVals); //,fWaveLessCoherent,fCorrectedMedians,fIntrinsicRMS,fMorphedWaveforms,finalErosion);
429 
430  std::cout << " --> have returned from denoising" << std::endl;
431 
432  theClockTotal.stop();
433 
434  double totalTime = theClockTotal.accumulated_real_time();
435 
436  mf::LogInfo("TPCNoiseFilterCannyMC") << " *totalTime: " << totalTime << std::endl;
437 
438  return;
439 }
icarus_signal_processing::VectorFloat fTruncRMSVals
icarus_signal_processing::VectorFloat fFullRMSVals
icarus_signal_processing::ArrayFloat fPedCorWaveforms
icarus_signal_processing::FilterFunctionVec fFilterFunctionVec
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.
icarus_signal_processing::VectorFloat fPedestalVals
icarus_signal_processing::ArrayFloat fCorrectedMedians
std::vector< std::string > fFilterModeVec
icarus_signal_processing::ArrayFloat fIntrinsicRMS
icarus_signal_processing::ArrayFloat fWaveLessCoherent
icarus_signal_processing::VectorInt fRangeBins
icarus_signal_processing::FFTFilterFunctionVec fFFTFilterFunctionVec
icarus_signal_processing::VectorFloat fThresholdVec
std::vector< size_t > fStructuringElement
Structuring element for morphological filter.
icarus_signal_processing::ArrayBool fSelectVals
std::vector< float > fThreshold
Threshold to apply for saving signal.
icarus_signal_processing::VectorInt fNumTruncBins
icarus_signal_processing::ArrayFloat fMorphedWaveforms
icarus_signal_processing::ArrayFloat fRawWaveforms
BEGIN_PROLOG could also be cout
icarus_signal_processing::VectorInt fChannelIDVec

Member Data Documentation

unsigned int daq::TPCNoiseFilterCannyMC::fADFilter_SX
private

Definition at line 177 of file TPCNoiseFilterCanny_tool.cc.

unsigned int daq::TPCNoiseFilterCannyMC::fADFilter_SY
private

Definition at line 178 of file TPCNoiseFilterCanny_tool.cc.

std::unique_ptr<icarus_signal_processing::BilateralFilters> daq::TPCNoiseFilterCannyMC::fBilateralFilters
private

Definition at line 217 of file TPCNoiseFilterCanny_tool.cc.

unsigned int daq::TPCNoiseFilterCannyMC::fBinaryDilation_SX
private

Definition at line 184 of file TPCNoiseFilterCanny_tool.cc.

unsigned int daq::TPCNoiseFilterCannyMC::fBinaryDilation_SY
private

Definition at line 185 of file TPCNoiseFilterCanny_tool.cc.

std::unique_ptr<icarus_signal_processing::IFFTFilterFunction> daq::TPCNoiseFilterCannyMC::fButterworthFilter
private

Definition at line 214 of file TPCNoiseFilterCanny_tool.cc.

unsigned int daq::TPCNoiseFilterCannyMC::fButterworthOrder
private

Order parameter for Butterworth filter.

Definition at line 162 of file TPCNoiseFilterCanny_tool.cc.

unsigned int daq::TPCNoiseFilterCannyMC::fButterworthThreshold
private

Threshold for Butterworth filter.

Definition at line 163 of file TPCNoiseFilterCanny_tool.cc.

icarus_signal_processing::VectorInt daq::TPCNoiseFilterCannyMC::fChannelIDVec
private

Definition at line 188 of file TPCNoiseFilterCanny_tool.cc.

unsigned int daq::TPCNoiseFilterCannyMC::fCoherentNoiseGrouping
private

Number of consecutive channels in coherent noise subtraction.

Definition at line 170 of file TPCNoiseFilterCanny_tool.cc.

unsigned int daq::TPCNoiseFilterCannyMC::fCoherentNoiseOffset
private

Offset for the midplane...

Definition at line 171 of file TPCNoiseFilterCanny_tool.cc.

float daq::TPCNoiseFilterCannyMC::fCoherentThresholdFactor
private

Threshold factor for coherent noise removal.

Definition at line 174 of file TPCNoiseFilterCanny_tool.cc.

icarus_signal_processing::ArrayFloat daq::TPCNoiseFilterCannyMC::fCorrectedMedians
private

Definition at line 194 of file TPCNoiseFilterCanny_tool.cc.

std::unique_ptr<icarus_signal_processing::IDenoiser2D> daq::TPCNoiseFilterCannyMC::fDenoiser2D
private

Definition at line 216 of file TPCNoiseFilterCanny_tool.cc.

bool daq::TPCNoiseFilterCannyMC::fDiagnosticOutput
private

Definition at line 151 of file TPCNoiseFilterCanny_tool.cc.

std::unique_ptr<icarus_signal_processing::EdgeDetection> daq::TPCNoiseFilterCannyMC::fEdgeDetection
private

Definition at line 218 of file TPCNoiseFilterCanny_tool.cc.

FloatPairVec daq::TPCNoiseFilterCannyMC::fFFTCutoffValsVec
private

Definition at line 153 of file TPCNoiseFilterCanny_tool.cc.

icarus_signal_processing::FFTFilterFunctionVec daq::TPCNoiseFilterCannyMC::fFFTFilterFunctionVec
private

Definition at line 211 of file TPCNoiseFilterCanny_tool.cc.

FloatPairVec daq::TPCNoiseFilterCannyMC::fFFTSigmaValsVec
private

Definition at line 152 of file TPCNoiseFilterCanny_tool.cc.

icarus_signal_processing::FilterFunctionVec daq::TPCNoiseFilterCannyMC::fFilterFunctionVec
private

Definition at line 206 of file TPCNoiseFilterCanny_tool.cc.

std::vector<std::string> daq::TPCNoiseFilterCannyMC::fFilterModeVec
private

Definition at line 155 of file TPCNoiseFilterCanny_tool.cc.

icarus_signal_processing::VectorFloat daq::TPCNoiseFilterCannyMC::fFullRMSVals
private

Definition at line 199 of file TPCNoiseFilterCanny_tool.cc.

const geo::Geometry* daq::TPCNoiseFilterCannyMC::fGeometry
private

Definition at line 208 of file TPCNoiseFilterCanny_tool.cc.

float daq::TPCNoiseFilterCannyMC::fHighThreshold
private

Definition at line 183 of file TPCNoiseFilterCanny_tool.cc.

icarus_signal_processing::ArrayFloat daq::TPCNoiseFilterCannyMC::fIntrinsicRMS
private

Definition at line 193 of file TPCNoiseFilterCanny_tool.cc.

float daq::TPCNoiseFilterCannyMC::fLowThreshold
private

Definition at line 182 of file TPCNoiseFilterCanny_tool.cc.

unsigned int daq::TPCNoiseFilterCannyMC::fMorph2DStructuringElementX
private

Structuring element in X.

Definition at line 166 of file TPCNoiseFilterCanny_tool.cc.

unsigned int daq::TPCNoiseFilterCannyMC::fMorph2DStructuringElementY
private

Structuring element in Y.

Definition at line 167 of file TPCNoiseFilterCanny_tool.cc.

icarus_signal_processing::ArrayFloat daq::TPCNoiseFilterCannyMC::fMorphedWaveforms
private

Definition at line 196 of file TPCNoiseFilterCanny_tool.cc.

std::unique_ptr<icarus_signal_processing::IMorphologicalFunctions2D> daq::TPCNoiseFilterCannyMC::fMorphologicalFilter
private

Definition at line 215 of file TPCNoiseFilterCanny_tool.cc.

unsigned int daq::TPCNoiseFilterCannyMC::fMorphologicalWindow
private

Window size for filter.

Definition at line 172 of file TPCNoiseFilterCanny_tool.cc.

icarus_signal_processing::VectorInt daq::TPCNoiseFilterCannyMC::fNumTruncBins
private

Definition at line 201 of file TPCNoiseFilterCanny_tool.cc.

icarus_signal_processing::ArrayFloat daq::TPCNoiseFilterCannyMC::fPedCorWaveforms
private

Definition at line 192 of file TPCNoiseFilterCanny_tool.cc.

icarus_signal_processing::VectorFloat daq::TPCNoiseFilterCannyMC::fPedestalVals
private

Definition at line 198 of file TPCNoiseFilterCanny_tool.cc.

icarus_signal_processing::VectorInt daq::TPCNoiseFilterCannyMC::fRangeBins
private

Definition at line 202 of file TPCNoiseFilterCanny_tool.cc.

icarus_signal_processing::ArrayFloat daq::TPCNoiseFilterCannyMC::fRawWaveforms
private

Definition at line 191 of file TPCNoiseFilterCanny_tool.cc.

std::unique_ptr<icarus_signal_processing::IROIFinder2D> daq::TPCNoiseFilterCannyMC::fROIFinder2D
private

Definition at line 219 of file TPCNoiseFilterCanny_tool.cc.

icarus_signal_processing::ArrayBool daq::TPCNoiseFilterCannyMC::fROIVals
private

Definition at line 190 of file TPCNoiseFilterCanny_tool.cc.

icarus_signal_processing::ArrayBool daq::TPCNoiseFilterCannyMC::fSelectVals
private

Definition at line 189 of file TPCNoiseFilterCanny_tool.cc.

float daq::TPCNoiseFilterCannyMC::fSigma_r
private

Definition at line 181 of file TPCNoiseFilterCanny_tool.cc.

float daq::TPCNoiseFilterCannyMC::fSigma_x
private

Definition at line 179 of file TPCNoiseFilterCanny_tool.cc.

float daq::TPCNoiseFilterCannyMC::fSigma_y
private

Definition at line 180 of file TPCNoiseFilterCanny_tool.cc.

float daq::TPCNoiseFilterCannyMC::fSigmaForTruncation
private

Definition at line 149 of file TPCNoiseFilterCanny_tool.cc.

std::vector<size_t> daq::TPCNoiseFilterCannyMC::fStructuringElement
private

Structuring element for morphological filter.

Definition at line 158 of file TPCNoiseFilterCanny_tool.cc.

std::vector<float> daq::TPCNoiseFilterCannyMC::fThreshold
private

Threshold to apply for saving signal.

Definition at line 159 of file TPCNoiseFilterCanny_tool.cc.

icarus_signal_processing::VectorFloat daq::TPCNoiseFilterCannyMC::fThresholdVec
private

Definition at line 204 of file TPCNoiseFilterCanny_tool.cc.

icarus_signal_processing::VectorFloat daq::TPCNoiseFilterCannyMC::fTruncRMSVals
private

Definition at line 200 of file TPCNoiseFilterCanny_tool.cc.

bool daq::TPCNoiseFilterCannyMC::fUseFFTFilter
private

Definition at line 150 of file TPCNoiseFilterCanny_tool.cc.

icarus_signal_processing::ArrayFloat daq::TPCNoiseFilterCannyMC::fWaveLessCoherent
private

Definition at line 195 of file TPCNoiseFilterCanny_tool.cc.


The documentation for this class was generated from the following file: