This should work for pp.
[u/mrichter/AliRoot.git] / DPMJET / ConfigDPM.C
CommitLineData
d30b8254 1static Int_t eventsPerRun = 100;
2enum PprGeo_t
3{
4 kHoles, kNoHoles
5};
6static PprGeo_t geo = kHoles;
7
8void Config()
9{
10 // 7-DEC-2000 09:00
11 // Switch on Transition Radiation simulation. 6/12/00 18:00
12 // iZDC=1 7/12/00 09:00
13 // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
14 // Theta range given through pseudorapidity limits 22/6/2001
15
16 // Set Random Number seed
17 gRandom->SetSeed(123456);
18
19
66f9d089 20
d30b8254 21 // libraries required by geant321
22 gSystem->Load("libgeant321");
66f9d089 23 gSystem->Load("libdpmjet");
24 gSystem->Load("libTDPMjet");
d30b8254 25
26 new TGeant3("C++ Interface to Geant3");
27
66f9d089 28 AliRunLoader* rl=0x0;
29
30 cout<<"Config.C: Creating Run Loader ..."<<endl;
31 rl = AliRunLoader::Open("galice.root",
32 AliConfig::GetDefaultEventFolderName(),
33 "recreate");
34 if (rl == 0x0)
35 {
36 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
37 return;
38 }
39 rl->SetCompressionLevel(2);
40 rl->SetNumberOfEventsPerFile(100);
41 gAlice->SetRunLoader(rl);
42
d30b8254 43 if (!gSystem->Getenv("CONFIG_FILE"))
44 {
45 TFile *rootfile = new TFile("galice.root", "recreate");
46
47 rootfile->SetCompressionLevel(2);
48 }
49
50 TGeant3 *geant3 = (TGeant3 *) gMC;
51 AliIonPDGCodes *PDGcodes = new AliIonPDGCodes();
66f9d089 52
d30b8254 53 PDGcodes->AddParticlesToPdgDataBase();
66f9d089 54// geant3->DefineIons();
d30b8254 55
56 //
57 // Set External decayer
58 TVirtualMCDecayer *decayer = new AliDecayerPythia();
59
60 decayer->SetForceDecay(kAll);
61 decayer->Init();
62 gMC->SetExternalDecayer(decayer);
63 //
64 //
65 //=======================================================================
66 // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
67 geant3->SetTRIG(1); //Number of events to be processed
68 geant3->SetSWIT(4, 10);
69 geant3->SetDEBU(0, 0, 1);
70 //geant3->SetSWIT(2,2);
71 geant3->SetDCAY(1);
72 geant3->SetPAIR(1);
73 geant3->SetCOMP(1);
74 geant3->SetPHOT(1);
75 geant3->SetPFIS(0);
76 geant3->SetDRAY(0);
77 geant3->SetANNI(1);
78 geant3->SetBREM(1);
79 geant3->SetMUNU(1);
80 geant3->SetCKOV(1);
81 geant3->SetHADR(0); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
82 geant3->SetLOSS(2);
83 geant3->SetMULS(1);
84 geant3->SetRAYL(1);
85 geant3->SetAUTO(1); //Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
86 geant3->SetABAN(0); //Restore 3.16 behaviour for abandoned tracks
87 geant3->SetOPTI(2); //Select optimisation level for GEANT geometry searches (0,1,2)
88 geant3->SetERAN(5.e-7);
89
90 Float_t cut = 1.e-3; // 1MeV cut by default
91 Float_t tofmax = 1.e10;
92
93 // GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
94 geant3->SetCUTS(cut, cut, cut, cut, cut, cut, cut, cut, cut, cut,
95 tofmax);
96 //
97 //=======================================================================
98 // ************* STEERING parameters FOR ALICE SIMULATION **************
99 // --- Specify event type to be tracked through the ALICE setup
100 // --- All positions are in cm, angles in degrees, and P and E in GeV
101 // #### AliGenDPMjet generation ######################################
102 AliGenDPMjet *gener = new AliGenDPMjet(1);
103 gener->SetBeamEnergy(2700.);
66f9d089 104 gener->SetEnergyCMS(5500.);
105 gener->SetProjectile(1, 1);
106 gener->SetTarget(1, 1);
d30b8254 107 gener->SetImpactParameterRange(12.,16.);
66f9d089 108 gener->SetTrackingFlag(0);
d30b8254 109 gener->Init();
110 //
111 // Activate this line if you want the vertex smearing to happen
112 // track by track
113 //
114 //gener->SetVertexSmear(perTrack);
115 // Field (L3 0.4 T)
116 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
d30b8254 117 gAlice->SetField(field);
66f9d089 118 rl->CdGAFile();
d30b8254 119
66f9d089 120 Int_t iABSO = 0;
121 Int_t iDIPO = 0;
d30b8254 122 Int_t iFMD = 0;
123 Int_t iFRAME = 0;
124 Int_t iHALL = 0;
125 Int_t iITS = 0;
126 Int_t iMAG = 0;
127 Int_t iMUON = 0;
128 Int_t iPHOS = 0;
66f9d089 129 Int_t iPIPE = 0;
d30b8254 130 Int_t iPMD = 0;
131 Int_t iRICH = 0;
66f9d089 132 Int_t iSHIL = 0;
d30b8254 133 Int_t iSTART = 0;
134 Int_t iTOF = 0;
135 Int_t iTPC = 0;
136 Int_t iTRD = 0;
66f9d089 137 Int_t iZDC = 0;
d30b8254 138 Int_t iEMCAL = 0;
139 Int_t iCRT = 0;
140 Int_t iVZERO = 0;
141
142 //=================== Alice BODY parameters =============================
143 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
144
145 if (iMAG)
146 {
147 //=================== MAG parameters ============================
148 // --- Start with Magnet since detector layouts may be depending ---
149 // --- on the selected Magnet dimensions ---
150 AliMAG *MAG = new AliMAG("MAG", "Magnet");
151 }
152
153
154 if (iABSO)
155 {
156 //=================== ABSO parameters ============================
157 AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
158 }
159
160 if (iDIPO)
161 {
162 //=================== DIPO parameters ============================
163
164 AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
165 }
166
167 if (iHALL)
168 {
169 //=================== HALL parameters ============================
170
171 AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
172 }
173
174
175 if (iFRAME)
176 {
177 //=================== FRAME parameters ============================
178
179 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
180 if (geo == kHoles) {
181 FRAME->SetHoles(1);
182 } else {
183 FRAME->SetHoles(0);
184 }
185 }
186
187 if (iSHIL)
188 {
189 //=================== SHIL parameters ============================
190
191 AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding Version 2");
192 }
193
194
195 if (iPIPE)
196 {
197 //=================== PIPE parameters ============================
198
199 AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
200 }
201
202 if(iITS) {
203
204 //=================== ITS parameters ============================
205 //
206 // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
207 // almost all other detectors. This involves the fact that the ITS geometry
208 // still has several options to be followed in parallel in order to determine
209 // the best set-up which minimizes the induced background. All the geometries
210 // available to date are described in the following. Read carefully the comments
211 // and use the default version (the only one uncommented) unless you are making
212 // comparisons and you know what you are doing. In this case just uncomment the
213 // ITS geometry you want to use and run Aliroot.
214 //
215 // Detailed geometries:
216 //
217 //
218 //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
219 //
220 //AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
221 //
222 AliITSvPPRasymm *ITS = new AliITSvPPRasymm("ITS","New ITS PPR detailed version with asymmetric services");
223 ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
224 ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
225 // ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer
226 ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
227 ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
228 ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300]
229 ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300]
230 ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
231 ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
232 //
233 //AliITSvPPRsymm *ITS = new AliITSvPPRsymm("ITS","New ITS PPR detailed version with symmetric services");
234 //ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
235 //ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
236 //ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRsymm2.det"); // don't touch this parameter if you're not an ITS developer
237 //ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
238 //ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
239 //ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300]
240 //ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300]
241 //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
242 //ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
243 //
244 //
245 // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful
246 // for reconstruction !):
247 //
248 //
249 //AliITSvPPRcoarseasymm *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
250 //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
251 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
252 //
253 //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
254 //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
255 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
256 //
257 //
258 //
259 // Geant3 <-> EUCLID conversion
260 // ============================
261 //
262 // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
263 // media to two ASCII files (called by default ITSgeometry.euc and
264 // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
265 // The default (=0) means that you dont want to use this facility.
266 //
267 ITS->SetEUCLID(0);
268 }
269
270 if (iTPC)
271 {
272 //============================ TPC parameters ================================
273 // --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
274 // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
275 // --- sectors are specified, any value other than that requires at least one
276 // --- sector (lower or upper)to be specified!
277 // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
278 // --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
279 // --- SecLows - number of lower sectors specified (up to 6)
280 // --- SecUps - number of upper sectors specified (up to 12)
281 // --- Sens - sensitive strips for the Slow Simulator !!!
282 // --- This does NOT work if all S or L-sectors are specified, i.e.
283 // --- if SecAL or SecAU < 0
284 //
285 //
286 //-----------------------------------------------------------------------------
287
288 // gROOT->LoadMacro("SetTPCParam.C");
289 // AliTPCParam *param = SetTPCParam();
290 AliTPC *TPC = new AliTPCv2("TPC", "Default");
291
292 // All sectors included
293 TPC->SetSecAL(-1);
294 TPC->SetSecAU(-1);
295
296 }
297
298
299 if (iTOF) {
300 if (geo == kHoles) {
301 //=================== TOF parameters ============================
302 AliTOF *TOF = new AliTOFv2FHoles("TOF", "TOF with Holes");
303 } else {
304 AliTOF *TOF = new AliTOFv4T0("TOF", "normal TOF");
305 }
306 }
307
308
309 if (iRICH)
310 {
311 //=================== RICH parameters ===========================
312 AliRICH *RICH = new AliRICHv3("RICH", "normal RICH");
313
314 }
315
316
317 if (iZDC)
318 {
319 //=================== ZDC parameters ============================
320
321 AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
322 ZDC->NoShower();
323 }
324
325 if (iTRD)
326 {
327 //=================== TRD parameters ============================
328
329 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
330
331 // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
332 TRD->SetGasMix(1);
333 if (geo == kHoles) {
334 // With hole in front of PHOS
335 TRD->SetPHOShole();
336 // With hole in front of RICH
337 TRD->SetRICHhole();
338 }
339 // Switch on TR
340 AliTRDsim *TRDsim = TRD->CreateTR();
341 }
342
343 if (iFMD)
344 {
345 //=================== FMD parameters ============================
346 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
347 FMD->SetRingsSi1(256);
348 FMD->SetRingsSi2(128);
349 FMD->SetSectorsSi1(20);
350 FMD->SetSectorsSi2(40);
351 }
352
353 if (iMUON)
354 {
355 //=================== MUON parameters ===========================
356
357 AliMUON *MUON = new AliMUONv1("MUON", "default");
358 }
359 //=================== PHOS parameters ===========================
360
361 if (iPHOS)
362 {
363 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
364 }
365
366
367 if (iPMD)
368 {
369 //=================== PMD parameters ============================
370 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
371 }
372
373 if (iSTART)
374 {
375 //=================== START parameters ============================
376 AliSTART *START = new AliSTARTv1("START", "START Detector");
377 }
378
379 if (iEMCAL)
380 {
381 //=================== EMCAL parameters ============================
382 AliEMCAL *EMCAL = new AliEMCALv1("EMCAL", "G56_2_55_19_104_14");
383 }
384
385 if (iCRT)
386 {
387 //=================== CRT parameters ============================
388 AliCRT *CRT = new AliCRTv0("CRT", "normal ACORDE");
389 }
390
391 if (iVZERO)
392 {
393 //=================== CRT parameters ============================
394 AliVZERO *VZERO = new AliVZEROv2("VZERO", "normal VZERO");
395 }
396
397}
398