8 #include "art/Utilities/ToolMacros.h"
9 #include "art/Utilities/make_tool.h"
10 #include "art/Framework/Principal/Handle.h"
11 #include "art_root_io/TFileService.h"
12 #include "messagefacility/MessageLogger/MessageLogger.h"
13 #include "cetlib_except/exception.h"
16 #include "icarus_signal_processing/WaveformTools.h"
31 void configure(
const fhicl::ParameterSet& pset)
override;
37 std::pair<float,int>
GetBaseline(
const std::vector<float>&,
int,
size_t,
size_t)
const;
63 fSignalShaping = art::ServiceHandle<icarusutil::SignalShapingICARUSService>();
79 float deconNoise = 1.26491 *
fSignalShaping->GetDeconNoise(channel);
80 int binRange = std::max(1,
int(std::round(deconNoise)));
82 size_t roiStop = roiStart + roiLen;
85 std::pair<float,int> baseFront =
GetBaseline(holder, binRange, roiStart, roiStart + halfLen);
86 std::pair<float,int> baseBack =
GetBaseline(holder, binRange, roiStop - halfLen, roiStop );
91 if (
std::abs(baseFront.first - baseBack.first) > 1.5 * deconNoise)
94 if (baseFront.second < 3 * baseBack.second / 2) base = baseFront.first;
95 else base = baseBack.first;
100 float rangeFront = baseFront.second;
101 float rangeBack = baseBack.second;
103 base = (baseFront.first/rangeFront + baseBack.first/rangeBack)*(rangeFront*rangeBack)/(rangeFront+rangeBack);
115 size_t roiStop)
const
117 std::pair<double,int> base(0.,1);
120 if (roiStop > roiStart)
125 std::copy(holder.begin() + roiStart,holder.begin() + roiStop,temp.begin());
127 fWaveformTool.getTruncatedMean(temp, base.first, nTrunc, base.second);
Utilities related to art service access.
This provides an interface for tools which are tasked with finding the baselines in input waveforms...
std::vector< SigProcPrecision > TimeVec
unsigned int ChannelID_t
Type representing the ID of a readout channel.