Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
dunesim
dunesim
DetSim
Service
LarsoftHuffmanCompressService.h
Go to the documentation of this file.
1
// LarsoftHuffmanCompressService.h
2
//
3
// David Adams
4
// February 2016
5
//
6
// Service to compress an ADC vector using the LArSoft
7
// conventions in larsoft/lardata/RawData/raw.cxx.
8
// Uncompress in that same utility can be used to uncompress.
9
// Data may be put in block format, Huffman encoded or both or neither.
10
// In the latter case, any zero-supressed values are replaced with zero.
11
//
12
// FCL parameters:
13
// UseBlock - Put the data in larsoft block format
14
// UseHuffman - Do Huffman encoding
15
// LogLevel - Log messaging level
16
// 0 - no messages
17
// 1 - Initialization only
18
// 2 - Short message for each event
19
// 3 - Long message for each event
20
// 4 - Very long message for each event
21
22
#ifndef LarsoftHuffmanCompressService_H
23
#define LarsoftHuffmanCompressService_H
24
25
#include "
dunecore/DuneInterface/Service/AdcCompressService.h
"
26
27
namespace
fhicl
{
28
class
ParameterSet;
29
}
30
namespace
art
{
31
class
ActivityRegistry;
32
}
33
34
class
LarsoftHuffmanCompressService
:
public
AdcCompressService
{
35
36
public
:
37
38
// Ctor from parameters that characterize the algorithm.
39
LarsoftHuffmanCompressService
(
bool
useBlock,
bool
useHuffman,
int
logLevel);
40
41
// Ctor from fcl.
42
LarsoftHuffmanCompressService
(
fhicl::ParameterSet
const
& pset,
art::ActivityRegistry
&);
43
44
// Compress a vector of signals.
45
// Suppressed signals are replaced with the value of offset + (FCL parameter) Zero.
46
int
compress(
AdcCountVector
& sigs,
47
const
AdcFilterVector
& keep,
48
AdcCount
offset,
49
raw::Compress_t
& comp)
const
;
50
51
// Print the configuration.
52
std::ostream& print(std::ostream& out =std::cout,
std::string
prefix
=
" "
)
const
;
53
54
private
:
55
56
// Convert to block format.
57
void
block(
const
AdcCountVector
& oldsigs,
const
AdcFilterVector
& keep,
AdcCountVector
& newsigs)
const
;
58
59
private
:
60
61
bool
m_UseBlock
;
62
bool
m_UseHuffman
;
63
int
m_LogLevel
;
64
65
};
66
67
DECLARE_ART_SERVICE_INTERFACE_IMPL
(
LarsoftHuffmanCompressService
,
AdcCompressService
, LEGACY)
68
69
#endif
LarsoftHuffmanCompressService::m_UseHuffman
bool m_UseHuffman
Definition:
LarsoftHuffmanCompressService.h:62
AdcCountVector
std::vector< AdcCount > AdcCountVector
Definition:
AdcTypes.h:19
raw::Compress_t
enum raw::_compress Compress_t
submit_ppfxjobs.prefix
string prefix
Definition:
submit_ppfxjobs.py:128
string
std::string string
Definition:
nybbler.cc:12
DECLARE_ART_SERVICE_INTERFACE_IMPL
DECLARE_ART_SERVICE_INTERFACE_IMPL(MySharedService, art::test::MyServiceInterface, SHARED) DEFINE_ART_SERVICE_INTERFACE_IMPL(MySharedService
LarsoftHuffmanCompressService::m_LogLevel
int m_LogLevel
Definition:
LarsoftHuffmanCompressService.h:63
fhicl
Definition:
InputSourceFactory.h:7
AdcCompressService.h
LarsoftHuffmanCompressService
Definition:
LarsoftHuffmanCompressService.h:34
AdcCompressService
Definition:
AdcCompressService.h:26
AdcFilterVector
std::vector< bool > AdcFilterVector
Definition:
AdcTypes.h:27
art::ActivityRegistry
Definition:
ActivityRegistry.h:52
art
Definition:
BasicOptionsHandler.h:9
LarsoftHuffmanCompressService::m_UseBlock
bool m_UseBlock
Definition:
LarsoftHuffmanCompressService.h:61
AdcCount
short AdcCount
Definition:
AdcTypes.h:18
fhicl::ParameterSet
Definition:
ParameterSet.h:36
Generated by
1.8.11