AdcChannelTrimmer.h
Go to the documentation of this file.
1 // AdcChannelTrimmer.h
2 
3 // David Adams
4 // May 2019
5 //
6 // Tool to trim or pad the ADC samples to a fixed length. If longer,
7 // later samples are dropped. If shorter, samples at the start are
8 // appended to the end.
9 //
10 // If the # samples to trim or pad exceeds a threshold, no action is taken
11 // and an error message is broadcast.
12 //
13 // Configuration:
14 // LogLevel: 0=errors only, 1=show config, 2=message for each trim/pad
15 // Length - Output length.
16 // MaxTrim - Max # samples to trim or pad.
17 //
18 // Output datamap:
19 // int trimAction: 0 - Input # samples matched the requested value
20 // 1 - Samples vector trimmed to requested length
21 // -1 - From call to view. Vector would have been trimmed if
22 // update was called.
23 // 2 - Required trim exceeded threshold.
24 // 3 - Input data had no samples.
25 // int trimLength: (# input samples) - (requested length)
26 
27 #ifndef AdcChannelTrimmer_H
28 #define AdcChannelTrimmer_H
29 
31 #include "fhiclcpp/ParameterSet.h"
33 #include "TH1.h"
34 #include <memory>
35 
37 class TPadManipulator;
38 
40 
41 public:
42 
43  using Index = unsigned int;
44 
46 
47  ~AdcChannelTrimmer() override =default;
48 
49  // Inherited methods.
50  DataMap view(const AdcChannelData& acd) const override;
51  DataMap update(AdcChannelData& acd) const override;
52 
53 private:
54 
55  // Configuration data.
59 
60 };
61 
62 
63 #endif
unsigned int Index
~AdcChannelTrimmer() override=default
static constexpr double ps
Definition: Units.h:99
DataMap update(AdcChannelData &acd) const override
AdcChannelTrimmer(fhicl::ParameterSet const &ps)
DataMap view(const AdcChannelData &acd) const override