AdcSuppressSignalFindingService_service.cc
Go to the documentation of this file.
1 // AdcSuppressSignalFindingService_service.cc
2 
4 #include <iostream>
5 #include <sstream>
9 
10 using std::vector;
11 using std::string;
12 using std::ostream;
13 using std::cout;
14 using std::endl;
15 using art::ServiceHandle;
16 
17 //**********************************************************************
18 
21 : m_psup(&*ServiceHandle<AdcSuppressService>()) { }
22 
23 //**********************************************************************
24 
26  const string myname = "AdcSuppressSignalFindingService:find: ";
27  const AdcCountVector& raw = data.raw;
28  if ( raw.size() == 0 && data.samples.size() != 0 ) {
29  cout << "ERROR: Input data does not include raw counts." << endl;
30  return 1;
31  }
32  if ( raw.size() != data.samples.size() ) {
33  cout << "ERROR: Input prep and raw data have inconsistent sizes." << endl;
34  return 2;
35  }
36  m_psup->filter(raw, data.channel(), data.pedestal, data.signal);
37  return 0;
38 }
39 
40 //**********************************************************************
41 
43 print(ostream& out, string prefix) const {
44  out << prefix << "AdcSuppressSignalFindingService:" << endl;
45  return out;
46 }
47 
48 //**********************************************************************
49 
51 
52 //**********************************************************************
std::vector< AdcCount > AdcCountVector
Definition: AdcTypes.h:19
std::string string
Definition: nybbler.cc:12
struct vector vector
Raw data description.
std::ostream & print(std::ostream &out=std::cout, std::string prefix="") const
AdcCountVector raw
AdcSuppressSignalFindingService(fhicl::ParameterSet const &pset, art::ActivityRegistry &)
Channel channel() const
AdcSignal pedestal
AdcFilterVector signal
virtual int filter(const AdcCountVector &sigs, Channel chan, AdcPedestal ped, AdcFilterVector &keep) const =0
AdcSignalVector samples
QTextStream & endl(QTextStream &s)
#define DEFINE_ART_SERVICE_INTERFACE_IMPL(svc, iface)