433 art::Ptr<raw::RawDigit> digitVec(digitVecHandle, idx);
449 size_t dataSize = digitVec->Samples();
454 std::vector<short> rawadc(dataSize);
467 mf::LogDebug(
"Decon1DROI_module") <<
"Pedestal lookup fails with channel: " << channel << std::endl;
473 std::vector<float> rawAdcLessPedVec(dataSize);
475 std::transform(rawadc.begin(),rawadc.end(),rawAdcLessPedVec.begin(),std::bind(std::minus<short>(),std::placeholders::_1,pedestal));
479 float raw_noise = digitVec->GetSigma();
494 auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(event);
498 const std::vector<float>& deconvolvedWaveform = deconVec.
get_ranges().front().data();
506 std::vector<float> holder;
509 for(
const auto& candROI : candRoiVec)
512 size_t roiLen = candROI.second - candROI.first + 1;
514 holder.resize(roiLen);
516 std::copy(deconvolvedWaveform.begin()+candROI.first, deconvolvedWaveform.begin()+candROI.second, holder.begin());
520 float base =
fBaseline->GetBaseline(holder, channel, 0, roiLen);
522 std::transform(holder.begin(),holder.end(),holder.begin(),[base](
auto& adcVal){
return adcVal - base;});
525 ROIVec.
add_range(candROI.first, std::move(holder));
533 for(
const auto& pair : candRoiVec)
536 float fullRMS = std::inner_product(deconvolvedWaveform.begin(), deconvolvedWaveform.end(), deconvolvedWaveform.begin(), 0.);
538 fullRMS = std::sqrt(std::max(
float(0.),fullRMS /
float(deconvolvedWaveform.size())));
544 if (ROIVec.
empty())
return;
556 throw art::Exception(art::errors::ProductRegistrationFailure)
557 <<
"Can't associate wire #" << (wireColVec.size() - 1)
558 <<
" with raw digit #" << digitVec.key();
The data type to uniquely identify a Plane.
bool fOutputHistograms
Output histograms?
const std::string instance
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
const datarange_t & add_range(size_type offset, ITER first, ITER last)
Adds a sequence of elements as a range with specified offset.
const range_list_t & get_ranges() const
Returns the internal list of non-void ranges.
Class managing the creation of a new recob::Wire object.
size_t fEventCount
count of event processed
std::unique_ptr< icarus_tool::IBaseline > fBaseline
std::vector< TH1F * > fROILenHistVec
virtual bool IsPresent(raw::ChannelID_t channel) const =0
Returns whether the specified channel is physical and connected to wire.
std::vector< TH1F * > fFullRMSVec
std::unique_ptr< icarus_tool::IDeconvolution > fDeconvolution
virtual Status_t Status(raw::ChannelID_t channel) const
Returns a status integer with arbitrary meaning.
PlaneID_t Plane
Index of the plane within its TPC.
std::vector< TH1F * > fNumROIsHistVec
virtual float PedMean(raw::ChannelID_t ch) const =0
Retrieve pedestal information.
const geo::GeometryCore * fGeometry
bool CreateAssn(art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t index=UINT_MAX)
Creates a single one-to-one association.
bool empty() const
Returns whether the vector is empty.
const lariov::DetPedestalProvider * fPedRetrievalAlg
const lariov::ChannelStatusProvider * fChannelFilter
int fMinAllowedChanStatus
Don't consider channels with lower status.
unsigned int ChannelID_t
Type representing the ID of a readout channel.
std::vector< std::unique_ptr< icarus_tool::IROIFinder > > fROIFinderVec
ROI finders per plane.
void Uncompress(const std::vector< short > &adc, std::vector< short > &uncompressed, raw::Compress_t compress)
Uncompresses a raw data buffer.
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.
tbb::spin_mutex deconvolutionSpinMutex