]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EMCAL/doc/simulation.tex
Dependence of AliHMPIDCluster objects on geometry.root file eliminated
[u/mrichter/AliRoot.git] / EMCAL / doc / simulation.tex
CommitLineData
02582a78 1\section{Simulation code}
2
017e0494 3The class AliSimulation manages this part. An example is here : ``\$ALICE\_ROOT/EMCAL/
02582a78 4macros/TestEMCALSimulation.C''. The simulation
5consists of different steps: geometry and event definition, particle
6generation, transport of the particle in the material (GEANT) and
7finally digitization. Note that the final output from the digitization
017e0494 8process is different from the processing of real experimental Raw Data. The process
9of converting the digitized data to Raw Data is discussed in Sec.~\ref{sec:digi}.
10Sec.~\ref{sec:simu_steps} gives the recipe to do all the steps of the simulation.
02582a78 11
12
017e0494 13\subsection{Event generation and particle transport: Hits}
02582a78 14
15
16Once the generator is executed, the generated particles are transported
17in the detector material with the Monte Carlo code, GEANT3 by default. Other options are
017e0494 18GEANT4 or FLUKA\footnote{There may be some license problems with FLUKA right now which could explain why it cannot be used at the moment}. All the generated particles are kept in a file called \textbf{Kinematics.root}. After the particle transport is executed, the objects \textbf{Hits}
02582a78 19are created. They contain the energy deposited in the sensitive material
20of the detector by the generated particle, their position, impact
21time (after collision) and the identity of the original particle.
22Hits are stored in a file called \textbf{DETECTOR.Hits.root}, in the
23calorimeter case: \textbf{EMCAL.Hits.root.}
24
25
017e0494 26\subsection{Digitization: SDigits and Digits - Evi \label{sec:digi}}
02582a78 27
28We want to generate events which look like the real data collected
29by the experiment. In the end, we want to have an amplitude in ADC
30counts and a time (when particle traverse a cell) per each cell (tower)
31of the calorimeter. In the code for calorimeters, it is done in the
017e0494 32following steps:
33\begin{enumerate}
34\item \textbf{SDigit} objects are created, they consist
02582a78 35of the sum of deposited energy by all Hits in a cell (a particle can
36create Hits in different cells but only one in a single cell), so
017e0494 37there is only one SDigit per fired cell.
38\item \textbf{Digit} objects are created, they are like the SDigits but the energy in the cell
02582a78 39is transformed into the ADC amplitude units, the electronic noise
40is added and Digits whose energy does not pass an energy threshold
41(3 ADC counts) are eliminated. SDigits and Digits are stored in the files
42\textbf{EMCAL.SDigits.root} and \textbf{EMCAL.Digits.root}, respectively.
017e0494 43\end{enumerate}
02582a78 44
45\subsection{Raw data - David}
46
017e0494 47The experiment does not record Digits directly but a
48time samples of ADC counts per cell. These samples are called
02582a78 49\textbf{Raw Data}. The samples have a shape, more complicated than
50a Gaussian distribution, which is fitted offline. With real data,
51Digits amplitude is just the maximum of the distribution obtained
017e0494 52with the fit to the sample. The Digit time (defined by the time the
53particle hits the active volume of the detector) is the time bin when
54the signal begins to rise. There is a method to go from Digits to
55Raw and vice versa AliEMCALRawUtils class: Raw2Digits and Digits2Raw,
56respectively. For the reconstruction step Digits are needed. The
57generation of Raw Data is optional during simulations and the generated data can be reconstructed directly from Digits, but Raw data will be the initial
02582a78 58step when reconstructing real data.
59
60
017e0494 61\subsection{How to make a simulation\label{sec:simu_steps}}
02582a78 62
63TestEMCALSimulation.C is a very simple macro where we specify all the simulation parameters
017e0494 64and proccess the simulation. Below is a similar but a bit more elaborated macro:
02582a78 65
02582a78 66
02582a78 67
017e0494 68\begin{DDbox}{\linewidth}
69\begin{lstlisting}
70void TestEMCALSimulation() {
02582a78 71
017e0494 72TString detector=``EMCAL TPC''; // Define in this variable the detectors that you want to be included in the simulation for the digitization. They can be less detectors than the detectors defined in the Config.C file, imagine that you want all the detectors in front of EMCal present to consider the conversion of particles but you are not really interested in the output from these detectors.
73// Option detector=``ALL'' makes all detectors.
02582a78 74
017e0494 75AliSimulation sim ; //Create simulation object
02582a78 76
017e0494 77// Generation and simulation
02582a78 78
017e0494 79sim.SetRunGeneration(kTRUE) ; //Default value is kTRUE, make generation
80// For some reason we may want to redo the Digitization, without redoing the generation, in this case it must set to kFALSE
02582a78 81
017e0494 82// Making SDigits
83sim.SetMakeSDigits(detector) ; //We want to make SDigits
84// set no detectors if SDigits are already made
02582a78 85
017e0494 86// Making Digits
87sim.SetMakeDigits(detector) ; //We want to make Digits
88// set no detectors if SDigits are already made
02582a78 89
017e0494 90//Merging
91//sim.MergeWith(``bgrd/galice.root'') ; //If we want to merge a signal and a background, the merging is done at the SDigit level. The background must be located in the repertory defined in the method.
02582a78 92
017e0494 93//Write Raw Data, make Raw data from digits
94//sim.SetWriteRawData(detector) ;
95//sim.SetConfigFile(``somewhere/ConfigXXX.C'');//Default is Config.C
02582a78 96
017e0494 97//Make the simulation
98sim.Run(3) ; // Run the simulation and make 3 events
02582a78 99
02582a78 100
02582a78 101
017e0494 102\end{lstlisting}
103\end{DDbox}