]>
Commit | Line | Data |
---|---|---|
02d6eccc | 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,"Config.C++" | |
6 | ||
7 | #if !defined(__CINT__) || defined(__MAKECINT__) | |
8 | #include <Riostream.h> | |
9 | #include <TPDGCode.h> | |
10 | #include <TRandom.h> | |
11 | #include <TSystem.h> | |
12 | #include <TVirtualMC.h> | |
13 | #include <TGeant3TGeo.h> | |
14 | #include "STEER/AliRunLoader.h" | |
15 | #include "STEER/AliRun.h" | |
16 | #include "STEER/AliConfig.h" | |
17 | #include "PYTHIA6/AliDecayerPythia.h" | |
18 | #include "EVGEN/AliGenCocktail.h" | |
19 | #include "EVGEN/AliGenHIJINGpara.h" | |
20 | #include "EVGEN/AliGenFixed.h" | |
21 | #include "EVGEN/AliGenBox.h" | |
22 | #include "STEER/AliMagWrapCheb.h" | |
23 | #include "STRUCT/AliBODY.h" | |
24 | #include "STRUCT/AliMAG.h" | |
25 | #include "STRUCT/AliABSOv3.h" | |
26 | #include "STRUCT/AliDIPOv3.h" | |
27 | #include "STRUCT/AliHALLv3.h" | |
28 | #include "STRUCT/AliFRAMEv2.h" | |
29 | #include "STRUCT/AliSHILv3.h" | |
30 | #include "STRUCT/AliPIPEv3.h" | |
4f976c08 | 31 | #include "STRUCT/AliPIPEupgrade.h" |
02d6eccc | 32 | #include "ITS/AliITSv11.h" |
33 | #include "ITS/UPGRADE/AliITSUv11.h" | |
34 | #include "TPC/AliTPCv2.h" | |
35 | #include "TOF/AliTOFv6T0.h" | |
36 | #include "HMPID/AliHMPIDv3.h" | |
37 | #include "ZDC/AliZDCv3.h" | |
38 | #include "TRD/AliTRDv1.h" | |
39 | #include "TRD/AliTRDgeometry.h" | |
40 | #include "FMD/AliFMDv1.h" | |
41 | #include "MUON/AliMUONv1.h" | |
42 | #include "PHOS/AliPHOSv1.h" | |
43 | #include "PMD/AliPMDv1.h" | |
44 | #include "T0/AliT0v1.h" | |
45 | #include "EMCAL/AliEMCALv2.h" | |
46 | #include "ACORDE/AliACORDEv1.h" | |
47 | #include "VZERO/AliVZEROv7.h" | |
48 | #include <TVirtualMagField.h> | |
49 | #endif | |
50 | ||
4f976c08 | 51 | Int_t generatorFlag = 1; |
52 | ||
02d6eccc | 53 | /* $Id: Config.C 47147 2011-02-07 11:46:44Z amastros $ */ |
54 | enum PprTrigConf_t | |
55 | { | |
56 | kDefaultPPTrig, kDefaultPbPbTrig | |
57 | }; | |
58 | ||
59 | const char * pprTrigConfName[] = { | |
60 | "p-p","Pb-Pb" | |
61 | }; | |
62 | ||
63 | Float_t EtaToTheta(Float_t arg); | |
64 | ||
65 | static PprTrigConf_t strig = kDefaultPPTrig;// default PP trigger configuration | |
66 | ||
67 | void Config() | |
68 | { | |
69 | // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00 | |
70 | // Theta range given through pseudorapidity limits 22/6/2001 | |
71 | ||
72 | // Set Random Number seed | |
73 | gRandom->SetSeed(0); // Set 0 to use the currecnt time | |
74 | ||
75 | ||
76 | // libraries required by geant321 | |
77 | #if defined(__CINT__) | |
78 | gSystem->Load("liblhapdf"); | |
79 | gSystem->Load("libEGPythia6"); | |
80 | gSystem->Load("libpythia6"); | |
81 | gSystem->Load("libAliPythia6"); | |
82 | gSystem->Load("libgeant321"); | |
4f976c08 | 83 | gSystem->Load("libhijing"); |
84 | gSystem->Load("libTHijing"); | |
02d6eccc | 85 | #endif |
86 | gSystem->Load("libITSUpgradeBase.so"); | |
87 | gSystem->Load("libITSUpgradeSim.so"); | |
88 | ||
89 | ||
90 | new TGeant3TGeo("C++ Interface to Geant3"); | |
91 | ||
92 | AliRunLoader* rl=0x0; | |
93 | ||
94 | ||
95 | rl = AliRunLoader::Open("galice.root", | |
96 | AliConfig::GetDefaultEventFolderName(), | |
97 | "recreate"); | |
98 | if (rl == 0x0) | |
99 | { | |
100 | gAlice->Fatal("Config.C","Can not instatiate the Run Loader"); | |
101 | return; | |
102 | } | |
103 | rl->SetCompressionLevel(2); | |
104 | rl->SetNumberOfEventsPerFile(2000); | |
105 | gAlice->SetRunLoader(rl); | |
106 | ||
107 | // Set the trigger configuration | |
108 | // gAlice->SetTriggerDescriptor(pprTrigConfName[strig]); | |
109 | //cout<<"Trigger configuration is set to "<<pprTrigConfName[strig]<<endl; | |
110 | AliSimulation::Instance()->SetTriggerConfig(pprTrigConfName[strig]); | |
111 | cout<<"Trigger configuration is set to pprTrigConfName[strig] "<<endl; | |
112 | ||
113 | // | |
114 | // Set External decayer | |
115 | TVirtualMCDecayer *decayer = new AliDecayerPythia(); | |
116 | ||
117 | decayer->SetForceDecay(kAll); | |
118 | decayer->Init(); | |
119 | gMC->SetExternalDecayer(decayer); | |
120 | //======================================================================= | |
121 | // ************* STEERING parameters FOR ALICE SIMULATION ************** | |
122 | // --- Specify event type to be tracked through the ALICE setup | |
123 | // --- All positions are in cm, angles in degrees, and P and E in GeV | |
124 | ||
125 | ||
126 | gMC->SetProcess("DCAY",1); | |
127 | gMC->SetProcess("PAIR",1); | |
128 | gMC->SetProcess("COMP",1); | |
129 | gMC->SetProcess("PHOT",1); | |
130 | gMC->SetProcess("PFIS",0); | |
131 | gMC->SetProcess("DRAY",0); | |
132 | gMC->SetProcess("ANNI",1); | |
133 | gMC->SetProcess("BREM",1); | |
134 | gMC->SetProcess("MUNU",1); | |
135 | gMC->SetProcess("CKOV",1); | |
136 | gMC->SetProcess("HADR",0); | |
137 | gMC->SetProcess("LOSS",2); | |
138 | gMC->SetProcess("MULS",1); | |
139 | gMC->SetProcess("RAYL",1); | |
140 | ||
141 | Float_t cut = 1.e-3; // 1MeV cut by default | |
142 | Float_t tofmax = 1.e10; | |
143 | ||
144 | gMC->SetCut("CUTGAM", cut); | |
145 | gMC->SetCut("CUTELE", cut); | |
146 | gMC->SetCut("CUTNEU", cut); | |
147 | gMC->SetCut("CUTHAD", cut); | |
148 | gMC->SetCut("CUTMUO", cut); | |
149 | gMC->SetCut("BCUTE", cut); | |
150 | gMC->SetCut("BCUTM", cut); | |
151 | gMC->SetCut("DCUTE", cut); | |
152 | gMC->SetCut("DCUTM", cut); | |
153 | gMC->SetCut("PPCUTM", cut); | |
154 | gMC->SetCut("TOFMAX", tofmax); | |
155 | ||
156 | // Special generation for Valgrind tests | |
157 | // Each detector is fired by few particles selected | |
158 | // to cover specific cases | |
159 | ||
160 | ||
161 | // The cocktail itself | |
02d6eccc | 162 | |
4f976c08 | 163 | if (generatorFlag==0) { |
164 | // Fast generator with parametrized pi,kaon,proton distributions | |
165 | ||
166 | int nParticles = 50;//14022; | |
167 | AliGenHIJINGpara *gener = new AliGenHIJINGpara(nParticles); | |
168 | gener->SetMomentumRange(0.1, 10.); | |
169 | gener->SetPhiRange(0., 360.); | |
170 | Float_t thmin = EtaToTheta(2.5); // theta min. <---> eta max | |
171 | Float_t thmax = EtaToTheta(-2.5); // theta max. <---> eta min | |
172 | gener->SetThetaRange(thmin,thmax); | |
173 | gener->SetOrigin(0, 0, 0); //vertex position | |
174 | gener->SetSigma(0, 0, 0); //Sigma in (X,Y,Z) (cm) on IP position | |
175 | gener->Init(); | |
176 | ||
177 | } else if (generatorFlag==1) { | |
178 | ||
179 | // Pure HiJing generator adapted to ~2000dNdy at highest energy | |
180 | ||
181 | AliGenHijing *generHijing = new AliGenHijing(-1); | |
182 | generHijing->SetEnergyCMS(5500.); // GeV | |
183 | generHijing->SetImpactParameterRange(0,2); | |
184 | generHijing->SetReferenceFrame("CMS"); | |
185 | generHijing->SetProjectile("A", 208, 82); | |
186 | generHijing->SetTarget ("A", 208, 82); | |
187 | generHijing->KeepFullEvent(); | |
188 | generHijing->SetJetQuenching(1); | |
189 | generHijing->SetShadowing(1); | |
190 | generHijing->SetSpectators(0); | |
191 | generHijing->SetSelectAll(0); | |
192 | generHijing->SetPtHardMin(4.5); | |
193 | ||
194 | AliGenerator* gener = generHijing; | |
195 | gener->SetSigma(0, 0, 6); // Sigma in (X,Y,Z) (cm) on IP position | |
196 | gener->SetVertexSmear(kPerEvent); | |
197 | gener->Init(); | |
198 | ||
199 | } | |
02d6eccc | 200 | |
201 | // | |
202 | // Activate this line if you want the vertex smearing to happen | |
203 | // track by track | |
204 | // | |
205 | //VertexSmear_t perTrack; | |
206 | //gener->SetVertexSmear(perTrack); | |
207 | // Field (L3 0.5 T) | |
208 | //AliMagF* field = new AliMagF("map","map",2, -1.,1., 15, AliMagF::k5kGUniform); | |
209 | //TGeoGlobalMagField::Instance()->SetField(field); | |
210 | TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", -1., -1., AliMagF::k5kG)); | |
211 | ||
4f976c08 | 212 | Int_t iABSO = 1; |
213 | Int_t iDIPO = 1; | |
214 | Int_t iFMD = 1; | |
215 | Int_t iFRAME = 1; | |
216 | Int_t iHALL = 1; | |
02d6eccc | 217 | Int_t iITS = 1; |
4f976c08 | 218 | Int_t iMAG = 1; |
219 | Int_t iMUON = 1; | |
220 | Int_t iPHOS = 1; | |
221 | Int_t iPIPE = 1; | |
222 | Int_t iPMD = 1; | |
223 | Int_t iHMPID = 1; | |
224 | Int_t iSHIL = 1; | |
225 | Int_t iT0 = 1; | |
226 | Int_t iTOF = 1; | |
227 | Int_t iTPC = 1; | |
228 | Int_t iTRD = 1; | |
229 | Int_t iZDC = 1; | |
230 | Int_t iEMCAL = 1; | |
231 | Int_t iACORDE= 1; | |
232 | Int_t iVZERO = 1; | |
02d6eccc | 233 | rl->CdGAFile(); |
234 | //=================== Alice BODY parameters ============================= | |
235 | AliBODY *BODY = new AliBODY("BODY", "Alice envelop"); | |
236 | ||
237 | if (iMAG) | |
238 | { | |
239 | //=================== MAG parameters ============================ | |
240 | // --- Start with Magnet since detector layouts may be depending --- | |
241 | // --- on the selected Magnet dimensions --- | |
242 | AliMAG *MAG = new AliMAG("MAG", "Magnet"); | |
243 | } | |
244 | ||
245 | ||
246 | if (iABSO) | |
247 | { | |
248 | //=================== ABSO parameters ============================ | |
249 | AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber"); | |
250 | } | |
251 | ||
252 | if (iDIPO) | |
253 | { | |
254 | //=================== DIPO parameters ============================ | |
255 | ||
256 | AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3"); | |
257 | } | |
258 | ||
259 | if (iHALL) | |
260 | { | |
261 | //=================== HALL parameters ============================ | |
262 | ||
263 | AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall"); | |
264 | } | |
265 | ||
266 | ||
267 | if (iFRAME) | |
268 | { | |
269 | //=================== FRAME parameters ============================ | |
270 | ||
271 | AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame"); | |
272 | FRAME->SetHoles(1); | |
273 | } | |
274 | ||
275 | if (iSHIL) | |
276 | { | |
277 | //=================== SHIL parameters ============================ | |
278 | ||
279 | AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3"); | |
280 | } | |
281 | ||
282 | ||
283 | if (iPIPE) | |
284 | { | |
285 | //=================== PIPE parameters ============================ | |
286 | ||
4f976c08 | 287 | AliPIPE *PIPE = new AliPIPEupgrade("PIPE", "Beam Pipe",0,1.8,0.08,40.0); |
288 | //AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe"); | |
02d6eccc | 289 | } |
290 | ||
291 | if (iITS) | |
292 | { | |
293 | //=================== ITS parameters ============================ | |
294 | // | |
295 | // create segmentations: | |
296 | AliITSUSegmentationPix* seg0 = new AliITSUSegmentationPix(0, // segID (0:9) | |
297 | 5, // chips per module | |
298 | 1750, // ncols (total for module) | |
299 | 835, // nrows | |
300 | 20., // default row pitch in microns | |
301 | 20., // default col pitch in microns | |
302 | 300. // sensor thickness in microns | |
303 | ); // see AliITSUSegmentationPix.h for extra options | |
304 | seg0->Store(AliITSUGeomTGeo::GetITSsegmentationFileName()); | |
305 | AliITSUSegmentationPix* seg1 = new AliITSUSegmentationPix(1, // segID (0:9) | |
306 | 5, // chips per module | |
307 | 1750, // ncols (total for module) | |
308 | 835, // nrows | |
309 | 20., // default row pitch in microns | |
310 | 20., // default col pitch in microns | |
311 | 300. // sensor thickness in microns | |
312 | ); // see AliITSUSegmentationPix.h for extra options | |
313 | seg1->Store(AliITSUGeomTGeo::GetITSsegmentationFileName()); | |
314 | // | |
315 | int nmod,nlad; // modules per ladded, n ladders | |
316 | const double kUM2CM=1e-4; | |
317 | double tilt = 10.; | |
318 | double thickLr = 0.15; | |
319 | AliITSUv11 *ITS = new AliITSUv11("ITS Upgrade",7); | |
320 | nmod = 8; | |
321 | nlad = 10; | |
322 | ITS->DefineLayerTurbo(0, 2.2, nmod*seg0->Dz()*kUM2CM, nlad, nmod, seg0->Dx()*kUM2CM, tilt, thickLr, seg0->Dy()*kUM2CM, seg0->GetDetTypeID()); | |
323 | nmod = 8; | |
324 | nlad = 14; | |
325 | ITS->DefineLayerTurbo(1, 2.8, nmod*seg0->Dz()*kUM2CM, nlad, nmod, seg0->Dx()*kUM2CM, tilt, thickLr, seg0->Dy()*kUM2CM, seg0->GetDetTypeID()); | |
326 | nmod = 8; | |
327 | nlad = 18; | |
328 | ITS->DefineLayerTurbo(2, 3.6, nmod*seg0->Dz()*kUM2CM, nlad, nmod, seg0->Dx()*kUM2CM, tilt, thickLr, seg0->Dy()*kUM2CM, seg0->GetDetTypeID()); | |
329 | nmod = 24; | |
330 | nlad = 30; | |
331 | ITS->DefineLayerTurbo(3, 20.0, nmod*seg0->Dz()*kUM2CM, nlad, nmod, seg0->Dx()*kUM2CM, tilt, thickLr, seg1->Dy()*kUM2CM, seg1->GetDetTypeID()); | |
332 | nmod = 24; | |
333 | nlad = 32; | |
334 | ITS->DefineLayerTurbo(4, 22.0, nmod*seg0->Dz()*kUM2CM, nlad, nmod, seg0->Dx()*kUM2CM, tilt, thickLr, seg1->Dy()*kUM2CM, seg1->GetDetTypeID()); | |
335 | nmod = 42; | |
336 | nlad = 50; | |
337 | ITS->DefineLayerTurbo(5, 40.0, nmod*seg0->Dz()*kUM2CM, nlad, nmod, seg0->Dx()*kUM2CM, tilt, thickLr, seg1->Dy()*kUM2CM, seg1->GetDetTypeID()); //41 creates ovl! | |
338 | nmod = 42; | |
339 | nlad = 52; | |
340 | ITS->DefineLayerTurbo(6, 43.0, nmod*seg0->Dz()*kUM2CM, nlad, nmod, seg0->Dx()*kUM2CM, tilt, thickLr, seg1->Dy()*kUM2CM, seg1->GetDetTypeID()); | |
341 | // | |
4f976c08 | 342 | // ITS->AddBeamPipe(2.0, 2.08, 100); |
02d6eccc | 343 | } |
344 | ||
345 | ||
346 | if (iTPC) | |
347 | { | |
348 | //============================ TPC parameters =================== | |
349 | AliTPC *TPC = new AliTPCv2("TPC", "Default"); | |
350 | } | |
351 | ||
352 | ||
353 | if (iTOF) { | |
354 | //=================== TOF parameters ============================ | |
355 | AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF"); | |
356 | } | |
357 | ||
358 | ||
359 | if (iHMPID) | |
360 | { | |
361 | //=================== HMPID parameters =========================== | |
362 | AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID"); | |
363 | ||
364 | } | |
365 | ||
366 | ||
367 | if (iZDC) | |
368 | { | |
369 | //=================== ZDC parameters ============================ | |
370 | ||
371 | AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC"); | |
372 | } | |
373 | ||
374 | if (iTRD) | |
375 | { | |
376 | //=================== TRD parameters ============================ | |
377 | ||
378 | AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator"); | |
379 | AliTRDgeometry *geoTRD = TRD->GetGeometry(); | |
380 | // Partial geometry: modules at 2,3,4,6,11,12,14,15 | |
381 | // starting at 6h in positive direction | |
382 | geoTRD->SetSMstatus(0,0); | |
383 | geoTRD->SetSMstatus(1,0); | |
384 | geoTRD->SetSMstatus(5,0); | |
385 | geoTRD->SetSMstatus(7,0); | |
386 | geoTRD->SetSMstatus(8,0); | |
387 | geoTRD->SetSMstatus(9,0); | |
388 | geoTRD->SetSMstatus(10,0); | |
389 | geoTRD->SetSMstatus(13,0); | |
390 | geoTRD->SetSMstatus(16,0); | |
391 | geoTRD->SetSMstatus(17,0); | |
392 | } | |
393 | ||
394 | if (iFMD) | |
395 | { | |
396 | //=================== FMD parameters ============================ | |
397 | AliFMD *FMD = new AliFMDv1("FMD", "normal FMD"); | |
398 | } | |
399 | ||
400 | if (iMUON) | |
401 | { | |
402 | //=================== MUON parameters =========================== | |
403 | // New MUONv1 version (geometry defined via builders) | |
404 | AliMUON *MUON = new AliMUONv1("MUON","default"); | |
405 | } | |
406 | //=================== PHOS parameters =========================== | |
407 | ||
408 | if (iPHOS) | |
409 | { | |
410 | AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP"); | |
411 | } | |
412 | ||
413 | ||
414 | if (iPMD) | |
415 | { | |
416 | //=================== PMD parameters ============================ | |
417 | AliPMD *PMD = new AliPMDv1("PMD", "normal PMD"); | |
418 | } | |
419 | ||
420 | if (iT0) | |
421 | { | |
422 | //=================== T0 parameters ============================ | |
423 | AliT0 *T0 = new AliT0v1("T0", "T0 Detector"); | |
424 | } | |
425 | ||
426 | if (iEMCAL) | |
427 | { | |
428 | //=================== EMCAL parameters ============================ | |
429 | AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETEV1"); | |
430 | } | |
431 | ||
432 | if (iACORDE) | |
433 | { | |
434 | //=================== ACORDE parameters ============================ | |
435 | AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE"); | |
436 | } | |
437 | ||
438 | if (iVZERO) | |
439 | { | |
440 | //=================== VZERO parameters ============================ | |
441 | AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO"); | |
442 | } | |
443 | ||
444 | ||
445 | } | |
446 | ||
447 | Float_t EtaToTheta(Float_t arg){ | |
448 | return (180./TMath::Pi())*2.*atan(exp(-arg)); | |
449 | } |