1 #include "fhiclcpp/ParameterSet.h"
2 #include "art/Framework/Services/Registry/ServiceHandle.h"
3 #include "art_root_io/TFileService.h"
4 #include "art/Framework/Core/ModuleMacros.h"
5 #include "art/Utilities/ToolMacros.h"
6 #include "messagefacility/MessageLogger/MessageLogger.h"
21 #include "TProfile2D.h"
35 void configure(
const fhicl::ParameterSet& pset)
override;
68 fCharacterizationAlg(pset)
73 mf::LogInfo(
"RawDigitFilterAlg") <<
"RawDigitFilterAlg configured\n";
113 std::vector<float> meanVec;
115 meanVec.resize(dataVec.size(), 0);
116 std::vector<float>::iterator meanVecItr = meanVec.begin();
120 float runningSum(0.);
122 for(
size_t idx = 0; idx < halfStructure - 1; idx++) runningSum += dataVec[idx];
125 for(RawDigitVector::iterator dataItr = dataVec.begin(); dataItr != dataVec.end(); dataItr++)
129 size_t count = std::min(2 * halfStructure, std::min(startOffset + halfStructure, halfStructure + stopOffset));
131 if (startOffset > halfStructure) runningSum -= *(dataItr - halfStructure - 1);
132 if (stopOffset >= halfStructure) runningSum += *(dataItr + halfStructure - 1);
134 float adaptVal = runningSum / float(count) - truncMean;
136 *meanVecItr++ = adaptVal;
140 for(
size_t idx = 0; idx < dataVec.size(); idx++)
141 dataVec[idx] = dataVec[idx] - std::round(meanVec[idx]);
bool fFillHistograms
if true then will fill diagnostic hists
~RawDigitFilterAlg()
Destructor.
art::ServiceHandle< geo::Geometry > fGeometry
pointer to Geometry service
void getMeanAndRms(const RawDigitVector &rawWaveform, float &aveVal, float &rmsVal, int &numBins) const
raw::RawDigit::ADCvector_t RawDigitVector
size_t fStructuringElement
Structuring element to use with Top Hat filter.
float fTruncMeanFraction
Fraction for truncated mean.
void doAdaptiveFilter(RawDigitVector &) const
double distance(geo::Point_t const &point, CathodeDesc_t const &cathode)
Returns the distance of a point from the cathode.
RawDigitCharacterizationAlg fCharacterizationAlg
void configure(const fhicl::ParameterSet &pset) override
void reconfigure(fhicl::ParameterSet const &pset)
void FilterWaveform(RawDigitVector &, size_t, size_t, float=0.) const override
void initializeHistograms(art::TFileDirectory &) const override
RawDigitFilterAlg(const fhicl::ParameterSet &pset)
This provides an interface for tools which are tasked with filtering input waveforms.
size_t plane() const override
art::ServiceHandle< art::TFileService > tfs
std::size_t count(Cont const &cont)
process_name can override from command line with o or output caldata
art framework interface to geometry description