All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HitFilterAlg.cxx
Go to the documentation of this file.
1 #include "HitFilterAlg.h"
2 
5 
6 #include "fhiclcpp/ParameterSet.h"
7 #include "messagefacility/MessageLogger/MessageLogger.h"
8 
9 namespace hit{
10 
11  HitFilterAlg::HitFilterAlg(fhicl::ParameterSet const & p) :
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
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
Definition: UtilFunc.cxx:42
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
Declaration of signal hit object.
pdgs p
Definition: selectors.fcl:22
process_name hit
Definition: cheaterreco.fcl:51
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
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:493
Definition of data types for geometry description.
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:48
HitFilterAlg(fhicl::ParameterSet const &p)
const std::vector< float > fMinPulseHeight
Definition: HitFilterAlg.h:28