214 std::unique_ptr<std::vector<recob::Wire> > wirecol(
new std::vector<recob::Wire>);
216 std::unique_ptr<art::Assns<raw::RawDigit,recob::Wire> > WireDigitAssn(
new art::Assns<raw::RawDigit,recob::Wire>);
219 art::Handle< std::vector<raw::RawDigit> > digitVecHandle;
224 if (!digitVecHandle->size())
235 auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(
evt);
238 wirecol->reserve(digitVecHandle->size());
239 for(
size_t rdIter = 0; rdIter < digitVecHandle->size(); ++rdIter)
245 art::Ptr<raw::RawDigit> digitVec(digitVecHandle, rdIter);
246 channel = digitVec->Channel();
249 if (!chanFilt.
IsPresent(channel))
continue;
252 if (digitVec->GetPedestal() < 0.)
continue;
259 size_t dataSize = digitVec->Samples();
266 std::vector<short> rawadc(dataSize);
273 pedestal = pedestalRetrievalAlg.
PedMean(channel);
276 std::vector<float> rawAdcLessPedVec(dataSize);
278 std::transform(rawadc.begin(),rawadc.end(),rawAdcLessPedVec.begin(),std::bind(std::minus<short>(),std::placeholders::_1,pedestal));
297 fDeconvolution->Deconvolve(rawAdcLessPedVec, samplingRate, channel, candRoiVec, ROIVec);
308 for(
const auto& pair : candRoiVec)
320 throw art::Exception(art::errors::ProductRegistrationFailure)
321 <<
"Can't associate wire #" << (wirecol->size() - 1)
322 <<
" with raw digit #" << digitVec.key();
327 if(wirecol->size() == 0)
328 mf::LogWarning(
"RecoWireROIICARUS") <<
"No wires made for this event.";
333 art::ServiceHandle<art::TFileService>
tfs;
334 for (
size_t wireN = 0; wireN < wirecol->size(); wireN++){
335 std::vector<float> sigTMP = wirecol->at(wireN).Signal();
336 TH1D* fWire = tfs->make<TH1D>(Form(
"Noise_Evt%04zu_N%04zu",
fEventCount,wireN),
";Noise (ADC);",
337 sigTMP.size(),-0.5,sigTMP.size()-0.5);
339 fWire->SetBinContent(
tick+1, sigTMP.at(
tick) );
bool fOutputHistograms
Output histograms?
const geo::GeometryCore * fGeometry
std::vector< std::unique_ptr< icarus_tool::IROIFinder > > fROIFinderVec
ROI finders per plane.
The data type to uniquely identify a Plane.
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
float fixTheFreakingWaveform(const std::vector< float > &, raw::ChannelID_t, std::vector< float > &)
Class managing the creation of a new recob::Wire object.
size_t fEventCount
count of event processed
virtual bool IsPresent(raw::ChannelID_t channel) const =0
Returns whether the specified channel is physical and connected to wire.
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
virtual Status_t Status(raw::ChannelID_t channel) const
Returns a status integer with arbitrary meaning.
Class providing information about the quality of channels.
int fSaveWireWF
Save recob::wire object waveforms.
PlaneID_t Plane
Index of the plane within its TPC.
virtual float PedMean(raw::ChannelID_t ch) const =0
Retrieve pedestal information.
std::unique_ptr< icarus_tool::IDeconvolution > fDeconvolution
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.
std::vector< TH1F * > fROILenHistVec
std::string fDigitModuleLabel
module that made digits
art::ServiceHandle< art::TFileService > tfs
unsigned int ChannelID_t
Type representing the ID of a readout channel.
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.
std::vector< TH1F * > fNumROIsHistVec
int fMinAllowedChanStatus
Don't consider channels with lower status.