HitFilterAlg.cxx
Go to the documentation of this file.
1 #include "HitFilterAlg.h"
2 
5 
8 
9 namespace hit{
10 
12  fMinPulseHeight(p.get< std::vector<float> >("MinPulseHeight")),
13  fMinPulseSigma(p.get< std::vector<float> >("MinPulseSigma"))
14 {
15 }
16 
17  bool HitFilterAlg::IsGoodHit(const recob::Hit& hit) const {
18 
19  const float hitPH = hit.PeakAmplitude();
20  const float hitSigma = hit.RMS();
21 
22  const geo::WireID& wireID = hit.WireID();
23  const size_t view = wireID.Plane;
24 
25  if (view >= fMinPulseSigma.size() || view >= fMinPulseHeight.size()) {
26  mf::LogError("HitFilterAlg") << "Filtering settings not configured for all views! Will not filter hits in unconfigured views!";
27  return true;
28  }
29 
30  if ( hitPH > fMinPulseHeight[view] &&
31  hitSigma > fMinPulseSigma[view] ) {
32  return true;
33  }
34  else return false;
35  }
36 }//end namespace hit
bool IsGoodHit(const recob::Hit &hit) const
geo::WireID WireID() const
Definition: Hit.h:233
float RMS() const
RMS of the hit shape, in tick units.
Definition: Hit.h:220
STL namespace.
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
const std::vector< float > fMinPulseSigma
Definition: HitFilterAlg.h:29
float PeakAmplitude() const
The estimated amplitude of the hit at its peak, in ADC units.
Definition: Hit.h:221
p
Definition: test.py:223
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:493
Definition of data types for geometry description.
Detector simulation of raw signals on wires.
Declaration of signal hit object.
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:48
auto const & get(AssnsNode< L, R, D > const &r)
Definition: AssnsNode.h:115
HitFilterAlg(fhicl::ParameterSet const &p)
const std::vector< float > fMinPulseHeight
Definition: HitFilterAlg.h:28