LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
HitFilterAlg.cxx
Go to the documentation of this file.
1 #include "HitFilterAlg.h"
3 
4 namespace hit{
5 
7  this->reconfigure(p);
8  }
9 
11  // Implementation of optional member function here.
12  fMinPulseHeight = p.get< std::vector<float> >("MinPulseHeight");
13  fMinPulseSigma = p.get< std::vector<float> >("MinPulseSigma");
14  }
15 
16  bool HitFilterAlg::IsGoodHit(const recob::Hit& hit) const {
17 
18  float hitPH = hit.PeakAmplitude();
19  float hitSigma = hit.RMS();
20 
21  const geo::WireID& wireID = hit.WireID();
22  size_t view = wireID.Plane;
23 
24  if (view >= fMinPulseSigma.size() || view >= fMinPulseHeight.size()) {
25  mf::LogError("HitFilterAlg") << "Filtering settings not configured for all views! Will not filter hits in unconfigured views!";
26  return true;
27  }
28 
29  if ( hitPH > fMinPulseHeight[view] &&
30  hitSigma > fMinPulseSigma[view] ) {
31  return true;
32  }
33  else return false;
34  }
35 }//end namespace hit
bool IsGoodHit(const recob::Hit &hit) const
geo::WireID WireID() const
Initial tdc tick for hit.
Definition: Hit.h:234
float RMS() const
RMS of the hit shape, in tick units.
Definition: Hit.h:221
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
float PeakAmplitude() const
The estimated amplitude of the hit at its peak, in ADC units.
Definition: Hit.h:222
std::vector< float > fMinPulseHeight
Definition: HitFilterAlg.h:28
void reconfigure(fhicl::ParameterSet const &p)
T get(std::string const &key) const
Definition: ParameterSet.h:231
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:258
Detector simulation of raw signals on wires.
std::vector< float > fMinPulseSigma
Definition: HitFilterAlg.h:29
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:49
HitFilterAlg(fhicl::ParameterSet const &p)
Definition: HitFilterAlg.cxx:6