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

Last change on this file since 5995 was 5993, checked in by gaug, 20 years ago
*** empty log message ***
File size: 41.5 KB
Line 
1\section{Signal Reconstruction Algorithms \label{sec:algorithms}}
2
3{\it Missing coding:
4\begin{itemize}
5\item Real fit to the expected pulse shape \ldots Hendrik, Wolfgang ???
6\end{itemize}
7}
8
9\subsection{Implementation of Signal Extractors in MARS}
10
11All signal extractor classes are stored in the MARS-directory {\textit{\bf msignal/}}.
12There, the base classes {\textit{\bf MExtractor}}, {\textit{\bf MExtractTime}}, {\textit{\bf MExtractTimeAndCharge}} and
13all individual extractors can be found. Figure~\ref{fig:extractorclasses} gives a sketch of the
14inheritances of each class and what each class calculates.
15
16\begin{figure}[htp]
17\includegraphics[width=0.99\linewidth]{ExtractorClasses.eps}
18\caption{Sketch of the inheritances of three examplary MARS signal extractor classes: MExtractFixedWindow, MExtractTimeFastSpline and MExtractTimeAndChargeDigitalFilter}
19\label{fig:extractorclasses}
20\end{figure}
21
22The following base classes for the extractor tasks are used:
23\begin{description}
24\item[MExtractor:\xspace] This class provides the basic data members equal for all extractors which are:
25 \begin{enumerate}
26 \item Global extraction ranges, parameterized by the variables
27 {\textit{\bf fHiGainFirst, fHiGainLast, fLoGainFirst, fLoGainLast}} and the function {\textit{\bf SetRange()}}.
28 The ranges always {\textit{\bf include}} the edge slices.
29 \item An internal variable {\textit{\bf fHiLoLast}} regulating the overlap of the desired high-gain
30 extraction range into the low-gain array.
31 \item The maximum possible FADC value, before the slice is declared as saturated, parameterized
32 by the variable {\textit{\bf fSaturationLimit}} (default:\,254).
33 \item The typical delay between high-gain and low-gain slices, expressed in FADC slices and parameterized
34 by the variable {\textit{\bf fOffsetLoGain}} (default:\,1.51)
35 \item Pointers to the used storage containers {\textit{\bf MRawEvtData, MRawRunHeader, MPedestalCam}}
36 and~{\textit{\bf MExtractedSignalCam}}, parameterized by the variables
37 {\textit{\bf fRawEvt, fRunHeader, fPedestals}} and~{\textit{\bf fSignals}}.
38 \item Names of the used storage containers to be searched for in the parameter list, parameterized
39 by the variables {\textit{\bf fNamePedestalCam}} and~{\textit{\bf fNameSignalCam}} (default: ``MPedestalCam''
40 and~''MExtractedSignalCam'').
41 \item The equivalent number of FADC samples, used for the calculation of the pedestal RMS and then the
42 number of photo-electrons with the F-Factor method (see eq.~\ref{eq:rmssubtraction} and
43 section~\ref{sec:photo-electrons}). This number is parameterized by the variables
44 {\textit{\bf fNumHiGainSamples}} and~{\textit{\bf fNumLoGainSamples}}.
45 \end{enumerate}
46
47 {\textit {\bf MExtractor}} is able to loop over all events, if the {\textit{\bf Process()}}-function is not overwritten.
48 It uses the following (virtual) functions, to be overwritten by the derived extractor class:
49
50 \begin{enumerate}
51 \item void {\textit {\bf FindSignalHiGain}}(Byte\_t* firstused, Byte\_t* logain, Float\_t\& sum, Byte\_t\& sat) const
52 \item void {\textit {\bf FindSignalLoGain}}(Byte\_t* firstused, Float\_t\& sum, Byte\_t\& sat) const
53 \end{enumerate}
54
55 where the pointers ``firstused'' point to the first used FADC slice declared by the extraction ranges,
56 the pointer ``logain'' points to the beginning of the ``low-gain'' FADC slices array (to be used for
57 pulses reaching into the low-gain array) and the variables ``sum'' and ``sat'' get filled with the
58 extracted signal and the number of saturating FADC slices, respectively.
59 \par
60 The pedestals get subtracted automatically {\textit {\bf after}} execution of these two functions.
61
62\item[MExtractTime:\xspace] This class provides - additionally to those already declared in {\textit{\bf MExtractor}} -
63 the basic data members equal for all time extractors which are:
64 \begin{enumerate}
65 \item Pointer to the used storage container {\textit{\bf MArrivalTimeCam}}
66 parameterized by the variables
67 {\textit{\bf fArrTime}}.
68 \item The name of the used ``MArrivalTimeCam''-container to be searched for in the parameter list,
69 parameterized by the variables {\textit{\bf fNameTimeCam}} (default: ``MArrivalTimeCam'' ).
70 \end{enumerate}
71
72 {\textit {\bf MExtractTime}} is able to loop over all events, if the {\textit{\bf Process()}}-function is not
73 overwritten.
74 It uses the following (virtual) functions, to be overwritten by the derived extractor class:
75
76 \begin{enumerate}
77 \item void {\textit {\bf FindTimeHiGain}}(Byte\_t* firstused, Float\_t\& time, Float\_t\& dtime, Byte\_t\& sat, const MPedestlPix \&ped) const
78 \item void {\textit {\bf FindTimeLoGain}}(Byte\_t* firstused, Float\_t\& time, Float\_t\& dtime, Byte\_t\& sat, const MPedestalPix \&ped) const
79 \end{enumerate}
80
81 where the pointers ``firstused'' point to the first used FADC slice declared by the extraction ranges,
82 and the variables ``time'', ``dtime'' and ``sat'' get filled with the
83 extracted arrival time, its error and the number of saturating FADC slices, respectively.
84 \par
85 The pedestals can be used for the arrival time extraction via the reference ``ped''.
86
87\item[MExtractTimeAndCharge:\xspace] This class provides - additionally to those already declared in
88 {\textit{\bf MExtractor}} and {\textit{\bf MExtractTime}} -
89 the basic data members equal for all time and charge extractors which are:
90 \begin{enumerate}
91 \item The actual extraction window sizes, parameterized by the variables
92 {\textit{\bf fWindowSizeHiGain}} and {\textit{\bf fWindowSizeLoGain}}.
93 \item The shift of the low-gain extraction range start w.r.t. to the found high-gain arrival
94 time, parameterized by the variable {\textit{\bf fLoGainStartShift}} (default: -2.8)
95 \end{enumerate}
96
97 {\textit {\bf MExtractTimeAndCharge}} is able to loop over all events, if the {\textit{\bf Process()}}-function is not
98 overwritten.
99 It uses the following (virtual) functions, to be overwritten by the derived extractor class:
100
101 \begin{enumerate}
102 \item void {\textit {\bf FindTimeAndChargeHiGain}}(Byte\_t* firstused, Byte\_t* logain, Float\_t\& sum, Float\_t\& dsum,
103 Float\_t\& time, Float\_t\& dtime, Byte\_t\& sat,
104 const MPedestlPix \&ped, const Bool\_t abflag) const
105 \item void {\textit {\bf FindTimeAndChargeLoGain}}(Byte\_t* firstused, Float\_t\& sum, Float\_t\& dsum,
106 Float\_t\& time, Float\_t\& dtime, Byte\_t\& sat,
107 const MPedestalPix \&ped, const Bool\_t abflag) const
108 \end{enumerate}
109
110 where the pointers ``firstused'' point to the first used FADC slice declared by the extraction ranges,
111 the pointer ``logain'' point to the beginning of the low-gain FADC slices array (to be used for
112 pulses reaching into the ``low-gain'' array),
113 the variables ``sum'', ``dsum'' get filled with the
114 extracted signal and its error. The variables ``time'', ``dtime'' and ``sat'' get filled with the
115 extracted arrival time, its error and the number of saturating FADC slices, respectively.
116 \par
117 The pedestals can be used for the extraction via the reference ``ped'', also the AB-flag is given
118 for AB-clock noise correction.
119\end{description}
120
121
122\subsection{Pure Signal Extractors}
123
124The pure signal extractors have in common that they reconstruct only the
125charge, but not the arrival time. All treated extractors here derive from the MARS-base
126class {\textit{\bf MExtractor}} which provides the following facilities:
127
128\begin{itemize}
129\item The global extraction limits can be set from outside
130\item FADC saturation is kept track of
131\end{itemize}
132
133The following adjustable parameters have to be set from outside:
134\begin{description}
135\item[Global extraction limits:\xspace] Limits in between which the extractor is allowed
136to extract the signal, for high gain and low gain, respectively.
137\end{description}
138
139As the pulses jitter by about one FADC slice,
140not every pulse lies exactly within the optimal limits, especially if one takes small
141extraction windows.
142Moreover, the readout position with respect to the trigger position has changed a couple
143of times during last year, therefore a very careful adjustment of the extraction limits
144is mandatory before using these extractors.
145
146\subsubsection{Fixed Window}
147
148This extractor is implemented in the MARS-class {\textit{\bf MExtractFixedWindow}}.
149It simply adds the FADC slice contents in the assigned ranges.
150As it does not correct for the clock-noise, only an even number of samples is allowed.
151Figure~\ref{fig:fixedwindowsketch} gives a sketch of the used extraction ranges for this
152paper and two typical calibration pulses.
153
154\begin{figure}[htp]
155 \includegraphics[width=0.49\linewidth]{MExtractFixedWindow_5Led_UV.eps}
156 \includegraphics[width=0.49\linewidth]{MExtractFixedWindow_23Led_Blue.eps}
157\caption[Sketch extraction ranges MExtractFixedWindow]{%
158Sketch of the extraction ranges for the extractor {\textit{\bf MExtractFixedWindow}}
159for two typical calibration pulses (pedestals have been subtracted) and a typical inner pixel.
160The pulse would be shifted half a slice to the right for an outer pixel. }
161\label{fig:fixedwindowsketch}
162\end{figure}
163
164
165\subsubsection{Fixed Window with Integrated Cubic Spline}
166
167This extractor is implemented in the MARS-class {\textit{\bf MExtractFixedWindowSpline}}. It
168uses a cubic spline algorithm, adapted from \cite{NUMREC} and integrates the
169spline interpolated FADC slice values from a fixed extraction range. The edge slices are counted as half.
170As it does not correct for the clock-noise, only an odd number of samples is allowed.
171Figure~\ref{fig:fixedwindowsplinesketch} gives a sketch of the used extraction ranges for this
172paper and two typical calibration pulses.
173
174\begin{figure}[htp]
175 \includegraphics[width=0.49\linewidth]{MExtractFixedWindowSpline_5Led_UV.eps}
176 \includegraphics[width=0.49\linewidth]{MExtractFixedWindowSpline_23Led_Blue.eps}
177\caption[Sketch extraction ranges MExtractFixedWindowSpline]{%
178Sketch of the extraction ranges for the extractor {\textit{\bf MExtractFixedWindowSpline}}
179for two typical calibration pulses (pedestals have been subtracted) and a typical inner pixel.
180The pulse would be shifted half a slice to the right for an outer pixel. }
181\label{fig:fixedwindowsplinesketch}
182\end{figure}
183
184\subsubsection{Fixed Window with Global Peak Search}
185
186This extractor is implemented in the MARS-class {\textit{\bf MExtractFixedWindowPeakSearch}}.
187The basic idea of this extractor is to correct for coherent movements in arrival time for all pixels,
188as e.g. caused by the trigger jitter.
189In a first loop, it fixes a reference point defined as the highest sum of
190consecutive non-saturating FADC slices in a (smaller) peak-search window.
191\par
192In a second loop over the pixels,
193it adds the FADC contents starting from a pre-defined offset from the obtained peak-search window
194over an extraction window of a pre-defined window size.
195It loops twice over all pixels in every event, because it has to find the reference point, first.
196As it does not correct for the clock-noise, only an even number of samples is allowed.
197For a high intensity calibration run causing high-gain saturation in the whole camera, this
198extractor apparently fails since only dead pixels which cannot produced a saturated signal, are taken into account
199in the peak search. For this special case, we modified {\textit{\bf MExtractFixedWindowPeakSearch}}
200such to define the peak search window as the one starting from the mean position of the first saturating slice.
201\par
202The following adjustable parameters have to be set from outside:
203\begin{description}
204\item[Peak Search Window:\xspace] Defines the ``sliding window'' size within which the peaking sum is
205searched for (default: 4 slices)
206\item[Offset from Window:\xspace] Defines the offset of the start of the extraction window w.r.t. the
207starting point of the obtained peak search window (default: 1 slice)
208\item[Low-Gain Peak shift:\xspace] Defines the shift in the low-gain with respect to the peak found
209in the high-gain (default: 1 slice)
210\end{description}
211
212Figure~\ref{fig:fixedwindowpeaksearchsketch} gives a sketch of the possible peak-search and extraction
213window positions in two typical calibration pulses.
214
215\begin{figure}[htp]
216 \includegraphics[width=0.49\linewidth]{MExtractFixedWindowPeakSearch_5Led_UV.eps}
217 \includegraphics[width=0.49\linewidth]{MExtractFixedWindowPeakSearch_23Led_Blue.eps}
218\caption[Sketch extraction ranges MExtractFixedWindowPeakSearch]{%
219Sketch of the extraction ranges for the extractor {\textit{\bf MExtractFixedWindowPeakSearch}}
220for two typical calibration pulses (pedestals have been subtracted) and a typical inner pixel.
221The pulse would be shifted half a slice to the right for an outer pixel. }
222\label{fig:fixedwindowpeaksearchsketch}
223\end{figure}
224
225\subsection{Combined Extractors}
226
227The combined extractors have in common that they reconstruct the arrival time and
228the charge at the same time and for the same pulse.
229All treated combined extractors here derive from the MARS-base
230class {\textit{\bf MExtractTimeAndCharge}} which itself derives from MExtractor and MExtractTime.
231It provides the following facilities:
232
233\begin{itemize}
234\item Only one loop over all pixels is performed.
235\item The individual FADC slice values get the clock-noise-corrected pedestals immediately subtracted.
236\item The low-gain extraction range is adapted dynamically, based on the computed arrival time
237 from the high-gain samples.
238\item Extracted times from the low-gain samples get corrected for the intrinsic time delay of the low-gain
239 pulse.
240\item The global extraction limits can be set from outside.
241\item FADC saturation is kept track of.
242\end{itemize}
243
244The following adjustable parameters have to be set from outside, additionally to those declared in the
245base classes MExtractor and MExtractTime:
246
247\begin{description}
248\item[Global extraction limits:\xspace] Limits in between which the extractor is allowed
249to search. They are fixed by the extractor for the high-gain, but re-adjusted for
250every event in the low-gain, depending on the arrival time found in the low-gain.
251However, the dynamically adjusted window is not allowed to pass beyond the global
252limits.
253\item[Low-gain start shift:\xspace] Global shift between the computed high-gain arrival
254time and the start of the low-gain extraction limit (corrected for the intrinsic time offset).
255This variable tells where the extractor is allowed to start searching for the low-gain signal
256if the high-gain arrival time is known. It avoids that the extractor gets confused by possible high-gain
257signals leaking into the ``low-gain'' region (default: -2.8).
258\end{description}
259
260\subsubsection{Sliding Window with Amplitude-Weighted Time}
261
262This extractor is implemented in the MARS-class {\textit{\bf MExtractTimeAndChargeSlidingWindow}}.
263It extracts the signal from a sliding window of an adjustable size, for high-gain and low-gain
264individually (default: 6 and 6). The signal is the one which maximizes the summed
265(clock-noise and pedestal-corrected) consecutive FADC slice contents.
266\par
267The amplitude-weighted arrival time is calculated from the window with
268the highest FADC slice contents integral using the following formula:
269
270\begin{equation}
271 t = \frac{\sum_{i=i_0}^{i_0+ws} s_i \cdot i}{\sum_{i=i_0}^{i_0t+ws} i}
272\end{equation}
273where $i$ denotes the FADC slice index, starting from $i_0$
274window and running over a window of size $ws$. $s_i$ the clock-noise and
275pedestal-corrected FADC slice contents at slice position $i$.
276\par
277The following adjustable parameters have to be set from outside:
278\begin{description}
279\item[Window sizes:\xspace] Independently for high-gain and low-gain (default: 6,6)
280\end{description}
281
282\begin{figure}[htp]
283 \includegraphics[width=0.49\linewidth]{MExtractTimeAndChargeSlidingWindow_5Led_UV.eps}
284 \includegraphics[width=0.49\linewidth]{MExtractTimeAndChargeSlidingWindow_23Led_Blue.eps}
285\caption[Sketch calculated arrival times MExtractTimeAndChargeSlidingWindow]{%
286Sketch of the calculated arrival times for the extractor {\textit{\bf MExtractTimeAndChargeSlidingWindow}}
287for two typical calibration pulses (pedestals have been subtracted) and a typical inner pixel.
288The extraction window sizes modify the position of the (amplitude-weighted) mean FADC-slices slightly.
289The pulse would be shifted half a slice to the right for an outer pixel. }
290\label{fig:slidingwindowsketch}
291\end{figure}
292
293\subsubsection{Cubic Spline with Sliding Window or Amplitude Extraction}
294
295This extractor is implemented in the MARS-class {\textit{\bf MExtractTimeAndChargeSpline}}.
296It interpolates the FADC contents using a cubic spline algorithm, adapted from \cite{NUMREC}.
297In a second step, it searches for the position of the spline maximum. From then on, two
298possibilities are offered:
299
300\begin{enumerate}
301\item[Extraction Type Amplitude:\xspace] The amplitude of the spline maximum is taken as charge signal
302and the (precisee) position of the maximum is returned as arrival time. This type is faster, since it
303performs not spline intergraion .
304\item[Extraction Type Integral:\xspace] The integrated spline between maximum position minus
305rise time (default: 1.5 slices) and maximum position plus fall time (default: 4.5 slices)
306is taken as charge signal and the position of the half maximum left from the position of the maximum
307is returned as arrival time (default).
308The low-gain signal stretches the rise and fall time by a stretch factor (default: 1.5). This type
309is slower, but yields more precise results (see section~\ref{sec:performance}) .
310The charge integration resolution is set to 0.1 FADC slices.
311\end{enumerate}
312
313The following adjustable parameters have to be set from outside:
314
315\begin{description}
316\item[Charge Extraction Type:\xspace] The amplitude of the spline maximum can be chosen while the position
317of the maximum is returned as arrival time. This type is fast. \\
318Otherwise, the integrated spline between maximum position minus rise time (default: 1.5 slices)
319and maximum position plus fall time (default: 4.5 slices) is taken as signal and the position of the
320half maximum is returned as arrival time (default).
321The low-gain signal stretches the rise and fall time by a stretch factor (default: 1.5). This type
322is slower, but more precise. The charge integration resolution is 0.1 FADC slices.
323\item[Rise Time and Fall Time:\xspace] Can be adjusted for the integration charge extraction type.
324\item[Resolution:\xspace] Defined as the maximum allowed difference between the calculated half maximum value and
325the computed spline value at the arrival time position. Can be adjusted for the half-maximum time extraction
326type.
327\item[Low Gain Stretch:\xspace] Can be adjusted to account for the larger rise and fall times in the
328low-gain as compared to the high gain pulses (default: 1.5)
329\end{description}
330
331\begin{figure}[htp]
332 \includegraphics[width=0.49\linewidth]{MExtractTimeAndChargeSpline_5Led_UV.eps}
333 \includegraphics[width=0.49\linewidth]{MExtractTimeAndChargeSpline_23Led_Blue.eps}
334\caption[Sketch calculated arrival times MExtractTimeAndChargeSpline]{%
335Sketch of the calculated arrival times for the extractor {\textit{\bf MExtractTimeAndChargeSpline}}
336for two typical calibration pulses (pedestals have been subtracted) and a typical inner pixel.
337The extraction window sizes modify the position of the (amplitude-weighted) mean FADC-slices slightly.
338The pulse would be shifted half a slice to the right for an outer pixel. }
339\label{fig:splinesketch}
340\end{figure}
341
342\subsubsection{Digital Filter}
343
344This extractor is implemented in the MARS-class {\textit{\bf MExtractTimeAndChargeDigitalFilter}}.
345
346
347The 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
348from discrete measurements of the signal. Thereby, the noise contribution to the amplitude reconstruction is minimized.
349
350For the digital filtering method, three assumptions have to be made:
351
352\begin{itemize}
353\item{The normalized signal shape has to be independent of the signal amplitude.}
354\item{The noise properties have to be independent of the signal amplitude.}
355\item{The noise auto-correlation matrix does not change its form significantly with time.}
356\end{itemize}
357
358\par
359\ldots {\textit{\bf IS THIS TRUE FOR MAGIC???? }} \ldots
360\par
361
362Let $g(t)$ be the normalized signal shape, $E$ the signal amplitude and $\tau$ the time shift
363of the physical signal from the predicted signal shape. Then the time dependence of the signal, $y(t)$, is given by:
364
365\begin{equation}
366y(t)=E \cdot g(t-\tau) + b(t) \ ,
367\end{equation}
368
369where $b(t)$ is the time-dependent noise contribution. For small time shifts $\tau$ (usually smaller than
370one FADC slice width),
371the time dependence can be linearized by the use of a Taylor expansion:
372
373\begin{equation} \label{shape_taylor_approx}
374y(t)=E \cdot g(t) - E\tau \cdot \dot{g}(t) + b(t) \ ,
375\end{equation}
376
377where $\dot{g}(t)$ is the time derivative of the signal shape. Discrete
378measurements $y_i$ of the signal at times $t_i \ (i=1,...,n)$ have the form:
379
380\begin{equation}
381y_i=E \cdot g_i- E\tau \cdot \dot{g}_i +b_i \ .
382\end{equation}
383
384The correlation of the noise contributions at times $t_i$ and $t_j$ can be expressed in the
385noise autocorrelation matrix $\boldsymbol{B}$:
386
387\begin{equation}
388B_{ij} = \langle b_i b_j \rangle - \langle b_i \rangle \langle b_j
389\rangle \ .
390\label{eq:autocorr}
391\end{equation}
392%\equiv \langle b_i b_j \rangle with $\langle b_i \rangle = 0$.
393
394The signal amplitude $E$, and the product of amplitude and time shift $E \tau$, can be estimated from the given set of
395measurements $\boldsymbol{y} = (y_1, ... ,y_n)$ by minimizing the excess noise contribution with respect to the known noise
396auto-correlation:
397
398\begin{eqnarray}
399\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}_j) \\
400&=& (\boldsymbol{y} - E
401\boldsymbol{g} - E\tau \dot{\boldsymbol{g}})^T \boldsymbol{B}^{-1} (\boldsymbol{y} - E \boldsymbol{g}- E\tau \dot{\boldsymbol{g}}) \ ,
402\end{eqnarray}
403
404where the last expression is matricial. $\chi^2$ is a continuous function of $\tau$ and will have to be discretized itself for a
405desired resolution. $\chi^2$ is also proportional to the auto noise-correlation matrix where increases in the noise level lead to
406a multiplicative factor for all matrix elements and thus do not affect the position of the maximum of $\chi^2$.
407The minimum of $\chi^2$ is obtained for:
408
409\begin{equation}
410\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 \ .
411\end{equation}
412
413
414Taking into account that $\boldsymbol{B}$ is a symmetric matrix, this leads to the following
415two equations for the estimated amplitude $\overline{E}$ and the estimation for the product of amplitude
416and time offset $\overline{E\tau}$:
417
418\begin{eqnarray}
4190&=&-\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}
420\\
4210&=&-\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} \ .
422\end{eqnarray}
423
424Solving these equations one gets the following solutions:
425
426\begin{equation}
427\overline{E}(\tau) = \boldsymbol{w}_{\text{amp}}^T (\tau)\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 } \ ,
428\end{equation}
429
430\begin{equation}
431\overline{E\tau}(\tau)= \boldsymbol{w}_{\text{time}}^T(\tau) \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 } \ .
432\end{equation}
433
434
435Thus $\overline{E}$ and $\overline{E\tau}$ are given by a weighted sum of the discrete measurements $y_i$
436with the digital filtering weights for the amplitude, $w_{\text{amp}}(\tau)$, and time shift, $w_{\text{time}}(\tau)$
437where the time dependency gets discretized once again leading to a set of weights samples depending on the
438discretized time $\tau$.
439
440\par
441\ldots {\textit{\bf IS THIS CORRECT LIKE THIS???}} \ldots
442\par
443
444Note the remaining time dependence of the two weights which follow from the dependency of $\boldsymbol{g}$ and
445$\dot{\boldsymbol{g}}$ on the position of the pulse with respect to the FADC bin positions.
446\par
447Because of the truncation of the Taylor series in equation (\ref{shape_taylor_approx}) the above results are
448only valid for vanishing time offsets $\tau$. For non-zero time offsets one has to iterate the problem using
449the time shifted signal shape $g(t-\tau)$.
450
451The covariance matrix $\boldsymbol{V}$ of $\overline{E}$ and $\overline{E\tau}$ is given by:
452
453\begin{equation}
454\left(\boldsymbol{V}^{-1}\right)_{i,j}=\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\} \ .
455\end{equation}
456
457The expected contribution of the noise to the estimated amplitude, $\sigma_E$, is:
458
459\begin{equation}\label{of_noise}
460\sigma_E^2=\boldsymbol{V}_{E,E}=\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} \ .
461\end{equation}
462
463The expected contribution of the noise to the estimated timing, $\sigma_{\tau}$, is:
464
465\begin{equation}\label{of_noise_time}
466E^2 \cdot \sigma_{\tau}^2=\boldsymbol{V}_{E\tau,E\tau}=\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} \ .
467\end{equation}
468
469For 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
470reconstructed signal and time of:
471
472\begin{equation}\label{of_noise}
473\sigma_E \approx 8.3 \ \mathrm{FADC\ counts} \qquad \sigma_{\tau} \approx \frac{6.5\ \Delta T_{\mathrm{FADC}}}{(E\ /\ \mathrm{FADC\ counts})} \ ,
474\end{equation}
475
476\par
477\ldots {\textit{\bf CALCULATE THESE NUMBERS FOR 6 SLICES! }} \ldots
478\par
479
480where $\Delta T_{\mathrm{FADC}} = 3.33$ ns is the sampling interval of the MAGIC FADCs.
481
482
483For an IACT there are two types of background noise. On the one hand, there is the constantly present electronics noise,
484on the other hand, the light of the night sky introduces a sizeable background noise to the measurement of Cherenkov photons from air showers.
485
486The electronics noise is largely white, uncorrelated in time. The noise from the night sky background photons is the superposition of the
487detector response to single photo electrons following a Poisson distribution in time. Figure \ref{fig:noise_autocorr_AB_36038_TDAS} shows the noise
488autocorrelation matrix for an open camera. The large noise autocorrelation in time of the current FADC system is due to the pulse shaping with a
489shaping constant of 6 ns.
490
491In general, the amplitude and time weights, $\boldsymbol{w}_{\text{amp}}$ and $\boldsymbol{w}_{\text{time}}$, depend on the pulse shape, the
492derivative of the pulse shape and the noise autocorrelation. In the high gain samples the correlated night sky background noise dominates over
493the white electronics noise. Thus different noise levels just cause the noise autocorrelation matrix $\boldsymbol{B}$ to change by a same factor,
494which cancels out in the weights calculation. Thus in the high gain the weights are to a very good approximation independent of the night
495sky background noise level.
496
497Contrary to that in the low gain samples ... .
498\ldots
499\ldots {\textit{\bf SITUATION FOR LOW-GAIN SAMPLES! }} \ldots
500\par
501
502
503
504\begin{figure}[h!]
505\begin{center}
506\includegraphics[totalheight=7cm]{noise_autocorr_AB_36038_TDAS.eps}
507\end{center}
508\caption[Noise autocorrelation.]{Noise autocorrelation matrix for open camera including the noise due to night sky background fluctuations.} \label{fig:noise_autocorr_AB_36038_TDAS}
509\end{figure}
510
511
512
513Using the average reconstructed pulpo pulse shape, as shown in figure \ref{fig:pulpo_shape_low}, and the
514reconstructed noise autocorrelation matrix from a pedestal run
515
516\par
517\ldots {\textit{\bf WHICH RUN (RUN NUMBER, WHICH NSB?, WHICH PIXELS ??}} \ldots
518\par
519
520with random triggers, the digital filter
521weights are computed. Figures \ref{fig:w_time_MC_input_TDAS} and \ref{fig:w_amp_MC_input_TDAS} show the
522parameterization of the amplitude and timing weights for the MC pulse shape as a function of the ...
523
524\par
525\ldots {\textit{\bf MISSING END OF SENTENCE }} \ldots
526\par
527
528\begin{figure}[h!]
529\begin{center}
530\includegraphics[totalheight=7cm]{w_time_MC_input_TDAS.eps}
531\end{center}
532\caption[Time weights.]{Time weights $w_{\mathrm{time}}(t_0) \ldots w_{\mathrm{time}}(t_5)$ for a window size of 6 FADC slices for the pulse shape
533used in the MC simulations. The first weight $w_{\mathrm{time}}(t_0)$ is plotted as a function of the relative time $t_{\text{rel}}$ the trigger and the
534FADC clock in the range $[-0.5,0.5[ \ T_{\text{ADC}}$, the second weight in the range $[0.5,1.5[ \ T_{\text{ADC}}$ and so on. A binning resolution
535of $0.1 T_{\text{ADC}}$ has been chosen.} \label{fig:w_time_MC_input_TDAS}
536\end{figure}
537
538\begin{figure}[h!]
539\begin{center}
540\includegraphics[totalheight=7cm]{w_amp_MC_input_TDAS.eps}
541\end{center}
542\caption[Amplitude weights.]{Amplitude weights $w_{\mathrm{amp}}(t_0) \ldots w_{\mathrm{amp}}(t_5)$ for a window size of 6 FADC slices for the
543pulse shape used in the MC simulations. The first weight $w_{\mathrm{amp}}(t_0)$ is plotted as a function of the relative time $t_{\text{rel}}$
544the trigger and the FADC clock in the range $[-0.5,0.5[ \ T_{\text{ADC}}$, the second weight in the range $[0.5,1.5[ \ T_{\text{ADC}}$ and so on.
545A binning resolution of $0.1\, T_{\text{ADC}}$ has been chosen.} \label{fig:w_amp_MC_input_TDAS}
546\end{figure}
547
548
549
550In 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 using a window of $n$ slices:
551
552\begin{equation}
553e_{i_0}=\sum_{i=i_0}^{i_0+n-1} w_{\mathrm{amp}}(t_i)y(t_{i+i_0}) \qquad (e\tau)_{i_0}=\sum_{i=i_0}^{i_0+n-1} w_{\mathrm{time}}(t_i)y(t_{i+i_0})
554\end{equation}
555
556for all possible signal start slices $i_0$. Let $i_0^*$ be the signal start slice with the largest $e_{i_0}$. Then in a second step the timing offset $\tau$ is calculated:
557
558\begin{equation}
559\tau=\frac{(e\tau)_{i_0^*}}{e_{i_0^*}}
560\end{equation}
561
562and the weights iterated:
563
564\begin{equation}
565E=\sum_{i=i_0^*}^{i_0^*+n-1} w_{\mathrm{amp}}(t_i - \tau)y(t_{i+i_0^*}) \qquad E \theta=\sum_{i=i_0^*}^{i_0^*+n-1} w_{\mathrm{time}}(t_i - \tau)y(t_{i+i_0^*}) \ .
566\end{equation}
567
568The reconstructed signal is then taken to be $E$ and the reconstructed arrival time $t_{\text{arrival}}$ is
569
570\begin{equation}
571t_{\text{arrival}} = i_0^* + \tau + \theta \ .
572\end{equation}
573
574
575
576% This does not apply for MAGIC as the LONs are giving always a correlated noise (in addition to the artificial shaping)
577
578%In the case of an uncorrelated noise with zero mean the noise autocorrelation matrix is:
579
580%\begin{equation}
581%\boldsymbol{B}_{ij}= \langle b_i b_j \rangle \delta_{ij} = \sigma^2(b_i) \ ,
582%\end{equation}
583
584%where $\sigma(b_i)$ is the standard deviation of the noise of the discrete measurements. Equation (\ref{of_noise}) than becomes:
585
586
587%\begin{equation}
588%\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}} \ .
589%\end{equation}
590
591
592\begin{figure}[h!]
593\begin{center}
594\includegraphics[totalheight=7cm]{amp_sliding.eps}
595\includegraphics[totalheight=7cm]{time_sliding.eps}
596\end{center}
597\caption[Digital filter weights applied.]{Digital filter weights applied to the recorded FADC time slices of
598one calibration pulse. The left plot shows the result of the applied amplitude weights
599$e(t_0)=\sum_{i=0}^{i=n-1} w_{\mathrm{amp}}(t_0+i \cdot T_{\text{ADC}})y(t_0+i \cdot T_{\text{ADC}})$ and
600the right plot shows the result of the applied timing weights
601$e\tau(t_0)=\sum_{i=0}^{i=n-1} w_{\mathrm{time}}(t_0+i \cdot T_{\text{ADC}})y(t_0+i \cdot T_{\text{ADC}})$ .}
602\label{fig:amp_sliding}
603\end{figure}
604
605
606\ldots
607\textit {\bf FIGURE~\ref{fig:shape_fit_TDAS} shows what???}
608\ldots
609
610Figure \ref{fig:shape_fit_TDAS} shows the FADC slices of a single MC event together with the result of a full
611fit of the input MC pulse shape to the simulated FADC samples together with the result of the numerical fit
612using the digital filter.
613
614
615\begin{figure}[h!]
616\begin{center}
617\includegraphics[totalheight=7cm]{shape_fit_TDAS.eps}
618\end{center}
619\caption[Shape fit.]{Full fit to the MC pulse shape with the MC input shape and a numerical fit using the
620digital filter.} \label{fig:shape_fit_TDAS}
621\end{figure}
622
623
624\ldots {\it Hendrik ... }
625
626The following free adjustable parameters have to be set from outside:
627
628\begin{description}
629\item[Weights File:\xspace] An ascii-file containing the weights, the binning resolution and
630the window size. Currently, the following weight files have been created:
631\begin{itemize}
632\item "cosmics\_weights.dat'' with a window size of 6 FADC slices
633\item "cosmics\_weights4.dat'' with a window size of 4 FADC slices
634\item "calibration\_weights\_blue.dat'' with a window size of 6 FADC slices
635\item "calibration\_weights4\_blue.dat'' with a window size of 4 FADC slices
636\item "calibration\_weights\_UV.dat'' with a window size of 6 FADC slices and in the low-gain the
637calibration weigths obtained from blue pulses\footnote{UV-pulses saturating the high-gain are not yet
638available.}.
639\item "calibration\_weights4\_UV.dat'' with a window size of 4 FADC slices and in the low-gain the
640calibration weigths obtained from blue pulses\footnote{UV-pulses saturating the high-gain are not yet
641available.}.
642\item "cosmics\_weights\_logaintest.dat'' with a window size of 6 FADC slices and swapped high-gain and low-gain
643weights. This file is only used for stability tests.
644\item "cosmics\_weights4\_logaintest.dat'' with a window size of 4 FADC slices and swapped high-gain and low-gain
645weights. This file is only used for stability tests.
646\item "calibration\_weights\_UV\_logaintest.dat'' with a window size of 6 FADC slices and swapped high-gain and low-gain
647weights. This file is only used for stability tests.
648\item "calibration\_weights4\_UV\_logaintest.dat'' with a window size of 4 FADC slices and swapped high-gain and low-gain
649weights. This file is only used for stability tests.
650\item "calibration\_weights\_blue\_logaintest.dat'' with a window size of 6 FADC slices and swapped high-gain and low-gain
651weights. This file is only used for stability tests.
652\item "calibration\_weights4\_blue\_logaintest.dat'' with a window size of 4 FADC slices and swapped high-gain and low-gain
653weights. This file is only used for stability tests.
654\end{itemize}
655\end{description}
656
657\begin{figure}[htp]
658 \includegraphics[width=0.49\linewidth]{MExtractTimeAndChargeDigitalFilter_5Led_UV.eps}
659 \includegraphics[width=0.49\linewidth]{MExtractTimeAndChargeDigitalFilter_23Led_Blue.eps}
660\caption[Sketch calculated arrival times MExtractTimeAndChargeDigitalFilter]{%
661Sketch of the calculated arrival times for the extractor {\textit{MExtractTimeAndChargeDigitalFilter}}
662for two typical calibration pulses (pedestals have been subtracted) and a typical inner pixel.
663The extraction window sizes modify the position of the (amplitude-weighted) mean FADC-slices slightly.
664The pulse would be shifted half a slice to the right for an outer pixels. }
665\label{fig:dfsketch}
666\end{figure}
667
668\subsubsection{Real Fit to the Expected Pulse Shape }
669
670This extractor is not yet implemented as MARS-class...
671\par
672It fits the pulse shape to a Landau convoluted with a Gaussian using the following
673parameters:...
674
675\ldots {\it Hendrik, Wolfgang ... }
676
677\begin{figure}[h!]
678\begin{center}
679\includegraphics[totalheight=7cm]{probability_fit_0ns.eps}
680\end{center}
681\caption[Fit Probability.]{Probability of the fit with the input signal shape to the simulated FADC samples
682including electronics and NSB noise.} \label{fig:w_amp_MC_input_TDAS.eps}
683\end{figure}
684
685
686
687\subsection{Used Extractors for this Analysis}
688
689We tested in this TDAS the following parameterized extractors:
690
691\begin{description}
692\item[MExtractFixedWindow]: with the following intialization, if {\textit{maxbin}} defines the
693 mean position of the high-gain FADC slice which carries the pulse maximum \footnote{The function
694{\textit{MExtractor::SetRange(higain first, higain last, logain first, logain last)}} sets the extraction
695range with the high gain start bin {\textit{higain first}} to (including) the last bin {\textit{higain last}}.
696Analoguously for the low gain extraction range. Note that in MARS, the low-gain FADC samples start with
697the index 0 again, thus {\textit{maxbin+0.5}} means in reality {\textit{maxbin+15+0.5}}. }
698:
699\begin{enumerate}
700\item SetRange({\textit{maxbin}}-1,{\textit{maxbin}}+2,{\textit{maxbin}}+0.5,{\textit{maxbin}}+3.5);
701\item SetRange({\textit{maxbin}}-1,{\textit{maxbin}}+2,{\textit{maxbin}}-0.5,{\textit{maxbin}}+4.5);
702\item SetRange({\textit{maxbin}}-2,{\textit{maxbin}}+3,{\textit{maxbin}}-0.5,{\textit{maxbin}}+4.5);
703\item SetRange({\textit{maxbin}}-2,{\textit{maxbin}}+5,{\textit{maxbin}}-0.5,{\textit{maxbin}}+6.5);
704\item SetRange({\textit{maxbin}}-3,{\textit{maxbin}}+10,{\textit{maxbin}}-1.5,{\textit{maxbin}}+7.5);
705\suspend{enumerate}
706\item[MExtractFixedWindowSpline]: with the following initialization, if {\textit{maxbin}} defines the
707 mean position of the high-gain FADC slice carrying the pulse maximum \footnote{The function
708{\textit{MExtractor::SetRange(higain first, higain last, logain first, logain last)}} sets the extraction
709range with the high gain start bin {\textit{higain first}} to (including) the last bin {\textit{higain last}}.
710Analoguously for the low gain extraction range. Note that in MARS, the low-gain FADC samples start with
711the index 0 again, thus {\textit{maxbin+0.5}} means in reality {\textit{maxbin+15+0.5}}.}:
712\resume{enumerate}
713\item SetRange({\textit{maxbin}}-1,{\textit{maxbin}}+3,{\textit{maxbin}}+0.5,{\textit{maxbin}}+4.5);
714\item SetRange({\textit{maxbin}}-1,{\textit{maxbin}}+3,{\textit{maxbin}}-0.5,{\textit{maxbin}}+5.5);
715\item SetRange({\textit{maxbin}}-2,{\textit{maxbin}}+4,{\textit{maxbin}}-0.5,{\textit{maxbin}}+5.5);
716\item SetRange({\textit{maxbin}}-2,{\textit{maxbin}}+6,{\textit{maxbin}}-0.5,{\textit{maxbin}}+7.5);
717\item SetRange({\textit{maxbin}}-3,{\textit{maxbin}}+11,{\textit{maxbin}}-1.5,{\textit{maxbin}}+8.5);
718\suspend{enumerate}
719\item[MExtractFixedWindowPeakSearch]: with the following initialization: \\
720SetRange(0,18,2,14); and:
721\resume{enumerate}
722\item SetWindows(2,2,2); SetOffsetFromWindow(0);
723\item SetWindows(4,4,2); SetOffsetFromWindow(1);
724\item SetWindows(4,6,4); SetOffsetFromWindow(0);
725\item SetWindows(6,6,4); SetOffsetFromWindow(1);
726\item SetWindows(8,8,4); SetOffsetFromWindow(1);
727\item SetWindows(14,10,4); SetOffsetFromWindow(2);
728\suspend{enumerate}
729\item[MExtractTimeAndChargeSlidingWindow]: with the following initialization: \\
730SetRange(0,18,2,14); and:
731\resume{enumerate}
732\item SetWindowSize(2,2);
733\item SetWindowSize(4,4);
734\item SetWindowSize(4,6);
735\item SetWindowSize(6,6);
736\item SetWindowSize(8,8);
737\item SetWindowSize(14,10);
738\suspend{enumerate}
739\item[MExtractTimeAndChargeSpline]: with the following initialization:
740\resume{enumerate}
741\item SetChargeType(MExtractTimeAndChargeSpline::kAmplitude); \\
742SetRange(0,10,4,11);
743\suspend{enumerate}
744SetChargeType(MExtractTimeAndChargeSpline::kIntegral); \\
745SetRange(0,18,2,14); \\
746and:
747\resume{enumerate}
748\item SetRiseTime(0.5); SetFallTime(0.5);
749\item SetRiseTime(0.5); SetFallTime(1.5);
750\item SetRiseTime(1.0); SetFallTime(3.0);
751\item SetRiseTime(1.5); SetFallTime(4.5);
752\suspend{enumerate}
753\item[MExtractTimeAndChargeDigitalFilter]: with the following initialization:
754\resume{enumerate}
755\item SetWeightsFile(``cosmics\_weights.dat'');
756\item SetWeightsFile(``cosmics\_weights4.dat'');
757\item SetWeightsFile(``calibration\_weights\_UV.dat'');
758\item SetWeightsFile(``calibration\_weights4\_UV.dat'');
759\item SetWeightsFile(``calibration\_weights\_blue.dat'');
760\item SetWeightsFile(``calibration\_weights4\_blue.dat'');
761\item SetWeightsFile(``cosmic\_weights\_logain6.dat'');
762\item SetWeightsFile(``cosmic\_weights\_logain4.dat'');
763\item SetWeightsFile(``calibration\_weights\_UV\_logaintest.dat'');
764\item SetWeightsFile(``calibration\_weights4\_UV\_logaintest.dat'');
765\item SetWeightsFile(``calibration\_weights\_blue\_logaintest.dat'');
766\item SetWeightsFile(``calibration\_weights4\_blue\_logaintest.dat'');
767\suspend{enumerate}
768\item[``Real Fit'']: (not yet implemented, one try)
769\resume{enumerate}
770\item Real Fit
771\end{enumerate}
772\end{description}
773
774Note that the extractors \#34 through \#39 are used only to test the stability of the extraction against
775changes in the pulse-shape.
776
777References: \cite{OF77,OF94}.
778
779
780%%% Local Variables:
781%%% mode: latex
782%%% TeX-master: "MAGIC_signal_reco"
783%%% TeX-master: "MAGIC_signal_reco"
784%%% TeX-master: "MAGIC_signal_reco"
785%%% TeX-master: "MAGIC_signal_reco"
786%%% TeX-master: "MAGIC_signal_reco"
787%%% TeX-master: "MAGIC_signal_reco"
788%%% TeX-master: "MAGIC_signal_reco"
789%%% TeX-master: "MAGIC_signal_reco"
790%%% TeX-master: "MAGIC_signal_reco"
791%%% TeX-master: "MAGIC_signal_reco"
792%%% End:
Note: See TracBrowser for help on using the repository browser.