Index: trunk/MagicSoft/TDAS-Extractor/Pedestal.tex
===================================================================
--- trunk/MagicSoft/TDAS-Extractor/Pedestal.tex	(revision 5370)
+++ trunk/MagicSoft/TDAS-Extractor/Pedestal.tex	(revision 5536)
@@ -4,22 +4,20 @@
 \begin{itemize}
 \item Defining the pedestal RMS as contribution
-to the extracted signal fluctuations (later used in the calibration) 
+    to the extracted signal fluctuations (later used in the calibration) 
 \item Defining the Pedestal Mean and RMS as the result of distributions obtained by 
-applying the extractor to pedestal runs (yielding biases and modified widths).
+    applying the extractor to pedestal runs (yielding biases and modified widths).
 \item Deriving the correct probability for background fluctuations based on the extracted signal height. 
   ( including biases and modified widths).
 \end{itemize}
-\ldots Florian + ??? 
-\newline
-\newline
 }
 
-\subsection{Copy of email by W. Wittek from 25 Oct 2004 and 10 Nov 2004}
+\subsection{Pedestal RMS}
 
 
-\subsubsection{Pedestal RMS}
+\vspace{1cm}
+\ldots {\it  Modified email by W. Wittek from 25 Oct 2004 and 10 Nov 2004}
+\vspace{1cm}
 
-We all know how it is defined. It can be completely
-described by the matrix
+The Pedestal RMS can be completely described by the matrix
 
 \begin{equation}
@@ -27,18 +25,18 @@
 \end{equation}
 
-where $i$ and $j$ denote the $i^{th}$ and $j^{th}$ FADC slice, 
+where $i$ and $j$ denote the $i^{th}$ and $j^{th}$ FADC slice and 
 $P_i$ is the pedestal
-value in slice $i$ for an event and the average $<>$ is over many events.
+value in slice $i$ for an event and the average $<>$ is over many events (usually 1000).
 \par
 
-By definition, the pedestal RMS is independent of the signal extractor.
-Therefore no signal extractor is needed for the pedestals.
+By definition, the pedestal RMS is independent from the signal extractor.
+Therefore, no signal extractor is needed to calculate the pedestals.
 
-\subsubsection{Bias and Error}
+\subsection{Bias and Error}
 
 Consider a large number of signals (FADC spectra), all with the same
 integrated charge $ST$ (true signal). By applying some signal extractor
 we obtain a distribution of extracted signals $SE$ (for fixed $ST$ and
-fixed background fluctuations). The distribution of the quantity
+fixed background fluctuations $BG$). The distribution of the quantity
 
 \begin{equation}
@@ -60,77 +58,31 @@
 
 $B$ is the bias, $R$ is the RMS of the distribution of $X$ and $D$ is something
-like the (asymmetric) error of $SE$. It is the distribution of $X$ (or its
-parameters $B$ and $R$) which we are eventually interested in. The distribution
-of $X$, and thus the parameters $B$ and $R$, depend on $ST$ and the size of the
-background fluctuations.
-\par
-
-By applying the signal extractor to pedestal events you want to
-determine these parameters, I guess.
-
-\par
-By applying it with max. peak search you get information about the bias $B$
-for very low signals, not for high signals. By applying it to a fixed window,
-without max.peak search, you may get something like $R$ for high signals (but
-I am not sure). 
-
-\par
-For the normal image cleaning, knowledge of $B$ is sufficient, because the
-error $R$ is not used anyway. You only want to cut off the low signals.
-
-\par
-For the model analysis you need both, $B$ and $R$, because you want to keep small
-signals. Unfortunately $B$ and $R$ depend on the size of the signal ($ST$) and on
-the size of the background fluctuations (BG). However, applying the signal
-extractor to pedestal events gives you only 1 number, dependent on BG but
-independent of $ST$.
+like the (asymmetric) error of $SE$. 
+The distribution of $X$, and thus the parameters $B$ and $R$, 
+depend on the size of $ST$ and the size of the background fluctuations $BG$.
 
 \par
 
-Where do we get the missing information from ? I have no simple solution or
-answer, but I would think
-\begin{itemize}
-\item that you have to determine the bias from MC
-\item and you may gain information about $R$ from the fitted error of $SE$, which is
-  known for every pixel and event
-\end{itemize}
-
-The question is 'How do we determine the $R$ ?'. A proposal which
-has been discussed in various messages is to apply the signal extractor to
-pedestal events. One can do that, however, this will give you information
-about the bias and the error of the extracted signal only for signals
-whose size is in the order of the pedestal fluctuations. This is certainly
-useful for defining the right level for the image cleaning.
+For the normal image cleaning, knowledge of $B$ is sufficient and the 
+error $R$ should be know in order to calculate a correct background probability.
 \par
-
-However, because the bias $B$ and the error of the extracted signal $R$ depend on
-the size of the signal, applying the signal extractor to pedestal events
-won't give you the right answer for larger signals, for example for the
-calibration signals.
-
-The basic relation of the F-method is
+Also for the model analysis $B$ and $R$ are needed, because you want to keep small
+signals. 
+\par
+In the case of the calibration with the F-Factor methoid, 
+the basic relation is:
 
 \begin{equation}
