Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
dunesim
dunesim
DetSim
Service
ReplaceCompressService_service.cc
Go to the documentation of this file.
1
// ReplaceCompressService.cxx
2
3
#include "
dunesim/DetSim/Service/ReplaceCompressService.h
"
4
#include "
art/Framework/Services/Registry/ServiceDefinitionMacros.h
"
5
#include "
fhiclcpp/ParameterSet.h
"
6
7
using
std::string
;
8
using
std::ostream;
9
using
std::endl
;
10
11
//**********************************************************************
12
13
ReplaceCompressService::ReplaceCompressService
(
AdcCount
azero)
14
: m_zero(azero) { }
15
16
//**********************************************************************
17
18
ReplaceCompressService::
19
ReplaceCompressService
(
const
fhicl::ParameterSet
& pset,
art::ActivityRegistry
&)
20
:
m_zero
(0) {
21
pset.
get_if_present
<
AdcCount
>(
"Zero"
,
m_zero
);
22
}
23
24
//**********************************************************************
25
26
int
ReplaceCompressService::
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
38
AdcCount
ReplaceCompressService::zero
()
const
{
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
53
DEFINE_ART_SERVICE_INTERFACE_IMPL
(
ReplaceCompressService
,
AdcCompressService
)
54
55
//**********************************************************************
AdcCountVector
std::vector< AdcCount > AdcCountVector
Definition:
AdcTypes.h:19
raw::Compress_t
enum raw::_compress Compress_t
ReplaceCompressService::ReplaceCompressService
ReplaceCompressService(AdcCount azero=0)
Definition:
ReplaceCompressService_service.cc:13
submit_ppfxjobs.prefix
string prefix
Definition:
submit_ppfxjobs.py:128
string
std::string string
Definition:
nybbler.cc:12
ReplaceCompressService::zero
AdcCount zero() const
Definition:
ReplaceCompressService_service.cc:38
raw::kNone
no compression
Definition:
RawTypes.h:9
ParameterSet.h
ReplaceCompressService::print
std::ostream & print(std::ostream &out=std::cout, std::string prefix=" ") const
Definition:
ReplaceCompressService_service.cc:44
ReplaceCompressService::compress
int compress(AdcCountVector &sigs, const AdcFilterVector &keep, AdcCount offset, raw::Compress_t &comp) const
Definition:
ReplaceCompressService_service.cc:27
AdcCompressService
Definition:
AdcCompressService.h:26
AdcFilterVector
std::vector< bool > AdcFilterVector
Definition:
AdcTypes.h:27
art::ActivityRegistry
Definition:
ActivityRegistry.h:52
fhicl::ParameterSet::get_if_present
std::optional< T > get_if_present(std::string const &key) const
Definition:
ParameterSet.h:224
ServiceDefinitionMacros.h
ReplaceCompressService.h
ReplaceCompressService::m_zero
AdcCount m_zero
Definition:
ReplaceCompressService.h:49
ReplaceCompressService
Definition:
ReplaceCompressService.h:24
AdcCount
short AdcCount
Definition:
AdcTypes.h:18
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
fhicl::ParameterSet
Definition:
ParameterSet.h:36
DEFINE_ART_SERVICE_INTERFACE_IMPL
#define DEFINE_ART_SERVICE_INTERFACE_IMPL(svc, iface)
Definition:
ServiceDefinitionMacros.h:42
Generated by
1.8.11