f2afc421 |
1 | void Config() |
2 | { |
3 | |
4 | // |
5 | // Set Random Number seed |
6 | TDatime dt; |
7 | UInt_t curtime=dt.Get(); |
8 | UInt_t procid=gSystem->GetPid(); |
9 | UInt_t seed=curtime-procid; |
10 | |
11 | gRandom->SetSeed(seed); |
12 | cerr<<"Seed for random number generation= "<<seed<<endl; |
13 | |
2a7b7180 |
14 | // libraries required by geant321 |
15 | gSystem->Load("libgeant321"); |
16 | |
b9d0a01d |
17 | new TGeant3("C++ Interface to Geant3"); |
f2afc421 |
18 | |
19 | //======================================================================= |
20 | // Create the output file |
21 | |
22 | TFile *rootfile = new TFile("galice.root","recreate"); |
23 | rootfile->SetCompressionLevel(2); |
24 | TGeant3 *geant3 = (TGeant3*)gMC; |
25 | |
26 | // |
27 | // Set External decayer |
28 | AliDecayer* decayer = new AliDecayerPythia(); |
29 | decayer->SetForceDecay(kAll); |
30 | decayer->Init(); |
31 | gMC->SetExternalDecayer(decayer); |
32 | |
33 | // |
34 | // |
35 | //======================================================================= |
36 | // ******* GEANT STEERING parameters FOR ALICE SIMULATION ******* |
37 | geant3->SetTRIG(1); //Number of events to be processed |
38 | geant3->SetSWIT(4,10); |
39 | geant3->SetDEBU(0,0,1); |
40 | //geant3->SetSWIT(2,2); |
41 | geant3->SetDCAY(1); |
42 | geant3->SetPAIR(1); |
43 | geant3->SetCOMP(1); |
44 | geant3->SetPHOT(1); |
45 | geant3->SetPFIS(0); |
46 | geant3->SetDRAY(0); |
47 | geant3->SetANNI(1); |
48 | geant3->SetBREM(1); |
49 | geant3->SetMUNU(1); |
50 | geant3->SetCKOV(1); |
51 | geant3->SetHADR(1); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3) |
52 | geant3->SetLOSS(2); |
53 | geant3->SetMULS(1); |
54 | geant3->SetRAYL(1); |
55 | geant3->SetAUTO(1); //Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0) |
56 | geant3->SetABAN(0); //Restore 3.16 behaviour for abandoned tracks |
57 | geant3->SetOPTI(2); //Select optimisation level for GEANT geometry searches (0,1,2) |
58 | geant3->SetERAN(5.e-7); |
59 | |
60 | Float_t cut = 1.e-3; // 1MeV cut by default |
61 | Float_t tofmax = 1.e10; |
62 | // GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX |
63 | geant3->SetCUTS(cut,cut, cut, cut, cut, cut, cut, cut, cut, cut, tofmax); |
64 | // |
65 | //======================================================================= |
66 | // ************* STEERING parameters FOR ALICE SIMULATION ************** |
67 | // --- Specify event type to be tracked through the ALICE setup |
68 | // --- All positions are in cm, angles in degrees, and P and E in GeV |
69 | // AliGenPythia *gener = new AliGenPythia(ntracks); |
70 | AliGenPythia *gener = new AliGenPythia(-1); |
71 | |
72 | gener->SetMomentumRange(0,999); |
73 | gener->SetPhiRange(-180.,180.); |
74 | gener->SetThetaRange(0,180); |
75 | gener->SetYRange(-999,999); |
76 | //gener->SetPtRange(0,100); |
77 | gener->SetOrigin(0,0,0); // vertex position |
78 | //gener->SetVertexSmear(kPerEvent); |
79 | gener->SetSigma(0,0,5.3); // Sigma in (X,Y,Z) (cm) on IP position |
80 | gener->SetTrackingFlag(0); |
81 | // gener->SetForceDecay(kHadronicD); |
82 | |
83 | // |
84 | // The following settings select the Pythia parameters tuned to agree |
85 | // with charm NLO calculation for Pb-Pb @ 5.5 TeV with MNR code. |
86 | // |
87 | gener->SetProcess(kPyCharmPbMNR); |
402c423c |
88 | gener->SetStrucFunc(kCTEQ4L); |
f2afc421 |
89 | gener->SetPtHard(2.1,-1.0); |
90 | gener->SetEnergyCMS(5500.); |
91 | gener->SetNuclei(208,208); // Pb-Pb collisions |
92 | |
93 | gener->Init(); |
94 | // |
95 | // Activate this line if you want the vertex smearing to happen |
96 | // track by track |
97 | // |
98 | //gener->SetVertexSmear(perTrack); |
99 | |
100 | // Field (L3 0.4 T) |
101 | AliMagFCM* field = new AliMagFCM( |
102 | "Map2","$(ALICE_ROOT)/data/field01.dat", 2, 1., 10.); |
103 | field->SetSolenoidField(4.); |
104 | gAlice->SetField(field); |
105 | |
106 | Int_t iABSO=0; |
b9d0a01d |
107 | Int_t iCRT=0; |
f2afc421 |
108 | Int_t iDIPO=0; |
109 | Int_t iFMD=0; |
110 | Int_t iFRAME=0; |
111 | Int_t iHALL=0; |
112 | Int_t iITS=0; |
113 | Int_t iMAG=0; |
114 | Int_t iMUON=0; |
115 | Int_t iPHOS=0; |
116 | Int_t iPIPE=0; |
117 | Int_t iPMD=0; |
118 | Int_t iRICH=0; |
119 | Int_t iSHIL=0; |
120 | Int_t iSTART=0; |
121 | Int_t iTOF=0; |
122 | Int_t iTPC=0; |
123 | Int_t iTRD=0; |
124 | Int_t iZDC=0; |
125 | |
126 | //=================== Alice BODY parameters ============================= |
127 | AliBODY *BODY = new AliBODY("BODY","Alice envelop"); |
128 | |
129 | if(iMAG) { |
130 | //=================== MAG parameters ============================ |
131 | // --- Start with Magnet since detector layouts may be depending --- |
132 | // --- on the selected Magnet dimensions --- |
133 | AliMAG *MAG = new AliMAG("MAG","Magnet"); |
134 | } |
135 | |
136 | |
137 | if(iABSO) { |
138 | //=================== ABSO parameters ============================ |
139 | AliABSO *ABSO = new AliABSOv0("ABSO","Muon Absorber"); |
140 | } |
141 | |
142 | if(iDIPO) { |
143 | //=================== DIPO parameters ============================ |
144 | |
145 | AliDIPO *DIPO = new AliDIPOv2("DIPO","Dipole version 2"); |
146 | } |
147 | |
148 | if(iHALL) { |
149 | //=================== HALL parameters ============================ |
150 | |
151 | AliHALL *HALL = new AliHALL("HALL","Alice Hall"); |
152 | } |
153 | |
154 | |
155 | if(iFRAME) { |
156 | //=================== FRAME parameters ============================ |
157 | |
158 | AliFRAME *FRAME = new AliFRAMEv2("FRAME","Space Frame"); |
159 | |
160 | } |
161 | |
162 | if(iSHIL) { |
163 | //=================== SHIL parameters ============================ |
164 | |
e0559846 |
165 | AliSHIL *SHIL = new AliSHILv2("SHIL","Shielding"); |
f2afc421 |
166 | } |
167 | |
168 | |
169 | if(iPIPE) { |
170 | //=================== PIPE parameters ============================ |
171 | |
172 | AliPIPE *PIPE = new AliPIPEv0("PIPE","Beam Pipe"); |
173 | } |
174 | |
175 | |
176 | if(iITS) { |
177 | |
178 | //=================== ITS parameters ============================ |
179 | // |
180 | // As the innermost detector in ALICE, the Inner Tracking System "impacts" on |
181 | // almost all other detectors. This involves the fact that the ITS geometry |
182 | // still has several options to be followed in parallel in order to determine |
183 | // the best set-up which minimizes the induced background. All the geometries |
184 | // available to date are described in the following. Read carefully the comments |
185 | // and use the default version (the only one uncommented) unless you are making |
186 | // comparisons and you know what you are doing. In this case just uncomment the |
187 | // ITS geometry you want to use and run Aliroot. |
188 | // |
189 | // Detailed geometries: |
190 | // |
191 | // |
192 | //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services"); |
193 | // |
194 | //AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services"); |
195 | // |
196 | AliITSvPPRasymm *ITS = new AliITSvPPRasymm("ITS","New ITS PPR detailed version with asymmetric services"); |
197 | ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer |
198 | ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer |
199 | ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer |
200 | ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [150,300] |
201 | ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [150,300] |
202 | ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [100,300] |
203 | ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [100,300] |
204 | ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out |
205 | ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon |
206 | // |
207 | //AliITSvPPRsymm *ITS = new AliITSvPPRsymm("ITS","New ITS PPR detailed version with symmetric services"); |
208 | //ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer |
209 | //ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer |
210 | //ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRsymm2.det"); // don't touch this parameter if you're not an ITS developer |
211 | //ITS->SetThicknessDet1(300.); // detector thickness on layer 1 must be in the range [150,300] |
212 | //ITS->SetThicknessDet2(300.); // detector thickness on layer 2 must be in the range [150,300] |
213 | //ITS->SetThicknessChip1(300.); // chip thickness on layer 1 must be in the range [100,300] |
214 | //ITS->SetThicknessChip2(300.); // chip thickness on layer 2 must be in the range [100,300] |
215 | //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out |
216 | //ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon |
217 | // |
218 | // |
219 | // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful |
220 | // for reconstruction !): |
221 | // |
222 | // |
223 | //AliITSvPPRcoarseasymm *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services"); |
224 | //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out |
225 | //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon |
226 | // |
227 | //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services"); |
228 | //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out |
229 | //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon |
230 | // |
231 | // |
232 | // |
233 | // Geant3 <-> EUCLID conversion |
234 | // ============================ |
235 | // |
236 | // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and |
237 | // media to two ASCII files (called by default ITSgeometry.euc and |
238 | // ITSgeometry.tme) in a format understandable to the CAD system EUCLID. |
239 | // The default (=0) means that you dont want to use this facility. |
240 | // |
241 | ITS->SetEUCLID(0); |
242 | } |
243 | |
244 | |
245 | if(iTPC) { |
246 | //============================ TPC parameters ================================ |
247 | // --- This allows the user to specify sectors for the SLOW (TPC geometry 2) |
248 | // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper) |
249 | // --- sectors are specified, any value other than that requires at least one |
250 | // --- sector (lower or upper)to be specified! |
251 | // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0) |
252 | // --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0) |
253 | // --- SecLows - number of lower sectors specified (up to 6) |
254 | // --- SecUps - number of upper sectors specified (up to 12) |
255 | // --- Sens - sensitive strips for the Slow Simulator !!! |
256 | // --- This does NOT work if all S or L-sectors are specified, i.e. |
257 | // --- if SecAL or SecAU < 0 |
258 | // |
259 | // |
260 | //----------------------------------------------------------------------------- |
261 | |
262 | // gROOT->LoadMacro("SetTPCParam.C"); |
263 | // AliTPCParam *param = SetTPCParam(); |
264 | AliTPC *TPC = new AliTPCv2("TPC","Default"); |
265 | // All sectors included |
266 | TPC->SetSecAL(-1); |
267 | TPC->SetSecAU(-1); |
268 | |
269 | } |
270 | |
271 | |
272 | if(iTOF) { |
273 | //=================== TOF parameters ============================ |
274 | AliTOF *TOF = new AliTOFv2("TOF","normal TOF"); |
275 | } |
276 | |
277 | if(iRICH) { |
278 | //=================== RICH parameters =========================== |
279 | AliRICH *RICH = new AliRICHv1("RICH","normal RICH"); |
280 | |
281 | } |
282 | |
283 | |
284 | if(iZDC) { |
285 | //=================== ZDC parameters ============================ |
286 | |
287 | AliZDC *ZDC = new AliZDCv1("ZDC","normal ZDC"); |
288 | } |
289 | |
b9d0a01d |
290 | if(iCRT) { |
291 | //=================== CRT parameters ============================ |
f2afc421 |
292 | |
b9d0a01d |
293 | AliCRT *CRT = new AliCRTv1("CRT","normal CRT"); |
f2afc421 |
294 | } |
295 | |
296 | if(iTRD) { |
297 | //=================== TRD parameters ============================ |
298 | |
299 | AliTRD *TRD = new AliTRDv1("TRD","TRD slow simulator"); |
300 | |
301 | // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2) |
302 | TRD->SetGasMix(1); |
303 | |
304 | // With hole in front of PHOS |
305 | TRD->SetPHOShole(); |
306 | // With hole in front of RICH |
307 | TRD->SetRICHhole(); |
308 | // Switch on TR |
309 | AliTRDsim *TRDsim = TRD->CreateTR(); |
310 | } |
311 | |
312 | if(iFMD) { |
313 | //=================== FMD parameters ============================ |
314 | |
315 | AliFMD *FMD = new AliFMDv0("FMD","normal FMD"); |
316 | } |
317 | |
318 | if(iMUON) { |
319 | //=================== MUON parameters =========================== |
320 | AliMUON *MUON = new AliMUONv1("MUON","default"); |
321 | } |
322 | |
323 | //=================== PHOS parameters =========================== |
324 | |
325 | if(iPHOS) { |
326 | AliPHOS *PHOS = new AliPHOSv1("PHOS","GPS2"); |
327 | } |
328 | |
329 | |
b9d0a01d |
330 | //=================== CRT parameters =========================== |
331 | |
332 | if(iCRT) { |
333 | AliCRT *CRT = new AliCRTv1("CRT","Normal CRTGPS2"); |
334 | } |
335 | |
336 | |
f2afc421 |
337 | if(iPMD) { |
338 | //=================== PMD parameters ============================ |
339 | |
340 | AliPMD *PMD = new AliPMDv1("PMD","normal PMD"); |
341 | PMD->SetPAR(1., 1., 0.8, 0.02); |
342 | PMD->SetIN(6., 18., -580., 27., 27.); |
343 | PMD->SetGEO(0.0, 0.2, 4.); |
344 | PMD->SetPadSize(0.8, 1.0, 1.0, 1.5); |
345 | |
346 | } |
347 | |
348 | if(iSTART) { |
349 | //=================== START parameters ============================ |
350 | AliSTART *START = new AliSTARTv1("START","START Detector"); |
351 | } |
352 | |
353 | |
354 | } |