8 #include "art/Utilities/ToolMacros.h"
9 #include "art/Utilities/make_tool.h"
10 #include "art_root_io/TFileService.h"
11 #include "messagefacility/MessageLogger/MessageLogger.h"
12 #include "cetlib_except/exception.h"
14 #include "icarus_signal_processing/Filters/ICARUSFFT.h"
31 void configure(
const fhicl::ParameterSet& pset)
override;
32 void setResponse(
size_t numBins,
double binWidth)
override;
59 std::unique_ptr<icarus_signal_processing::ICARUSFFT<double>>
fFFT;
74 fPlane = pset.get<
size_t>(
"Plane");
87 double timeCorrect = 1.e-3;
94 if (!
fFFT)
fFFT = std::make_unique<icarus_signal_processing::ICARUSFFT<double>>(numBins);
107 for(
size_t timeIdx = 0; timeIdx < numBins; timeIdx++)
114 double leftArg2 = (0.9 * funcArg) * (0.9 * funcArg);
115 double rightArg2 = (0.5 * funcArg) * (0.5 * funcArg);
153 art::TFileDirectory
dir = histDir.mkdir(dirName.c_str());
166 std::vector<double> powerVec(halfFFTDataSize);
172 double freqWidth = maxFreq / powerVec.size();
174 histName =
"FFT_" + histName;
176 TProfile* fftHist = dir.make<TProfile>(histName.c_str(),
"Electronics FFT; Frequency(MHz)", powerVec.size(), 0., maxFreq);
178 for(
size_t idx = 0; idx < powerVec.size(); idx++)
180 double bin = (idx + 0.5) * freqWidth;
182 fftHist->Fill(bin, powerVec.at(idx), 1.);
std::vector< ComplexVal > FrequencyVec
constexpr details::BinObj< T > bin(T value)
Returns a wrapper to print the specified data in binary format.
std::vector< SigProcPrecision > TimeVec
std::string to_string(WindowPattern const &pattern)
This is the interface class for a tool to handle the electronics response.