35 #include "larevt/CalibrationDBI/Interface/ChannelStatusService.h" 36 #include "larevt/CalibrationDBI/Interface/ChannelStatusProvider.h" 56 #include "TDecompSVD.h" 167 std::vector<float> holder;
168 std::vector<short> rawadc;
176 std::vector<float> startTimes;
177 std::vector<float> maxTimes;
178 std::vector<float> endTimes;
179 std::vector<float> peakHeight;
180 std::vector<float> hitrms;
181 std::vector<double> charge;
183 uint32_t channel = 0;
184 double threshold = 0;
189 std::stringstream numConv;
191 hcol.
reserve(digitVecHandle->size());
192 for(
size_t rdIter = 0; rdIter < digitVecHandle->size(); ++rdIter){
213 lariov::ChannelStatusProvider
const& channelStatus
216 lariov::ChannelStatusProvider::ChannelSet_t
const BadChannels
217 = channelStatus.BadChannels();
232 bool channelSwitch =
false;
234 for(
auto it = BadChannels.begin(); it != BadChannels.end(); it++)
238 channelSwitch =
true;
243 if(channelSwitch==
false)
258 float negthr=-1.0*threshold;
263 while (bin<(fDataSize-1)) {
264 float thisadc = holder[
bin];
float nextadc = holder[bin+1];
265 if (thisadc<negthr && nextadc < negthr) {
268 unsigned int place =
bin;
269 while (thisadc<=0 && bin>0) {
274 float hittime = bin+thisadc/(thisadc-holder[bin+1]);
275 maxTimes.push_back(hittime);
280 while (thisadc<threshold && bin>stop) {
286 while (thisadc>threshold && bin>stop) {
291 startTimes.push_back(bin+1);
297 totSig = fabs(thisadc);
298 while (thisadc<negthr && bin<fDataSize) {
299 totSig += fabs(thisadc);
301 if (thisadc<minadc) minadc=thisadc;
304 endTimes.push_back(bin-1);
305 peakHeight.push_back(-1.0*minadc);
306 charge.push_back(totSig);
307 hitrms.push_back(5.0);
312 while (thisadc<0 && bin<fDataSize) {
315 if (bin == fDataSize)
break;
331 float madc = threshold;
335 unsigned int bin = 0;
337 while (bin<fDataSize)
339 float thisadc = holder[
bin];
347 if(thisadc>threshold && bin<fDataSize)
349 while (thisadc>threshold && bin<fDataSize)
357 if (bin == fDataSize)
break;
370 maxTimes.push_back(ibin);
371 peakHeight.push_back(madc);
372 startTimes.push_back(start);
373 endTimes.push_back(end);
382 for(
int i = start-moreTail; i <= end+moreTail; i++)
384 if(i<(
int)(holder.size()) && i>=0)
387 myrms += temp*temp*holder[i];
393 charge.push_back(totSig);
396 hitrms.push_back(sqrt(myrms));
433 double amplitude(0), position(0);
434 double start(0),
end(0);
435 double amplitudeErr(0), positionErr(0);
436 double goodnessOfFit(0), chargeErr(0);
439 numHits = maxTimes.size();
440 for (
int i = 0; i < numHits; ++i)
442 amplitude = peakHeight[i];
443 position = maxTimes[i];
444 start = startTimes[i];
454 std::vector<geo::WireID> wids = geom->
ChannelToWire(channel);
459 mf::LogWarning(
"RawHitFinder_module") <<
"Hit start " << start <<
" is >= hit end " <<
end;
475 std::accumulate(holder.begin() + (int) start, holder.begin() + (int) end, 0.),
495 #endif //RAWHITFINDER_H float GetPedestal() const
const ADCvector_t & ADCs() const
Reference to the compressed ADC count vector.
Encapsulate the construction of a single cyostat.
std::string fHitLabelName
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
Declaration of signal hit object.
void reconfigure(fhicl::ParameterSet const &p)
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.
Definition of basic raw digits.
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
static void declare_products(ModuleType &producer, std::string instance_name="", bool doWireAssns=true, bool doRawDigitAssns=true)
Declares the hit products we are going to fill.
void produce(art::Event &evt)
unsigned short Samples() const
Number of samples in the uncompressed ADC data.
Class managing the creation of a new recob::Hit object.
Helper functions to create a hit.
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
Enumerate the possible plane projections.
Collect all the RawData header files together.
T get(std::string const &key) const
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.
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.
raw::Compress_t Compression() const
Compression algorithm used to store the ADC counts.
Encapsulate the construction of a single detector plane.
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
std::string fCalDataModuleLabel
art::InputTag fDigitModuleLabel
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
void Uncompress(const std::vector< short > &adc, std::vector< short > &uncompressed, raw::Compress_t compress)
Uncompresses a raw data buffer.
art framework interface to geometry description
Encapsulate the construction of a single detector plane.
Signal from collection planes.