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

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