ConfigurableAdcChannelDataCopyService_service.cc
Go to the documentation of this file.
1 // ConfigurableAdcChannelDataCopyService_service.cc
2 
4 #include <iostream>
7 
8 using std::string;
9 using std::cout;
10 using std::endl;
11 
12 //**********************************************************************
13 
16  const string myname = "ConfigurableAdcChannelDataCopyService::ctor: ";
17  pset.get_if_present<int>("LogLevel", m_LogLevel);
18  pset.get_if_present<bool>("CopyChannel", m_CopyChannel);
19  pset.get_if_present<bool>("CopyPedestal", m_CopyPedestal);
20  pset.get_if_present<bool>("CopyRaw", m_CopyRaw);
21  pset.get_if_present<bool>("CopySamples", m_CopySamples);
22  pset.get_if_present<bool>("CopyFlags", m_CopyFlags);
23  pset.get_if_present<bool>("CopySignal", m_CopySignal);
24  pset.get_if_present<bool>("CopyRois", m_CopyRois);
25  pset.get_if_present<bool>("CopyDigit", m_CopyDigit);
26  pset.get_if_present<bool>("CopyWire", m_CopyWire);
27  pset.get_if_present<bool>("CopyDigitIndex", m_CopyDigitIndex);
28  pset.get_if_present<bool>("CopyWireIndex", m_CopyWireIndex);
29  print(cout, myname);
30 }
31 
32 //**********************************************************************
33 
35 copy(const AdcChannelData& acdin, AdcChannelData& acdout) const {
36  const string myname = "ConfigurableAdcChannelDataCopyService:copy: ";
37  if ( m_LogLevel >= 2 ) cout << myname << "Copying channel " << acdin.channel() << endl;
38  if ( m_CopyChannel ) acdout.setChannelInfo(acdin.getChannelInfoPtr());
39  if ( m_CopyPedestal ) acdout.pedestal = acdin.pedestal;
40  if ( m_CopyRaw ) acdout.raw = acdin.raw;
41  if ( m_CopySamples ) acdout.samples = acdin.samples;
42  if ( m_CopyFlags ) acdout.flags = acdin.flags;
43  if ( m_CopySignal ) acdout.signal = acdin.signal;
44  if ( m_CopyRois ) acdout.rois = acdin.rois;
45  if ( m_CopyDigit ) acdout.digit = acdin.digit;
46  if ( m_CopyWire ) acdout.wire = acdin.wire;
47  if ( m_CopyDigitIndex ) acdout.digitIndex = acdin.digitIndex;
48  if ( m_CopyWireIndex ) acdout.wireIndex = acdin.wireIndex;
49  return 0;
50 }
51 
52 //**********************************************************************
53 
55 print(std::ostream& out, std::string prefix) const {
56  out << prefix << "ConfigurableAdcChannelDataCopyService:" << endl;
57  out << prefix << " LogLevel: " << m_LogLevel << endl;
58  out << prefix << " CopyChannel: " << m_CopyChannel << endl;
59  out << prefix << " CopyPedestal: " << m_CopyPedestal << endl;
60  out << prefix << " CopyRaw: " << m_CopyRaw << endl;
61  out << prefix << " CopySamples: " << m_CopySamples << endl;
62  out << prefix << " CopyFlags: " << m_CopyFlags << endl;
63  out << prefix << " CopySignal: " << m_CopySignal << endl;
64  out << prefix << " CopyRois: " << m_CopyRois << endl;
65  out << prefix << " CopyDigit: " << m_CopyDigit << endl;
66  out << prefix << " CopyWire: " << m_CopyWire << endl;
67  out << prefix << " CopyDigitIndex: " << m_CopyDigitIndex << endl;
68  out << prefix << " CopyWireIndex: " << m_CopyWireIndex << endl;
69  return out;
70 }
71 
72 //**********************************************************************
73 
75 
76 //**********************************************************************
std::ostream & print(std::ostream &out=std::cout, std::string prefix="") const
ChannelInfoPtr getChannelInfoPtr() const
std::string string
Definition: nybbler.cc:12
const recob::Wire * wire
const raw::RawDigit * digit
int copy(const AdcChannelData &acdin, AdcChannelData &acdout) const
void setChannelInfo(ChannelInfoPtr pchi)
AdcRoiVector rois
ConfigurableAdcChannelDataCopyService(fhicl::ParameterSet const &pset, art::ActivityRegistry &)
AdcCountVector raw
Channel channel() const
AdcSignal pedestal
AdcFilterVector signal
std::optional< T > get_if_present(std::string const &key) const
Definition: ParameterSet.h:224
AdcIndex digitIndex
AdcIndex wireIndex
AdcSignalVector samples
QTextStream & endl(QTextStream &s)
AdcFlagVector flags
#define DEFINE_ART_SERVICE_INTERFACE_IMPL(svc, iface)