118 std::vector<float> holder;
119 std::vector<short> rawadc;
127 std::vector<float> startTimes;
128 std::vector<float> maxTimes;
129 std::vector<float> endTimes;
130 std::vector<float> peakHeight;
131 std::vector<float> hitrms;
132 std::vector<double> charge;
135 double threshold = 0;
140 std::stringstream numConv;
142 hcol.reserve(digitVecHandle->size());
143 for(
size_t rdIter = 0; rdIter < digitVecHandle->size(); ++rdIter){
148 channel = digitVec->Channel();
156 int pedestal = (
int)digitVec->GetPedestal();
157 raw::Uncompress(digitVec->ADCs(), rawadc, pedestal, digitVec->Compression());
168 = channelStatus.BadChannels();
171 holder[
bin]=(rawadc[
bin]-digitVec->GetPedestal());
183 bool channelSwitch =
false;
185 for(
auto it = BadChannels.begin(); it != BadChannels.end(); it++)
189 channelSwitch =
true;
194 if(channelSwitch==
false)
209 float negthr=-1.0*threshold;
214 while (bin<(fDataSize-1)) {
215 float thisadc = holder[
bin];
float nextadc = holder[bin+1];
216 if (thisadc<negthr && nextadc < negthr) {
219 unsigned int place =
bin;
220 while (thisadc<=0 && bin>0) {
225 float hittime = bin+thisadc/(thisadc-holder[bin+1]);
226 maxTimes.push_back(hittime);
231 while (thisadc<threshold && bin>stop) {
237 while (thisadc>threshold && bin>stop) {
242 startTimes.push_back(bin+1);
248 totSig = fabs(thisadc);
249 while (thisadc<negthr && bin<fDataSize) {
250 totSig += fabs(thisadc);
252 if (thisadc<minadc) minadc=thisadc;
255 endTimes.push_back(bin-1);
256 peakHeight.push_back(-1.0*minadc);
257 charge.push_back(totSig);
258 hitrms.push_back(5.0);
263 while (thisadc<0 && bin<fDataSize) {
266 if (bin == fDataSize)
break;
282 float madc = threshold;
286 unsigned int bin = 0;
288 while (bin<fDataSize)
290 float thisadc = holder[
bin];
298 if(thisadc>threshold && bin<fDataSize)
300 while (thisadc>threshold && bin<fDataSize)
308 if (bin == fDataSize)
break;
321 maxTimes.push_back(ibin);
322 peakHeight.push_back(madc);
323 startTimes.push_back(start);
324 endTimes.push_back(end);
333 for(
int i = start-moreTail; i <= end+moreTail; i++)
335 if(i<(
int)(holder.size()) && i>=0)
338 myrms += temp*temp*holder[i];
344 charge.push_back(totSig);
347 hitrms.push_back(sqrt(myrms));
385 double start(0),
end(0);
386 double amplitudeErr(0), positionErr(0);
387 double goodnessOfFit(0), chargeErr(0);
390 numHits = maxTimes.size();
391 for (
int i = 0; i < numHits; ++i)
393 amplitude = peakHeight[i];
395 start = startTimes[i];
405 std::vector<geo::WireID> wids = geom->
ChannelToWire(channel);
410 mf::LogWarning(
"RawHitFinder_module") <<
"Hit start " << start <<
" is >= hit end " <<
end;
426 std::accumulate(holder.begin() + (
int) start, holder.begin() + (
int) end, 0.),
432 hcol.emplace_back(
hit.move(), digitVec);
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
std::set< raw::ChannelID_t > ChannelSet_t
Type of set of channel IDs.
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
Class managing the creation of a new recob::Hit object.
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
A class handling a collection of hits and its associations.
Signal from induction planes.
enum geo::_plane_sigtype SigType_t
Class providing information about the quality of channels.
Detector simulation of raw signals on wires.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
art::InputTag fDigitModuleLabel
QTextStream & bin(QTextStream &s)
void Uncompress(const std::vector< short > &adc, std::vector< short > &uncompressed, raw::Compress_t compress)
Uncompresses a raw data buffer.
QTextStream & endl(QTextStream &s)
Signal from collection planes.