LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
raw.h
Go to the documentation of this file.
1 
6 #ifndef RAWDATA_RAW_H
7 #define RAWDATA_RAW_H
8 
10 #include <boost/circular_buffer.hpp>
11 #include <functional>
12 #include <map>
13 #include <vector>
14 
15 namespace raw {
16 
35  void Uncompress(const std::vector<short>& adc,
36  std::vector<short>& uncompressed,
37  raw::Compress_t compress);
38 
39  void Uncompress(const std::vector<short>& adc,
40  std::vector<short>& uncompressed,
41  int pedestal,
42  raw::Compress_t compress);
43 
44  void Compress(std::vector<short>& adc, raw::Compress_t compress, int& nearestneighbor);
45  void Compress(std::vector<short>& adc,
46  raw::Compress_t compress,
47  unsigned int& zerothreshold,
48  int& nearestneighbor);
49  void Compress(std::vector<short>& adc,
50  raw::Compress_t compress,
51  unsigned int& zerothreshold,
52  int pedestal,
53  int& nearestneighbor,
54  bool fADCStickyCodeFeature = false);
55 
68  void Compress(std::vector<short>& adc, raw::Compress_t compress);
69  void Compress(std::vector<short>& adc, raw::Compress_t compress, unsigned int& zerothreshold);
70 
71  void Compress(const boost::circular_buffer<std::vector<short>>& adcvec_neighbors,
72  std::vector<short>& adc,
73  raw::Compress_t compress,
74  unsigned int& zerothreshold,
75  int& nearestneighbor);
76 
77  void Compress(const boost::circular_buffer<std::vector<short>>& adcvec_neighbors,
78  std::vector<short>& adc,
79  raw::Compress_t compress,
80  unsigned int& zerothreshold,
81  int pedestal,
82  int& nearestneighbor,
83  bool fADCStickyCodeFeature = false);
84 
85  void CompressHuffman(std::vector<short>& adc);
86 
87  void UncompressHuffman(const std::vector<short>& adc, std::vector<short>& uncompressed);
88 
89  short fibonacci_decode(std::vector<bool>& chunk);
90  void fibonacci_encode_table(int end, std::vector<std::vector<bool>>& table);
91 
92  void CompressFibonacci(std::vector<short>& wf,
93  std::function<void(int, std::vector<std::vector<bool>>&)> add_to_table =
95 
97  const std::vector<short>& adc,
98  std::vector<short>& uncompressed,
99  std::function<int(std::vector<bool>&)> decode_table_chunk = fibonacci_decode);
100 
101  void ZeroSuppression(std::vector<short>& adc, unsigned int& zerothreshold, int& nearestneighbor);
102 
103  void ZeroSuppression(std::vector<short>& adc,
104  unsigned int& zerothreshold,
105  int pedestal,
106  int& nearestneighbor,
107  bool fADCStickyCodeFeature = false);
108 
109  void ZeroSuppression(std::vector<short>& adc, unsigned int& zerothreshold);
110 
111  void ZeroSuppression(const boost::circular_buffer<std::vector<short>>& adcvec_neighbors,
112  std::vector<short>& adc,
113  unsigned int& zerothreshold,
114  int& nearestneighbor);
115 
116  void ZeroSuppression(const boost::circular_buffer<std::vector<short>>& adcvec_neighbors,
117  std::vector<short>& adc,
118  unsigned int& zerothreshold,
119  int pedestal,
120  int& nearestneighbor,
121  bool fADCStickyCodeFeature = false);
122 
123  void ZeroUnsuppression(const std::vector<short>& adc, std::vector<short>& uncompressed);
124 
125  void ZeroUnsuppression(const std::vector<short>& adc,
126  std::vector<short>& uncompressed,
127  int pedestal);
128 
129  const unsigned int onemask =
130  0x003f; // Unsigned int ending in 111111 used to select 6 LSBs with bitwise AND
131 
132  int ADCStickyCodeCheck(
133  const short
134  adc_current_value, // Function to check if ADC value may be ADC sticky code in DUNE35t data
135  const int pedestal,
136  bool fADCStickyCodeFeature);
137 
138 } // namespace raw
139 
140 #endif // RAWDATA_RAW_H
void CompressHuffman(std::vector< short > &adc)
Definition: raw.cxx:818
enum raw::_compress Compress_t
void UncompressHuffman(const std::vector< short > &adc, std::vector< short > &uncompressed)
Definition: raw.cxx:1026
const unsigned int onemask
Definition: raw.h:129
Raw data description.
Definition: RawTypes.h:6
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:77
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:289
int ADCStickyCodeCheck(const short adc_value, const int pedestal, bool fADCStickyCodeFeature)
Definition: raw.cxx:1153
void fibonacci_encode_table(int end, std::vector< std::vector< bool >> &table)
Definition: raw.cxx:1321
void ZeroUnsuppression(const std::vector< short > &adc, std::vector< short > &uncompressed)
Definition: raw.cxx:688
void UncompressFibonacci(const std::vector< short > &adc, std::vector< short > &uncompressed, std::function< int(std::vector< bool > &)> decode_table_chunk)
Definition: raw.cxx:1272
void CompressFibonacci(std::vector< short > &wf, std::function< void(int, std::vector< std::vector< bool >> &)> add_to_table)
Definition: raw.cxx:1175
void Compress(std::vector< short > &adc, raw::Compress_t compress)
Compresses a raw data buffer.
Definition: raw.cxx:19
void Uncompress(const std::vector< short > &adc, std::vector< short > &uncompressed, raw::Compress_t compress)
Uncompresses a raw data buffer.
Definition: raw.cxx:744
void ZeroSuppression(std::vector< short > &adc, unsigned int &zerothreshold)
Definition: raw.cxx:171
short fibonacci_decode(std::vector< bool > &chunk)
Definition: raw.cxx:1368