-\frac{sig^2}{<Q>^2} = \frac{1}{<m_{pe}>} * F^2
+\frac{(\Delta ST)^2}{<ST>^2} = \frac{1}{<m_{pe}>} * F^2
 \end{equation}
 
-Here $sig$ is the fluctuation of the extracted signal $Q$ due to the
-fluctuation of the number of photo electrons. $sig$ is obtained from the
-measured fluctuations of $Q$  ($RMS_Q$) by subtracting the fluctuation of the
-extracted signal ($R$) due to the fluctuation of the pedestal RMS :
+Here $\Delta ST$ is the fluctuation of the true signal $ST$ due to the
+fluctuation of the number of photo electrons. $ST$ is obtained from the
+measured fluctuations of $SE$  ($RMS_{SE}$) by subtracting the fluctuation of the
+extracted signal ($R$) due to the fluctuation of the pedestal.
 
 \begin{equation}
- sig^2 = RMS_Q^2 - R^2
+ (\Delta ST)^2 = RMS_{SE}^2 - R^2
 \end{equation}
-
-$R$ is in general different from the pedestal RMS. It cannot be
-obtained by applying the signal extractor to pedestal events, because
-the calibration signal is usually large.
-
-In the case of the optimum filter, $R$ may be obtained from the
-fitted error of the extracted signal ($dQ_{fitted}$), which one can calculate
-for every event. Whether this statemebt is true should be checked by MC.
-For large signals I would expect the bias of the extracted to be small and
-negligible.
 
 A way to check whether the right RMS has been subtracted is to make the
@@ -138,5 +90,5 @@
 
 \begin{equation}
-    \frac{sig^2}{<Q>^2} \quad \textit{vs.} \quad \frac{1}{<Q>}
+    \frac{(\Delta ST)^2}{<ST>^2} \quad \textit{vs.} \quad \frac{1}{<ST>}
 \end{equation}
 
@@ -148,5 +100,65 @@
 \end{equation}
 
-where $c$ is the photon/ADC conversion factor  $<Q>/<m_{pe}>$.
+where $c$ is the photon/ADC conversion factor  $<ST>/<m_{pe}>$.
+
+\subsection{How to retrieve Bias $B$ and Error $R$}
+
+$R$ is in general different from the pedestal RMS. It cannot be
+obtained by applying the signal extractor to pedestal events, especially 
+for large signals (e.g. calibration signals).
+\par
+In the case of the optimum filter, $R$ can be obtained from the
+fitted error of the extracted signal ($\Delta(SE)_{fitted}$), 
+which one can calculate for every event. 
+
+\vspace{1cm}
+\ldots {\it Whether this statemebt is true should be checked by MC.}
+\vspace{1cm}
+
+For large signals, one would expect the bias of the extracted signal 
+to be small and negligible (i.e. $<ST> \approx <SE>$).
+\par
+
+In order to get the missing information, we did the following investigations:
+\begin{enumerate}
+\item Determine bias $B$ and resolution $R$ from MC events with and without added noise. 
+    Assuming that $R$ and $B$ are negligible for the events without noise, one can 
+    get a dependency of both values from the size of the signal. 
+\item Determine $R$ from the fitted error of $SE$, which is possible for the 
+    fit and the digital filter. In prinicple, all dependencies can be retrieved with this 
+    method.
+\item Determine $R$ for low signals by applying the signal extractor to a fixed window
+    of pedestal events. The background fluctuations can be simulated with different 
+    levels of night sky background and the continuous light, but no signal size 
+    dependency can be retrieved with the method. Its results are only valid for small 
+    signals.
+\end{enumerate}
+
+\par
+
+\subsubsection{Determine error $R$ by applying the signal extractor to a fixed window
+of pedestal events}
+
+By applying the signal extractor to pedestal events we want to
+determine these parameters. There are the following possibilities:
+
+\begin{enumerate}
+\item Applying the signal extractor allowing for a possible sliding window 
+    to get information about the bias $B$ (valid for low signals). 
+\item Applying the signal extractor to a fixed window, to get something like 
+    $R$. In the case of the digital filter, this has to be done by randomizing 
+    the time slice indices.
+\end{enumerate}
+
+\vspace{1cm}
+\ldots {\it This assumptions still have to proven, best mathematically!!! Wolfgang, Thomas???} 
+\vspace{1cm}
+\par
+
+
+\vspace{1cm}
+\ldots{\it More test plots can be found under: 
+http://magic.ifae.es/$\sim$markus/ExtractorPedestals/ }
+\vspace{1cm}
 
 %%% Local Variables: 
@@ -155,3 +167,4 @@
 %%% TeX-master: "MAGIC_signal_reco"
 %%% TeX-master: "MAGIC_signal_reco"
+%%% TeX-master: "MAGIC_signal_reco."
 %%% End: 
