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