AdcTimingMitigator.h
Go to the documentation of this file.
1 // AdcTimingMitigator.h
2 
3 // David Adams
4 // October 2017
5 //
6 // Tool to mitigate the timing in ADC samples to chave the sampling
7 // frequency and offset.
8 //
9 // If i is the old tick index and j is the new value:
10 // t = j T2 = (i + ioff) T1
11 // i = (T2/T1) j - ioff
12 // = SamplingRatio j + SamplingOffset
13 //
14 // The value for each new sample is obtained by interpolating linearly
15 // between the surrounding old samples. The new waveform ends when
16 // the end of the old waveform is reached.
17 //
18 // If the offset is positive, the original waveform is missing the data
19 // required for interpolation at the start of the new waveform and the
20 // first value in the old waveform is used.
21 //
22 // Configuration parameters.
23 // LogLevel - Logging level (0=none, 1=ctor only, ...)
24 // SamplingRatio - Sampling period is increased by this factor.
25 // SamplingOffset - Wave form is offset by this many (original) ticks
26 // FEMBs - FEMB indices for which correction should be applied.
27 
28 #ifndef AdcTimingMitigator_H
29 #define AdcTimingMitigator_H
30 
32 #include "fhiclcpp/ParameterSet.h"
34 #include <string>
35 #include <vector>
36 #include <set>
37 
38 class HistogramManager;
39 class TH1;
40 
42 : public TpcDataTool {
43 
44 public:
45 
46  using Index = unsigned int;
47  using IndexVector = std::vector<Index>;
48  using IndexSet = std::set<Index>;
49 
51 
52  DataMap update(AdcChannelData& acd) const override;
53 
54 private:
55 
56  // Configuration data.
61 
63 
64 };
65 
66 
67 #endif
unsigned int Index
AdcTimingMitigator(fhicl::ParameterSet const &ps)
std::vector< Index > IndexVector
static constexpr double ps
Definition: Units.h:99
DataMap update(AdcChannelData &acd) const override
std::set< Index > IndexSet