\section{Pulse Shape Reconstruction \label{sec:reco}}

The FADC clock is not synchronized with the trigger. Therefore, the relative position of the recorded 
signal samples varies  from event to event with respect to the position of the signal shape. 
The time $\Delta t$ between the trigger decision and the first read-out sample is uniformly distributed in the range 
$t_{\text{rel}} \in [0,T_{\mathrm{FADC}}[$, where $T_{\mathrm{FADC}}=3.33$\,ns is the digitization period of the MAGIC 300\,MHz FADCs. 
$\Delta t$ can be determined using the reconstructed arrival time 
$t_{\mathrm{arrival}}$.%directly by a time to digital converter (TDC) or 

\begin{figure}[h!]
\begin{center}
\includegraphics[totalheight=7cm]{shape_25945_raw.eps}
\end{center}
\caption[Raw shape.]{Raw FADC slices of 1000 constant pulse generator pulses overlayed.} 
\label{fig:raw_shape}
\end{figure}

\begin{figure}[h!]
\begin{center}
\includegraphics[totalheight=7cm]{time_25945.eps}
\end{center}
\caption[Reconstructed time.]{Distribution of the reconstructed time from the raw FADC samples shown in figure \ref{fig:raw_shape}. The width of the distribution is due to the trigger jitter of 1 FADC period (3.33 ns).} 
\label{fig:reco_time}
\end{figure}


Figure~\ref{fig:raw_shape} shows the raw FADC values as a function of the slice number for 1000 constant pulse generator pulses overlayed. Figure~\ref{fig:reco_time} shows the distribution of the corresponding reconstructed pulse arrival times. The distribution has a width of about 1 FADC period (3.33\,ns).



The asynchronous sampling of the pulse shape allows to determine an average pulse shape from the recorded 
signal samples: The recorded signal samples are shifted in time such that the shifted arrival times 
of all events are equal. In addition, the signal samples are normalized event by event using the 
reconstructed charge of the pulse. The accuracy of the signal shape reconstruction depends on the accuracy 
of the arrival time and charge reconstruction. The relative statistical error of the reconstructed pulse shape is well below $10^{-2}$ while the systematical error is by definition unknown at first hand.


\begin{figure}[h!]
\begin{center}
\includegraphics[totalheight=7cm]{pulpo_shape_high_low_TDAS.eps}%{pulpo_shape_high.eps}
\end{center}
\caption[Reconstructed high gain shape.]{Average reconstructed pulse shape from a pulpo run showing the high-gain and the low gain pulse. The FWHM of the high gain pulse is about 6.3\,ns while the FWHM of the low gain 
pulse is about 10\,ns.} 
\label{fig:pulpo_shape_high}
\end{figure}


Figure~\ref{fig:pulpo_shape_high} shows the averaged and shifted reconstructed signal of a fast pulser in the so called pulse generator (``pulpo'') setup. Thereby
the response of the photo-multipliers to Cherenkov light is simulated by a fast electrical pulse generator which generates unipolar pulses of about 2.5 ns FWHM and preset amplitude. These electrical pulses are transmitted using the same analog-optical link as the PMT pulses and are fed to the MAGIC receiver board. The pulse generator setup is mainly used for test purposes of the receiver board, trigger logic and FADCs.


In figure~\ref{fig:pulpo_shape_high} the high and the low gain pulses are clearly visible. The low gain pulse is attenuated by a factor of about 10 and delayed by about 55\,ns with respect to the high gain pulse.

Figure~\ref{fig:pulse_shapes} (left) shows the averaged normalized (to an area of 1FADC count * $T_{FADC}=3.33$ ns) reconstructed pulse shapes for the ``pulpo'' 
pulses in the high and in the low gain, respectively. The input FWHM of the pulse generator pulses is 
about 2\,ns. The FWHM of the average reconstructed high gain pulse shape is about 6.3\,ns, while the FWHM of 
the average reconstructed low gain pulse shape is about 10\,ns. The pulse broadening of the low gain pulses 
with respect to the high gain pulses is due to the limited dynamic range of the passive 55\,ns on board 
delay line of the MAGIC receiver boards. 
%   while the FWHM of the average reconstructed low gain pulse shape is 
% Due to the electric delay line for the low gain pules on the receiver board the low gain pulse is widened with respect to the high gain. 
It has a FWHM of about 10\,ns.


\begin{figure}[h!]
\begin{center}
\includegraphics[totalheight=7cm]{pulpo_shape_high_low_MC_TDAS.eps}%{pulpo_shape_low.eps}
\includegraphics[totalheight=7cm]{shape_green_UV_data_TDAS.eps}%{shape_green_high.eps}
\end{center}
\caption[Reconstructed pulse shapes]{Left: Average normalized reconstructed high gain and low gain pulse 
shapes from a pulpo run. 
The FWHM of the low gain pulse is about 10 ns. 
The black line corresponds to the pulse shape implemented into the MC simulations \cite{MC-Camera}.
Right: Average reconstructed high gain pulse shape for one green LED calibration run. 
The FWHM is about 6.5 ns.} 
\label{fig:pulse_shapes}
\end{figure}

Figure~\ref{fig:pulse_shapes} (right) shows the normalized average reconstructed pulse shapes for green and UV calibration LED pulses~\cite{MAGIC-calibration}
 as well as the normalized average reconstructed pulse shape for cosmics events. The pulse shape of the UV calibration pulses is quite similar to the 
reconstructed pulse shape for cosmics events, both have a FWHM of about 6.3 ns. As air showers due to hadronic cosmic rays trigger the telescope 
much more frequently than gamma showers the reconstructed pulse shape of the cosmics events corresponds mainly to hadron induced showers. 
The pulse shape due to electromagnetic air showers might be slightly different as indicated by MC simulations \cite{MC_timing_Indians}. The pulse shape for green calibration LED pulses is wider 
and has a pronounced tail.

% The pulses shape has a FWHM of about 6.5 ns and a significant tail.


%\begin{itemize}
%\item{Algorithm: overlay many events}
%\item{Differences cosmics / calibration}
%\item{Implementation / parameterization in the MC. 
%\newline
%\newline
%\ldots {\it MAYBE, we should create MC calibration pulses for the subsequent studies }
%\newline
%\newline}
%\end{itemize}


%%% Local Variables: 
%%% mode: latex
%%% TeX-master: "MAGIC_signal_reco"
%%% TeX-master: "MAGIC_signal_reco"
%%% End: 
