81 fIndWidth = pset.get<
int >(
"IndWidth",20);
82 fColWidth = pset.get<
double >(
"ColWidth");
87 fAreaNorms = pset.get< std::vector< double > >(
"AreaNorms");
89 fSkipInd = pset.get<
bool >(
"SkipInd",
false);
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){
168 = channelStatus.BadChannels();
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];
394 position = maxTimes[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.),
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
float GetPedestal() const
const ADCvector_t & ADCs() const
Reference to the compressed ADC count vector.
void produce(art::Event &evt) override
ULong64_t Samples() const
Number of samples in the uncompressed ADC data.
std::set< raw::ChannelID_t > ChannelSet_t
Type of set of channel IDs.
std::string fHitLabelName
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
EDProducer(fhicl::ParameterSet const &pset)
ChannelID_t Channel() const
DAQ channel this raw data was read from.
std::vector< double > fAreaNorms
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.
static void declare_products(art::ProducesCollector &collector, std::string instance_name="", bool doWireAssns=true, bool doRawDigitAssns=true)
Declares the hit products we are going to fill.
art framework interface to geometry description
Class managing the creation of a new recob::Hit object.
Helper functions to create a hit.
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
A class handling a collection of hits and its associations.
#define DEFINE_ART_MODULE(klass)
Signal from induction planes.
void reserve(size_t new_size)
Prepares the collection to host at least new_size hits.
enum geo::_plane_sigtype SigType_t
RawHitFinder(fhicl::ParameterSet const &pset)
void emplace_back(recob::Hit &&hit, art::Ptr< recob::Wire > const &wire=art::Ptr< recob::Wire >(), art::Ptr< raw::RawDigit > const &digits=art::Ptr< raw::RawDigit >())
Adds the specified hit to the data collection.
Class providing information about the quality of channels.
Definition of data types for geometry description.
void put_into(art::Event &)
Moves the data into an event.
Detector simulation of raw signals on wires.
ProducesCollector & producesCollector() noexcept
raw::Compress_t Compression() const
Compression algorithm used to store the ADC counts.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
std::string fCalDataModuleLabel
art::InputTag fDigitModuleLabel
QTextStream & bin(QTextStream &s)
Interface for experiment-specific channel quality info provider.
Interface for experiment-specific service for channel quality info.
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.