]>
Commit | Line | Data |
---|---|---|
1 | \section{Simulation code} | |
2 | ||
3 | The class AliSimulation manages this part. | |
4 | Have a look to the macro ``\$ALICE\_ROOT/EMCAL/ | |
5 | macros/TestEMCALSimulation.C''. The simulation | |
6 | consists of different steps: geometry and event definition, particle | |
7 | generation, transport of the particle in the material (GEANT) and | |
8 | finally digitization. Note that the final output from the digitization | |
9 | process is not the same as the experimental Raw Data. The process | |
10 | of converting the digitized data to Raw Data is discussed in Sec.~1.4. | |
11 | In Sec.~1.5, I give the recipe to do all the steps. | |
12 | ||
13 | ||
14 | \subsection{Event Generation and particle transport: Hits} | |
15 | ||
16 | ||
17 | Once the generator is executed, the generated particles are transported | |
18 | in the detector material with the Monte Carlo code, GEANT3 by default. Other options are | |
19 | GEANT4 or FLUKA (some license problems with FLUKA right now so not in use?). | |
20 | All the generated particles are kept in a file called \textbf{Kinematics.root}. | |
21 | After the particle transport is executed, the objects \textbf{Hits} | |
22 | are created. They contain the energy deposited in the sensitive material | |
23 | of the detector by the generated particle, their position, impact | |
24 | time (after collision) and the identity of the original particle. | |
25 | Hits are stored in a file called \textbf{DETECTOR.Hits.root}, in the | |
26 | calorimeter case: \textbf{EMCAL.Hits.root.} | |
27 | ||
28 | ||
29 | \subsection{Digitization: SDigits and Digits - Evi} | |
30 | ||
31 | We want to generate events which look like the real data collected | |
32 | by the experiment. In the end, we want to have an amplitude in ADC | |
33 | counts and a time (when particle traverse a cell) per each cell (tower) | |
34 | of the calorimeter. In the code for calorimeters, it is done in the | |
35 | following steps: 1st) \textbf{SDigit} objects are created, they consist | |
36 | of the sum of deposited energy by all Hits in a cell (a particle can | |
37 | create Hits in different cells but only one in a single cell), so | |
38 | there is only one SDigit per fired cell; 2nd) \textbf{Digit} objects | |
39 | are created, they are like the SDigits but the energy in the cell | |
40 | is transformed into the ADC amplitude units, the electronic noise | |
41 | is added and Digits whose energy does not pass an energy threshold | |
42 | (3 ADC counts) are eliminated. SDigits and Digits are stored in the files | |
43 | \textbf{EMCAL.SDigits.root} and \textbf{EMCAL.Digits.root}, respectively. | |
44 | ||
45 | \subsection{Raw data - David} | |
46 | ||
47 | What we will get directly from the experiment are not Digits but a | |
48 | time samples of ADC counts per each cell. These samples are called | |
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 | |
52 | with the fit to the sample. The Digit time (defined by a time the | |
53 | particle hit the active volume of the detector) is the time bin when | |
54 | the signal begins to rise. There is a method to pass from Digits to | |
55 | Raw and vice versa in the class AliEMCALRawUtils: Raw2Digits and Digits2Raw, | |
56 | respectively. For the reconstruction step we need the Digits. The | |
57 | generation of Raw Data is optional during simulations, we can reconstruct | |
58 | data generating directly Digits, but Raw data will be the initial | |
59 | step when reconstructing real data. | |
60 | ||
61 | ||
62 | \subsection{How to make a simulation} | |
63 | ||
64 | TestEMCALSimulation.C is a very simple macro where we specify all the simulation parameters | |
65 | and execute the simulation, here I put a similar but a bit more elaborated macro: | |
66 | ||
67 | \begin{singlespace} | |
68 | \texttt{void TestEMCALSimulation() \{ } | |
69 | ||
70 | \texttt{TString detector=\char`\"{}EMCAL TPC\char`\"{}; // Define | |
71 | in this variable the detectors } | |
72 | ||
73 | \texttt{//that you want to be included in the simulation for the digitization. } | |
74 | ||
75 | \texttt{//They can be less detectors than the detectors defined in | |
76 | the Config.C } | |
77 | ||
78 | \texttt{//file, imagine that you want all the detectors in front of | |
79 | EMCal present} | |
80 | ||
81 | \texttt{//to consider the conversion of particles but you are not | |
82 | really } | |
83 | ||
84 | \texttt{//interested in the output from these detectors. Option detector=\char`\"{}ALL\char`\"{} } | |
85 | ||
86 | \texttt{//makes all detectors. } | |
87 | ||
88 | \texttt{AliSimulation sim ; //Create simulation object } | |
89 | ||
90 | \texttt{// Generation and simulation } | |
91 | ||
92 | \texttt{sim.SetRunGeneration(kTRUE) ; //Default value is kTRUE, make | |
93 | generation } | |
94 | ||
95 | \texttt{//For some reason we may want to redo the Digitization, without | |
96 | redoing } | |
97 | ||
98 | \texttt{//the generation, in this case it must set to kFALSE } | |
99 | ||
100 | \texttt{// Making SDigits } | |
101 | ||
102 | \texttt{sim.SetMakeSDigits(detector) ; //We want to make SDigits} | |
103 | ||
104 | \texttt{// set no detectors if SDigits are already made} | |
105 | ||
106 | \texttt{// Making Digits } | |
107 | ||
108 | \texttt{sim.SetMakeDigits(detector) ; //We want to make Digits } | |
109 | ||
110 | \texttt{// set no detectors if SDigits are already made} | |
111 | ||
112 | \texttt{//Merging } | |
113 | ||
114 | \texttt{//sim.MergeWith(\char`\"{}bgrd/galice.root\char`\"{}) ; //If | |
115 | we want to merge a signal } | |
116 | ||
117 | \texttt{//and a background, the merging is done at the SDigit level. The } | |
118 | ||
119 | \texttt{//background must be located in the repertory defined in the | |
120 | method. } | |
121 | ||
122 | \texttt{//Write Raw Data, make Raw data from digits } | |
123 | ||
124 | \texttt{//sim.SetWriteRawData(detector) ;} | |
125 | ||
126 | \texttt{//sim.SetConfigFile(\char`\"{}somewhere/ConfigXXX.C\char`\"{});//Default | |
127 | is Config.C} | |
128 | ||
129 | \texttt{//Make the simulation } | |
130 | ||
131 | \texttt{sim.Run(3) ; // Run the simulation and make 3 events } | |
132 | ||
133 | \texttt{\} } | |
134 | \end{singlespace} |