Derive from AliGenMC.
[u/mrichter/AliRoot.git] / macros / Config.C
... / ...
CommitLineData
1void Config()
2{
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;
21
22 //
23 // Set External decayer
24 AliDecayer *decayer = new AliDecayerPythia();
25
26 decayer->SetForceDecay(kAll);
27 decayer->Init();
28 gMC->SetExternalDecayer(decayer);
29 //
30 //
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);
62 //
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
86 //
87 //gener->SetVertexSmear(perTrack);
88
89 gAlice->SetField(-999, 2); //Specify maximum magnetic field in Tesla (neg. ==> default field)
90
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;
110
111 //=================== Alice BODY parameters =============================
112 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
113
114
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 }
122
123
124 if (iABSO)
125 {
126 //=================== ABSO parameters ============================
127 AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
128 }
129
130 if (iDIPO)
131 {
132 //=================== DIPO parameters ============================
133
134 AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
135 }
136
137 if (iHALL)
138 {
139 //=================== HALL parameters ============================
140
141 AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
142 }
143
144
145 if (iFRAME)
146 {
147 //=================== FRAME parameters ============================
148
149 AliFRAME *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
150
151 }
152
153 if (iSHIL)
154 {
155 //=================== SHIL parameters ============================
156
157 AliSHIL *SHIL = new AliSHILv0("SHIL", "Shielding");
158 }
159
160
161 if (iPIPE)
162 {
163 //=================== PIPE parameters ============================
164
165 AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
166 }
167
168 if(iITS) {
169
170//=================== ITS parameters ============================
171 //
172 // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
173 // almost all other detectors. This involves the fact that the ITS geometry
174 // still has several options to be followed in parallel in order to determine
175 // the best set-up which minimizes the induced background. All the geometries
176 // available to date are described in the following. Read carefully the comments
177 // and use the default version (the only one uncommented) unless you are making
178 // comparisons and you know what you are doing. In this case just uncomment the
179 // ITS geometry you want to use and run Aliroot.
180 //
181 // Detailed geometries:
182 //
183 //
184 //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
185 //
186 //AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
187 //
188 AliITSvPPRasymm *ITS = new AliITSvPPRasymm("ITS","New ITS PPR detailed version with asymmetric services");
189 ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
190 ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
191 ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer
192 ITS->SetThicknessDet1(300.); // detector thickness on layer 1 must be in the range [100,300]
193 ITS->SetThicknessDet2(300.); // detector thickness on layer 2 must be in the range [100,300]
194 ITS->SetThicknessChip1(300.); // chip thickness on layer 1 must be in the range [150,300]
195 ITS->SetThicknessChip2(300.); // chip thickness on layer 2 must be in the range [150,300]
196 ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
197 ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
198 //
199 //AliITSvPPRsymm *ITS = new AliITSvPPRsymm("ITS","New ITS PPR detailed version with symmetric services");
200 //ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
201 //ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
202 //ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRsymm2.det"); // don't touch this parameter if you're not an ITS developer
203 //ITS->SetThicknessDet1(300.); // detector thickness on layer 1 must be in the range [100,300]
204 //ITS->SetThicknessDet2(300.); // detector thickness on layer 2 must be in the range [100,300]
205 //ITS->SetThicknessChip1(300.); // chip thickness on layer 1 must be in the range [150,300]
206 //ITS->SetThicknessChip2(300.); // chip thickness on layer 2 must be in the range [150,300]
207 //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
208 //ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
209 //
210 //
211 // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful
212 // for reconstruction !):
213 //
214 //
215 //AliITSvPPRcoarseasymm *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
216 //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
217 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
218 //
219 //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
220 //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
221 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
222 //
223 //
224 //
225 // Geant3 <-> EUCLID conversion
226 // ============================
227 //
228 // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
229 // media to two ASCII files (called by default ITSgeometry.euc and
230 // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
231 // The default (=0) means that you dont want to use this facility.
232 //
233 ITS->SetEUCLID(0);
234 }
235
236
237 if (iTPC)
238 {
239 //============================ TPC parameters ================================
240 // --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
241 // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
242 // --- sectors are specified, any value other than that requires at least one
243 // --- sector (lower or upper)to be specified!
244 // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
245 // --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
246 // --- SecLows - number of lower sectors specified (up to 6)
247 // --- SecUps - number of upper sectors specified (up to 12)
248 // --- Sens - sensitive strips for the Slow Simulator !!!
249 // --- This does NOT work if all S or L-sectors are specified, i.e.
250 // --- if SecAL or SecAU < 0
251 //
252 //
253 //-----------------------------------------------------------------------------
254
255 // gROOT->LoadMacro("SetTPCParam.C");
256 // AliTPCParam *param = SetTPCParam();
257 AliTPC *TPC = new AliTPCv2("TPC", "Default");
258
259 // All sectors included
260 TPC->SetSecAL(-1);
261 TPC->SetSecAU(-1);
262
263 }
264
265 if (iTOF)
266 {
267 //=================== TOF parameters ============================
268 AliTOF *TOF = new AliTOFv2("TOF", "normal TOF");
269 }
270
271 if (iRICH)
272 {
273 //=================== RICH parameters ===========================
274 AliRICH *RICH = new AliRICHv1("RICH", "normal RICH");
275
276 }
277
278
279 if (iZDC)
280 {
281 //=================== ZDC parameters ============================
282
283 AliZDC *ZDC = new AliZDCv1("ZDC", "normal ZDC");
284 }
285
286 if (iCASTOR)
287 {
288 //=================== CASTOR parameters ============================
289
290 AliCASTOR *CASTOR = new AliCASTORv1("CASTOR", "normal CASTOR");
291 }
292
293 if (iTRD)
294 {
295 //=================== TRD parameters ============================
296
297 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
298
299 // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
300 TRD->SetGasMix(1);
301
302 // With hole in front of PHOS
303 TRD->SetPHOShole();
304 // With hole in front of RICH
305 TRD->SetRICHhole();
306 // Switch on TR
307 AliTRDsim *TRDsim = TRD->CreateTR();
308 }
309
310 if (iFMD)
311 {
312 //=================== FMD parameters ============================
313
314 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
315 }
316
317 if (iMUON)
318 {
319 //=================== MUON parameters ===========================
320
321 AliMUON *MUON = new AliMUONv1("MUON", "default");
322 }
323 //=================== PHOS parameters ===========================
324
325 if (iPHOS)
326 {
327 AliPHOS *PHOS = new AliPHOSv1("PHOS", "GPS2");
328 }
329
330
331 if (iPMD)
332 {
333 //=================== PMD parameters ============================
334
335 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
336
337 PMD->SetPAR(1., 1., 0.8, 0.02);
338 PMD->SetIN(6., 18., -580., 27., 27.);
339 PMD->SetGEO(0.0, 0.2, 4.);
340 PMD->SetPadSize(0.8, 1.0, 1.0, 1.5);
341
342 }
343
344 if (iSTART)
345 {
346 //=================== START parameters ============================
347 AliSTART *START = new AliSTARTv1("START", "START Detector");
348 }
349
350
351}