36 class WaveformRoiFinder;
72 <<
"Both RawProducerLabel and WireProducerLabel are empty";
77 <<
"Only one of RawProducerLabel and WireProducerLabel should be set";
80 auto const*
geo = lar::providerFrom<geo::Geometry>();
85 auto const tool_psets =
p.get<std::vector<fhicl::ParameterSet>>(
"WaveformRecogs");
86 fWaveformSize = tool_psets[0].get<
unsigned int>(
"WaveformSize");
87 for (
auto const& pset : tool_psets) {
91 produces<std::vector<recob::Wire>>();
98 std::vector<art::Ptr<raw::RawDigit>> rawlist;
102 std::vector<art::Ptr<recob::Wire>> wirelist;
106 std::unique_ptr<std::vector<recob::Wire>> outwires(
new std::vector<recob::Wire>);
108 auto const*
geo = lar::providerFrom<geo::Geometry>();
113 for (
unsigned int ich = 0; ich < (rawlist.empty() ? wirelist.size() : rawlist.size()); ++ich) {
119 if (!wirelist.empty()) {
120 const auto& wire = wirelist[ich];
121 const auto& signal = wire->Signal();
125 for (
size_t itck = 0; itck < inputsignal.size(); ++itck) {
126 inputsignal[itck] = signal[itck];
129 else if (!rawlist.empty()) {
130 const auto& digitVec = rawlist[ich];
132 view =
geo->View(rawlist[ich]->Channel());
135 raw::Uncompress(digitVec->ADCs(), rawadc, digitVec->GetPedestal(), digitVec->Compression());
136 for (
size_t itck = 0; itck < rawadc.size(); ++itck) {
137 inputsignal[itck] = rawadc[itck] - digitVec->GetPedestal();
145 std::vector<float> sigs;
146 int lastsignaltick = -1;
154 sigs.push_back(inputsignal[i]);
159 if (
int(i) != lastsignaltick + 1) {
162 sigs.push_back(inputsignal[i]);
167 sigs.push_back(inputsignal[i]);
174 if (!wirelist.empty()) {
175 outwires->emplace_back(
recob::Wire(rois, wirelist[ich]->Channel(), wirelist[ich]->
View()));
177 else if (!rawlist.empty()) {
178 outwires->emplace_back(
179 recob::Wire(rois, rawlist[ich]->Channel(),
geo->View(rawlist[ich]->Channel())));
AdcChannelData::View View
EDProducer(fhicl::ParameterSet const &pset)
const datarange_t & add_range(size_type offset, ITER first, ITER last)
Adds a sequence of elements as a range with specified offset.
art framework interface to geometry description
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
#define DEFINE_ART_MODULE(klass)
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Class holding the regions of interest of signal from a channel.
Declaration of basic channel signal object.
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
void Uncompress(const std::vector< short > &adc, std::vector< short > &uncompressed, raw::Compress_t compress)
Uncompresses a raw data buffer.
LArSoft geometry interface.
cet::coded_exception< error, detail::translate > exception