Adc2dConvolute.h
Go to the documentation of this file.
1 // Adc2dConvolute.h
2 //
3 // Tool to perform 2D (time and channel) convolution of AdcChannelData.
4 //
5 // The transformation is
6 //
7 // d(m;i) = SUM(n;j) R(m,n;i,j) q(n,j)
8 //
9 // where q denotes the input charge with NT (BinsPerTick) bins in time (i, j) and
10 // NW (BinsPerWire) bins in channel (m, n).
11 //
12 // The response matrix is constructed assuming translational invariance (except for edges)
13 // in both time and channel, and reflection symmetry in channel, and so takes the form
14 //
15 // R(m,n;i,j) = r(S, T)
16 // = V(A, B, T)
17 // T = NT*i - (j - Joff)
18 // S = 0, 1, 2, ...
19 //
20 // where
21 //
22 // A = abs(n/NW - m)
23 // B = n % NW, for n - NW m < N/2 or
24 // NW - 1 - n % NW otherwise
25 //
26 // The response is provided as a vector r (ResponseVectors) which is a vector over channel
27 // bins of vectors over time bins with
28 // r = { r(0, (NW-1)/2), ..., r(0, NW-1)],
29 // r(1, 0), ..., r(1, NW-1),
30 // r(2, 0), ..., r(2, NW-1),
31 // ... }
32 //
33 // where v(A,B) is the response of a channel to unit charge in bin B of the channel R to
34 // the right, i.e. the second half of the diagonal reponse vector followed by the vectors
35 // or the right neighbors. Left elements are obtained by symmetry as shown above.
36 //
37 // The input charge is taken from binSamples or samples according to BinsPerTick.
38 // Output charge is stored in samples.
39 // If the reponse extends over multiple channels, then contiguous numbering from MinChannel to
40 // MaxChannel, inclusive is used.
41 //
42 // Configuration:
43 // LogLevel: 0=silent, 1=init, 2=each event, >2=more
44 // BinsPerTick - # input bins for each tick. Value 0 means 1 with input from samples.
45 // BinsPerWire - # bins for each input channel
46 // ResponseVectors: Vector of discrete sequences representing the response function.
47 // ReponseCenter: Center tick for the response function (Joff above).
48 // MinChannel: First channel
49 // MaxChannel: Last channel
50 //
51 
52 #ifndef Adc2dConvolute_H
53 #define Adc2dConvolute_H
54 
56 #include "fhiclcpp/ParameterSet.h"
59 
61 
62 public:
63 
64  using Index = unsigned int;
65 
67 
68  ~Adc2dConvolute() override =default;
69 
70  DataMap updateMap(AdcChannelDataMap& acd) const override;
71 
72 private:
73 
74  using Name = std::string;
75  using IndexVector = std::vector<Index>;
76  using ResponseVector = AdcSignalVector; // Same type as AdcChannel data
77  using ResponseVectorVector = std::vector<ResponseVector>;
78 
79  // Configuration data.
87 
88 };
89 
90 
91 #endif
DataMap updateMap(AdcChannelDataMap &acd) const override
unsigned int Index
std::string string
Definition: nybbler.cc:12
std::string Name
std::vector< ResponseVector > ResponseVectorVector
std::vector< Index > IndexVector
ResponseVectorVector m_ResponseVectors
~Adc2dConvolute() override=default
Adc2dConvolute(fhicl::ParameterSet const &ps)
static constexpr double ps
Definition: Units.h:99
AdcSignalVector ResponseVector
Index m_ResponseCenter
std::vector< AdcSignal > AdcSignalVector
Definition: AdcTypes.h:22
std::map< AdcChannel, AdcChannelData > AdcChannelDataMap