]>
Commit | Line | Data |
---|---|---|
456a8e2d | 1 | static Int_t eventsPerRun = 100; |
b84cbedc | 2 | enum PprGeo_t |
3 | { | |
4 | kHoles, kNoHoles | |
5 | }; | |
6 | static PprGeo_t geo = kHoles; | |
7 | ||
fe4da5cc | 8 | void Config() |
9 | { | |
682a4a95 | 10 | // 7-DEC-2000 09:00 |
11 | // Switch on Transition Radiation simulation. 6/12/00 18:00 | |
12 | // iZDC=1 7/12/00 09:00 | |
13 | // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00 | |
81bf125a | 14 | // Theta range given through pseudorapidity limits 22/6/2001 |
682a4a95 | 15 | |
16 | // Set Random Number seed | |
17 | // gRandom->SetSeed(12345); | |
18 | ||
19 | new AliGeant3("C++ Interface to Geant3"); | |
20 | ||
21 | if (!gSystem->Getenv("CONFIG_FILE")) | |
22 | { | |
23 | TFile *rootfile = new TFile("galice.root", "recreate"); | |
24 | ||
25 | rootfile->SetCompressionLevel(2); | |
26 | } | |
27 | ||
28 | TGeant3 *geant3 = (TGeant3 *) gMC; | |
d551411b | 29 | |
2ab0c725 | 30 | // |
682a4a95 | 31 | // Set External decayer |
32 | AliDecayer *decayer = new AliDecayerPythia(); | |
33 | ||
34 | decayer->SetForceDecay(kAll); | |
35 | decayer->Init(); | |
36 | gMC->SetExternalDecayer(decayer); | |
2ab0c725 | 37 | // |
2ab0c725 | 38 | // |
682a4a95 | 39 | //======================================================================= |
40 | // ******* GEANT STEERING parameters FOR ALICE SIMULATION ******* | |
41 | geant3->SetTRIG(1); //Number of events to be processed | |
42 | geant3->SetSWIT(4, 10); | |
43 | geant3->SetDEBU(0, 0, 1); | |
44 | //geant3->SetSWIT(2,2); | |
45 | geant3->SetDCAY(1); | |
46 | geant3->SetPAIR(1); | |
47 | geant3->SetCOMP(1); | |
48 | geant3->SetPHOT(1); | |
49 | geant3->SetPFIS(0); | |
50 | geant3->SetDRAY(0); | |
51 | geant3->SetANNI(1); | |
52 | geant3->SetBREM(1); | |
53 | geant3->SetMUNU(1); | |
54 | geant3->SetCKOV(1); | |
55 | geant3->SetHADR(1); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3) | |
56 | geant3->SetLOSS(2); | |
57 | geant3->SetMULS(1); | |
58 | geant3->SetRAYL(1); | |
59 | geant3->SetAUTO(1); //Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0) | |
60 | geant3->SetABAN(0); //Restore 3.16 behaviour for abandoned tracks | |
61 | geant3->SetOPTI(2); //Select optimisation level for GEANT geometry searches (0,1,2) | |
62 | geant3->SetERAN(5.e-7); | |
63 | ||
64 | Float_t cut = 1.e-3; // 1MeV cut by default | |
65 | Float_t tofmax = 1.e10; | |
66 | ||
67 | // GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX | |
68 | geant3->SetCUTS(cut, cut, cut, cut, cut, cut, cut, cut, cut, cut, | |
69 | tofmax); | |
2ab0c725 | 70 | // |
682a4a95 | 71 | //======================================================================= |
72 | // ************* STEERING parameters FOR ALICE SIMULATION ************** | |
73 | // --- Specify event type to be tracked through the ALICE setup | |
74 | // --- All positions are in cm, angles in degrees, and P and E in GeV | |
75 | if (gSystem->Getenv("CONFIG_NPARTICLES")) | |
76 | { | |
77 | int nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES")); | |
78 | } else | |
79 | { | |
80 | int nParticles = 50; | |
81 | } | |
82 | AliGenHIJINGpara *gener = new AliGenHIJINGpara(nParticles); | |
83 | ||
84 | gener->SetMomentumRange(0, 999); | |
85 | gener->SetPhiRange(0, 360); | |
81bf125a | 86 | // Set pseudorapidity range from -8 to 8. |
87 | Float_t thmin = EtaToTheta(8); // theta min. <---> eta max | |
88 | Float_t thmax = EtaToTheta(-8); // theta max. <---> eta min | |
89 | gener->SetThetaRange(thmin,thmax); | |
682a4a95 | 90 | gener->SetOrigin(0, 0, 0); //vertex position |
91 | gener->SetSigma(0, 0, 0); //Sigma in (X,Y,Z) (cm) on IP position | |
92 | gener->Init(); | |
93 | // | |
94 | // Activate this line if you want the vertex smearing to happen | |
95 | // track by track | |
2ab0c725 | 96 | // |
682a4a95 | 97 | //gener->SetVertexSmear(perTrack); |
35be7bcf | 98 | // Field (L3 0.4 T) |
99 | AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1); | |
100 | rootfile->cd(); | |
101 | gAlice->SetField(field); | |
102 | ||
103 | ||
104 | Int_t iABSO = 1; | |
105 | Int_t iDIPO = 1; | |
106 | Int_t iFMD = 1; | |
107 | Int_t iFRAME = 1; | |
108 | Int_t iHALL = 1; | |
109 | Int_t iITS = 1; | |
110 | Int_t iMAG = 1; | |
111 | Int_t iMUON = 1; | |
112 | Int_t iPHOS = 1; | |
113 | Int_t iPIPE = 1; | |
114 | Int_t iPMD = 1; | |
115 | Int_t iRICH = 1; | |
116 | Int_t iSHIL = 1; | |
117 | Int_t iSTART = 1; | |
118 | Int_t iTOF = 1; | |
119 | Int_t iTPC = 1; | |
120 | Int_t iTRD = 1; | |
121 | Int_t iZDC = 1; | |
122 | Int_t iEMCAL = 1; | |
123 | Int_t iCRT = 0; | |
2ab0c725 | 124 | |
682a4a95 | 125 | //=================== Alice BODY parameters ============================= |
126 | AliBODY *BODY = new AliBODY("BODY", "Alice envelop"); | |
2ab0c725 | 127 | |
682a4a95 | 128 | if (iMAG) |
129 | { | |
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 | } | |
8de40c27 | 135 | |
fe4da5cc | 136 | |
682a4a95 | 137 | if (iABSO) |
138 | { | |
139 | //=================== ABSO parameters ============================ | |
140 | AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber"); | |
141 | } | |
fe4da5cc | 142 | |
682a4a95 | 143 | if (iDIPO) |
144 | { | |
145 | //=================== DIPO parameters ============================ | |
fe4da5cc | 146 | |
682a4a95 | 147 | AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2"); |
148 | } | |
fe4da5cc | 149 | |
682a4a95 | 150 | if (iHALL) |
151 | { | |
152 | //=================== HALL parameters ============================ | |
2ab0c725 | 153 | |
682a4a95 | 154 | AliHALL *HALL = new AliHALL("HALL", "Alice Hall"); |
155 | } | |
2ab0c725 | 156 | |
2ab0c725 | 157 | |
682a4a95 | 158 | if (iFRAME) |
159 | { | |
160 | //=================== FRAME parameters ============================ | |
2ab0c725 | 161 | |
35be7bcf | 162 | AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame"); |
163 | if (geo == kHoles) { | |
164 | FRAME->SetHoles(1); | |
165 | } else { | |
166 | FRAME->SetHoles(0); | |
167 | } | |
682a4a95 | 168 | } |
fe4da5cc | 169 | |
682a4a95 | 170 | if (iSHIL) |
171 | { | |
172 | //=================== SHIL parameters ============================ | |
8dfe31df | 173 | |
35be7bcf | 174 | AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding Version 2"); |
682a4a95 | 175 | } |
fe4da5cc | 176 | |
ecd5c1f7 | 177 | |
682a4a95 | 178 | if (iPIPE) |
179 | { | |
180 | //=================== PIPE parameters ============================ | |
b422f318 | 181 | |
682a4a95 | 182 | AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe"); |
183 | } | |
d6478a5d | 184 | |
35be7bcf | 185 | if(iITS) { |
2ab0c725 | 186 | |
35be7bcf | 187 | //=================== ITS parameters ============================ |
d6478a5d | 188 | // |
189 | // As the innermost detector in ALICE, the Inner Tracking System "impacts" on | |
190 | // almost all other detectors. This involves the fact that the ITS geometry | |
191 | // still has several options to be followed in parallel in order to determine | |
192 | // the best set-up which minimizes the induced background. All the geometries | |
193 | // available to date are described in the following. Read carefully the comments | |
194 | // and use the default version (the only one uncommented) unless you are making | |
195 | // comparisons and you know what you are doing. In this case just uncomment the | |
196 | // ITS geometry you want to use and run Aliroot. | |
197 | // | |
198 | // Detailed geometries: | |
199 | // | |
200 | // | |
201 | //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services"); | |
202 | // | |
203 | //AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services"); | |
204 | // | |
35be7bcf | 205 | AliITSvPPRasymm *ITS = new AliITSvPPRasymm("ITS","New ITS PPR detailed version with asymmetric services"); |
206 | ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer | |
207 | ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer | |
3cdf398d | 208 | // ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer |
35be7bcf | 209 | ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300] |
210 | ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300] | |
211 | ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300] | |
212 | ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300] | |
213 | ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out | |
214 | ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon | |
215 | // | |
d6478a5d | 216 | //AliITSvPPRsymm *ITS = new AliITSvPPRsymm("ITS","New ITS PPR detailed version with symmetric services"); |
217 | //ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer | |
218 | //ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer | |
219 | //ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRsymm2.det"); // don't touch this parameter if you're not an ITS developer | |
6ed59d9f | 220 | //ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300] |
221 | //ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300] | |
222 | //ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300] | |
223 | //ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300] | |
35be7bcf | 224 | //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out |
d6478a5d | 225 | //ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon |
226 | // | |
227 | // | |
228 | // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful | |
229 | // for reconstruction !): | |
230 | // | |
231 | // | |
232 | //AliITSvPPRcoarseasymm *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services"); | |
35be7bcf | 233 | //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out |
d6478a5d | 234 | //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon |
235 | // | |
236 | //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services"); | |
35be7bcf | 237 | //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out |
d6478a5d | 238 | //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon |
239 | // | |
240 | // | |
241 | // | |
242 | // Geant3 <-> EUCLID conversion | |
243 | // ============================ | |
244 | // | |
245 | // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and | |
246 | // media to two ASCII files (called by default ITSgeometry.euc and | |
247 | // ITSgeometry.tme) in a format understandable to the CAD system EUCLID. | |
248 | // The default (=0) means that you dont want to use this facility. | |
249 | // | |
35be7bcf | 250 | ITS->SetEUCLID(0); |
251 | } | |
682a4a95 | 252 | |
253 | if (iTPC) | |
254 | { | |
255 | //============================ TPC parameters ================================ | |
256 | // --- This allows the user to specify sectors for the SLOW (TPC geometry 2) | |
257 | // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper) | |
258 | // --- sectors are specified, any value other than that requires at least one | |
259 | // --- sector (lower or upper)to be specified! | |
260 | // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0) | |
261 | // --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0) | |
262 | // --- SecLows - number of lower sectors specified (up to 6) | |
263 | // --- SecUps - number of upper sectors specified (up to 12) | |
264 | // --- Sens - sensitive strips for the Slow Simulator !!! | |
265 | // --- This does NOT work if all S or L-sectors are specified, i.e. | |
266 | // --- if SecAL or SecAU < 0 | |
267 | // | |
268 | // | |
269 | //----------------------------------------------------------------------------- | |
270 | ||
271 | // gROOT->LoadMacro("SetTPCParam.C"); | |
272 | // AliTPCParam *param = SetTPCParam(); | |
273 | AliTPC *TPC = new AliTPCv2("TPC", "Default"); | |
274 | ||
275 | // All sectors included | |
276 | TPC->SetSecAL(-1); | |
277 | TPC->SetSecAU(-1); | |
278 | ||
279 | } | |
280 | ||
35be7bcf | 281 | |
282 | if (iTOF) { | |
283 | if (geo == kHoles) { | |
682a4a95 | 284 | //=================== TOF parameters ============================ |
35be7bcf | 285 | AliTOF *TOF = new AliTOFv2FHoles("TOF", "TOF with Holes"); |
286 | } else { | |
287 | AliTOF *TOF = new AliTOFv4T0("TOF", "normal TOF"); | |
288 | } | |
682a4a95 | 289 | } |
290 | ||
35be7bcf | 291 | |
682a4a95 | 292 | if (iRICH) |
293 | { | |
294 | //=================== RICH parameters =========================== | |
35be7bcf | 295 | AliRICH *RICH = new AliRICHv3("RICH", "normal RICH"); |
682a4a95 | 296 | |
297 | } | |
298 | ||
299 | ||
300 | if (iZDC) | |
301 | { | |
302 | //=================== ZDC parameters ============================ | |
303 | ||
2423e0d9 | 304 | AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC"); |
682a4a95 | 305 | } |
306 | ||
682a4a95 | 307 | if (iTRD) |
308 | { | |
309 | //=================== TRD parameters ============================ | |
310 | ||
311 | AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator"); | |
312 | ||
313 | // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2) | |
314 | TRD->SetGasMix(1); | |
35be7bcf | 315 | if (geo == kHoles) { |
316 | // With hole in front of PHOS | |
317 | TRD->SetPHOShole(); | |
318 | // With hole in front of RICH | |
319 | TRD->SetRICHhole(); | |
320 | } | |
321 | // Switch on TR | |
322 | AliTRDsim *TRDsim = TRD->CreateTR(); | |
682a4a95 | 323 | } |
324 | ||
325 | if (iFMD) | |
326 | { | |
327 | //=================== FMD parameters ============================ | |
35be7bcf | 328 | AliFMD *FMD = new AliFMDv1("FMD", "normal FMD"); |
6e0a07ef | 329 | FMD->SetRingsSi1(256); |
35be7bcf | 330 | FMD->SetRingsSi2(128); |
f6d3338b | 331 | FMD->SetSectorsSi1(20); |
35be7bcf | 332 | FMD->SetSectorsSi2(40); |
f6d3338b | 333 | } |
682a4a95 | 334 | |
335 | if (iMUON) | |
336 | { | |
337 | //=================== MUON parameters =========================== | |
338 | ||
339 | AliMUON *MUON = new AliMUONv1("MUON", "default"); | |
340 | } | |
341 | //=================== PHOS parameters =========================== | |
342 | ||
343 | if (iPHOS) | |
344 | { | |
35be7bcf | 345 | AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP"); |
682a4a95 | 346 | } |
347 | ||
348 | ||
349 | if (iPMD) | |
350 | { | |
351 | //=================== PMD parameters ============================ | |
682a4a95 | 352 | AliPMD *PMD = new AliPMDv1("PMD", "normal PMD"); |
35be7bcf | 353 | } |
682a4a95 | 354 | |
35be7bcf | 355 | if (iSTART) |
356 | { | |
357 | //=================== START parameters ============================ | |
358 | AliSTART *START = new AliSTARTv1("START", "START Detector"); | |
682a4a95 | 359 | } |
360 | ||
35be7bcf | 361 | if (iEMCAL) |
9757d28c | 362 | { |
363 | //=================== EMCAL parameters ============================ | |
364 | AliEMCAL *EMCAL = new AliEMCALv1("EMCAL", "EMCALArch1a"); | |
365 | } | |
366 | ||
35be7bcf | 367 | if (iCRT) |
682a4a95 | 368 | { |
35be7bcf | 369 | //=================== CRT parameters ============================ |
370 | AliCRT *CRT = new AliCRTv0("CRT", "normal ACORDE"); | |
682a4a95 | 371 | } |
372 | ||
35be7bcf | 373 | if (iVZERO) |
374 | { | |
375 | //=================== CRT parameters ============================ | |
376 | AliVZERO *VZERO = new AliVZEROv2("VZERO", "normal VZERO"); | |
377 | } | |
682a4a95 | 378 | |
379 | } | |
81bf125a | 380 | |
381 | Float_t EtaToTheta(Float_t arg){ | |
382 | return (180./TMath::Pi())*2.*atan(exp(-arg)); | |
383 | } |