]>
Commit | Line | Data |
---|---|---|
02582a78 | 1 | \section{Simulation code} |
2 | ||
017e0494 | 3 | The class AliSimulation manages this part. An example is here : ``\$ALICE\_ROOT/EMCAL/ |
02582a78 | 4 | macros/TestEMCALSimulation.C''. The simulation |
5 | consists of different steps: geometry and event definition, particle | |
6 | generation, transport of the particle in the material (GEANT) and | |
7 | finally digitization. Note that the final output from the digitization | |
017e0494 | 8 | process is different from the processing of real experimental Raw Data. The process |
9 | of converting the digitized data to Raw Data is discussed in Sec.~\ref{sec:digi}. | |
10 | Sec.~\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 | ||
16 | Once the generator is executed, the generated particles are transported | |
17 | in the detector material with the Monte Carlo code, GEANT3 by default. Other options are | |
017e0494 | 18 | GEANT4 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 | 19 | are created. They contain the energy deposited in the sensitive material |
20 | of the detector by the generated particle, their position, impact | |
21 | time (after collision) and the identity of the original particle. | |
22 | Hits are stored in a file called \textbf{DETECTOR.Hits.root}, in the | |
23 | calorimeter case: \textbf{EMCAL.Hits.root.} | |
24 | ||
25 | ||
017e0494 | 26 | \subsection{Digitization: SDigits and Digits - Evi \label{sec:digi}} |
02582a78 | 27 | |
28 | We want to generate events which look like the real data collected | |
29 | by the experiment. In the end, we want to have an amplitude in ADC | |
30 | counts and a time (when particle traverse a cell) per each cell (tower) | |
31 | of the calorimeter. In the code for calorimeters, it is done in the | |
017e0494 | 32 | following steps: |
33 | \begin{enumerate} | |
34 | \item \textbf{SDigit} objects are created, they consist | |
02582a78 | 35 | of the sum of deposited energy by all Hits in a cell (a particle can |
36 | create Hits in different cells but only one in a single cell), so | |
017e0494 | 37 | there 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 | 39 | is transformed into the ADC amplitude units, the electronic noise |
40 | is 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 | 47 | The experiment does not record Digits directly but a |
48 | time samples of ADC counts per cell. These samples are called | |
02582a78 | 49 | \textbf{Raw Data}. The samples have a shape, more complicated than |
50 | a Gaussian distribution, which is fitted offline. With real data, | |
51 | Digits amplitude is just the maximum of the distribution obtained | |
017e0494 | 52 | with the fit to the sample. The Digit time (defined by the time the |
53 | particle hits the active volume of the detector) is the time bin when | |
54 | the signal begins to rise. There is a method to go from Digits to | |
55 | Raw and vice versa AliEMCALRawUtils class: Raw2Digits and Digits2Raw, | |
56 | respectively. For the reconstruction step Digits are needed. The | |
57 | generation 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 | 58 | step when reconstructing real data. |
59 | ||
60 | ||
017e0494 | 61 | \subsection{How to make a simulation\label{sec:simu_steps}} |
02582a78 | 62 | |
63 | TestEMCALSimulation.C is a very simple macro where we specify all the simulation parameters | |
017e0494 | 64 | and 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} | |
70 | void TestEMCALSimulation() { | |
02582a78 | 71 | |
017e0494 | 72 | TString 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 | 75 | AliSimulation sim ; //Create simulation object |
02582a78 | 76 | |
017e0494 | 77 | // Generation and simulation |
02582a78 | 78 | |
017e0494 | 79 | sim.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 |
83 | sim.SetMakeSDigits(detector) ; //We want to make SDigits | |
84 | // set no detectors if SDigits are already made | |
02582a78 | 85 | |
017e0494 | 86 | // Making Digits |
87 | sim.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 |
98 | sim.Run(3) ; // Run the simulation and make 3 events | |
02582a78 | 99 | |
02582a78 | 100 | |
02582a78 | 101 | |
017e0494 | 102 | \end{lstlisting} |
103 | \end{DDbox} |