]> git.uio.no Git - u/mrichter/AliRoot.git/blame - AliGeant4/macro/g4Config.C
Some additional changes related to the previous changes. AliL3Transform
[u/mrichter/AliRoot.git] / AliGeant4 / macro / g4Config.C
CommitLineData
0f507a31 1void Config()
2{
3 // =============================
4 // Root file
5 // =============================
6
7 // Create the output file
8 TFile *rootfile = new TFile("galice.root","recreate");
9 rootfile->SetCompressionLevel(2);
10
f65f3af2 11 // Set External decayer
12 AliDecayer* decayer = new AliDecayerPythia();
13 decayer->SetForceDecay(kAll);
14 decayer->Init();
15 gMC->SetExternalDecayer(decayer);
16
0f507a31 17 // =============================
18 // Geant4
19 // =============================
20
81f877d0 21 if (gClassTable->GetID("TGeant4") == -1) {
22 // load dynamically only if executable was not linked
23 // with geant4 libraries
0f507a31 24
81f877d0 25 // load Geant4 and AliRoot steer libraries
26 if (!gInterpreter->IsLoaded("g4libs.C")) gROOT->LoadMacro("g4libs.C");
27 gInterpreter->ProcessLine("g4libs()");
28 gInterpreter->ProcessLine("steerlibs()");
29
30 // Create Geant4
31 if (!gInterpreter->IsLoaded("g4menu.C")) gROOT->LoadMacro("g4menu.C");
32 gInterpreter->ProcessLine("CreateGeant4()");
33 }
0f507a31 34
35 // Physics process control
29d92eb4 36 gMC ->SetProcess("DCAY",1);
0f507a31 37 gMC ->SetProcess("PAIR",1);
38 gMC ->SetProcess("COMP",1);
47da9306 39 gMC ->SetProcess("PHOT",1);
0f507a31 40 gMC ->SetProcess("PFIS",0);
41 gMC ->SetProcess("DRAY",0);
42 gMC ->SetProcess("ANNI",1);
43 gMC ->SetProcess("BREM",1);
44 gMC ->SetProcess("MUNU",1);
45 //xx gMC ->SetProcess("CKOV",1);
46 gMC ->SetProcess("HADR",1); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
47 gMC ->SetProcess("LOSS",2);
48 gMC ->SetProcess("MULS",1);
49 //xx gMC ->SetProcess("RAYL",1);
50
51 // Energy cuts
52 // (in development)
53 Float_t cut = 1.e-3; // 1MeV cut by default
68a98ae5 54 Float_t tofmax = 1.e10;
55
0f507a31 56 gMC ->SetCut("CUTGAM",cut);
57 gMC ->SetCut("CUTELE",cut);
58 gMC ->SetCut("CUTNEU",cut);
59 gMC ->SetCut("CUTHAD",cut);
60 gMC ->SetCut("CUTMUO",cut);
61 gMC ->SetCut("BCUTE",cut);
62 gMC ->SetCut("BCUTM",cut);
63 gMC ->SetCut("DCUTE",cut);
64 gMC ->SetCut("DCUTM",cut);
68a98ae5 65 gMC ->SetCut("PPCUTM",cut);
66 gMC ->SetCut("TOFMAX",tofmax);
0f507a31 67
68 // =============================
69 // Event generator
70 // =============================
71
72 // --- Specify event type to be tracked through the ALICE setup
73 // --- All positions are in cm, angles in degrees, and P and E in GeV
74
661c4fa9 75 Int_t nParticles;
29d92eb4 76 if (gSystem->Getenv("CONFIG_NPARTICLES"))
77 nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
78 else
661c4fa9 79 nParticles = 100;
80
29d92eb4 81
82 AliGenHIJINGpara *gener = new AliGenHIJINGpara(nParticles);
0f507a31 83 gener->SetMomentumRange(0,999);
84 gener->SetPhiRange(0,360);
661c4fa9 85 // Set pseudorapidity range from -8 to 8.
86 Float_t thmin = EtaToTheta(8); // theta min. <---> eta max
87 Float_t thmax = EtaToTheta(-8); // theta max. <---> eta min
88 gener->SetThetaRange(thmin, thmax);
0f507a31 89 gener->SetOrigin(0,0,0); //vertex position
90 gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
91 gener->Init();
661c4fa9 92 //
0f507a31 93 // Activate this line if you want the vertex smearing to happen
94 // track by track
95
96 //gener->SetVertexSmear(perTrack);
97
98 // =============================
99 // Magnetic field
100 // =============================
101
661c4fa9 102 //xx gAlice->SetField(-999,2); //Specify maximum magnetic field in Tesla (neg. ==> default field)
0f507a31 103
104 // =============================
105 // Alice modules
106 // =============================
107
108 //Bool_t isSetInteractively = false;
109 Bool_t isSetInteractively = true;
110
111 if (!isSetInteractively) {
112
113 // Load modules libraries
676614b6 114 if (!gInterpreter->IsLoaded("g4libs.C")) gROOT->LoadMacro("g4libs.C");
0f507a31 115 gInterpreter->ProcessLine("detlibs()");
116
117 // Select modules
29d92eb4 118 Int_t iABSO=1;
119 Int_t iCASTOR=1;
120 Int_t iDIPO=1;
121 Int_t iFMD=1;
122 Int_t iFRAME=1;
123 Int_t iHALL=1;
124 Int_t iITS=1;
125 Int_t iMAG=1;
126 Int_t iMUON=1;
127 Int_t iPHOS=1;
128 Int_t iPIPE=1;
129 Int_t iPMD=1;
130 Int_t iRICH=1;
131 Int_t iSHIL=1;
132 Int_t iSTART=1;
133 Int_t iTOF=1;
134 Int_t iTPC=1;
135 Int_t iTRD=1;
136 Int_t iZDC=1;
0f507a31 137
138 // Exclude detectors that do not work with Geant4
0f507a31 139 iCASTOR=0;
d6880eca 140 // Detectors with temporary problem
7a9caca2 141 iZDC=0;
676614b6 142 iPMD=0;
143 iITS=0;
144
0f507a31 145// From G3 Config.C
146// Without any modification
147
0f507a31 148
29d92eb4 149 //=================== Alice BODY parameters =============================
150 AliBODY *BODY = new AliBODY("BODY","Alice envelop");
151
152
153 if(iMAG) {
154 //=================== MAG parameters ============================
155 // --- Start with Magnet since detector layouts may be depending ---
156 // --- on the selected Magnet dimensions ---
157 AliMAG *MAG = new AliMAG("MAG","Magnet");
158 }
159
160
161 if(iABSO) {
162 //=================== ABSO parameters ============================
163 AliABSO *ABSO = new AliABSOv0("ABSO","Muon Absorber");
164 }
165
166 if(iDIPO) {
167 //=================== DIPO parameters ============================
168
169 AliDIPO *DIPO = new AliDIPOv2("DIPO","Dipole version 2");
170 }
171
172 if(iHALL) {
173 //=================== HALL parameters ============================
174
175 AliHALL *HALL = new AliHALL("HALL","Alice Hall");
176 }
177
178
179 if(iFRAME) {
180 //=================== FRAME parameters ============================
181
661c4fa9 182 AliFRAME *FRAME = new AliFRAMEv2("FRAME","Space Frame");
29d92eb4 183
184 }
185
186 if(iSHIL) {
187 //=================== SHIL parameters ============================
188
189 AliSHIL *SHIL = new AliSHILv0("SHIL","Shielding");
190 }
191
192
193 if(iPIPE) {
194 //=================== PIPE parameters ============================
195
043ee3b8 196 AliPIPE *PIPE = new AliPIPEv0("PIPE","Beam Pipe");
29d92eb4 197 }
198
199
200 if(iITS) {
661c4fa9 201 //=================== ITS parameters ============================
29d92eb4 202 //
203 // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
f65f3af2 204 // almost all other detectors. This involves the fact that the ITS geometry
205 // still has several options to be followed in parallel in order to determine
29d92eb4 206 // the best set-up which minimizes the induced background. All the geometries
f65f3af2 207 // available to date are described in the following. Read carefully the comments
29d92eb4 208 // and use the default version (the only one uncommented) unless you are making
209 // comparisons and you know what you are doing. In this case just uncomment the
f65f3af2 210 // ITS geometry you want to use and run Aliroot.
29d92eb4 211 //
f65f3af2 212 // Detailed geometries:
29d92eb4 213 //
29d92eb4 214 //
29d92eb4 215 //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
216 //
661c4fa9 217 //AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
29d92eb4 218 //
661c4fa9 219 AliITSvPPRasymm *ITS = new AliITSvPPRasymm("ITS","New ITS PPR detailed version with asymmetric services");
220 ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
221 ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
222 // ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer
223 ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
224 ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
225 ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300]
226 ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300]
227 ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
228 ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
f65f3af2 229 //
230 //AliITSvPPRsymm *ITS = new AliITSvPPRsymm("ITS","New ITS PPR detailed version with symmetric services");
661c4fa9 231 //ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
232 //ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
233 //ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRsymm2.det"); // don't touch this parameter if you're not an ITS developer
234 //ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
235 //ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
236 //ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300]
237 //ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300]
f65f3af2 238 //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
239 //ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
240 //
29d92eb4 241 //
f65f3af2 242 // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful
243 // for reconstruction !):
244 //
29d92eb4 245 //
661c4fa9 246 //AliITSvPPRcoarseasymm *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
f65f3af2 247 //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
248 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
29d92eb4 249 //
661c4fa9 250 //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
f65f3af2 251 //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
252 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
253 //
29d92eb4 254 //
255 //
256 // Geant3 <-> EUCLID conversion
257 // ============================
258 //
f65f3af2 259 // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
260 // media to two ASCII files (called by default ITSgeometry.euc and
261 // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
29d92eb4 262 // The default (=0) means that you dont want to use this facility.
263 //
f65f3af2 264 ITS->SetEUCLID(0);
29d92eb4 265 }
266
29d92eb4 267 if(iTPC) {
268 //============================ TPC parameters ================================
269 // --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
270 // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
271 // --- sectors are specified, any value other than that requires at least one
272 // --- sector (lower or upper)to be specified!
273 // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
274 // --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
275 // --- SecLows - number of lower sectors specified (up to 6)
276 // --- SecUps - number of upper sectors specified (up to 12)
277 // --- Sens - sensitive strips for the Slow Simulator !!!
278 // --- This does NOT work if all S or L-sectors are specified, i.e.
279 // --- if SecAL or SecAU < 0
280 //
281 //
282 //-----------------------------------------------------------------------------
283
284 // gROOT->LoadMacro("SetTPCParam.C");
285 // AliTPCParam *param = SetTPCParam();
286 AliTPC *TPC = new AliTPCv2("TPC","Default");
287 // All sectors included
288 TPC->SetSecAL(-1);
289 TPC->SetSecAU(-1);
290
291 }
292
293 if(iTOF) {
294 //=================== TOF parameters ============================
295 AliTOF *TOF = new AliTOFv2("TOF","normal TOF");
296 }
297
298 if(iRICH) {
299 //=================== RICH parameters ===========================
e6738716 300 AliRICH *RICH = new AliRICHv1("RICH","normal RICH");
0f507a31 301
29d92eb4 302 }
0f507a31 303
304
29d92eb4 305 if(iZDC) {
306 //=================== ZDC parameters ============================
0f507a31 307
bcfe1265 308 AliZDC *ZDC = new AliZDCv2("ZDC","normal ZDC");
29d92eb4 309 }
0f507a31 310
29d92eb4 311 if(iCASTOR) {
312 //=================== CASTOR parameters ============================
0f507a31 313
29d92eb4 314 AliCASTOR *CASTOR = new AliCASTORv1("CASTOR","normal CASTOR");
315 }
0f507a31 316
29d92eb4 317 if(iTRD) {
318 //=================== TRD parameters ============================
0f507a31 319
29d92eb4 320 AliTRD *TRD = new AliTRDv1("TRD","TRD slow simulator");
0f507a31 321
29d92eb4 322 // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
323 TRD->SetGasMix(1);
0f507a31 324
29d92eb4 325 // With hole in front of PHOS
326 TRD->SetPHOShole();
327 // With hole in front of RICH
328 TRD->SetRICHhole();
329 // Switch on TR
330 AliTRDsim *TRDsim = TRD->CreateTR();
331 }
0f507a31 332
29d92eb4 333 if(iFMD) {
334 //=================== FMD parameters ============================
0f507a31 335
661c4fa9 336 AliFMD *FMD = new AliFMDv1("FMD","normal FMD");
337 FMD->SetRingsSi1(128);
338 FMD->SetRingsSi2(64);
339 FMD->SetSectorsSi1(20);
340 FMD->SetSectorsSi2(24);
29d92eb4 341 }
0f507a31 342
29d92eb4 343 if(iMUON) {
344 //=================== MUON parameters ===========================
0f507a31 345
f65f3af2 346 AliMUON *MUON = new AliMUONv1("MUON","default");
29d92eb4 347 }
0f507a31 348
29d92eb4 349 //=================== PHOS parameters ===========================
0f507a31 350
29d92eb4 351 if(iPHOS) {
352 AliPHOS *PHOS = new AliPHOSv1("PHOS","GPS2");
353 }
0f507a31 354
355
29d92eb4 356 if(iPMD) {
357 //=================== PMD parameters ============================
0f507a31 358
29d92eb4 359 AliPMD *PMD = new AliPMDv1("PMD","normal PMD");
360 PMD->SetPAR(1., 1., 0.8, 0.02);
361 PMD->SetIN(6., 18., -580., 27., 27.);
362 PMD->SetGEO(0.0, 0.2, 4.);
363 PMD->SetPadSize(0.8, 1.0, 1.0, 1.5);
0f507a31 364
29d92eb4 365 }
0f507a31 366
29d92eb4 367 if(iSTART) {
368 //=================== START parameters ============================
369 AliSTART *START = new AliSTARTv1("START","START Detector");
370 }
0f507a31 371
29d92eb4 372 } // end (!isSetInteractively)
0f507a31 373
374}
661c4fa9 375
376Float_t EtaToTheta(Float_t arg){
377 return (180./TMath::Pi())*2.*atan(exp(-arg));
378}