source: trunk/MagicSoft/TDAS-Extractor/Algorithms.tex@ 5424

Last change on this file since 5424 was 5376, checked in by hbartko, 20 years ago
*** empty log message ***
File size: 18.7 KB
Line 
1\section{Signal Reconstruction Algorithms}
2
3\ldots {\it In this section, the extractors are described, especially w.r.t. which free parameters are left to play,
4how they subtract the pedestal, how they compare between calibration and cosmics pulses and how an
5extraction in case of a pure pedestal event takes place. }
6\newline
7\newline
8{\it Missing coding:
9\begin{itemize}
10\item Implementing a low-gain extraction based on the high-gain information \ldots Arnau
11\item Real fit to the expected pulse shape \ldots Hendrik, Wolfgang ???
12\end{itemize}
13}
14
15\subsection{Pure signal extractors}
16
17The pure signal extractors have in common that they compute only the
18signal, but no arrival time. All treated extractors here derive from the MARS-base
19class {\textit{MExtractor}} which provides the following facilities:
20
21\begin{itemize}
22\item The global extraction limits can be set from outside
23\item FADC saturation is kept track off
24\end{itemize}
25
26The following free adjustable parameters have to be set from outside:
27\begin{description}
28\item[Global extraction limits:\xspace] Limits in between the extractor is allowed
29to search.
30\end{description}
31
32\subsubsection{Fixed Window}
33
34This extractor is implemented in the MARS-class {\textit{MExtractFixedWindow}}.
35It simply adds the FADC contents in the allowed ranges.
36As it does not correct for the clock-noise, only an even number of samples is allowed.
37
38\subsubsection{Fixed Window with global Peak Search}
39
40This extractor is implemented in the MARS-class {\textit{MExtractFixedWindowPeakSearch}}.
41It first fixes a reference point defined as the highest sum of
42consecutive non-saturating FADC slices in a (smaller) peak-search window. This reference
43point removes the coherent movement of the arrival times over whole camera due to the trigger jitter.
44
45Then, simply adds the FADC contents around the reference point in a fixed window manner.
46It loops twice over the all pixels every event, because it first has to find the reference point.
47As it does not correct for the clock-noise, only an even number of samples is allowed.
48
49The following free adjustable parameters have to be set from outside:
50\begin{description}
51\item[Peak Search Window:\xspace] Defines the ``sliding window'' in which the peaking sum is
52searched for (default: 4 slices)
53\item[Offset from Window:\xspace] Defines the offset from the found reference point to start
54extracting the fixed window (default: 1 slice)
55\item[Low-Gain Peak shift:\xspace] Defines the shift in the low-gain with respect to the peak found
56in the high-gain (default: 1 slice)
57\end{description}
58
59\subsubsection{Fixed Window with integrated cubic spline}
60
61This extractor is implemented in the MARS-class {\textit{MExtractFixedWindowSpline}}.
62It uses a cubic spline algorithm, adapted from \cite{NUMREC}.
63It integrated the
64spline interpolated FADC slice values, counting the edge slices as half.
65As it does not correct for the clock-noise, only an odd number of samples is allowed.
66
67\subsection{Combined extractors}
68
69The combined extractors have in common that they compute the arrival time and
70the signal in one step. All treated combined extractors here derive from the MARS-base
71class {\textit{MExtractTimeAndCharge}} which provides the following facilities:
72
73\begin{itemize}
74\item Only one loop over all pixels is performed
75\item The individual FADC slice values get the clock-noise-corrected pedestals immediately subtracted.
76\item The low-gain extraction range is adapted dynamically, based on the computed arrival time
77 from the high-gain samples
78\item Extracted times from the low-gain samples get corrected for the intrinsic time delay of the low-gain
79 pulse
80\item The global extraction limits can be set from outside
81\item FADC saturation is kept track off
82\end{itemize}
83
84The following free adjustable parameters have to be set from outside:
85\begin{description}
86\item[Global extraction limits:\xspace] Limits in between the extractor is allowed
87to search. They are fixed by the extractor for the high-gain, but re-adjusted for
88every event in the low-gain, depending on the arrival time found in the low-gain.
89However, the dynamically adjusted window is not allowed to pass beyond the global
90limits.
91\item[Low-gain start shift:\xspace] Global shift between the computed high-gain arrival
92time and the start of the low-gain extraction limit (corrected for the intrinsic time offset).
93This variable tells where the extractor is allowed to start searching for the low-gain signal
94if the high-gain arrival time is known. It avoids that the extractor gets confused by possible high-gain
95signals leaking into the ``low-gain'' region.
96\end{description}
97
98\ldots {\it Note for the usage of this class together with {\textit{MJCalibration}}: In order to access the
99arrival times computed by these classes, the option: MJCalibration::SetTimeAndCharge() has to
100be chosen} \ldots
101
102\subsubsection{Sliding Window with amplitude-weighted time}
103
104This extractor is implemented in the MARS-class {\textit{MExtractTimeAndChargeSlidingWindow}}.
105It extracts the signal from a sliding window of an adjustable size, for high-gain and low-gain
106individually (default: 6 and 6) The signal is the one which maximizes the summed
107(clock-noise and pedestal-corrected) FADC signal over the window.
108\par
109The amplitude-weighted arrival time is calculated from the window with
110the highest integral using the following formula:
111
112\begin{equation}
113 t = \frac{\sum_{i=0}^{windowsize} s_i \cdot i}{\sum_{i=0}^{windowsize} i}
114\end{equation}
115where $i$ denotes the FADC slice index, starting from the beginning of the derived
116window and running over the window and $s_i$ the clock-noise and
117pedestal-corrected FADC value at slice index i.
118\par
119The following free adjustable parameters have to be set from outside:
120\begin{description}
121\item[Window sizes:\xspace] Independenty for high-gain and low-gain (default: 6,6)
122\end{description}
123
124\subsubsection{Cubic Spline with Sliding Window or Amplitude extraction}
125
126This extractor is implemented in the MARS-class {\textit{MExtractTimeAndChargeSpline}}.
127It uses a cubic spline algorithm, adapted from \cite{NUMREC}.
128The following free adjustable parameters have to be set from outside:
129
130\begin{description}
131\item[Time Extraction Type:\xspace] The position of the maximum can be chosen (default) or the
132position of the half maximum at the rising edge of the pulse
133\item[Charge Extraction Type:\xspace] The amplitude of the maximum can be chosen (default) or the
134integrated spline between maximum position minus rise time (default: 1.5 slices) and maximum position plus
135fall time (default: 4.5 slices). The low-gain signal integrates one slice more at the falling part of the
136signal.
137\item[Rise Time and Fall Time:\xspace] Can be adjusted for the integration charge extraction type.
138\item[Resolution:\xspace] Defined as the maximum allowed difference between the calculated half maximum value and
139the computed spline value at the arrival time position. Can be adjusted for the half-maximum time extraction
140type.
141\end{description}
142
143\subsubsection{Digital Filter}
144
145This extractor is implemented in the MARS-class {\textit{MExtractTimeAndChargeDigitalFilter}}.
146
147
148The goal of the digital filtering method \cite{OF94,OF77} is to optimally reconstruct the amplitude and time origin of a signal with a known signal shape from discrete measurements of the signal. Thereby the noise contribution to the amplitude reconstruction is minimized.
149
150For the digital filtering method two assumptions have to be made:
151
152\begin{itemize}
153\item{The normalized signal shape has to be independent of the signal amplitude.}
154\item{The noise properties have to be independent of the signal amplitude.}
155\end{itemize}
156
157Let $g(t)$ be the normalized signal shape, $E$ the signal amplitude and $\tau$ the time shift of the physical signal from the predicted signal shape. Then the time dependence of the signal, $y(t)$, is given by:
158
159\begin{equation}
160y(t)=E \cdot g(t-\tau) + b(t) \ ,
161\end{equation}
162
163where $b(t)$ is the time dependent noise distribution. For small time shifts $\tau$ the time dependence can be linearized by the use of a Taylor expansion:
164
165\begin{equation} \label{shape_taylor_approx}
166y(t)=E \cdot g(t) - E\tau \cdot \dot{g}(t) + b(t) \ ,
167\end{equation}
168
169where $\dot{g}(t)$ is the time derivative of the signal shape. Discrete
170measurements $y_i$ of the signal at times $t_i \ (i=1,...,n)$ have the form:
171
172\begin{equation}
173y_i=E \cdot g_i- E\tau \cdot \dot{g}_i +b_i \ .
174\end{equation}
175
176The correlation of the noise contributions at times $t_i$ and $t_j$ is expressed in the noise autocorrelation matrix $\boldsymbol{B}$:
177
178\begin{equation}
179\boldsymbol{B_{ij}} = \langle b_i b_j \rangle - \langle b_i \rangle \langle b_j
180\rangle \ .
181\end{equation}
182%\equiv \langle b_i b_j \rangle with $\langle b_i \rangle = 0$.
183
184The signal amplitude, $E$, and the product of amplitude and time shift, $E \tau$, can be estimated from the given set of
185measurements $\boldsymbol{y} = (y_1, ... ,y_n)$ by minimizing:
186
187\begin{eqnarray}
188\chi^2(E, E\tau) &=& \sum_{i,j}(y_i-E g_i-E\tau \dot{g}_i) \boldsymbol{B}^{-1}_{ij} (y_j - E g_j-E\tau \dot{g}_i) \\
189&=& (\boldsymbol{y} - E
190\boldsymbol{g} - E\tau \dot{\boldsymbol{g}})^T \boldsymbol{B}^{-1} (\boldsymbol{y} - E \boldsymbol{g}- E\tau \dot{\boldsymbol{g}}) \ ,
191\end{eqnarray}
192
193where the last expression is matricial. The minimum is obtained for:
194
195\begin{equation}
196\frac{\partial \chi^2(E, E\tau)}{\partial E} = 0 \qquad \text{and} \qquad \frac{\partial \chi^2(E, E\tau)}{\partial(E\tau)} = 0 \ .
197\end{equation}
198
199This leads to the following two equations for the estimated amplitude $\overline{E}$ and the estimation for the product of amplitude and time offset $\overline{E\tau}$:
200
201\begin{eqnarray}
2020&=&-\boldsymbol{g}^T\boldsymbol{B}^{-1}\boldsymbol{y}+\boldsymbol{g}^T\boldsymbol{B}^{-1}\boldsymbol{g}\overline{E}+\boldsymbol{g}^T\boldsymbol{B}^{-1}\dot{\boldsymbol{g}}\overline{E\tau}
203\\
2040&=&-\dot{\boldsymbol{g}}^T\boldsymbol{B}^{-1}\boldsymbol{y}+\dot{\boldsymbol{g}}^T\boldsymbol{B}^{-1}\boldsymbol{g}\overline{E}+\dot{\boldsymbol{g}}^T\boldsymbol{B}^{-1}\dot{\boldsymbol{g}}\overline{E\tau} \ .
205\end{eqnarray}
206
207Solving these equations one gets the solutions:
208
209\begin{equation}
210\overline{E}= \boldsymbol{w}_{\text{amp}}^T \boldsymbol{y} \quad \mathrm{with} \quad \boldsymbol{w}_{\text{amp}} = \frac{ (\dot{\boldsymbol{g}}^T\boldsymbol{B}^{-1}\dot{\boldsymbol{g}}) \boldsymbol{B}^{-1} \boldsymbol{g} -(\boldsymbol{g}^T\boldsymbol{B}^{-1}\dot{\boldsymbol{g}}) \boldsymbol{B}^{-1} \dot{\boldsymbol{g}}} {(\boldsymbol{g}^T \boldsymbol{B}^{-1} \boldsymbol{g})(\dot{\boldsymbol{g}}^T\boldsymbol{B}^{-1}\dot{\boldsymbol{g}}) -(\dot{\boldsymbol{g}}^T\boldsymbol{B}^{-1}\boldsymbol{g})^2 } \ ,
211\end{equation}
212
213\begin{equation}
214\overline{E\tau}= \boldsymbol{w}_{\text{time}}^T \boldsymbol{y} \quad \mathrm{with} \quad \boldsymbol{w}_{\text{time}} = \frac{ ({\boldsymbol{g}}^T\boldsymbol{B}^{-1}{\boldsymbol{g}}) \boldsymbol{B}^{-1} \dot{\boldsymbol{g}} -(\boldsymbol{g}^T\boldsymbol{B}^{-1}\dot{\boldsymbol{g}}) \boldsymbol{B}^{-1} {\boldsymbol{g}}} {(\boldsymbol{g}^T \boldsymbol{B}^{-1} \boldsymbol{g})(\dot{\boldsymbol{g}}^T\boldsymbol{B}^{-1}\dot{\boldsymbol{g}}) -(\dot{\boldsymbol{g}}^T\boldsymbol{B}^{-1}\boldsymbol{g})^2 } \ .
215\end{equation}
216
217
218Thus $\overline{E}$ and $\overline{E\tau}$ are given by a weighted sum of the discrete measurements $y_i$ with the digital filtering weights for the amplitude, $w_{\text{amp},i}$, and time shift, $w_{\text{time},i}$.
219
220Because of the truncation of the Taylor series in equation (\ref{shape_taylor_approx}) the above results are only valid for vanishing time offsets $\tau$. For non-zero time offsets one has to iterate the problem using the time shifted signal shape $g(t-\tau)$.
221
222The covariance matrix $\boldsymbol{V}$ of $\overline{E}$ and $\overline{E\tau}$ is given by:
223
224\begin{equation}
225\boldsymbol{V}^{-1}=\frac{1}{2}\left(\frac{\partial^2 \chi^2(E, E\tau)}{\partial \alpha_i \partial \alpha_j} \right) \quad \text{with} \quad \alpha_i,\alpha_j \in [E, E\tau] \ .
226\end{equation}
227
228The expected contribution of the noise to the estimated amplitude, $\sigma_E$, is:
229
230\begin{equation}\label{of_noise}
231\sigma_E^2=\frac{\dot{\boldsymbol{g}}^T\boldsymbol{B}^{-1}\dot{\boldsymbol{g}}}{(\boldsymbol{g}^T \boldsymbol{B}^{-1} \boldsymbol{g})(\dot{\boldsymbol{g}}^T\boldsymbol{B}^{-1}\dot{\boldsymbol{g}}) -(\dot{\boldsymbol{g}}^T\boldsymbol{B}^{-1}\boldsymbol{g})^2} \ .
232\end{equation}
233
234The expected contribution of the noise to the estimated timing ,$\sigma_{\tau}$, is:
235
236\begin{equation}\label{of_noise_time}
237E^2 \cdot \sigma_{\tau}^2=\frac{{\boldsymbol{g}}^T\boldsymbol{B}^{-1}{\boldsymbol{g}}}{(\boldsymbol{g}^T \boldsymbol{B}^{-1} \boldsymbol{g})(\dot{\boldsymbol{g}}^T\boldsymbol{B}^{-1}\dot{\boldsymbol{g}}) -(\dot{\boldsymbol{g}}^T\boldsymbol{B}^{-1}\boldsymbol{g})^2} \ .
238\end{equation}
239
240For the MAGIC signals, as implemented in the MC simulations, a pedestal RMS of a single FADC slice of 4 FADC counts introduces an error in the reconstructed signal and time of:
241
242\begin{equation}\label{of_noise}
243\sigma_E \approx 8.3 \ \mathrm{FADC\ counts} \qquad \sigma_{\tau} \approx \frac{6.5\ \Delta T_{\mathrm{FADC}}}{E\ /\ \mathrm{FADC\ counts}} \ ,
244\end{equation}
245
246where $\Delta T_{\mathrm{FADC}} = 3.33$ ns is the sampling intervall of the MAGIC FADCs.
247
248In the current implementation a two step procedure is applied to reconstruct the signal. The weight functions $w_{\mathrm{amp}}(t)$ and $w_{\mathrm{time}}(t)$ are computed numerically with a resolution of $1/10$ of an FADC slice. In the first step the quantities $e_{i_0}$ and $e\tau_{i_0}$ are computed:
249
250\begin{equation}
251e_{i_0}=\sum_{i=i_0}^{i=i_0+5} w_{\mathrm{amp}(t_i)}y(t_{i+i_0}) \qquad e\tau_{i_0}=\sum_{i=i_0}^{i=i_0+5} w(t_i)_{\mathrm{time}(t_i)}y(t_{i+i_0})
252\end{equation}
253
254for all possible signal start samples $i_0$. Let $i_0^*$ be the signal start sample with the largest $e_{i_0}$. Then in a seconst step the timing offset $\tau$ is calculated:
255
256\begin{equation}
257\tau=\frac{e\tau_{i_0^*}}{e_{i_0^*}}
258\end{equation}
259
260and the weigths iterated:
261
262\begin{equation}
263E_{i_0^*}=\sum_{i=i_0^*}^{i=i_0^*+5} w_{\mathrm{amp}(t_i - \tau)}y(t_{i+i_0^*}) \qquad E \tau_{i_0^*}=\sum_{i=i_0^*}^{i=i_0^*+5} w(t_i - \tau)_{\mathrm{time}(t_i)}y(t_{i+i_0^*}) \ .
264\end{equation}
265
266The reconstructed signal is then taken to be $E_{i_0^*}$ and the reconstructed arrival time $t_{\text{arrival}}$ is
267
268\begin{equation}
269t_{\text{arrival}} = i_0^* + \tau_{i_0^*} + \tau \ .
270\end{equation}
271
272
273
274% This does not apply for MAGIC as the LONs are giving always a correlated noise (in addition to the artificial shaping)
275
276%In the case of an uncorrelated noise with zero mean the noise autocorrelation matrix is:
277
278%\begin{equation}
279%\boldsymbol{B}_{ij}= \langle b_i b_j \rangle \delta_{ij} = \sigma^2(b_i) \ ,
280%\end{equation}
281
282%where $\sigma(b_i)$ is the standard deviation of the noise of the discrete measurements. Equation (\ref{of_noise}) than becomes:
283
284
285%\begin{equation}
286%\frac{\sigma^2(b_i)}{\sigma_E^2} = \sum_{i=1}^{n}{g_i^2} - \frac{\sum_{i=1}^{n}{g_i \dot{g}_i}}{\sum_{i=1}^{n}{\dot{g}_i^2}} \ .
287%\end{equation}
288
289
290
291\ldots {\it Hendrik ... }
292
293The following free adjustable parameters have to be set from outside:
294
295\begin{description}
296\item[Weights File:\xspace]
297\item[Window Sizes:\xspace]
298\item[Binning Resolution:\xspace]
299\end{description}
300
301\subsubsection{Real fit to the expected pulse shape }
302
303This extractor is not yet implemented as MARS-class...
304\par
305It fit the pulse shape to a Landau convoluted with a Gaussian using the following
306parameters:...
307
308\ldots {\it Hendrik, Wolfgang ... }
309
310
311\subsection{Used Extractors for this Analysis}
312
313We propose to test the following parameterized extractors:
314
315\begin{description}
316\item[MExtractFixedWindow]: with the following parameters, if {\textit{maxbin}} defines the
317 mean position of the High-Gain FADC slice carrying the pulse maximum:
318\begin{enumerate}
319\item SetRange({\textit{maxbin}}-1,{\textit{maxbin}}+2,{\textit{maxbin}}+0.5,{\textit{maxbin}}+3.5);
320\item SetRange({\textit{maxbin}}-1,{\textit{maxbin}}+2,{\textit{maxbin}}-1.5,{\textit{maxbin}}+4.5);
321\item SetRange({\textit{maxbin}}-2,{\textit{maxbin}}+3,{\textit{maxbin}}-0.5,{\textit{maxbin}}+4.5);
322\item SetRange({\textit{maxbin}}-3,{\textit{maxbin}}+4,{\textit{maxbin}}-1.5,{\textit{maxbin}}+5.5);
323\item SetRange({\textit{maxbin}}-5,{\textit{maxbin}}+8,{\textit{maxbin}}-1.5,{\textit{maxbin}}+7.5);
324\suspend{enumerate}
325\item[MExtractFixedWindowSpline]: with the following parameters, if {\textit{maxbin}} defines the
326 mean position of the High-Gain FADC slice carrying the pulse maximum:
327\resume{enumerate}
328\item SetRange({\textit{maxbin}}-1,{\textit{maxbin}}+2,{\textit{maxbin}}+0.5,{\textit{maxbin}}+3.5);
329\item SetRange({\textit{maxbin}}-1,{\textit{maxbin}}+2,{\textit{maxbin}}-1.5,{\textit{maxbin}}+4.5);
330\item SetRange({\textit{maxbin}}-2,{\textit{maxbin}}+3,{\textit{maxbin}}-0.5,{\textit{maxbin}}+4.5);
331\item SetRange({\textit{maxbin}}-3,{\textit{maxbin}}+4,{\textit{maxbin}}-1.5,{\textit{maxbin}}+5.5);
332\item SetRange({\textit{maxbin}}-5,{\textit{maxbin}}+8,{\textit{maxbin}}-1.5,{\textit{maxbin}}+7.5);
333\suspend{enumerate}
334\item[MExtractFixedWindowPeakSearch]: with the following parameters: \\
335SetRange(0,18,2,14); and:
336\resume{enumerate}
337\item SetWindows(2,2,2);
338\item SetWindows(4,4,2);
339\item SetWindows(6,6,4);
340\item SetWindows(4,6,4);
341\item SetWindows(8,8,4);
342\item SetWindows(14,10,4);
343\suspend{enumerate}
344\item[MExtractTimeAndChargeSlidingWindow]: with the following parameters: \\
345SetRange(0,18,2,14); and:
346\resume{enumerate}
347\item SetWindowSize(2,2);
348\item SetWindowSize(4,4);
349\item SetWindowSize(6,6);
350\item SetWindowSize(4,6);
351\item SetWindowSize(8,8);
352\item SetWindowSize(14,10);
353\suspend{enumerate}
354\item[MExtractTimeAndChargeSpline]: with the following parameters:\\
355SetChargeType(MExtractTimeAndChargeSpline::kIntegral); \\
356SetRange(0,18,2,14); \\
357and:
358
359\resume{enumerate}
360\item SetRiseTime(1.5); SetFallTime(4.5);
361\item SetRiseTime(0.5); SetFallTime(2.5);
362\item SetRiseTime(0.5); SetFallTime(1.5);
363\item SetRiseTime(0.5); SetFallTime(0.5);
364\suspend{enumerate}
365and:
366\resume{enumerate}
367\item SetChargeType(MExtractTimeAndChargeSpline::kAmplitude); \\
368SetRange(0,10,4,11); and:
369\suspend{enumerate}
370\item[MExtractTimeAndChargeDigitalFilter]: with the following parameters:
371\resume{enumerate}
372\item SetWeightsFile(``cosmic\_weights6.dat'');
373\item SetWeightsFile(``cosmic\_weights4.dat'');
374\item SetWeightsFile(``cosmic\_weights\_logain6.dat'');
375\item SetWeightsFile(``cosmic\_weights\_logain4.dat'');
376\item SetWeightsFile(``calibration\_weights\_UV6.dat'');
377\item SetWeightsFile(``calibration\_weights\_UV4.dat'');
378\item SetWeightsFile(``calibration\_weights\_UV\_logain6.dat'');
379\item SetWeightsFile(``calibration\_weights\_UV\_logain4.dat'');
380\suspend{enumerate}
381\item[``Real Fit'']: (not yet implemented, one try)
382\resume{enumerate}
383\item Real Fit
384\end{enumerate}
385\end{description}
386
387
388References: \cite{OF77,OF94}.
389
390
391%%% Local Variables:
392%%% mode: latex
393%%% TeX-master: "MAGIC_signal_reco"
394%%% TeX-master: "Algorithms"
395%%% End:
Note: See TracBrowser for help on using the repository browser.