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