
{\centerline{\rule[0in]{0.9\columnwidth}{2pt}}
\vspace {-0.7cm}
\part*{\centerline{Appendix:}}
\vspace {-1cm}
\part*{\centerline{Physics Tools}}
\vskip -8pt
{\centerline{\rule[ 0.15in]{0.9\columnwidth}{2pt}}


%\part*{\centerline{Appendix:}}
%\vspace {-0.7cm}
%\part*{\centerline{Physics Tools}}%\\\small contributors: M. Rama, M. Morandin}


%\section*{Introduction}
\bigskip
\smallskip

We describe herein the tools used to simulate physics events and evaluate detector performance at the
\superb flavor factory. The simulation should meet two main
requirements. First, since the design of the subsystems is evolving, the user
should be able to perform optimization studies and modify the detector description in a simple way. Second, the program should be very fast, to simulate
very large numbers of physics events.
Table~\ref{tab:exp_rates} shows the event rate expected at a luminosity of
$1.0\times 10^{36}$~cm$^{-2}s^{-1}$. Over one year it translates to $1.1\times
10^{10}$ $\Upsilon(4S)$ decays and a total of about $5.4\times 10^{10}$
$e^+e^-\rightarrow q\bar{q}$ ($q=u,d,s,c,b$) and $\tau^+\tau^-$ decays.\\

\begin{table}[!htb]
\begin{center}
\caption{Physics rates at $1.0\times 10^{36}$~cm$^{-2}s^{-1}$.}
\begin{tabular}{lc}
\hline
\hline
Process & Rate at $\mathcal{L}=1\times 10^{36}$~cm$^{-2}s^{-1}$\\
 & (kHz)\\
\hline
$\Upsilon(4S)\rightarrow B\bar{B}$ & 1.1\\
$udsc$ continuum & 3.4 \\
$\tau^+\tau^-$ & 0.94 \\
$\mu^+\mu^-$ & 1.16 \\
$e^+e^-$ for $|\cos\theta_{\textrm{Lab}}|<0.95$& 30 \\
\hline
\end{tabular}
\label{tab:exp_rates}
\end{center}
\end{table}


At this stage, a single tool cannot fulfill completely both
requirements. Therefore the development of the simulation tools moves along parallel paths. A very fast
and relatively simple simulation program has been already developed and is
operational. It can simulate large amounts of both hadronic and $\tau^+\tau^-$
events while allowing to some extent the modification of the detector
configuration.
%Additional ways are being investigated
An upgrade schedule has been defined to increase the
accuracy of the simulation without sacrificing the speed.
%More details are provided in sec.~\ref{sec:app_fastsimu}.
More details are provided in the next section.

In parallel, a project is planned where the detailed description of both the detector
and the interaction region are done within the Geant4~\cite{geant4} framework.
%The goal is to develop a program that can be used to perform both ``full''
%and ``fast'' simulation using a common interface and description of the
%detector. See section~\ref{sec:app_geant4}.

Finally, the \babar\ simulation and reconstruction packages are being used to
perform \superb\ subdetector optimization studies. Although some aspects of the
\babar\ simulation make its evolution towards \superb\ not attractive, there are
good reasons why the possibility of exploring it for \superb\ can continue to be
particularly important. Detailed performance evaluations for \superb\ can in
fact be carried out by introducing minor modifications to the \babar\
detector. This will represent for a while the main option available to extract
the parameters needed as input by the \superb\ fast simulation. Negotiations
with \babar\ management are currently underway to extend access to
non-\babar\ members.

\section*{The parametric fast simulation}
\label{sec:app_fastsimu}
The simplest fast simulation program we have, named PravdaMC~\cite{pravda}, is
a very fast Monte Carlo which uses parametrization to simulate the detector
response. The radius, thickness and material of the beam pipe is configurable.
The tracking system can be modified by changing the number of active
layers of the silicon detector, the intrinsic spatial resolutions and the
amount of interaction length, as well as the number and dimension of the drift
chamber cells and their spatial resolutions. The current tracking algorithm is
TRACKERR~\cite{trackerr} which starts from the truth Monte Carlo charged
particle to produce the track and evaluate the error matrix of its parameters
taking into account the energy loss and the multiple scattering. The main
limitation is that the trajectory is not modified by the energy loss and
therefore it is a perfect helix. This approximation is poor for very low
momentum tracks, like soft pions from $D^{*\pm}$.

The response of the electromagnetic calorimeter is analytic.
In the current version of the program, the response of the DIRC and IFR to the
passage of a charged particle is implemented as an efficiency map of a
particle identification algorithm provided externally.

PravdaMC uses the same generators-framework interface as used by the \babar\
simulation code. In particular it can generate both hadronic
$e^+e^-\rightarrow q\bar{q}$ events (including obviously
$e^+e^-\rightarrow\Upsilon(4S)$) and $e^+e^-\rightarrow\tau^+\tau^-$ events.
In the latter case it is possible to generate events where the
$e^-$ or $e^+$ beams are polarized, which is a unique and important
aspect of the $\tau$ physics program at the \superb\ flavor factory.
%(see~\ref{sec:tau_polarization}).  % [{\it \bf wait for Alberto's input here}].

%The performance of PravdaMC in terms of speed is summarized by the time per
%event per GHz of CPU for the simulation of $B^0\rightarrow \pi^+\pi^-$ or
%$B^-\rightarrow D^0 K^-, D^0\rightarrow K^-\pi^+\pi^0$ events where the other
%$B$ decays generically. Simulation of $B^0\rightarrow \pi^+\pi^-$ takes $xxx\
%s/$ while $B^-\rightarrow D^0 K^-$ takes $yyy\ s/$. The time includes all the
%steps of the simulation, from the generation to the writing of the output into
%root files.

Activity is ongoing to develop an improved fast simulation. It uses PravdaMC
as a basis but eventually it will become a completely different program.
First, TRACKERR is replaced by a more accurate track fitting
algorithm based on the \babar\ track reconstruction and taking into account
all the effects of the interaction between particles and materials.
Second, the response of the DIRC, EMC and IFR is simulated through the
parametrization of the physics quantities measured by each subsystem and
used to perform the analysis of the physics events. Several sources can be used
to tune the parametrization of the detectors output: the real data collected
by the \babar\ detector, the Geant4 simulation of the \babar\ detector and the
standalone detailed simulation of the \superb\ subsystems.


\subsection*{Readout and analysis of simulated data}
%The tools to analyze the generated event, reconstruct the decay trees and
%apply the selection cuts are inherited from the \babar\ experiment and
%are therefore mature and fully functional.
The analysis of simulated events requires several specific tools.
Composition and
vertexing algorithms for the reconstruction of the signal decay trees,
the algorithms to determine the flavor and vertex position of the recoil $B$,
and an extensive set of utilities for signal/background separation are
inherited from the \babar\ experiment and therefore are mature and fully
functional. The output of the simulation with the information of the simulated
tracks and neutral clusters together with the reconstructed composite
particles are stored in ROOT files~\cite{root}.
Effort is ongoing to make the existing tools independent on the \babar\
framework.  % $<$Maybe we don't need this sentence$>$.


\section*{Simulation with Geant4}\label{sec:app_geant4}
%While for the short term physics studies will be done with the fast
%simulation, for the medium term we plan to
%develop a platform where the simulation of the \superb\  detector is based on
%Geant4
%and is designed to perform either the detailed or the fast simulation
%depending on the user's needs. The two operational modes should share the same
%interface for the detector description. This scheme presents obvious
%advantages. However, the speed of the fast simulation in this framework is an important factor which will be evaluated to understand if this solution
%can fully replace the program described in Sec.~\ref{sec:app_fastsimu}.

A medium-term plan for the development of a detailed simulation of the
\superb\ detector has been defined.
The simulation of the machine-induced backgrounds is at present accomplished
with a Geant4 application that incorporates a preliminary description of
the \superb\  detector volumes.
This initial effort of describing the \superb\  detector in Geant4
can represent the basis for the future development of a
detailed detector simulation.
At present some work is needed to improve the usability and
maintainability
of the tool for background studies.  The most important improvement consists
in decoupling
the geometry description from the code. The "technology" is available, since
using a markup
language to allow definition of geometry  data in XML format is now
implemented in Geant4
through GDML files.
Input from the subdetectors is needed to refine the current initial models.
When the detailed simulation of the \superb\ detector will be available, it
will be used to tune the output of the fast simulation including the effects
of the machine backgrounds.

\section*{Simulation of tau pair production with polarized beams}

The \superb project includes the ability to operate with an 85\%
longitudinally polarized electron beam, which is especially relevant
for tau physics studies. For this document, tau pairs produced with
polarized beams have been simulated with the KK
generator~\cite{Jadach:1999vf} and Tauola~\cite{Jadach:1999vf}.
That simulation framework includes all QED effects up to the second
order. Tau decays are simulated taking into account spin polarization
effects as well., and the complete spin correlations density matrix of
the initial-state beams and final state is incorporated in an exact
manner.

\begin{thebibliography}{9}   % Use for  1-9  references
%\begin{thebibliography}{99} % Use for 10-99 references
\bibitem{geant4} Geant4 Collaboration, Nucl. Instrum. Methods A{\bf 506},
  250 (2003).
\bibitem{pravda} Originally developed by N.~Kuznetsova and A.~Ryd for the
  \babar\  experiment.
\bibitem{trackerr} \babar\  Note 121.
\bibitem{root} ROOT, An Object-Oriented Data Analysis Framework. http://root.cern.ch/
\bibitem{Jadach:1999vf}
  S.\ Jadach, B.F.L.\ Ward, and Z.\ Was,
  %% The precision Monte Carlo event generator KK for two-fermion
  %% final  states in e+ e- collisions,
  Comput.\ Phys.\ Commun.\ {\bf 130}, 260 (2000), arXiv:hep-ph/9912214.
\end{thebibliography}

\onecolumngrid\twocolumngrid\hbox{}
