Public Member Functions | Private Attributes | List of all members
MultiChannelNoiseRemovalService Class Reference

#include <MultiChannelNoiseRemovalService.h>

Inheritance diagram for MultiChannelNoiseRemovalService:
AdcNoiseRemovalService

Public Member Functions

 MultiChannelNoiseRemovalService (fhicl::ParameterSet const &pset, art::ActivityRegistry &)
 
int update (AdcChannelDataMap &datamap) const
 
std::ostream & print (std::ostream &out=std::cout, std::string prefix="") const
 
- Public Member Functions inherited from AdcNoiseRemovalService
virtual ~AdcNoiseRemovalService ()=default
 

Private Attributes

int m_LogLevel
 
const AdcChannelNoiseRemovalServicem_pAdcChannelNoiseRemovalService
 

Detailed Description

Definition at line 20 of file MultiChannelNoiseRemovalService.h.

Constructor & Destructor Documentation

MultiChannelNoiseRemovalService::MultiChannelNoiseRemovalService ( fhicl::ParameterSet const &  pset,
art::ActivityRegistry  
)

Definition at line 18 of file MultiChannelNoiseRemovalService_service.cc.

19 : m_LogLevel(1) {
20  const string myname = "MultiChannelNoiseRemovalService::ctor: ";
21  pset.get_if_present<int>("LogLevel", m_LogLevel);
22  // Get service.
24  print(cout, myname);
25 }
const AdcChannelNoiseRemovalService * m_pAdcChannelNoiseRemovalService
std::ostream & print(std::ostream &out=std::cout, std::string prefix="") const

Member Function Documentation

ostream & MultiChannelNoiseRemovalService::print ( std::ostream &  out = std::cout,
std::string  prefix = "" 
) const
virtual

Implements AdcNoiseRemovalService.

Definition at line 50 of file MultiChannelNoiseRemovalService_service.cc.

50  {
51  out << prefix << "MultiChannelNoiseRemovalService:" << endl;
52  out << prefix << " LogLevel: " << m_LogLevel << endl;
53  return out;
54 }
QTextStream & endl(QTextStream &s)
int MultiChannelNoiseRemovalService::update ( AdcChannelDataMap datamap) const
virtual

Implements AdcNoiseRemovalService.

Definition at line 29 of file MultiChannelNoiseRemovalService_service.cc.

29  {
30  const string myname = "MultiChannelNoiseRemovalService:update: ";
31  if ( m_pAdcChannelNoiseRemovalService == nullptr ) {
32  cout << myname << "ERROR: AdcChannelNoiseRemovalService not found." << endl;
33  return 1;
34  }
35  if ( m_LogLevel >= 2 ) cout << myname << "Updating " << datamap.size() << " channel"
36  << (datamap.size()!=1 ? "" : "s") << "." << endl;
37  int rstat = 0;
38  for ( AdcChannelDataMap::value_type& chdata : datamap ) {
39  AdcChannelData& data = chdata.second;
40  if ( m_pAdcChannelNoiseRemovalService->update(data) ) ++rstat;
41  }
42  if ( rstat != 0 ) cout << myname << "WARNING: Update failed for " << rstat << " of "
43  << datamap.size() << " channel" << (rstat!=1 ? "" : "s") << "." << endl;
44  return 0;
45 }
const AdcChannelNoiseRemovalService * m_pAdcChannelNoiseRemovalService
virtual int update(AdcChannelData &data) const =0
QTextStream & endl(QTextStream &s)

Member Data Documentation

int MultiChannelNoiseRemovalService::m_LogLevel
private

Definition at line 33 of file MultiChannelNoiseRemovalService.h.

const AdcChannelNoiseRemovalService* MultiChannelNoiseRemovalService::m_pAdcChannelNoiseRemovalService
private

Definition at line 36 of file MultiChannelNoiseRemovalService.h.


The documentation for this class was generated from the following files: