%%
%% This is file `template-8s.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% template.raw  (with options: `8s')
%% 
%% Template for the LaTeX class aipproc.
%% 
%% (C) 1998,2000,2001 American Institute of Physics and Frank Mittelbach
%% All rights reserved
%% 
%%
%% $Id: template.raw,v 1.12 2005/07/06 19:22:14 frank Exp $
%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Please remove the next line of code if you
%% are satisfied that your installation is
%% complete and working.
%%
%% It is only there to help you in detecting
%% potential problems.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\input{aipcheck.tex}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% SELECT THE LAYOUT
%%
%% The class supports further options.
%% See aipguide.pdf for details.
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass[
    final            % use final for the camera ready runs
 %draft            % use draft while you are working on the paper
%%  ,numberedheadings % uncomment this option for numbered sections
%%  ,                 % add further options here if necessary
  ]
  {aipproc}

\layoutstyle{8x11single}
\renewcommand\XFMaddressmarkstyle{\alph}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% FRONTMATTER
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\title{Preliminary results of the LAT Calibration Unit beam tests}

\classification{95.55.Ka,29.40.Gx,29.40.Vj}
\keywords      {gamma-ray telescope, GLAST, LAT, beam test, calibration, Geant4}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\author{L. Baldini}{
address={INFN, Sezione di Pisa, L.go Pontecorvo 3, 56127 Pisa, Italy}
}
\author{G. Barbiellini}{
address={Dipartim. di Fisica, via Valerio 2, 34127 Trieste and INFN, sezione di Trieste, via Valerio 2, 34127 Trieste, Italy}
}
\author{R. Bellazzini}{
address={INFN, Sezione di Pisa, L.go Pontecorvo 3, 56127 Pisa, Italy}
}
\author{J.R. Bogart}{
address={Stanford Linear Accelerator Center, Menlo Park, California, 94025, USA }
}
\author{G. Bogaert}{
address={Laboratoire Leprince-Ringuet, IN2P3/CNRS, Ecole Polytechnique, 91128 PALAISEAU, France}
}
\author{E. Bonamente}{
address={Universit\`a di Perugia and INFN Sezione di Perugia, Via A. Pascoli 06123 Perugia, Italy}
}
\author{J. Bregeon}{
address={INFN, Sezione di Pisa, L.go Pontecorvo 3, 56127 Pisa, Italy}
}
\author{A. Brez}{
address={INFN, Sezione di Pisa, L.go Pontecorvo 3, 56127 Pisa, Italy}
}
\author{M.~Brigida}{
address={Dipartimento Interateneo di Fisica Universita' e Politecnico- via Amendola, 173 - 70126 Bari, Italy}
, altaddress={INFN Sezione di Bari, via Orabona, 4 - 70126 Bari, Italy}
}
\author{A.W. Borgland}{
address={Stanford Linear Accelerator Center, Menlo Park, California, 94025, USA }
}
\author{P. Bruel}{
address={Laboratoire Leprince-Ringuet, IN2P3/CNRS, Ecole Polytechnique, 91128 PALAISEAU, France}
}
\author{G.~A.~Caliandro}{
address={Dipartimento Interateneo di Fisica Universita' e Politecnico- via Amendola, 173 - 70126 Bari, Italy}
, altaddress={INFN Sezione di Bari, via Orabona, 4 - 70126 Bari, Italy}
}
\author{C. Cecchi}{
address={Universit\`a di Perugia and INFN Sezione di Perugia, Via A. Pascoli 06123 Perugia, Italy}
}
\author{F.~P.~Ceglie}{
address={INFN Sezione di Bari, via Orabona, 4 - 70126 Bari, Italy}
}
\author{E. Charles}{
address={Stanford Linear Accelerator Center, Menlo Park, California, 94025, USA }
}
\author{A. Chekhtman}{
address={Space Science Division, Naval Research Laboratory, Washington, DC 20375, USA}
, altaddress={George Mason University, Fairfax, VA 22030, USA}
}
\author{R. Claus}{
address={Stanford Linear Accelerator Center, Menlo Park, California, 94025, USA }
}
\author{J. Cohen-Tanugi}{
address={Stanford Linear Accelerator Center, Menlo Park, California, 94025, USA }
, altaddress={Kavli Institute for Particle Astrophysics and Cosmology, Menlo Park, California, 94025, USA }}
\author{E. do Couto e Silva}{
address={Stanford Linear Accelerator Center, Menlo Park, California, 94025, USA }
, altaddress={Kavli Institute for Particle Astrophysics and Cosmology, Menlo Park, California, 94025, USA }}
\author{R. Dubois}{
address={Stanford Linear Accelerator Center, Menlo Park, California, 94025, USA }
}
\author{J. Conrad}{
address={Royal Institute of Technology (KTH)
AlbaNova University Centre
10691 Stockholm, Sweden}
}
\author{D. Dumora}{
address={Université Bordeaux 1; CNRS/IN2P3;
CENBG, 33175 Gradignan, France}
}
\author{C.~Favuzzi}{
address={Dipartimento Interateneo di Fisica Universita' e Politecnico- via Amendola, 173 - 70126 Bari, Italy}
, altaddress={INFN Sezione di Bari, via Orabona, 4 - 70126 Bari, Italy}
}
\author{Z.Fewtrell}{
address={Space Science Division, Naval Research Laboratory, Washington, DC 20375, USA}
, altaddress={Praxis, Inc., Alexandria, VA 22303, USA}
}
\author{W.B. Focke}{
address={Stanford Linear Accelerator Center, Menlo Park, California, 94025, USA }
}
\author{S. Funk}{
address={Stanford Linear Accelerator Center, Menlo Park, California, 94025, USA }
, altaddress={Kavli Institute for Particle Astrophysics and Cosmology, Menlo Park, California, 94025, USA }}
\author{P.~Fusco}{
address={Dipartimento Interateneo di Fisica Universita' e Politecnico- via Amendola, 173 - 70126 Bari, Italy}
, altaddress={INFN Sezione di Bari, via Orabona, 4 - 70126 Bari, Italy}
}
\author{F.~Gargano}{
address={INFN Sezione di Bari, via Orabona, 4 - 70126 Bari, Italy}
}
\author{S. Germani}{
address={Universit\`a di Perugia and INFN Sezione di Perugia, Via A. Pascoli 06123 Perugia, Italy}
}
\author{B. Giebels}{
address={Laboratoire Leprince-Ringuet, IN2P3/CNRS, Ecole Polytechnique, 91128 PALAISEAU, France}
}
\author{N.~Giglietto}{
address={Dipartimento Interateneo di Fisica Universita' e Politecnico- via Amendola, 173 - 70126 Bari, Italy}
, altaddress={INFN Sezione di Bari, via Orabona, 4 - 70126 Bari, Italy}
}
\author{F.~Giordano}{
address={Dipartimento Interateneo di Fisica Universita' e Politecnico- via Amendola, 173 - 70126 Bari, Italy}
, altaddress={INFN Sezione di Bari, via Orabona, 4 - 70126 Bari, Italy}
}
\author{G.L. Godfrey}{
address={Stanford Linear Accelerator Center, Menlo Park, California, 94025, USA }
, altaddress={Kavli Institute for Particle Astrophysics and Cosmology, Menlo Park, California, 94025, USA }}
\author{H.M. Kelly}{
address={Stanford Linear Accelerator Center, Menlo Park, California, 94025, USA }
}
\author{E. Grove}{
address={Space Science Division, Naval Research Laboratory, Washington, DC 20375, USA}
}
\author{Niklas Karlsson}{
address={Royal Institute of Technology (KTH)
AlbaNova University Centre
10691 Stockholm, Sweden}
,altaddress={Stanford Linear Accelerator Center, Menlo Park, California, 94025, USA }
}
\author{M. Kocian}{
address={Stanford Linear Accelerator Center, Menlo Park, California, 94025, USA }
}
\author{M. Kuss}{
address={INFN, Sezione di Pisa, L.go Pontecorvo 3, 56127 Pisa, Italy}
}
\author{L. Latronico}{
address={INFN, Sezione di Pisa, L.go Pontecorvo 3, 56127 Pisa, Italy}
}
\author{F. Longo}{
address={Dipartim. di Fisica, via Valerio 2, 34127 Trieste and INFN, sezione di Trieste, via Valerio 2, 34127 Trieste, Italy}
}
\author{F.~Loparco}{
address={Dipartimento Interateneo di Fisica Universita' e Politecnico- via Amendola, 173 - 70126 Bari, Italy}
, altaddress={INFN Sezione di Bari, via Orabona, 4 - 70126 Bari, Italy}
}
\author{B. Lott}{
address={Université Bordeaux 1; CNRS/IN2P3;
CENBG, 33175 Gradignan, France}
}
\author{G. Mazzenga}{
address={INFN, Laboratori Nazionali di Frascati, Via E. Fermi 40, 00044 Frascati (Roma), Italy}
}
\author{M.N. Mazziotta}{
address={INFN Sezione di Bari, via Orabona, 4 - 70126 Bari, Italy}
}
\author{M. Minori}{
  address={INFN, Sezione di Roma2, Tor Vergata, Via della Ricerca Scientifica 1, 00133 Roma, Italy}
}
\author{M. Minuti}{
address={INFN, Sezione di Pisa, L.go Pontecorvo 3, 56127 Pisa, Italy}
}
\author{T. Mizuno}{
address={Department of Physics, Hiroshima University, Hiroshima 739-8526, Japan}
}
\author{A. Moiseev}{
address={Goddard Space Flight Center, Greenbelt, MD, USA}
}
\author{M.~Mongelli}{
address={INFN Sezione di Bari, via Orabona, 4 - 70126 Bari, Italy}
}
\author{C.~Monte}{
address={Dipartimento Interateneo di Fisica Universita' e Politecnico- via Amendola, 173 - 70126 Bari, Italy}
, altaddress={INFN Sezione di Bari, via Orabona, 4 - 70126 Bari, Italy}
}
\author{E. Nuss}{
address={LPTA, Université Montpellier 2, CNRS/IN2P3, Montpellier, France}
}
\author{N. Omodei}{
address={INFN, Sezione di Pisa, L.go Pontecorvo 3, 56127 Pisa, Italy}
}
\author{D. Paneque}{
address={Stanford Linear Accelerator Center, Menlo Park, California, 94025, USA }
, altaddress={Kavli Institute for Particle Astrophysics and Cosmology, Menlo Park, California, 94025, USA }}
\author{M. Pepe}{
address={Universit\`a di Perugia and INFN Sezione di Perugia, Via A. Pascoli 06123 Perugia, Italy}
}
\author{M. Pinchera}{
address={INFN, Sezione di Pisa, L.go Pontecorvo 3, 56127 Pisa, Italy}
}
\author{F. Piron}{
address={LPTA, Université Montpellier 2, CNRS/IN2P3, Montpellier, France}
}
\author{C. Pontoni}{
address={INFN, sezione di Trieste, via Valerio 2, 34127 Trieste, Italy}
}
\author{M. Prest}{
address={INFN, sezione di Trieste, via Valerio 2, 34127 Trieste, Italy}
}
\author{S.~Rain\`o}{
address={Dipartimento Interateneo di Fisica Universita' e Politecnico- via Amendola, 173 - 70126 Bari, Italy}
, altaddress={INFN Sezione di Bari, via Orabona, 4 - 70126 Bari, Italy}
}
\author{R. Rando}{
address={Universit\`a di Padova and INFN, sezione di Padova, via Marzolo 8, 35131 Padova, Italy}
}
\author{Th. Reposeur}{
address={Université Bordeaux 1; CNRS/IN2P3;
CENBG, 33175 Gradignan, France}
}
\author{L.C. Reyes}{
address={Goddard Space Flight Center, Greenbelt, MD, USA}
}
\author{L.S. Rochester}{
address={Stanford Linear Accelerator Center, Menlo Park, California, 94025, USA }
}
\author{A.~Sacchetti}{
address={INFN Sezione di Bari, via Orabona, 4 - 70126 Bari, Italy}
}
\author{G. Scolieri}{
address={Universit\`a di Perugia and INFN Sezione di Perugia, Via A. Pascoli 06123 Perugia, Italy}
}
\author{C. Sgr\`o}{
address={INFN, Sezione di Pisa, L.go Pontecorvo 3, 56127 Pisa, Italy}
}
\author{D.A. Smith}{
address={Université Bordeaux 1; CNRS/IN2P3;
CENBG, 33175 Gradignan, France}
}
\author{G. Spandre}{
address={INFN, Sezione di Pisa, L.go Pontecorvo 3, 56127 Pisa, Italy}
}
\author{P.~Spinelli}{
address={Dipartimento Interateneo di Fisica Universita' e Politecnico- via Amendola, 173 - 70126 Bari, Italy}
, altaddress={INFN Sezione di Bari, via Orabona, 4 - 70126 Bari, Italy}
}
\author{Hiromitsu Takahashi}{
address={Department of Physics, Hiroshima University, Hiroshima 739-8526, Japan}
}
\author{E. Vallazza}{
address={INFN, sezione di Trieste, via Valerio 2, 34127 Trieste, Italy}
}
\author{T. Ylinen}{
address={Royal Institute of Technology (KTH)
AlbaNova University Centre
10691 Stockholm, Sweden}
}
\author{the GLAST LAT Collaboration}{
address={\url{http://www-glast.stanford.edu}}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{abstract}

The calibration strategy of the GLAST Large Area Telescope (LAT) combines analysis of cosmic ray data with accelerator particle beams measurements. 
An advanced Monte Carlo simulation of the LAT, based on the Geant4 package, was set up to reproduce the LAT response to such radiation and to benchmark the event reconstruction and the background rejection strategy before launch and during operation. 
To validate the LAT simulation, a massive campaign of beam tests was performed between July and November 2006, in parallel with the LAT integration and test, on the LAT Calibration Unit. 
This is a detector built with spare flight modules and flight-like readout electronics, which was exposed to a large variety of beams, representing the whole spectrum of the signal that will be detected by the LAT, using the CERN and the GSI accelerator facilities. 
Beams of photons ($0-2.5~GeV$), electrons ($1-300~GeV$), hadrons ($\pi$ and $p$, a few $GeV-100~GeV$) and ions (C, Xe, $1.5~GeV/n$) were shot through the CU to measure the physical processes taking place in the detector and eventually fine-tune their description in the LAT Monte Carlo simulation. 
This paper describes the motivations and goals of the test runs, the many different experimental setups used, the measured detector performance and preliminary results of the LAT Monte Carlo validation.

\end{abstract}

\maketitle

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% MAINMATTER
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{Goals of beam tests for GLAST}
\label{sec:goal}
Since data analysis and performance parameterization of the LAT rely heavily on Monte Carlo simulations, a thorough experimental characterization must be performed to verify that the response of the actual instrument matches the predictions of the current simulation based on the Geant4 toolkit\cite{Geant4}, and to serve as a basis for improvements in case of significant discrepancies. 
The good reproduction of both directly-measured parameters (energy deposits, hit multiplicities) and quantities resulting from a high level analysis (reconstructed energy and direction), as well as the background rejection power, must be investigated throughout the huge phase space of the LAT (1.6 $\pi$ steradian, $20~MeV$ to $300~GeV$). 

\subsection{Testing the signal}
\label{sec:signal}
Low energy gamma-rays create few tracks in the tracker (TKR) and deposit little energy in the calorimeter (CAL). 
The higher the energy, the higher the activity in the tracker and the larger the energy in the calorimeter. 
At zero degree incidence, gamma-rays go through $1.5~X0$ (TKR) + $8.5~X0$ (CAL). 
As a consequence, below $1~GeV$ the electromagnetic shower induced by a gamma-ray deposits a significant fraction of its energy in the tracker. 
By contrast, above $1~GeV$ a large fraction of the shower escapes the calorimeter. 
At very high energy, the activity in the tracker is increased because of backsplash: low energy particles ($100-1000~keV$) traveling backwards from the calorimeter. 
This picture changes with the angle of incidence since the number of radiation lengths in the tracker and calorimeter increase accordingly. 
In addition, the reconstruction of gamma-rays in the LAT is very sensitive to the geometry of the instrument, especially to the gaps between towers.
% dead areas between TKR towers are minimal 
The beam tests should ensure that the simulation reproduces the following characteristics: 

\begin{itemize}
\item \emph{Direction measurement and Point Spread Function}\\
 The Point Spread Function is a key parameter of the LAT. 
The reconstruction of the direction uses tracker information to find the best tracks and assign a direction to the events. 
At low energy, the accuracy of the direction measurement is directly limited by multiple scattering. 
By contrast, at high energy, the reconstruction of the direction becomes more difficult because of the high activity in the tracker, mainly due to delta electrons and also to backsplash above $10~GeV$.

\item \emph{Energy reconstruction and energy resolution}\\
 The LAT energy reconstruction is based on three algorithms. Each of them makes use of the tracker activity and the energy deposited in the eight layers of the calorimeter, and corrects for lateral and longitudinal energy leakage, using our knowledge of the development of electromagnetic showers. 
The LAT calorimeters have been calibrated with cosmic muons, which deposit $11.2~MeV$ in the crystals along their trajectory, far away from the crystal saturation level, which is above $50~GeV$. 
Testing the CU with particles depositing more than $30~GeV$ in some crystals is needed to ensure a good calibration procedure from $10~MeV$ to $50~GeV$. 

\item \emph{Backsplash and ACD veto}\\
 The LAT anticoincidence detector (ACD) is segmented into many tiles because the backsplash of low energy photons can get back to the ACD and produce a veto signal in a tile via Compton scattering \cite{key:ACD paper}. 
The tile hit probability mainly depends on the energy of the incoming particle and the distance between the tile and the impact point of the particle on the calorimeter. 
Though this effect has been measured before in a dedicated beam test\cite{key:Moiseev 2004}, the current beam tests allow a measurement of backsplash with the real tower geometry.
\end{itemize} 

\subsection{Testing the background}
\label{sec:background}
Gamma-rays represent a very small fraction of the particles that will go through the LAT on orbit. 
At $10~GeV$, the science requirements dictate a rejection power of $10^{6}$ to 1. 
Reducible background needs to be clearly identified and removed, whereas irreducible background (photons within the LAT Field of View), need to be well modeled in order to be statistically subtracted from the measured fluxes.
Below is a list of the main sources of background that were studied during the BT campaign.

\begin{itemize}
\item \emph{Albedo gamma-rays}\\
Albedo gamma-rays are produced by cosmic ray interactions in the atmosphere of the Earth. Because of the orientation of the LAT in orbit, these albedo gamma-rays will enter the LAT upwards through its back and sides. They will not be in the LAT field of view but some of them can mimic a gamma-ray going forward: their shower is contained in the calorimeter but some electrons can escape the calorimeter and create a track in the tracker. All of these effects should be well reproduced by the simulation.

\item \emph{Hadronic interactions}\\
Hadronic showers induced by protons are responsible for a part of the reducible background. For instance, protons can interact in the instrument or in the spacecraft and generate a hadronic cascade in the calorimeter that mimics an electromagnetic shower. To suppress such events, the LAT rejection analysis makes use of many reconstructed quantities, such as the transverse size of the shower or the distance between the first hit in the tracker and the ACD.

\item \emph{Charged particles interacting in the MicroMeteoroid Shield (MMS)}\\
The ACD provides the rejection of charged particles that enter the instrument. However, protons and positrons can interact in the MMS (which surrounds the instrument), producing photons within the LAT field of view. Dedicated runs of protons and positrons hitting the CU after traversing an MMS target were taken to allow us to check that the probability of such processes is well reproduced by the simulation.

\item \emph{Heavy ions}\\
Heavy ions represent a very special and useful source of background as they deposit a well known amount of energy through ionization in the CAL and ACD subsystems; the calibration of these detectors during the flight will therefore be based on heavy ion signals. A dedicated trigger based on a high-signal threshold in the ACD allows the LAT to tag such events, and this mode of operation was tested during the GSI campaign.

\end{itemize}

\section{The Glast-LAT Calibration Unit}

\subsection{Description}

The CU is composed of two complete LAT tower modules (TKR and CAL)
and one additional CAL module, integrated in a $1 \times 4$ aluminum grid, identical
for all practical purposes to a one-row slice of the actual LAT flight grid.
Five flight-like ACD tiles complete the assembly.
In order to ensure contamination and humidity control, which is
required since some of the
modules are flight spares, the CU is housed into a nitrogen-flushed, 2 mm thick aluminum
Inner Shipping Container (ISC), whose base plate serves as a mechanical interface with
the remotely controlled $XY$ table used to set the CU position and orientation with
respect to the beam line.
The ACD tiles are mounted on the outside of the ISC to facilitate quick repositioning during the campaign.

%%%% description from Nicola
% The CU was composed of two spare towers meeting the flight standards plus one additional calorimeter forming a line of 3 adjacent elements. These modules were integrated into a $1 \times 4$ grid similar to a X slice of the LAT flight grid (bays 0,1,2,3), the extra bay was filled with a dummy calorimeter modules. Using 3 towers in line will allow the effects of inter-tower gaps on the direction and energy reconstructions to be investigated. The whole set of detectors plus the TEM were enclosed in a sealed container flushed with dry nitrogen. The container was made of 2mm-thick Al. Five ACD tiles were placed at different positions outside this container for backsplash studies.

\subsection{Electronics, Data Acquisition and Trigger}
\label{sec:elxdaq}
The CU is controlled by means of the same data acquisition system used throughout all of the LAT Integration and Test (IT) activities.
All the electronics is flight or flight-like.
Each single tower is controlled by a Tower Electronics Module (TEM) -- responsible for tower level commanding, data readout and
processing of the autonomous trigger requests generated by the TKR and CAL subsystems
\footnote{The TKR trigger primitive requires a coincident signal in any six consecutive silicon planes; 
the CAL has two independent energy triggers whose nominal settings require at least $100~MeV$ and $1~GeV$ per crystal, respectively.} 
-- and a Tower Power Supply (TPS) -- providing all the necessary low and high voltage levels starting from a common external $28~V$ power line.
The three TEMs are connected to a Global trigger Anticoincidence Signal distribution Unit (GASU), 
which is a rather complex module essentially responsible for all the activities connected to command, 
data flow and trigger generation at the LAT level, as well as for the interface with the ACD front end electronics.
The GASU can trigger the CU either internally, based on tower-level and ACD self-trigger requests,
or externally, with any combination of the external signals.
The latter mode constituted the basic trigger scheme during the CERN beam test campaign, where ancillary detectors along the beam line provided the external trigger signal to the CU. 
At GSI, thanks to the purity of the beam line, the more complex, internal trigger scheme was used, 
coupled to the multi-engine capability provided by the GASU module 
(i.e. the capability of changing the readout mode event by event, depending on the particular trigger combination).
This trigger mode is very similar to the way the LAT will operate on orbit.

An external power supply, sitting next to the CU and remotely controlled, supplies the $28~V$ power that will be delivered to the LAT by the spacecraft during the mission.
The GASU is connected to a VME Single Board Computer (SBC) -- also placed in the experimental area -- 
which controls all the data acquisition at a low level and interfaces with the users PC located in the control room.
During the whole campaign, an automated system took care of filling 
a specific database with all the relevant information for each run and of feeding a dedicated pipeline for data processing at SLAC.
The same pipeline was used for generating the large common Monte Carlo datasets.

\section{Beam Test setups}

\subsection{At the CERN-PS}
\label{sec:ps}

Figure~\ref{fig:setup} shows a schematic view of the experimental setup
used in the T9 line of the CERN-PS, where electrons, positrons,
pions and protons are available in ``cocktail'' beams, covering the momentum range
between $500~MeV/c$ and $10~GeV/c$. 

\begin{figure}[htbp]
\includegraphics[height=.35\textheight]{figure/PSSetUp.eps}
\caption{Schematic view of the experimental beam test setup at the CERN PS-T9 line. \emph{Top panel}: configuration to study the response to gamma-rays and charged particles. \emph{Bottom panel}: setup to study on-orbit gamma-ray background induced by positrons}
\label{fig:setup}
\end{figure}

A set of plastic scintillators ($S0$, $Sh$, $S1$, $S2$, $S4$) provided the external trigger signal for the different data acquisition configurations. 
$S0$ ($15 \times 40~cm^2 \times 1~cm$) was used to monitor the total number of particles in the beam; 
$Sh$ ($15 \times 40~cm^2 \times 1~cm$) had a hole of $2.4~cm$ diameter in the center and was used as a veto to reject the halo beam; 
$S1$ and $S2$ were two thin scintillators ($2~mm$ thick) with a small cross-section, used to select a small area of the beam; 
$S4$ ($10 \times 10~cm^2 \times 1~cm$) was used to select electrons inside the spectrometer acceptance.
Two gas threshold Cherenkov counters ($C1$ and $C2$) were used for particle identification.

%%%%%% maybe move elsewhere?
%The beam divergence at the PS-T9 beam line decreases with increasing beam momentum. For momenta above $5 ~GeV/c$ the beam divergence is of about $1~mrad$, while at $1~GeV/c$ it is of about $10~mrad$. The beam divergence is caused both by the T9 line optic magnets and by the amount of material crossed by the beam particles, that increases the multiple scattering angle. 

\subsubsection{Photon Tagger setup}

The photon tagger is a two-armed spectrometer composed of two Silicon Strip Detector (SSD) hodoscopes with two $XY$ detection planes each \cite{agile}. 
A gamma ray beam was produced by bremsstrahlung of electrons in the upstream materials (Cherenkov
counters, plastic scintillators and SSDs of the first arm, equivalent to $\simeq 0.1$ radiation length).
A dipole magnet (the triangle in figure~\ref{fig:setup}) with a maximum bending power of $50 ~cm \times 1~T$ 
deflected electrons into the second arm of the spectrometer and eventually onto the beam dump.
The curved tracks measured by the spectrometer provide the energy of the deflected electron
and, by difference with the nominal beam energy, that of the photon hitting the CU.

The two arms of the tagger were positioned to match the maximum bending angle allowed by
the dipole magnet (of the order of $10^{\circ}$ for $1.5~GeV$ electrons) and compatible with the dimensions of the experimental area.
On the other hand, because of the finite acceptance of the spectrometer, 
the magnetic field was scaled to maintain a constant 
ratio of the field to the beam energy, which allowed us to keep the positions of the SSDs fixed and to avoid recalibrating the spectrometer.
The photon bremsstrahlung spectrum between $\simeq 50~MeV$ and $1.5~GeV$ could be explored using different electron beam momenta ($0.5,~1,~1.5,~2.5~GeV$).
Particular care was taken to minimize the thickness of the detector windows since the tagger energy resolution was dominated by multiple scattering.

%%% from Nicola details to keep for final paper 
%The distance between the SSD modules in the first arm was of $50~cm$, while the distance between the SSD modules in the second arm was of $30~cm$. These distances were chosen in order to optimize the momentum resolution for the tagger in the photon energy range from $500 MeV$ to $2 GeV$. The first spectrometer arm was centered with respect to the beam direction, while the second one was displaced with respect to the incoming beam direction, in order to accept electron events in a fixed momentum range. The first SSD module of the second arm was shifted of about $12.5 cm$ from the beam axis, while the second module was shifted of about $15 cm$.

%The tagger calibration was performed with a set of dedicated runs, 
%where the deflected electron momentum was measured as a function of 
%the deflection angle with respect the direction of the incoming electron.

\begin{figure}[h!]
%\begin{center}
\includegraphics[height=.3\textheight]{figure/tagger.eps}
%\end{center}
\caption{Energy distributions: photon energy measured with the CU (blue-dotted line); 
deflected electron energy measured with the tagger spectrometer (red-dashed line); 
total energy (full line)}
\label{fig:tgene2_5}
\end{figure}

Figure~\ref{fig:tgene2_5} shows the energy distributions measured by the CU 
and by the tagger with $2.5~GeV/c$ electrons. The dotted
line shows the energy distribution of photons measured with the CU, 
the dashed line shows the energy distribution of deflected electrons measured 
with the spectrometer tagger, and the full line shows the distribution of the
sum of photon and electron energies. As expected, the total energy distribution
is peaked around the nominal energy of the incoming beam.

The tagger provides an independent measurement of the energy and incoming direction
\footnote{if this is assumed to be coincident with the incoming electron} 
of the photons entering the CU, and allows a validation of the electromagnetic interaction model used in the simulation.

Photons were also collected in non-tagged mode, i.e. running the CU as a stand-alone detector and neglecting the tagger information.
This mode had the advantage of a faster readout rate (see below)and an acceptance of the full bremsstrahlung spectrum, and was performed to recover from the time lost due to some accelerator problems.
In this case the photon energy was provided by the CU, and the photon direction is assumed to be coincident with 
the nominal electron beam direction in the analysis.

\subsection{At the CERN-SPS}
\label{sec:sps}
The performance of the CU at very high energy was studied in the 
CERN SPS-H4 beam line, where secondary beams ($e^{\pm}$,~$\pi$,~$p$) 
with momenta from $10$ to $300~GeV/c$ are available. 
In addition, the H4 facility can provide tertiary {\it clean} 
electron, pion and proton beams.   

A set of plastic scintillators ($S0$, $Sh$, $S1$, $S2$) provided the 
external trigger signal for the different data acquisition configurations. 
Two helium gas threshold Cherenkov counters were used for particle identification.
The scintillator $S0$ again monitored the total number of particles in the beam; $Sh$ was assembled 
with four $15 \times 40 cm^2$ tiles, leaving a square hole 
$4~cm$ on a side in the middle, and was used to reject the beam halo; 
$S1$ and $S2$ were again used to select a small area of the beam in front 
of the CU.

Table \ref{tab:dataset} summarizes the available data sets and the different trigger configurations used.

\begin{table}[h!]
\begin{tabular}{ccccccc}
\hline
  \tablehead{1}{c}{b}{Particle}
%& \tablehead{1}{c}{b}{Purpose}
& \tablehead{1}{c}{b}{Line}
& \tablehead{1}{c}{b}{Energy}
& \tablehead{1}{c}{b}{Stat}
& \tablehead{1}{c}{b}{Trigger}
& \tablehead{1}{c}{b}{Magnet}
& \tablehead{1}{c}{b}{Cherenkov}\\
\hline
$tag-\gamma$
\tablenote{photon direction and energy measured independently by the spectrometer; limited by tagger acceptance and synchronized data acquisition (DAQ) readout speed} 
%& response to photons 
& PS & $\simeq 0.05-1.5GeV$ & 4M
& $C1~C2~S1~S2~\overline{Sh}~S4$ & ON & $CO_2$ \\
& & & & & & tag $e^{-}$\\
\hline
$f-brem-\gamma$
\tablenote{no tagger information, full bremsstrahlung spectrum available} 
%& response to photons 
& PS & $0-2.5GeV$ & 12M
& $C1~C2~S1~S2~\overline{Sh}$ & ON & $CO_2$\\
& & & & & & tag $e^{-}$\\
\hline
$e^{-}$           
%& EM processes 
& PS & $1,5GeV$ & 6.4M
& $C1~C2~S1~S2~\overline{Sh}~S3$ & OFF & $CO_2$\\
& & & & & & tag $e^{-}$\\
\hline
$\pi^{-}$           
%& hadronic processes 
& PS & $5GeV$ & 0.6M
& $S1~S2~(\overline{C1+C2+Sh})~S3$ & OFF & $CO_2$\\
& & & & & & tag $\mu^{-}$\\
\hline
$p$           
%& hadronic processes 
& PS & $6,10GeV$\tablenote{also through the MMS target} & 19M
& $S1~S2~\overline{C1+C2+Sh}$ & OFF & $CO_2$\\
& & & & & & tag $K$\\
\hline
$e^{+}$
\tablenote{{\it clean}, i.e. without background photons from bremsstrahlung upstream}            
%& $e^{+}$ annihilation in MMS 
& PS & $1GeV$ & 2.5M
& $C1~C2~S1~S2~\overline{Sh}~S5$
\tablenote{$S5$ is an additional thin plastic scintillator located just in front of the MMS} 
                                                   & ON & $CO_2$\\
& & & & & & tag $e$\\
\hline
$e^{-}$           
%& EM processes 
& SPS & $10,20,50GeV$ & 17.8M
& $S1~S2~\overline{Sh}$ & OFF & empty\tablenote{not needed because of the clean tertiary beam}\\ 
& & $100,200,280GeV$ & & & &  \\
\hline
$\pi^{-}$           
%& hadronic processes 
& SPS & $20GeV$ & 1.6M
& $S1~S2~\overline{Sh}$ & OFF & empty\\
\hline
$p$           
%& hadronic processes 
& SPS & $20,100GeV$ & 0.8M
& $S1~S2~\overline{C1+C2+Sh}$ & OFF & $He$\\
& & & & & & tag $\pi$\\
\hline
\end{tabular}
\caption{Summary of the different particle beams and data sets collected at CERN. More than 300 different configurations were tested, changing the beam particle, energy and rate, the incoming angle and the interaction point of the beam, and several register settings of the instrument}
\label{tab:dataset}
\end{table}

\subsection{At GSI}
\label{sec:gsisetup}

The CU was exposed to heavy ion beams ($^{12}$$_{6}$C and $^{131}$$_{54}$Xe), with energies of 1 and $1.5~GeV/n$, and impacting the detector at $0^{\circ}$, $30^{\circ}$ and $60^{\circ}$. 
Various rates were explored ($10-1000~Hz/cm^2$) around the expected average ion rate in orbit to make sure that test results were not influenced by rate effects such as event pileup.
An array of thin external scintillators was made available by the GSI team to monitor the beam rate, provide an optional external trigger to the CU, and to veto any beam halo.
Given the purity of the beam line, which provides a well defined ion species with no contamination at any beam rate, the CU was in fact mostly operated in self-trigger mode.
The subsystem trigger primitives are combined in the GASU, which only broadcasts a global data-latch command if a predefined combination is matched. 
At GSI, only the trigger combination that requires a high level discriminator signal in the ACD\footnote{this is called the CNO trigger primitive due to the relative high abundance of C,N and O ions on orbit} and any other signal in TKR and CAL was enabled. 
Periodic triggers for evaluating CAL and ACD pedestals were pre-scaled to $5~Hz$ and taken in parallel, using the multiple trigger engine capability (see above).
In this way heavy ion events were mostly read out with CAL zero-suppression and auto-range readout, while random triggers for pedestal evaluation were read out without zero-suppression and four-range readout.
The GSI test represents the first successful system test of the LAT subsystems working together in a flight-like operating mode.

\subsection{Data merging}
\label{sec:daqmerge}
In order to be able to cross-correlate variables from the photon tagger and the CU
(i.e. tagged photon vs. electron energy) in real time, 
thereby assuring that the two DAQ systems were synchronized,
we decided to implement the merging of the corresponding data streams online; that required
some modifications of the LAT DAQ software to accommodate the additional information in the standard LAT Data Format (LDF) file.
Merging the data streams coming from the CU and the photon tagger is complicated
by the fact that the CU does not provide a \emph{busy} signal to be incorporated in the trigger logic, so
that under certain conditions (especially at high rate) it can in principle drop external triggers.
 
The merging strategy, which could only rely on event number, was
therefore susceptible to possible glitches.
To overcome this limitation we introduced an artificial gate ($\simeq 1~ms$) in the trigger logic to inhibit the trigger long enough for the CU to clear its buffers. 
To check the synchronization we introduced an additional time stamp in the ancillary data stream, generated
by a scaler clocked on the CU internal clock, against
which the standard time stamp was checked event by
event. This mechanism proved to be stable
on the run timescale (hours), and the check was incorporated into the online
monitor, allowing us to identify the few glitches that we experienced throughout the whole period of
data taking in tagged mode.

The synchronized DAQ could run at speeds on the order of $100~Hz$, while the standalone CU DAQ was able to reach several $kHz$ readout rates by making use of the internal event buffers.

\subsection{Online monitoring}
\label{sec:online}
As the offline data reconstruction could not be completed in less than a couple
of hours, a tool to monitor in real time the behavior of the
instrument and the beam quality was of crucial importance.
The monitoring tool relies on the capability of the DAQ system of sending events,
through a local network, to to different computers. In this way, the data are  
processed in real time without any
negative effect on the DAQ performance, and boosting the monitoring  
speed. 
The online monitor was in fact able to process $100\%$ of the events when working at the typical rates of $10~Hz-10~kHz/cm^{2}$.
Fast reconstruction algorithms were implemented in order to monitor some
of the most relevant quantities, e.g. beam position and direction, raw energy release in the CU, and pulse
height in the ACD.
In all the cases, these reconstruction algorithms demonstrated to  
be very suitable for this purpose,
and showed an overall performance typically less than a factor two  
worse than their offline counterparts.

\section{Simulation}

\subsection{Simulation of the beam test setup}

Given the multiple experimental setups and tested trigger conditions, an independent beam simulation was provided to describe the beam particle interactions with the ancillary detectors and secondary material along the beam line at the PS and the SPS (Cherenkov volumes, trigger scintillator detectors, beam dump, and silicon tagger detectors).
A proper description of particle spectra and beam properties (spread, divergence) was introduced and verified experimentally.
All the particles generated in such simulation and crossing a reference plane are scored to be tracked within the CU, therefore decoupling the simulation of the incoming particle beams from the CU simulation.

\subsection{Simulation of the CU}

The GLAST simulation infrastructure\cite{Perugia} allows the user to describe interactions of particles originating from cosmic sources, thus including the proper description of orbit and telescope orientation. 
This same framework was used for simulating the CU response to particle beams.
New classes were developed to allow the tracking of multiple primary particles per event, as is the case 
for experimental conditions at CERN. 
The CU geometry was described starting from real measurements and CAD drawings, 
taking into account the best knowledge of active and passive material
\footnote{A comprehensive material review of the subsystems is on-going and will lead to an update of the LAT geometry description.}.
An appropriate selection of electromagnetic processes was chosen to properly describe the interactions 
in the tracker and the calorimeter, while verification of the hadronic processes libraries is on-going (see below). 

\section{Data/MC comparison of raw quantities}

\subsection{Tracker}

%%%%%%% from Nicola
The TKR trigger efficiency, hits and clusters have been analyzed to study 
the low level performance of the TKR and to compare experimental and simulated data. 

Figure~\ref{fig:shower}-left shows the TKR trigger efficiency as a function of 
the beam electron energy and incident angle for real data and MC simulations. 
The agreement between data and MC is quite good, and the small discrepancies 
at normal incidence are due to the differences in the impact point. In fact, 
at normal incidence the gaps between the ladders introduce dead regions in 
the TKR.

\begin{figure}[htbp]
\includegraphics[width=0.49\textwidth]{figure/TkrTrigEff.eps}
\includegraphics[width=0.49\textwidth]{figure/HitVsPlane.eps}
\caption{\emph{Left}: Tracker electron trigger efficiency as a function of beam energy and 
incident angle. Real data: solid line and full symbols, MC data: dashed line and 
empty symbols. Circles: beam at normal incidence; squares: beam incidence $10~deg$; triangles: beam incidence $20~deg$; stars: beam incidence $30~deg$. \emph{Right}: Average number of TKR hits as function of the plane number: full circles: 
$6~GeV/c$ protons; other symbols: electrons of different momenta, from the bottom to the top $1,~2.5,~5,~20,~50,~100,~280~GeV/c$.}
\label{fig:shower}
\end{figure}

Figure~\ref{fig:shower}-right shows the multiplicities of fired strips in 
the TKR planes for electrons with momenta ranging from $1~GeV/c$ 
to $280~GeV/c$ and for $6~GeV/c$ protons, all at normal incidence.
 The beam direction is from the top plane (35) 
to the bottom one (0). The hit strip multiplicity is roughly constant 
for non-interacting protons. On the other hand, it increases along the beam direction 
for electrons, following the development of the electromagnetic 
shower in the tracker. This behavior is expected and due to the amount of material in the tracker
\footnote{The best trade-off between photon conversion efficiency and angular resolution was obtained 
with a tracker design consisting of twelve $XY$ layers equipped with $2.7\%~X0$ tungsten foils each on top, followed by four with a $18\%~X0$ foils, then three layers with no tungsten.}, although the current MC model underestimates the number of hits produced in the Tracker by almost $10\%$.
We are currently studying the tracker calibration and the signal generation in our simulation to try to understand this discrepancy.

\subsection{Calorimeter}

\subsubsection{Calibration}
\label{CalCalib}
The procedure for the calibration of the CU calorimeter was similar to that for the LAT calorimeter. 
The pedestals in all channels were measured using random trigger events, when no energy is deposited in the calorimeter crystals. The non-linearity of each channel was measured using the charge injection system. 
The energy scale of each channel was calibrated using the signals produced by cosmic muons. 
After path-length correction, the energy deposits of cosmic muons in a single crystal have the peak with most probable value of $11.2~MeV$. 
To see this signal in the high energy ranges\footnote{each CAL log has four readout ranges, called {\it LEX1, LEX8, HEX1, HEX8}, to cover the large dynamic range between $2~MeV$ and $60~GeV$}
a special muon gain setting was used providing an output signal ten times bigger than for normal flight gain. The exact ratio between the flight and muon gains was calibrated using charge injection.
At the beginning of each beam test data taking period the calorimeter was exposed to the electron beam ($5~GeV$ for the PS and $100~GeV$ at the SPS) and a set of runs was collected with four-range readout and different incident points in order to provide a broad spectrum of energy deposits in all crystals. The measurement of the same energy deposit in two energy ranges simultaneously allowed us to verify the inter-calibration of the energy ranges in the overlap regions and to correct the calibration if necessary.
  The inter-calibration procedure showed that the LEX1/LEX8 and HEX1/HEX8 ratios are equal to 1 with systematic error less than $0.5 \%$, but the HEX8 energy measurement is systematically $\sim 10 \%$ smaller than LEX1. 

Several effects contributing to this discrepancy were found, such as non-linearities in the charge injection circuitry at low charge, a few percent cross-talk between the readout ranges in the same crystal and $\simeq 1\%$ cross-talk between adjacent crystals.
All these were mapped with specific measurements and corrected in the initial calibration procedure, and the residual discrepancy of HEX8/LEX1 ratio became $\simeq 2.5 \%$. 
This last was corrected individually for each crystal end by correspondingly increasing the energy scale of the HEX8 and HEX1 ranges.

%\begin{itemize}
%\item we suspect that the deviations from linearity measured at low injected charge values (charge injection DAC<64) are caused by the charge injection system itself and not by the front-end electronics chain. To correct for this effect we just ignored the nonlinearity measurement in this region and considered the electronics chain perfectly linear for DAC<64. After this correction the HEX8/LEX1 ratio was increased by $2-3 \%$ and the fluctuations of this ratio from channel to channel became significantly smaller

%\item there is a few percent crosstalk between the LEX1, the HEX8 and HEX1 ranges of the same crystal end, which we measured by charge injection. The dependency of this crosstalk on the input signal is rather nonlinear for big input signals when the LEX1 range preamplifier is saturated. After the correction of this crosstalk the HEX8/LEX1 ratio was increased by $\simeq 5 \%$

%\item there is up to $\simeq 1\%$ crosstalk between the LEX1 range of some crystals to the HEX8 and the HEX1 ranges of adjacent crystals; this effect was measured in special charge injection runs pulsing only one crystal per layer. This effect becomes important and considerably changes the HEX8/LEX1 ratio in a crystal with modest energy deposition of a few hundred of MeV, adjacent to a crystal with 10 times bigger energy deposition. About 10\% of all crystals were affected by this crosstalk in the HEX8/LEX1 inter-calibration runs at SPS. After correction of this effect the problem disappeared

%\end{itemize}

\subsubsection{Deposited Energy}
\label{Eraw}
Before comparing data and simulation, some cuts have to be applied
in order to avoid beam contamination and geometric effects:
\begin{itemize}
\item The time between the previous event has to be greater than $0.5~ms$,
otherwise the signal could not have been measured properly because of
the characteristics of the electronics.
\item The extrapolation of the track on the top of the calorimeter has to be
far enough from the tower edges and not point between two crystals.
\item The raw deposited energy has to be greater than the typical energy
deposited by a minimum ionizing particle in order to remove the small
pion contamination.
\item The raw deposited energy has to be less than the beam energy in order
to remove pile-up events.
\end{itemize}

After these cuts, the average raw energy is systematically greater in
data than in the simulation. This discrepancy has been intensively
studied by revising and improving the calibration of the calorimeter, as
described in the previous section, and by carefully checking our simulation
(geometry description, material along the beam line, Geant3/Geant4
comparisons).
Despite this effort the discrepancy is still there and is between 5 and
20\%. It has been seen with tagged photons at the PS and with electrons at the PS
and SPS and it varies with the incident angle of the beam. The energy
in the layers and in the crystals is also greater in the data than in the simulation. A feature of this excess is that it is
systematically larger in the first layers, as seen in figure \ref{fig:Escale}.
This discrepancy is still under investigation.

\begin{figure}
\includegraphics[height=.3\textheight]{figure/scale_100gev_proceeding.eps}
\caption{$100~GeV$ electrons, normal incidence. \emph{Left}: the mean energy in the data divided by the mean energy in simuation in the eight layers of the calorimeter. \emph{Right}: total deposited energy for the data (empty circles), for the simulation (line) and the sum of the corrected layer energies using the ratios shown in the left graph (black circles).}
\label{fig:Escale}
\end{figure}

\section{Preliminary results for the signal (gamma/electrons)}

\subsection{Angular Dispersion}
%%%% from Nicola
We have classified all acceptable events into three classes, using the output of the tracking and vertexing algorithms:  events with a single vertex, events with two vertices, and events with more than two vertices. In addition, since one or two tracks can be associated to a vertex, it is possible to introduce sub-classes in each of these classes. In particular, the first class was separated into two sub-classes: events with only two tracks and events with a single track associated to the vertex.

Additional cuts are introduced in each class in order to select photon events that are fully contained in the CU.
For angular dispersion studies, photon data from runs in both tagged and non-tagged mode have been used. The runs in non-tagged mode were taken with a $2.5~GeV/c$ $e$ beam; the runs in tagged mode runs were taken with electron momenta ranging from $0.5$ to $2.5~GeV/c$. 
The gamma direction for non-tagged mode runs was taken to be the nominal beam direction.

The systematic errors in the evaluation of the angular dispersion in non-tagged mode runs are due to the beam divergence at $2.5~GeV/c$ ($4~ mrad$), to the uncertainty of the CU position with respect to the beam ($0.1~deg$), and to the photon production angle by bremsstrahlung with respect to the electron ($0.1 ~deg$).

\begin{figure}
\includegraphics[width=0.49\textwidth]{figure/FB_TW3_0Deg_PSF68_A11_MC_Liny.eps}
\includegraphics[width=0.49\textwidth]{figure/FB_TW3_0Deg_PSF95_68_A11_MCMeet.eps}
\caption{\emph{Left}: Angular dispersion at the $68\%$ containment value. Full symbols refer to the real data, and open symbols refer the prediction of the simulation. Statistical and systematic errors have been added in quadrature.
\emph{Right}: the ratio of the angular dispersions at $95\%$ and $68\%$ containment, evaluated using vertexed events in all TKR planes}
\label{fig:psf68}
\end{figure}

%Figure~\ref{fig:psf68} shows a comparison between the predictions of the simulation and the of the angle dispersion at $68\%$ containment value of the angular dispersion, evaluated for single-vertex events in all planes, in thin planes and in thick planes. The error bars in the figure were calculated by adding in quadrature statistical and systematic errors. The results shown in Fig.~\ref{fig:psf68} refer to photon events collected at normal incidence with two tracks associated to the vertex.

Figure~\ref{fig:psf68} shows a comparison between data and MonteCarlo simulation for the angle dispersion at $68\%$ containment value (left-panel), and the data-MC comparison for the ratio between the angular dispersion at $95\%$ containment and the angular dispersion at $68\%$ containment. %All plots were filled with single-vertex events in any planes. 
The events in this comparison were taken at normal incidence, and only those with two tracks associated with the vertex were used.


\subsection{Energy measurement}
\label{Erecon}
Using tagged-photon runs, we have compared the CU reconstructed energy to the
energy determined with the tagger. The resolution of the tagger depends
on the configuration (beam energy, magnetic field) and on the energy of
the outgoing electron. It is not negligible compared to the resolution
of the CU, in particular for low energy photons 
\footnote{corresponding to electrons whose deviation from the nominal beam position is small and therefore harder to measure with the tagger}. 
As a consequence, one has to take into account the resolution
of the tagger in order to determine the resolution of the CU, as seen in Figure~\ref{fig:tagger}.

\begin{figure}[hb!]
\includegraphics*[width=0.4\textwidth]{figure/reso_0deg_resotaggerbeam.eps}
\caption{The (fractional) tagger energy resolution (empty
circles), the uncorrected CU resolution (black circles) and the
corrected CU resolution as function of the logarithm of the photon
energy in MeV.}
\label{fig:tagger}
\end{figure}

With electrons, the CU reconstructed energy can be directly compared to the
energy of the beam. The energy reconstruction of the LAT has been tuned
with the simulation. Because of the discrepancy between data and the
simulation described above, the reconstructed energy
overestimates the beam energy by several percent. Despite this
discrepancy, the distributions of the energy in the layers are well
reproduced when corrected by {\it ad-hoc} factors. This good agreement
indicates that once the energy scale issue is resolved, the
performance of the instrument will be as good as expected.

%%%%%%%%% ACD backsplash (Luis)
\subsection{ACD Backsplash measurement}

The ACD hit probability per unit area as a function of energy and
distance backwards from the shower has been studied with past beam
tests for different calorimeter materials\cite{key:Moiseev 2004}.
These studies were used to set the level of segmentation
in the ACD design and to validate the design choices. Our goals for
this beam test regarding backsplash are: i) to determine the backsplash
probability with \emph{as-built} detectors and readout electronics,
and ii) to verify the capabilities of the LAT Monte Carlo simulations
to reproduce the backsplash effect.

Our Monte Carlo simulation of the backsplash effect considers the
energy loss by backsplash radiation in the ACD tile, Poisson fluctuations
in the number of photoelectrons created in the photo-multiplier, and corrections
due to non-uniform light collection at the edges of each tile.
The amount by which the light collection decreases near an edge is
different for each tile, but in general, it is known from the LAT that
the light collection is as low as $70$\% of nominal
value at the tile edge, and recovers back to $100$\% when measured $3$
cm away from the edge\cite{key:ACD paper}. This currently
represents the largest source of uncertainty in our ACD simulation. The
expected backsplash distribution is therefore bracketed in this analysis by two extreme scenarios:

\begin{itemize}
\item In the \emph{minimum light collection efficiency} scenario, edge corrections are
applied within 3 cm of the tile edge. The collection efficiency
is assumed to decrease linearly from 100\% (away from the edge) to
70\% at the edge.
\item In the \emph{maximum light collection efficiency} scenario, edge corrections are
applied within 0.5 cm of the tile edge. The collection efficiency
is assumed to decrease linearly from 100\% (away from the edge) to
90\% at the edge.
\end{itemize}

Backsplash is calculated as the fraction of events for which the signal
in an ACD tile was above a given threshold in units of mips (1 mip
is equal to the energy lost by a minimum-ionizing particle (MIP) crossing
the tile at normal incidence). Figure~\ref{fig:backsplash110}-left
shows the backsplash distributions with statistical errors
$\left(1\sigma\right)$ for one of the tiles as obtained from the
beam test data (black points) for a 200 GeV electron beam. As can
be seen from the figure, the Monte Carlo simulation is able to reproduce the backsplash distribution well.

The energy dependence of the measured backsplash energy in one of the tiles
is shown Figure~\ref{fig:backsplash110}-right. As expected, the
backsplash probability correlates with the beam energy. Furthermore,
it can be seen that backsplash does not increase dramatically at the
highest energies. This is because the electromagnetic
shower is not fully contained in the calorimeter at the highest energies%
\footnote{Nevertheless, the segmented calorimeter provides a clear image of
the shower profile, which is used to calculate the actual energy of
the event.}.
An empirical formula was found in the beam test of the ACD design
choices in 2002 to describe the backsplash probability\cite{key:Moiseev 2004}.
The energy dependence of that formula is given by \begin{equation}
P_{backsplash}\propto\sqrt{E}\end{equation}
and as can be seen in Figure~\ref{fig:backsplash110}-right, it fits the data well and thus corroborates the results obtained in that earlier beam test.

\begin{figure}[ht!]
%\includegraphics[width=0.49\textwidth]{figure/Tile110_MCvsDatav2.eps}
\includegraphics[width=0.5\textwidth]{figure/acd_fig1.eps}
\includegraphics[width=0.37\textheight]{figure/energy_isocurves.eps}
\label{fig:backsplash110}
\caption{\emph{Left}: Backsplash distribution
for an ACD tile expressed as the fraction of events for which the signal in the tile is above a
given threshold. Monte Carlo simulations consider two extreme scenarios of light leakage
through the tile edge, which bracket the measured backsplash distribution (black points).
The width of each band is given by twice the statistical error $\left(2\sigma\right)$
obtained from the simulation.
\emph{Right}: Energy dependence of backsplash for different thresholds. 
The data is well fitted by a function of the form $\sqrt{E}$ }
\end{figure}

%%%%%%%%% Background analysis (johan, carmelo)
\section{Preliminary results for the background}

\subsection{Albedo gammas}

We measured the response of the CU to gamma-rays produced from bremsstrahlung
interactions of a $2.5~GeV$ electron beam in the material along the beam line;
electrons were deflected away from the CU using the spectrometer magnet, while
photons hit the CU at the back, at mid-distance between Tracker and
Calorimeter.

 The preliminary analysis shows that these special events are well reproduced by the GLAST simulation both for low level variables and
high level reconstructed parameters: the event energy is shown in
Figure~\ref{AlbedoEvtEnergyCorr}-left. 

\subsection{Simulation of hadronic processes}
\label{sec:hadronsim}
The preliminary analysis of a $6~GeV/c$ proton run at $0^\circ$ taken at the CERN-PS shows
that the energy distribution produced by the LHEP model poorly matches the one
observed in the data whereas the Bertini model shows quite good agreement
for most low and high level distributions, as can be seen in Figure~\ref{AlbedoEvtEnergyCorr}-right. 
At higher energy, the preliminary results show the default LHEP model is instead able
to reproduce raw energy variables quite well.

\begin{figure}[htbp]
\includegraphics[width=0.49\textwidth]{figure/BgPSEnergy.eps}
\includegraphics[width=0.49\textwidth]{figure/AlbedoEvtEnergyCorr.eps}
\label{AlbedoEvtEnergyCorr}
\caption{\emph{Left}: Hadronic interactions: raw energy distribution for beam test
data and simulation with standard hadronic model (dashed-red) 
or with the Bertini hadronic cascade model(dotted-blue). 
\emph{Right}: albedo Gamma-rays entering at the back of the CU from the $2.5~GeV/c$ electron beam;
 reconstructed energy distribution for beam-test data and Monte Carlo simulation (dashed-red)}
\end{figure}

\subsection{Charged particle interactions in the MMS}

\subsubsection{Protons}
The goal of this part of the beam test was to measure the probability for an incident proton to create a $\gamma$ 
%with an energy ranging from $30$ to $50~MeV$ 
in the MMS without a signal in the ACD and compare this with the results of the simulation. 
A preliminary evaluation of the photon production probability is in reasonable
agreement with a Geant-3.21 simple model simulation.

\subsubsection{Positrons}

Positron annihilation in the MMS produces photons that cannot be individually
distinguished from celestial photons.

Positron annihilation events were identified as gamma-like events and
compared to the residual bremsstrahlung background from a set of electron runs
taken in exactly the same configuration. Preliminary analysis highlights a
clear excess of gamma-like events in the positron sample as shown in
Figure~\ref{Annihilation}.

\begin{figure}[htbp]
\includegraphics[height=.3\textheight]{figure/Annihilation.eps}
\caption{Number or reconstructed tracks for electron and positron data (red), showing a clear excess}
\label{Annihilation}
\end{figure} 

\section{Preliminary results with heavy ions}

\subsection{Tracker response}
The LAT TKR system was exposed to heavy ions for the first time during the GSI CU beam test.
The large energy deposits from ions can saturate the charge pre-amplifier of the silicon strips, producing large clusters due to the capacitative coupling of hit strips to the neighboring ones, potentially inducing a long dead-time for signal baseline restoration. 
SPICE simulations based on the equivalent detector circuit indicate a cluster size of 3 strips with oxygen ions.
The cluster size was measured with carbon ions and was found to be $\sim6$. The correct dependence on the incident angle of the beam was found.

\subsection{Calorimeter response}
On-orbit calibration of the GLAST CAL is based on the signal produced by heavy ions. These produce nicely separated peaks that can be easily identified in the measured spectrum and therefore used to determine the absolute energy scale.
Unfortunately the cesium iodide detector (CsI) response to large energy deposits is non-linear, and appropriate quenching factors must be experimentally determined to locate the expected ion energy deposit.
The GLAST collaboration performed a series of dedicated beam tests of CAL prototype modules in 2003 in order to measure such factors for many different ion species and different energies.
A quenching factor, i.e. a signal reduction, was measured at low energy, while a signal enhancement, called anti-quenching, was recorded at high energy.
This unexpected result was extensively studied with previous beam test data\cite{gsipaper} and represented the first measurement of the CsI response to such radiation. These quenching factors are included in the current LAT simulation.
The CU beam test at GSI aimed at confirming this result with a flight LAT module (CAL+TKR), read out with flight electronics.
A very good agreement was found between the signal induced in the CsI by carbon ions and the simulated data, validating previous measurements and establishing the basis for a reliable on-orbit calibration (see figure\ref{fig:gsi}-left).

\subsection{ACD response}
Although a thorough calibration of the ACD tiles was not performed before the test, the signals obtained with the C and Xe beams are consistent with those expected according to the Voltz model for very large energy deposits in plastic scintillators\cite{voltz}. The energy resolutions obtained were 16\% and 2.6\% for the C and Xe beams respectively.
An interesting measurement showing an ACD tile internal structure was obtained with the C beam. Each tile is read out by $1~mm$ diameter wave-length-shifting (WLS) fibers, embedded in $2~mm$ deep grooves inside the $1~cm$ thick tile\cite{key:ACD paper}.
This lowers the energy deposited in the scintillator in the vicinity of the fibers, where the scintillator is thinner because of the groove depth. The effect is negligible for mips, because this non-uniformity is hidden by the fluctuation of the collected light ($\simeq 20$ photoelectrons). But in the case of high-Z projectiles, much more light is collected, and the scintillator energy resolution is dominated by Landau fluctuations. This exposes the non-uniformity of light collection, which can be seen in Figure~\ref{fig:gsi}-right.

\begin{figure}[htbp]
\includegraphics[width=0.9\textwidth]{figure/composite_new.eps}
%\includegraphics[width=0.35\textwidth,angle=-90]{figure/fibers4.eps}  %
%\includegraphics[width=0.49\textwidth]{figure/calgsi.eps}
\caption{\emph{Left}: quenching factors measured in 2006 for different beam rates and compared to the average values measured in the 2003 run for a $1.7~GeV/n$ C beam. \emph{Right}: ACD {\it tomography} with heavy ions}
%\caption{ACD {\it tomography} with heavy ions} 
\label{fig:gsi}
\end{figure}

\section{Conclusion}

A massive beam test campaign on a GLAST Calibration Unit made with spare flight modules was performed in 2006 with the goal of validating the LAT Monte Carlo simulation used for data analysis, parameterization of the instrument performance and optimization of the background rejection.
Preliminary results confirm that a large amount of good data was collected for this study, and that the current Monte Carlo simulation is fairly accurate in reproducing the general behavior of all the subsystems. 
Two main discrepancies were found, namely a deficit in the number of Monte Carlo tracker hits and an overall shift in the calorimeter energy scale.
Despite these issues, whose investigation is underway, the angular resolution of the Tracker, the electro-magnetic shower shape in the Calorimeter and the backsplash signal in the Anti-Coincidence Detector are well reproduced.
The response to heavy ions is also well reproduced and confirms previously obtained results, although a new description of the signal in the tracker must be developed to take into account saturation of the charge amplifiers induced by very large signals.
Preliminary results indicate room for an optimization of the hadronic physics model for the GLAST simulation.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% BACKMATTER
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{theacknowledgments}
We would like to acknowledge the CERN and GSI accelerator teams for providing invaluable support during our experiments.
\end{theacknowledgments}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% The following lines show an example how to produce a bibliography
%% without the help of the BibTeX program. This could be used instead
%% of the above.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{thebibliography}{99}
\bibitem{Geant4} S. Agostinelli et al., (2003) NIM A {\bf 506}, 250-303
\bibitem{key:ACD paper}A. Moiseev et al., \emph{The Anti-Coincidence Detector for the GLAST Large Area Telescope}, AstroParticle Physics, 2007 in press
\bibitem{key:Moiseev 2004}A. Moiseev et al., Astroparticle Physics, \textbf{22}, 275, 2004
\bibitem{agile} E. Vallazza et al., IEEE Nucl. Sci. Symp. Conf. Rec. Vol. 1 (2004) 176 
\bibitem{Perugia} W. Atwood et al., (2004) in Proceedings of the Eleventh International Conference on Calorimetry in Particle Physics, C. Cecchi, P. Cenci, P. Lubrano, M. Pepe (eds.), 329-336
\bibitem{gsipaper}B. Lott, et al., \emph{Response of the GLAST LAT calorimeter to relativistic heavy ions},
Nuclear Instruments and Methods A, \textbf{560}, 395--404, 2006
\bibitem{voltz}R. Voltz et al., J. Chem. Phys, 45, 3306 (1966), S.P.Ahlen et al., NIM 147, 321 (1977)

\end{thebibliography}

\end{document}
\endinput



