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) {
160 rois.add_range(roistart,
std::move(sigs));
162 sigs.push_back(inputsignal[i]);
167 sigs.push_back(inputsignal[i]);
173 if (!sigs.empty()) { rois.add_range(roistart,
std::move(sigs)); }
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
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Class holding the regions of interest of signal from a channel.
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.