ReplaceCompressService_service.cc
Go to the documentation of this file.
1 // ReplaceCompressService.cxx
2 
6 
7 using std::string;
8 using std::ostream;
9 using std::endl;
10 
11 //**********************************************************************
12 
14 : m_zero(azero) { }
15 
16 //**********************************************************************
17 
20 : m_zero(0) {
21  pset.get_if_present<AdcCount>("Zero", m_zero);
22 }
23 
24 //**********************************************************************
25 
27 compress(AdcCountVector& sigs, const AdcFilterVector& keep, AdcCount offset,
28  raw::Compress_t& comp) const {
29  for ( unsigned int isig=0; isig<sigs.size(); ++isig ) {
30  if ( ! keep[isig] ) sigs[isig] = zero() + offset;
31  }
32  comp = raw::kNone;
33  return 0;
34 }
35 
36 //**********************************************************************
37 
39  return m_zero;
40 }
41 
42 //**********************************************************************
43 
44 ostream& ReplaceCompressService::print(ostream& out, string prefix) const {
45  out << prefix << "ReplaceCompressService:" << endl;
46  prefix += " ";
47  out << prefix << "Zero = " << m_zero << endl;
48  return out;
49 }
50 
51 //**********************************************************************
52 
54 
55 //**********************************************************************
std::vector< AdcCount > AdcCountVector
Definition: AdcTypes.h:19
enum raw::_compress Compress_t
std::string string
Definition: nybbler.cc:12
no compression
Definition: RawTypes.h:9
std::ostream & print(std::ostream &out=std::cout, std::string prefix=" ") const
int compress(AdcCountVector &sigs, const AdcFilterVector &keep, AdcCount offset, raw::Compress_t &comp) const
std::vector< bool > AdcFilterVector
Definition: AdcTypes.h:27
std::optional< T > get_if_present(std::string const &key) const
Definition: ParameterSet.h:224
short AdcCount
Definition: AdcTypes.h:18
QTextStream & endl(QTextStream &s)
#define DEFINE_ART_SERVICE_INTERFACE_IMPL(svc, iface)