122 art::ServiceHandle<geo::Geometry> geom;
125 std::unique_ptr<std::vector<recob::Wire> > wirecol(
new std::vector<recob::Wire>);
127 std::unique_ptr<art::Assns<raw::RawDigit,recob::Wire> > WireDigitAssn(
new art::Assns<raw::RawDigit,recob::Wire>);
129 mf::LogDebug(
"RecoWireICARUSRaw") <<
" before wirecol size " << wirecol->size() << std::endl;
132 art::Handle< std::vector<raw::RawDigit> > digitVecHandle;
135 if (digitVecHandle.isValid() && digitVecHandle->size() > 0)
137 mf::LogInfo(
"RecoWireICARUSRaw") <<
"RecoWireICARUSRaw:: digitVecHandle size is " << digitVecHandle->size();
140 art::Ptr<raw::RawDigit> digitVec0(digitVecHandle, 0);
142 unsigned int dataSize = digitVec0->Samples();
148 std::vector<float> holder;
149 std::vector<short> rawadc(dataSize);
151 wirecol->reserve(digitVecHandle->size());
154 for(
unsigned int rdIter = 0; rdIter < digitVecHandle->size(); ++rdIter) {
157 art::Ptr<raw::RawDigit> digitVec(digitVecHandle, rdIter);
158 channel = digitVec->Channel();
163 std::vector<geo::WireID> wids = geom->ChannelToWire(channel);
165 if (wids.empty())
continue;
169 holder.resize(dataSize);
175 holder[
bin]=(rawadc[
bin]-digitVec->GetPedestal());
186 for(
int js=0;js<4096;js++)
187 media+=(holder[js]/4096.);
188 for(
int js=0;js<4096;js++)
189 rms2+=(holder[js]-media)*(holder[js]-media)/4096.;
190 float rms=sqrt(rms2);
198 throw art::Exception(art::errors::ProductRegistrationFailure)
199 <<
"Can't associate wire #" << (wirecol->size() - 1)
200 <<
" with raw digit #" << digitVec.key();
211 if(wirecol->size() == 0)
212 mf::LogWarning(
"RecoWireICARUSRaw") <<
"No wires made for this event.";
214 evt.put(std::move(wirecol));
215 evt.put(std::move(WireDigitAssn));
void DoubleRebinning(std::vector< float > &)
Class managing the creation of a new recob::Wire object.
constexpr details::BinObj< T > bin(T value)
Returns a wrapper to print the specified data in binary format.
std::string fDigitModuleLabel
module that made digits
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.
PlaneID_t Plane
Index of the plane within its TPC.
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.
const lariov::ChannelStatusProvider * fChannelFilter
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.
void OfflineIntegration(std::vector< float > &)