de78d77f |
1 | #if !defined(__CINT__) || defined(__MAKECINT__) |
2 | #include <Riostream.h> |
3 | #include <TRandom.h> |
4 | #include <TDatime.h> |
5 | #include <TSystem.h> |
6 | #include <TVirtualMC.h> |
7 | #include <TGeant3.h> |
8 | #include "STEER/AliRunLoader.h" |
9 | #include "STEER/AliRun.h" |
10 | #include "STEER/AliConfig.h" |
11 | #include "PYTHIA6/AliDecayerPythia.h" |
12 | #include "PYTHIA6/AliGenPythia.h" |
13 | #include "STEER/AliMagFCM.h" |
14 | #include "STRUCT/AliBODY.h" |
15 | #include "STRUCT/AliMAG.h" |
16 | #include "STRUCT/AliABSOv0.h" |
17 | #include "STRUCT/AliDIPOv2.h" |
18 | #include "STRUCT/AliHALL.h" |
19 | #include "STRUCT/AliFRAMEv2.h" |
20 | #include "STRUCT/AliSHILv2.h" |
21 | #include "STRUCT/AliPIPEv0.h" |
22 | #include "ITS/AliITSvPPRasymm.h" |
23 | #include "TPC/AliTPCv2.h" |
2253ef47 |
24 | #include "TOF/AliTOFv4T0.h" |
de78d77f |
25 | #include "RICH/AliRICHv1.h" |
26 | #include "ZDC/AliZDCv1.h" |
27 | #include "TRD/AliTRDv1.h" |
28 | #include "FMD/AliFMDv0.h" |
29 | #include "MUON/AliMUONv1.h" |
d13ed8f3 |
30 | #include "MUON/AliMUONSt1GeometryBuilder.h" |
31 | #include "MUON/AliMUONSt2GeometryBuilder.h" |
32 | #include "MUON/AliMUONSlatGeometryBuilder.h" |
33 | #include "MUON/AliMUONTriggerGeometryBuilder.h" |
de78d77f |
34 | #include "PHOS/AliPHOSv1.h" |
35 | #include "PMD/AliPMDv1.h" |
36 | #include "START/AliSTARTv1.h" |
37 | #include "CRT/AliCRTv1.h" |
38 | #endif |
39 | |
642b80f3 |
40 | void Config() |
41 | { |
42 | |
43 | // |
44 | // Set Random Number seed |
45 | TDatime dt; |
46 | UInt_t curtime=dt.Get(); |
47 | UInt_t procid=gSystem->GetPid(); |
48 | UInt_t seed=curtime-procid; |
49 | |
de78d77f |
50 | // gRandom->SetSeed(seed); |
51 | gRandom->SetSeed(12345); |
642b80f3 |
52 | cerr<<"Seed for random number generation= "<<seed<<endl; |
53 | |
c8921088 |
54 | // libraries required by geant321 |
de78d77f |
55 | #if defined(__CINT__) |
c8921088 |
56 | gSystem->Load("libgeant321"); |
de78d77f |
57 | #endif |
c8921088 |
58 | |
b0470150 |
59 | new TGeant3TGeo("C++ Interface to Geant3"); |
642b80f3 |
60 | |
61 | //======================================================================= |
62 | // Create the output file |
63 | |
de78d77f |
64 | AliRunLoader* rl=0x0; |
65 | |
66 | cout<<"Config.C: Creating Run Loader ..."<<endl; |
67 | rl = AliRunLoader::Open("galice.root", |
f5a857b2 |
68 | AliConfig::GetDefaultEventFolderName(), |
de78d77f |
69 | "recreate"); |
70 | if (rl == 0x0) |
71 | { |
72 | gAlice->Fatal("Config.C","Can not instatiate the Run Loader"); |
73 | return; |
74 | } |
75 | rl->SetCompressionLevel(2); |
76 | rl->SetNumberOfEventsPerFile(3); |
77 | gAlice->SetRunLoader(rl); |
78 | |
642b80f3 |
79 | // |
80 | // Set External decayer |
81 | AliDecayer* decayer = new AliDecayerPythia(); |
82 | decayer->SetForceDecay(kAll); |
83 | decayer->Init(); |
84 | gMC->SetExternalDecayer(decayer); |
85 | |
642b80f3 |
86 | |
642b80f3 |
87 | // |
88 | //======================================================================= |
89 | // ************* STEERING parameters FOR ALICE SIMULATION ************** |
90 | // --- Specify event type to be tracked through the ALICE setup |
91 | // --- All positions are in cm, angles in degrees, and P and E in GeV |
6a3df6c9 |
92 | |
93 | gMC->SetProcess("DCAY",1); |
94 | gMC->SetProcess("PAIR",1); |
95 | gMC->SetProcess("COMP",1); |
96 | gMC->SetProcess("PHOT",1); |
97 | gMC->SetProcess("PFIS",0); |
98 | gMC->SetProcess("DRAY",0); |
99 | gMC->SetProcess("ANNI",1); |
100 | gMC->SetProcess("BREM",1); |
101 | gMC->SetProcess("MUNU",1); |
102 | gMC->SetProcess("CKOV",1); |
103 | gMC->SetProcess("HADR",1); |
104 | gMC->SetProcess("LOSS",2); |
105 | gMC->SetProcess("MULS",1); |
106 | gMC->SetProcess("RAYL",1); |
107 | |
108 | Float_t cut = 1.e-3; // 1MeV cut by default |
109 | Float_t tofmax = 1.e10; |
110 | |
111 | gMC->SetCut("CUTGAM", cut); |
112 | gMC->SetCut("CUTELE", cut); |
113 | gMC->SetCut("CUTNEU", cut); |
114 | gMC->SetCut("CUTHAD", cut); |
115 | gMC->SetCut("CUTMUO", cut); |
116 | gMC->SetCut("BCUTE", cut); |
117 | gMC->SetCut("BCUTM", cut); |
118 | gMC->SetCut("DCUTE", cut); |
119 | gMC->SetCut("DCUTM", cut); |
120 | gMC->SetCut("PPCUTM", cut); |
121 | gMC->SetCut("TOFMAX", tofmax); |
122 | |
123 | |
642b80f3 |
124 | // AliGenPythia *gener = new AliGenPythia(ntracks); |
125 | AliGenPythia *gener = new AliGenPythia(-1); |
126 | |
127 | gener->SetMomentumRange(0,999); |
0ac28de4 |
128 | gener->SetPhiRange(0.,360.); |
642b80f3 |
129 | gener->SetThetaRange(0,180); |
130 | gener->SetYRange(-999,999); |
131 | //gener->SetPtRange(0,100); |
132 | gener->SetOrigin(0,0,0); // vertex position |
133 | //gener->SetVertexSmear(kPerEvent); |
134 | gener->SetSigma(0,0,5.3); // Sigma in (X,Y,Z) (cm) on IP position |
135 | gener->SetTrackingFlag(0); |
136 | // gener->SetForceDecay(kHadronicD); |
137 | |
138 | // |
139 | // The following settings select the Pythia parameters tuned to agree |
140 | // with beauty NLO calculation for Pb-Pb @ 5.5 TeV with MNR code. |
141 | // |
de78d77f |
142 | gener->SetProcess(kPyBeautyPbPbMNR); |
642b80f3 |
143 | gener->SetStrucFunc(kCTEQ4L); |
144 | gener->SetPtHard(2.75,-1.0); |
145 | gener->SetEnergyCMS(5500.); |
146 | gener->SetNuclei(208,208); // Pb-Pb collisions |
147 | // Force no decay heavy quark mesons |
148 | gener->SetForceDecay(kNoDecayHeavy); |
149 | |
150 | gener->Init(); |
151 | // |
152 | // Activate this line if you want the vertex smearing to happen |
153 | // track by track |
154 | // |
155 | //gener->SetVertexSmear(perTrack); |
156 | |
157 | // Field (L3 0.4 T) |
158 | AliMagFCM* field = new AliMagFCM( |
159 | "Map2","$(ALICE_ROOT)/data/field01.dat", 2, 1., 10.); |
160 | field->SetSolenoidField(4.); |
161 | gAlice->SetField(field); |
162 | |
163 | Int_t iABSO=0; |
b9d0a01d |
164 | Int_t iCRT=0; |
642b80f3 |
165 | Int_t iDIPO=0; |
166 | Int_t iFMD=0; |
167 | Int_t iFRAME=0; |
168 | Int_t iHALL=0; |
169 | Int_t iITS=0; |
170 | Int_t iMAG=0; |
171 | Int_t iMUON=0; |
172 | Int_t iPHOS=0; |
173 | Int_t iPIPE=0; |
174 | Int_t iPMD=0; |
175 | Int_t iRICH=0; |
176 | Int_t iSHIL=0; |
177 | Int_t iSTART=0; |
178 | Int_t iTOF=0; |
179 | Int_t iTPC=0; |
180 | Int_t iTRD=0; |
181 | Int_t iZDC=0; |
182 | |
183 | //=================== Alice BODY parameters ============================= |
184 | AliBODY *BODY = new AliBODY("BODY","Alice envelop"); |
185 | |
186 | if(iMAG) { |
187 | //=================== MAG parameters ============================ |
188 | // --- Start with Magnet since detector layouts may be depending --- |
189 | // --- on the selected Magnet dimensions --- |
190 | AliMAG *MAG = new AliMAG("MAG","Magnet"); |
191 | } |
192 | |
193 | |
194 | if(iABSO) { |
195 | //=================== ABSO parameters ============================ |
196 | AliABSO *ABSO = new AliABSOv0("ABSO","Muon Absorber"); |
197 | } |
198 | |
199 | if(iDIPO) { |
200 | //=================== DIPO parameters ============================ |
201 | |
202 | AliDIPO *DIPO = new AliDIPOv2("DIPO","Dipole version 2"); |
203 | } |
204 | |
205 | if(iHALL) { |
206 | //=================== HALL parameters ============================ |
207 | |
208 | AliHALL *HALL = new AliHALL("HALL","Alice Hall"); |
209 | } |
210 | |
211 | |
212 | if(iFRAME) { |
213 | //=================== FRAME parameters ============================ |
214 | |
215 | AliFRAME *FRAME = new AliFRAMEv2("FRAME","Space Frame"); |
216 | |
217 | } |
218 | |
219 | if(iSHIL) { |
220 | //=================== SHIL parameters ============================ |
221 | |
e0559846 |
222 | AliSHIL *SHIL = new AliSHILv2("SHIL","Shielding"); |
642b80f3 |
223 | } |
224 | |
225 | |
226 | if(iPIPE) { |
227 | //=================== PIPE parameters ============================ |
228 | |
229 | AliPIPE *PIPE = new AliPIPEv0("PIPE","Beam Pipe"); |
230 | } |
231 | |
232 | |
233 | if(iITS) { |
234 | |
235 | //=================== ITS parameters ============================ |
236 | // |
237 | // As the innermost detector in ALICE, the Inner Tracking System "impacts" on |
238 | // almost all other detectors. This involves the fact that the ITS geometry |
239 | // still has several options to be followed in parallel in order to determine |
240 | // the best set-up which minimizes the induced background. All the geometries |
241 | // available to date are described in the following. Read carefully the comments |
242 | // and use the default version (the only one uncommented) unless you are making |
243 | // comparisons and you know what you are doing. In this case just uncomment the |
244 | // ITS geometry you want to use and run Aliroot. |
245 | // |
246 | // Detailed geometries: |
247 | // |
248 | // |
249 | //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services"); |
250 | // |
251 | //AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services"); |
252 | // |
253 | AliITSvPPRasymm *ITS = new AliITSvPPRasymm("ITS","New ITS PPR detailed version with asymmetric services"); |
254 | ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer |
255 | ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer |
256 | ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer |
257 | ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [150,300] |
258 | ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [150,300] |
259 | ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [100,300] |
260 | ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [100,300] |
261 | ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out |
262 | ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon |
263 | // |
264 | //AliITSvPPRsymm *ITS = new AliITSvPPRsymm("ITS","New ITS PPR detailed version with symmetric services"); |
265 | //ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer |
266 | //ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer |
267 | //ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRsymm2.det"); // don't touch this parameter if you're not an ITS developer |
268 | //ITS->SetThicknessDet1(300.); // detector thickness on layer 1 must be in the range [150,300] |
269 | //ITS->SetThicknessDet2(300.); // detector thickness on layer 2 must be in the range [150,300] |
270 | //ITS->SetThicknessChip1(300.); // chip thickness on layer 1 must be in the range [100,300] |
271 | //ITS->SetThicknessChip2(300.); // chip thickness on layer 2 must be in the range [100,300] |
272 | //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out |
273 | //ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon |
274 | // |
275 | // |
276 | // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful |
277 | // for reconstruction !): |
278 | // |
279 | // |
280 | //AliITSvPPRcoarseasymm *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services"); |
281 | //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out |
282 | //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon |
283 | // |
284 | //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services"); |
285 | //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out |
286 | //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon |
287 | // |
288 | // |
289 | // |
290 | // Geant3 <-> EUCLID conversion |
291 | // ============================ |
292 | // |
293 | // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and |
294 | // media to two ASCII files (called by default ITSgeometry.euc and |
295 | // ITSgeometry.tme) in a format understandable to the CAD system EUCLID. |
296 | // The default (=0) means that you dont want to use this facility. |
297 | // |
298 | ITS->SetEUCLID(0); |
299 | } |
300 | |
301 | |
302 | if(iTPC) { |
26ca4b4a |
303 | //============================ TPC parameters =================== |
642b80f3 |
304 | AliTPC *TPC = new AliTPCv2("TPC","Default"); |
642b80f3 |
305 | } |
306 | |
307 | |
308 | if(iTOF) { |
309 | //=================== TOF parameters ============================ |
2253ef47 |
310 | AliTOF *TOF = new AliTOFv4T0("TOF","normal TOF"); |
642b80f3 |
311 | } |
312 | |
313 | if(iRICH) { |
314 | //=================== RICH parameters =========================== |
315 | AliRICH *RICH = new AliRICHv1("RICH","normal RICH"); |
316 | |
317 | } |
318 | |
319 | |
320 | if(iZDC) { |
321 | //=================== ZDC parameters ============================ |
322 | |
323 | AliZDC *ZDC = new AliZDCv1("ZDC","normal ZDC"); |
324 | } |
325 | |
b9d0a01d |
326 | if(iCRT) { |
327 | //=================== CRT parameters ============================ |
642b80f3 |
328 | |
b9d0a01d |
329 | AliCRT *CRT = new AliCRTv1("CRT","normal CRT"); |
642b80f3 |
330 | } |
331 | |
332 | if(iTRD) { |
333 | //=================== TRD parameters ============================ |
334 | |
335 | AliTRD *TRD = new AliTRDv1("TRD","TRD slow simulator"); |
336 | |
337 | // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2) |
338 | TRD->SetGasMix(1); |
339 | |
340 | // With hole in front of PHOS |
341 | TRD->SetPHOShole(); |
342 | // With hole in front of RICH |
343 | TRD->SetRICHhole(); |
344 | // Switch on TR |
345 | AliTRDsim *TRDsim = TRD->CreateTR(); |
346 | } |
347 | |
348 | if(iFMD) { |
349 | //=================== FMD parameters ============================ |
350 | |
351 | AliFMD *FMD = new AliFMDv0("FMD","normal FMD"); |
352 | } |
353 | |
354 | if(iMUON) { |
355 | //=================== MUON parameters =========================== |
356 | AliMUON *MUON = new AliMUONv1("MUON","default"); |
d13ed8f3 |
357 | MUON->AddGeometryBuilder(new AliMUONSt1GeometryBuilder(MUON)); |
358 | MUON->AddGeometryBuilder(new AliMUONSt2GeometryBuilder(MUON)); |
359 | MUON->AddGeometryBuilder(new AliMUONSlatGeometryBuilder(MUON)); |
360 | MUON->AddGeometryBuilder(new AliMUONTriggerGeometryBuilder(MUON)); |
642b80f3 |
361 | } |
362 | |
363 | //=================== PHOS parameters =========================== |
364 | |
365 | if(iPHOS) { |
366 | AliPHOS *PHOS = new AliPHOSv1("PHOS","GPS2"); |
367 | } |
368 | |
369 | |
370 | if(iPMD) { |
371 | //=================== PMD parameters ============================ |
372 | |
373 | AliPMD *PMD = new AliPMDv1("PMD","normal PMD"); |
374 | PMD->SetPAR(1., 1., 0.8, 0.02); |
375 | PMD->SetIN(6., 18., -580., 27., 27.); |
376 | PMD->SetGEO(0.0, 0.2, 4.); |
377 | PMD->SetPadSize(0.8, 1.0, 1.0, 1.5); |
378 | |
379 | } |
380 | |
381 | if(iSTART) { |
382 | //=================== START parameters ============================ |
383 | AliSTART *START = new AliSTARTv1("START","START Detector"); |
384 | } |
385 | |
386 | |
387 | } |