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