48c42d52 |
1 | // One can use the configuration macro in compiled mode by |
2 | // root [0] gSystem->Load("libgeant321"); |
3 | // root [0] gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include\ |
4 | // -I$ALICE_ROOT -I$ALICE/geant3/TGeant3"); |
5 | // root [0] .x grun.C(1,"ConfigHBT.C++") |
6 | |
7 | #if !defined(__CINT__) || defined(__MAKECINT__) |
8 | #include <Riostream.h> |
9 | #include <TRandom.h> |
10 | #include <TSystem.h> |
11 | #include <TVirtualMC.h> |
12 | #include <TGeant3.h> |
13 | #include "STEER/AliRunLoader.h" |
14 | #include "STEER/AliRun.h" |
15 | #include "STEER/AliConfig.h" |
16 | #include "PYTHIA6/AliDecayerPythia.h" |
17 | #include "EVGEN/AliGenCocktailAfterBurner.h" |
18 | #include "TMEVSIM/AliMevSimConfig.h" |
19 | #include "TMEVSIM/AliMevSimParticle.h" |
20 | #include "TMEVSIM/AliGenMevSim.h" |
21 | #include "THbtp/AliGenHBTprocessor.h" |
22 | #include "STRUCT/AliBODY.h" |
23 | #include "STRUCT/AliMAG.h" |
24 | #include "STRUCT/AliABSOv0.h" |
25 | #include "STRUCT/AliDIPOv2.h" |
26 | #include "STRUCT/AliHALL.h" |
27 | #include "STRUCT/AliFRAMEv2.h" |
28 | #include "STRUCT/AliSHILv2.h" |
29 | #include "STRUCT/AliPIPEv0.h" |
30 | #include "ITS/AliITSvPPRasymm.h" |
31 | #include "TPC/AliTPCv2.h" |
32 | #include "TOF/AliTOFv2.h" |
33 | #include "RICH/AliRICHv1.h" |
34 | #include "ZDC/AliZDCv1.h" |
35 | #include "TRD/AliTRDv1.h" |
36 | #include "FMD/AliFMDv1.h" |
37 | #include "MUON/AliMUONv1.h" |
38 | #include "PHOS/AliPHOSv1.h" |
39 | #include "PMD/AliPMDv1.h" |
40 | #include "START/AliSTARTv1.h" |
41 | #include "EMCAL/AliEMCALv1.h" |
42 | #include "CRT/AliCRTv1.h" |
43 | #include "VZERO/AliVZEROv2.h" |
44 | #endif |
45 | |
66d04b38 |
46 | void Config() |
47 | { |
66d04b38 |
48 | // Set Random Number seed |
49 | // gRandom->SetSeed(12345); |
50 | |
b9d0a01d |
51 | new TGeant3("C++ Interface to Geant3"); |
66d04b38 |
52 | |
48c42d52 |
53 | cout<<"Config.C: Creating Run Loader ..."<<endl; |
54 | AliRunLoader* rl = AliRunLoader::Open("galice.root",AliConfig::fgkDefaultEventFolderName, |
88cb7938 |
55 | "recreate"); |
48c42d52 |
56 | if (rl == 0x0) |
57 | { |
58 | gAlice->Fatal("Config.C","Can not instatiate the Run Loader"); |
59 | return; |
60 | } |
61 | rl->SetCompressionLevel(2); |
62 | rl->SetNumberOfEventsPerFile(6); |
63 | gAlice->SetRunLoader(rl); |
66d04b38 |
64 | |
65 | // |
66 | // Set External decayer |
67 | AliDecayer *decayer = new AliDecayerPythia(); |
68 | |
69 | decayer->SetForceDecay(kAll); |
70 | decayer->Init(); |
71 | gMC->SetExternalDecayer(decayer); |
72 | // |
66d04b38 |
73 | //======================================================================= |
6a3df6c9 |
74 | // ************* STEERING parameters FOR ALICE SIMULATION ************** |
75 | // --- Specify event type to be tracked through the ALICE setup |
76 | // --- All positions are in cm, angles in degrees, and P and E in GeV |
77 | |
78 | |
79 | |
80 | gMC->SetProcess("DCAY",1); |
81 | gMC->SetProcess("PAIR",1); |
82 | gMC->SetProcess("COMP",1); |
83 | gMC->SetProcess("PHOT",1); |
84 | gMC->SetProcess("PFIS",0); |
85 | gMC->SetProcess("DRAY",0); |
86 | gMC->SetProcess("ANNI",1); |
87 | gMC->SetProcess("BREM",1); |
88 | gMC->SetProcess("MUNU",1); |
89 | gMC->SetProcess("CKOV",1); |
90 | gMC->SetProcess("HADR",1); |
91 | gMC->SetProcess("LOSS",2); |
92 | gMC->SetProcess("MULS",1); |
93 | gMC->SetProcess("RAYL",1); |
66d04b38 |
94 | |
95 | Float_t cut = 1.e-3; // 1MeV cut by default |
96 | Float_t tofmax = 1.e10; |
97 | |
6a3df6c9 |
98 | gMC->SetCut("CUTGAM", cut); |
99 | gMC->SetCut("CUTELE", cut); |
100 | gMC->SetCut("CUTNEU", cut); |
101 | gMC->SetCut("CUTHAD", cut); |
102 | gMC->SetCut("CUTMUO", cut); |
103 | gMC->SetCut("BCUTE", cut); |
104 | gMC->SetCut("BCUTM", cut); |
105 | gMC->SetCut("DCUTE", cut); |
106 | gMC->SetCut("DCUTM", cut); |
107 | gMC->SetCut("PPCUTM", cut); |
108 | gMC->SetCut("TOFMAX", tofmax); |
109 | |
110 | |
66d04b38 |
111 | if (gSystem->Getenv("CONFIG_NPARTICLES")) |
112 | { |
113 | int nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES")); |
114 | } else |
115 | { |
116 | int nParticles = 10000; |
117 | } |
66d04b38 |
118 | |
119 | /*********************************************************************************/ |
120 | /*********************************************************************************/ |
121 | /***************** G E N E R A T O R S *********************************/ |
122 | |
123 | /** C O C K T A I L W I T H A F T E R B U R N E R S A F T E R W A R D S **/ |
124 | /***************** (WRAPPER GENERATOR) *********************************/ |
125 | |
126 | |
127 | |
99f4b63d |
128 | AliGenCocktailAfterBurner* gener = new AliGenCocktailAfterBurner(); |
66d04b38 |
129 | gener->SetPhiRange(0, 360); |
99f4b63d |
130 | gener->SetThetaRange(40., 140.); |
66d04b38 |
131 | gener->SetOrigin(0, 0, 0); //vertex position |
132 | gener->SetSigma(0, 0, 0); //Sigma in (X,Y,Z) (cm) on IP position |
133 | |
134 | /***************** HIJING PARAMETRIZATION ********************************/ |
135 | |
99f4b63d |
136 | //AliGenHIJINGpara *g2 = new AliGenHIJINGpara(5); |
137 | //g2->SetMomentumRange(0, 999); |
66d04b38 |
138 | |
139 | /***************** G E N B O X ***********************************/ |
140 | |
99f4b63d |
141 | // AliGenBox *g1 = new AliGenBox(5); |
142 | // g1->SetMomentumRange(0, 3); |
66d04b38 |
143 | // g1->SetOrigin(0,0,0); //vertex position |
144 | // g1->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position |
145 | // g1->SetPart(310); //K0short(310), Lambda(3122) |
146 | |
147 | |
148 | /***************** M E V S I M ********************************/ |
66d04b38 |
149 | |
150 | AliMevSimConfig *c = new AliMevSimConfig(1); |
151 | c->SetRectPlane(1); // reaction plane control, model 4 |
99f4b63d |
152 | c->SetGrid(80,80); |
153 | |
66d04b38 |
154 | AliGenMevSim *g3 = new AliGenMevSim(c); |
99f4b63d |
155 | g3->SetPtRange(0.001, 3); |
156 | g3->SetMomentumRange(0.1, 3); |
157 | |
66d04b38 |
158 | g3->SetTrackingFlag(1); |
159 | g3->SetOrigin(0.0, 0.0, 0.0); |
160 | g3->SetSigma(0.0, 0.0, 0.0); |
99f4b63d |
161 | //g3->SetEtaCutRange(-4,4); |
66d04b38 |
162 | |
88cb7938 |
163 | AliMevSimParticle *piPlus = new AliMevSimParticle(kPiPlus, 100, 3, 0.2, 0.01, 3, 0.1, 0.0, 0.0); |
164 | AliMevSimParticle *piMinus = new AliMevSimParticle(kPiMinus, 100, 3, 0.2, 0.01, 3, 0.1, 0.0, 0.0); |
66d04b38 |
165 | //AliMevSimParticle *KPlus = new AliMevSimParticle(kKPlus, 10, 0, 0.25, 0.0, 2, 0.15, 0.0, 0.0 ); |
166 | //AliMevSimParticle *KMinus = new AliMevSimParticle(kKMinus, 10, 0, 0.25, 0.0, 2, 0.15, 0.0, 0.0 ); |
167 | //AliMevSimParticle *protonPlus = new AliMevSimParticle(kProton, 3, 0, 0.4, 0.0, 2, 0.15, 0.0, 0.0); |
168 | //AliMevSimParticle *protonMinus = new AliMevSimParticle(kProtonBar, 2, 0, 0.4, 0.0, 2, 0.15, 0.0, 0.0); |
169 | |
66d04b38 |
170 | g3->AddParticleType(piPlus); |
171 | g3->AddParticleType(piMinus); |
172 | //g3->AddParticleType(KPlus); |
173 | //g3->AddParticleType(KMinus); |
174 | //g3->AddParticleType(protonPlus); |
175 | //g3->AddParticleType(protonMinus); |
176 | |
99f4b63d |
177 | |
66d04b38 |
178 | /***************** H B T P R O C E S S O R ********************************/ |
179 | |
180 | AliGenHBTprocessor *hbtp = new AliGenHBTprocessor(); |
181 | hbtp->SetRefControl(2); |
182 | hbtp->SetSwitch1D(1); |
183 | hbtp->SetSwitch3D(1); |
88cb7938 |
184 | hbtp->SetSwitchCoulomb(1); |
66d04b38 |
185 | hbtp->SetSwitchCoherence(0); |
88cb7938 |
186 | hbtp->SetSwitchFermiBose(-1); |
99f4b63d |
187 | hbtp->SetDeltap(0.1); |
66d04b38 |
188 | hbtp->SetDelChi(0.1); |
99f4b63d |
189 | hbtp->SetLambda(0.5); |
190 | hbtp->SetQ0(8.0); |
191 | hbtp->SetR0(8.0); |
192 | hbtp->SetRParallel(8.0); |
193 | hbtp->SetR1d(8.0); |
194 | hbtp->SetRSide(8.0); |
195 | hbtp->SetRLong(8.0); |
196 | hbtp->SetROut(8.0); |
66d04b38 |
197 | hbtp->SetPtRange(0.1,0.98); |
198 | hbtp->SetPIDs(211,-211); //pi+ pi- |
199 | hbtp->SetSwitchType(3); // fit both the like and unlike pair correl |
88cb7938 |
200 | hbtp->SetMaxIterations(300); |
66d04b38 |
201 | /***********************************************************************************/ |
202 | |
99f4b63d |
203 | // gener->AddGenerator(g2,"HIJING PARAMETRIZATION",1); |
66d04b38 |
204 | // gener->AddGenerator(g1,"BOX (K0short)",1); |
205 | gener->AddGenerator(g3,"MEVSIM",1); |
206 | |
207 | gener->AddAfterBurner(hbtp,"HBT PROCESSOR",1); |
208 | |
209 | gener->Init(); |
210 | // |
211 | // Activate this line if you want the vertex smearing to happen |
212 | // track by track |
213 | // |
214 | //gener->SetVertexSmear(perTrack); |
215 | |
216 | gAlice->SetField(-999, 2); //Specify maximum magnetic field in Tesla (neg. ==> default field) |
99f4b63d |
217 | // gAlice->SetField(-999, 2, 2.); //Specify maximum magnetic field in Tesla (neg. ==> default field) |
218 | //Last number indicates the scale factor |
66d04b38 |
219 | |
220 | Int_t iABSO = 1; |
b9d0a01d |
221 | Int_t iCRT = 0; |
66d04b38 |
222 | Int_t iDIPO = 1; |
223 | Int_t iFMD = 0; |
224 | Int_t iFRAME = 1; |
225 | Int_t iHALL = 1; |
226 | Int_t iITS = 1; |
227 | Int_t iMAG = 1; |
228 | Int_t iMUON = 0; |
229 | Int_t iPHOS = 0; |
230 | Int_t iPIPE = 1; |
231 | Int_t iPMD = 0; |
232 | Int_t iRICH = 0; |
233 | Int_t iSHIL = 1; |
234 | Int_t iSTART = 0; |
235 | Int_t iTOF = 0; |
236 | Int_t iTPC = 1; |
237 | Int_t iTRD = 0; |
238 | Int_t iZDC = 0; |
9757d28c |
239 | Int_t iEMCAL = 0; |
66d04b38 |
240 | |
241 | //=================== Alice BODY parameters ============================= |
242 | AliBODY *BODY = new AliBODY("BODY", "Alice envelop"); |
243 | |
244 | |
245 | if (iMAG) |
246 | { |
247 | //=================== MAG parameters ============================ |
248 | // --- Start with Magnet since detector layouts may be depending --- |
249 | // --- on the selected Magnet dimensions --- |
250 | AliMAG *MAG = new AliMAG("MAG", "Magnet"); |
251 | } |
252 | |
253 | |
254 | if (iABSO) |
255 | { |
256 | //=================== ABSO parameters ============================ |
257 | AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber"); |
258 | } |
259 | |
260 | if (iDIPO) |
261 | { |
262 | //=================== DIPO parameters ============================ |
263 | |
264 | AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2"); |
265 | } |
266 | |
267 | if (iHALL) |
268 | { |
269 | //=================== HALL parameters ============================ |
270 | |
271 | AliHALL *HALL = new AliHALL("HALL", "Alice Hall"); |
272 | } |
273 | |
274 | |
275 | if (iFRAME) |
276 | { |
277 | //=================== FRAME parameters ============================ |
278 | |
279 | AliFRAME *FRAME = new AliFRAMEv2("FRAME", "Space Frame"); |
280 | |
281 | } |
282 | |
283 | if (iSHIL) |
284 | { |
285 | //=================== SHIL parameters ============================ |
286 | |
e0559846 |
287 | AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding"); |
66d04b38 |
288 | } |
289 | |
290 | |
291 | if (iPIPE) |
292 | { |
293 | //=================== PIPE parameters ============================ |
294 | |
295 | AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe"); |
296 | } |
297 | |
298 | if(iITS) { |
299 | |
300 | //=================== ITS parameters ============================ |
301 | // |
302 | // As the innermost detector in ALICE, the Inner Tracking System "impacts" on |
303 | // almost all other detectors. This involves the fact that the ITS geometry |
304 | // still has several options to be followed in parallel in order to determine |
305 | // the best set-up which minimizes the induced background. All the geometries |
306 | // available to date are described in the following. Read carefully the comments |
307 | // and use the default version (the only one uncommented) unless you are making |
308 | // comparisons and you know what you are doing. In this case just uncomment the |
309 | // ITS geometry you want to use and run Aliroot. |
310 | // |
311 | // Detailed geometries: |
312 | // |
313 | // |
314 | //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services"); |
315 | // |
316 | //AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services"); |
317 | // |
318 | AliITSvPPRasymm *ITS = new AliITSvPPRasymm("ITS","New ITS PPR detailed version with asymmetric services"); |
319 | ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer |
320 | ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer |
99f4b63d |
321 | // ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer |
322 | ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300] |
323 | ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300] |
324 | ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300] |
325 | ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300] |
66d04b38 |
326 | ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out |
327 | ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon |
328 | // |
329 | //AliITSvPPRsymm *ITS = new AliITSvPPRsymm("ITS","New ITS PPR detailed version with symmetric services"); |
330 | //ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer |
331 | //ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer |
332 | //ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRsymm2.det"); // don't touch this parameter if you're not an ITS developer |
333 | //ITS->SetThicknessDet1(300.); // detector thickness on layer 1 must be in the range [100,300] |
334 | //ITS->SetThicknessDet2(300.); // detector thickness on layer 2 must be in the range [100,300] |
335 | //ITS->SetThicknessChip1(300.); // chip thickness on layer 1 must be in the range [150,300] |
336 | //ITS->SetThicknessChip2(300.); // chip thickness on layer 2 must be in the range [150,300] |
337 | //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out |
338 | //ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon |
339 | // |
340 | // |
341 | // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful |
342 | // for reconstruction !): |
343 | // |
344 | // |
345 | //AliITSvPPRcoarseasymm *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services"); |
346 | //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out |
347 | //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon |
348 | // |
349 | //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services"); |
350 | //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out |
351 | //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon |
352 | // |
353 | // |
354 | // |
355 | // Geant3 <-> EUCLID conversion |
356 | // ============================ |
357 | // |
358 | // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and |
359 | // media to two ASCII files (called by default ITSgeometry.euc and |
360 | // ITSgeometry.tme) in a format understandable to the CAD system EUCLID. |
361 | // The default (=0) means that you dont want to use this facility. |
362 | // |
363 | ITS->SetEUCLID(0); |
364 | } |
365 | |
366 | |
367 | if (iTPC) |
368 | { |
369 | //============================ TPC parameters ================================ |
370 | // --- This allows the user to specify sectors for the SLOW (TPC geometry 2) |
371 | // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper) |
372 | // --- sectors are specified, any value other than that requires at least one |
373 | // --- sector (lower or upper)to be specified! |
374 | // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0) |
375 | // --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0) |
376 | // --- SecLows - number of lower sectors specified (up to 6) |
377 | // --- SecUps - number of upper sectors specified (up to 12) |
378 | // --- Sens - sensitive strips for the Slow Simulator !!! |
379 | // --- This does NOT work if all S or L-sectors are specified, i.e. |
380 | // --- if SecAL or SecAU < 0 |
381 | // |
382 | // |
383 | //----------------------------------------------------------------------------- |
384 | |
385 | // gROOT->LoadMacro("SetTPCParam.C"); |
386 | // AliTPCParam *param = SetTPCParam(); |
387 | AliTPC *TPC = new AliTPCv2("TPC", "Default"); |
388 | |
389 | // All sectors included |
390 | TPC->SetSecAL(-1); |
391 | TPC->SetSecAU(-1); |
392 | |
393 | } |
394 | |
395 | if (iTOF) |
396 | { |
397 | //=================== TOF parameters ============================ |
398 | AliTOF *TOF = new AliTOFv2("TOF", "normal TOF"); |
399 | } |
400 | |
401 | if (iRICH) |
402 | { |
403 | //=================== RICH parameters =========================== |
404 | AliRICH *RICH = new AliRICHv1("RICH", "normal RICH"); |
405 | |
406 | } |
407 | |
408 | |
409 | if (iZDC) |
410 | { |
411 | //=================== ZDC parameters ============================ |
412 | |
413 | AliZDC *ZDC = new AliZDCv1("ZDC", "normal ZDC"); |
414 | } |
415 | |
b9d0a01d |
416 | if (iCRT) |
66d04b38 |
417 | { |
b9d0a01d |
418 | //=================== CRT parameters ============================ |
66d04b38 |
419 | |
b9d0a01d |
420 | AliCRT *CRT = new AliCRTv1("CRT", "normal CRT"); |
66d04b38 |
421 | } |
422 | |
423 | if (iTRD) |
424 | { |
425 | //=================== TRD parameters ============================ |
426 | |
427 | AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator"); |
428 | |
429 | // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2) |
430 | TRD->SetGasMix(1); |
431 | |
432 | // With hole in front of PHOS |
433 | TRD->SetPHOShole(); |
434 | // With hole in front of RICH |
435 | TRD->SetRICHhole(); |
436 | // Switch on TR |
437 | AliTRDsim *TRDsim = TRD->CreateTR(); |
438 | } |
439 | |
440 | if (iFMD) |
441 | { |
442 | //=================== FMD parameters ============================ |
443 | |
444 | AliFMD *FMD = new AliFMDv1("FMD", "normal FMD"); |
445 | } |
446 | |
447 | if (iMUON) |
448 | { |
449 | //=================== MUON parameters =========================== |
450 | |
451 | AliMUON *MUON = new AliMUONv1("MUON", "default"); |
452 | } |
453 | //=================== PHOS parameters =========================== |
454 | |
455 | if (iPHOS) |
456 | { |
457 | AliPHOS *PHOS = new AliPHOSv1("PHOS", "GPS2"); |
458 | } |
459 | |
460 | |
461 | if (iPMD) |
462 | { |
463 | //=================== PMD parameters ============================ |
464 | |
465 | AliPMD *PMD = new AliPMDv1("PMD", "normal PMD"); |
466 | |
467 | PMD->SetPAR(1., 1., 0.8, 0.02); |
468 | PMD->SetIN(6., 18., -580., 27., 27.); |
469 | PMD->SetGEO(0.0, 0.2, 4.); |
470 | PMD->SetPadSize(0.8, 1.0, 1.0, 1.5); |
471 | |
472 | } |
9757d28c |
473 | if (iEMCAL && !iRICH) |
474 | { |
475 | //=================== EMCAL parameters ============================ |
88cb7938 |
476 | AliEMCAL *EMCAL = new AliEMCALv1("EMCAL", "EMCALArch1a"); |
9757d28c |
477 | } |
66d04b38 |
478 | |
479 | if (iSTART) |
480 | { |
481 | //=================== START parameters ============================ |
482 | AliSTART *START = new AliSTARTv1("START", "START Detector"); |
483 | } |
484 | |
485 | |
486 | } |