KeepAllRoiBuildingService_service.cc
Go to the documentation of this file.
1 // KeepAllRoiBuildingService_service.cc
2 
4 #include <iostream>
5 #include <sstream>
6 #include <iomanip>
9 
10 using std::vector;
11 using std::string;
12 using std::ostream;
13 using std::cout;
14 using std::endl;
15 using std::setw;
16 using art::ServiceHandle;
17 
18 //**********************************************************************
19 
22 : m_LogLevel(1) {
23  const string myname = "KeepAllRoiBuildingService::ctor: ";
24  pset.get_if_present<int>("LogLevel", m_LogLevel);
25  if ( m_LogLevel > 0 ) print(cout, myname);
26 }
27 
28 
29 //**********************************************************************
30 
32  const string myname = "KeepAllRoiBuildingService:build: ";
33  if ( m_LogLevel >= 2 ) cout << myname << "Building ROIs for channel "
34  << data.channel() << "." << endl;
35  data.signal.clear();
36  data.signal.resize(data.samples.size(), true);
37  data.roisFromSignal();
38  return 0;
39 }
40 
41 //**********************************************************************
42 
44 print(ostream& out, string prefix) const {
45  out << prefix << "KeepAllRoiBuildingService:" << endl;
46  out << prefix << " LogLevel: " << m_LogLevel << endl;
47  return out;
48 }
49 
50 //**********************************************************************
51 
53 
54 //**********************************************************************
std::string string
Definition: nybbler.cc:12
struct vector vector
KeepAllRoiBuildingService(fhicl::ParameterSet const &pset, art::ActivityRegistry &)
Q_EXPORT QTSManip setw(int w)
Definition: qtextstream.h:331
Channel channel() const
AdcFilterVector signal
std::optional< T > get_if_present(std::string const &key) const
Definition: ParameterSet.h:224
std::ostream & print(std::ostream &out=std::cout, std::string prefix="") const
int build(AdcChannelData &data) const
AdcSignalVector samples
QTextStream & endl(QTextStream &s)
#define DEFINE_ART_SERVICE_INTERFACE_IMPL(svc, iface)