
\section{Gflash Shower Parameterizations}

The computing time needed for the simulation of high energy electromagnetic 
showers can become very large, since it increases approximately linearly with the 
energy absorbed in the detector.  Using parameterizations instead of 
individual particle tracking for electromagnetic (sub)showers can speed up 
the simulations considerably without sacrificing much precision.  The Gflash 
package allows the parameterization of electron and positron showers in 
homogeneous (for the time being) calorimeters and is based on the 
parameterization described in Ref. \cite{para.grind} .

\subsection{Parameterization Ansatz}
The spatial energy distribution of electromagnetic showers is given by  
three probability density functions (pdf),                                     
\begin{equation}                                                               
dE (\vec{r}) \, = \, E\, f(t)dt\, f(r)dr\, f(\phi) d\phi ,                    
\end{equation}                                                                 
describing the longitudinal, radial, and azimuthal energy distributions.
Here $t$ denotes the longitudinal shower depth in units of radiation length, 
$r$ measures the radial distance from the shower axis in Moli\`{e}re units, 
and $\phi$ is the azimuthal angle.  The start of the shower is defined by the 
space point where the electron or positron enters the calorimeter, which 
is different from the original Gflash.   
A gamma distribution is used for the parameterization of the longitudinal 
shower profile, $f(t)$.  The radial distribution $f(r)$, is described by a 
two-component ansatz. In $\phi$, it is assumed that the energy is distributed 
uniformly: $ f(\phi) = 1/2\pi $.

\subsection{Longitudinal Shower Profiles }                  
\label{sec_hom_long}
The average longitudinal shower profiles can be described by a gamma 
dis\-tri\-bution \cite{para.longo}:                       
\begin{equation}                                                              
\left\langle \frac{1}{E} \frac{dE(t)}{dt} \right\rangle                     
\, = \, f(t) \, = \,                           
\frac{ (\beta t)^{\alpha -1} \beta \exp(-\beta t) }                         
{ \Gamma(\alpha) }.                                                    
\end{equation}                                                                

The center of gravity, $\langle t \rangle$, and the depth of the maximum, 
$T$, are calculated from the shape parameter $\alpha$ and the scaling 
parameter $\beta$ according~to:                             
\begin{eqnarray}                 
\langle t \rangle  & = & \frac{\alpha}{\beta}\\            
T                  & = & \frac{\alpha-1}{\beta}.                             
\label{talp}                                                                  
\end{eqnarray}                 

In the parameterization all lengths are measured in units of radiation length 
$(X_0)$, and energies in units of the critical energy 
($E_c=  2.66 \left( X_0 \frac{Z}{A} \right)^{1.1}$~).
This allows material independence, since the longitudinal shower moments are 
equal in different materials, according to Ref. \cite{para.rossi}.
The following equations are used for the energy dependence of $T_{hom}$ and 
$(\alpha_{hom})$, 
with $y = E/E_c$ and $t=x/X_0$, x being the longitudinal shower depth:
\begin{eqnarray}                                                              
\label{e_thom}                                                                 
T_{hom} & = & \ln y + t_1 \\                                                 
\label{e_ahom}                                                                 
\alpha_{hom} & = & a_1 + (a_2 + a_3/Z) \ln y.                                
\end{eqnarray}                                                                

The $y$-dependence of the fluctuations can be described by: 
\begin{equation}                                                              
\sigma \, = \, ( s_1 + s_2 \ln y )^{-1} .                                     
\label{lsighom}                                                              
\end{equation}                                                                

The correlation between $\ln T_{hom} $ and $\ln \alpha_{hom} $
is given by:   
\begin{equation}                                                              
\rho(\ln T_{hom}, \ln \alpha_{hom}) \, \equiv \, \rho                        
               \, = \, r_1 + r_2 \ln y .    
\label{corrhom}                                                              
\end{equation}                                                                
From these formulae, correlated and varying parameters $\alpha_i$ and 
$\beta_i$ are generated according to                          
\begin{equation}       
\left(                                                                        
\begin{array}{c}                                                           
\ln T_i \\                                                               
\ln \alpha_i                                                             
\end{array} \right)                                                        
\, = \,                                                                     
\left(                                                                        
\begin{array}{c}                                                           
\langle \ln T \rangle \\                                                 
\langle \ln \alpha \rangle                                               
\end{array} \right)                                                        
+ C                                                                         
\left(                                                                        
\begin{array}{c}                                                           
z_1 \\                                                                   
z_2                                                                      
\end{array} \right)                                                        
\end{equation}        
with                                                                           
$$                 
C \, = \,                                                                     
\left(                                                                     
\begin{array}{cc}                                                          
\sigma (\ln T) & 0 \\                                                     
0 & \sigma (\ln \alpha)                                                   
\end{array} \right)                                                        
\left(                                                                     
\begin{array}{cc}                                                          
\sqrt{\frac{1+\rho}{2}} & \sqrt{\frac{1-\rho}{2}} \\                     
\sqrt{\frac{1+\rho}{2}} & - \sqrt{\frac{1-\rho}{2}}                      
\end{array} \right) \,   $$                                                  
$ \sigma (\ln \alpha)$ and $\sigma (\ln T)$ are the fluctuations of $T_{hom}$ 
and $(\alpha_{hom}$.
The values of the coefficients can be found in Ref. \cite{para.grind}.


\subsection{Radial Shower Profiles}                        
\label{sec_hom_rad}                                                            

For the description of average radial energy profiles,                  
\begin{equation}                                                               
f(r) \, = \, \frac{1}{dE(t)} \frac{dE(t,r)}{dr},                             
\end{equation}                                                                 
a variety of different functions can be found in the literature.
In Gflash the following two-component ansatz, an extension of that in 
Ref.\cite{para.nim90}, was used:
\begin{eqnarray}     
\label{frad}                                                                  
f(r) &  = &  p f_C(r) + (1-p) f_T(r) \\                                      
      &  = &                                                            
                 p \frac{2 r R_C^2}{(r^2 + R_C^2)^2}                    
            + (1-p) \frac{2 r R_T^2}{(r^2 + R_T^2)^2}                   
\nonumber                                                                     
\end{eqnarray}  

with $$ 0 \leq p \leq 1 . $$     
Here $R_C$ ($R_T$) is the median of the core (tail) component and $p$ 
is a probability giving the relative weight of the core component.             
The variable $\tau = t/T$, which measures the shower depth in 
units of the depth of the shower maximum, is used in order to generalize 
the radial profiles. This makes the parameterization more convenient and 
separates the energy and material dependence of various parameters.          
The median of the core distribution, $R_C$, increases linearly with $\tau$. 
The weight of the core, $p$, is maximal around the shower maximum, and the 
width of the tail, $R_T$, is minimal at $\tau \approx 1$.

The following formulae are used to parameterize the radial energy density 
distribution for a given energy and material:
\begin{eqnarray}         
\label{rz}                                                                  
R_{C,hom}(\tau) & = &                                                          
z_1 + z_2 \tau \\                                                           
\label{rk}                                                                  
R_{T,hom}(\tau) & = &                                                          
k_1 \{ \exp (k_3(\tau -k_2)) + \exp (k_4(\tau -k_2)) \} \\                  
\label{p}                                                                   
p_{hom}(\tau) & = &                                                          
p_1  \exp \left\{ \frac{p_2-\tau}{p_3} -                                    
      \exp \left(   \frac{p_2-\tau}{p_3} \right) \right\}               
\end{eqnarray}               
The parameters $z_1 \cdots p_3$ are either constant or simple                  
functions of $\ln E$ or $Z$.

Radial shape fluctuations are also taken into account. A detailed 
explanation of this procedure, as well as a list of all the parameters used 
in Gflash, can be found in Ref. \cite{para.grind}.

\subsection{Gflash Performance}

The parameters used in this Gflash implementation were extracted from full 
simulation studies with Geant 3.  They also give good results inside the 
Geant4 fast shower framework when compared with the full electromagnetic 
shower simulation.  However, if more precision or higher particle energies
are required, retuning may be necessary.  
For the longitudinal profiles the difference between full simulation 
and Gflash parameterization is at the level of a few percent.   
Because the radial profiles are slightly broader in Geant3 than in Geant4, 
the differences may reach $ > 10 \% $. 
The gain in speed, on the other hand, is impressive. The simulation of a 
1~TeV electron in a $PbWO_4$ cube is 160 times faster with Gflash.
Gflash can also be used to parameterize electromagnetic showers in sampling 
calorimeters. So far, however, only homogeneous materials are supported. 


\subsection{Status of this document}
02.12.04 created by J.Weng \\
03.12.04 grammar check and minor re-wording by D.H. Wright \\


\begin{latexonly}

\begin{thebibliography}{99}

\bibitem{para.grind} G.~Grindhammer, S.~Peters,
{\em The Parameterized Simulation of Electromagnetic Showers in 
Homogeneous and Sampling Calorimeters, hep-ex/0001020 } (1993).

\bibitem {para.longo} E.~Longo and I.~Sestili,{\em                      
Nucl.~Instrum.~Meth.~128, 283} (1975).         

\bibitem{para.rossi} ~Rossi {\em                                   
rentice Hall, New York} (1952). 

\bibitem{para.nim90} G.~Grindhammer, M.~Rudowicz, and              
       S.~Peters, {\em    Nucl.~Instrum.~Meth.~A290, 469} (1990).                                

\end{thebibliography}                                               

\end{latexonly}

\begin{htmlonly}

\subsection{Bibliography}

\begin{enumerate}
\item G.~Grindhammer, S.~Peters,
{\em The Parameterized Simulation of Electromagnetic Showers in 
Homogeneous and Sampling Calorimeters, hep-ex/0001020 } (1993).

\item E.~Longo and I.~Sestili,{\em                      
Nucl.~Instrum.~Meth.~128, 283} (1975).         

\item ~Rossi {\em Prentice Hall, New York} (1952). 

\item G.~Grindhammer, M.~Rudowicz, and              
       S.~Peters, {\em    Nucl.~Instrum.~Meth.~A290, 469} (1990).                                

\end{enumerate}                                               

\end{htmlonly}

