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

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