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;
58 std::unique_ptr<icarus_signal_processing::ICARUSFFT<double>>
fFFT;
73 fPlane = pset.get<
size_t>(
"Plane");
85 double timeCorrect = 1.e-3;
92 if (!
fFFT)
fFFT = std::make_unique<icarus_signal_processing::ICARUSFFT<double>>(numBins);
105 for(
size_t timeIdx = 0; timeIdx < numBins; timeIdx++)
149 art::TFileDirectory
dir = histDir.mkdir(dirName.c_str());
155 TProfile* hist = dir.make<TProfile>(histName.c_str(),
"Response;Time(us)",
fElectronicsResponseVec.size(), 0., hiEdge);
166 double freqWidth = maxFreq / powerVec.size();
168 histName =
"FFT_" + histName;
170 TProfile* fftHist = dir.make<TProfile>(histName.c_str(),
"Electronics FFT; Frequency(MHz)", powerVec.size(), 0., maxFreq);
172 for(
size_t idx = 0; idx < powerVec.size(); idx++)
174 float bin = (idx + 0.5) * freqWidth;
176 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.