]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/UPGRADE/ConfigTGeoUpgrade.C
suppressed std:... implicit calls
[u/mrichter/AliRoot.git] / ITS / UPGRADE / ConfigTGeoUpgrade.C
CommitLineData
29998a6e 1/// One can use the configuration macro in compiled mode by
2// root [0] gSystem->Load("libgeant321");
3// root [0] gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include\
4// -I$ALICE_ROOT -I$ALICE/geant3/TGeant3");
5// root [0] .x grun.C(1,"Config.C++"
6
7#if !defined(__CINT__) || defined(__MAKECINT__)
8#include <Riostream.h>
9#include <TPDGCode.h>
10#include <TRandom.h>
11#include <TSystem.h>
12#include <TVirtualMC.h>
13#include <TGeant3TGeo.h>
14#include "STEER/AliRunLoader.h"
15#include "STEER/AliRun.h"
16#include "STEER/AliConfig.h"
17#include "PYTHIA6/AliDecayerPythia.h"
18#include "EVGEN/AliGenCocktail.h"
19#include "EVGEN/AliGenHIJINGpara.h"
20#include "EVGEN/AliGenFixed.h"
21#include "EVGEN/AliGenBox.h"
22#include "STEER/AliMagWrapCheb.h"
23#include "STRUCT/AliBODY.h"
24#include "STRUCT/AliMAG.h"
25#include "STRUCT/AliABSOv3.h"
26#include "STRUCT/AliDIPOv3.h"
27#include "STRUCT/AliHALLv3.h"
28#include "STRUCT/AliFRAMEv2.h"
29#include "STRUCT/AliSHILv3.h"
30#include "STRUCT/AliPIPEv3.h"
362fe8e0 31#include "ITS/AliITSv11Hybrid.h"
29998a6e 32#include "ITS/UPGRADE/AliITSvUpgrade.h"
33#include "TPC/AliTPCv2.h"
34#include "TOF/AliTOFv6T0.h"
35#include "HMPID/AliHMPIDv3.h"
36#include "ZDC/AliZDCv3.h"
37#include "TRD/AliTRDv1.h"
38#include "TRD/AliTRDgeometry.h"
39#include "FMD/AliFMDv1.h"
40#include "MUON/AliMUONv1.h"
41#include "PHOS/AliPHOSv1.h"
42#include "PMD/AliPMDv1.h"
43#include "T0/AliT0v1.h"
44#include "EMCAL/AliEMCALv2.h"
45#include "ACORDE/AliACORDEv1.h"
46#include "VZERO/AliVZEROv7.h"
47#include <TVirtualMagField.h>
48#endif
49
50/* $Id: Config.C 47147 2011-02-07 11:46:44Z amastros $ */
51enum PprTrigConf_t
52{
53 kDefaultPPTrig, kDefaultPbPbTrig
54};
55
56const char * pprTrigConfName[] = {
57 "p-p","Pb-Pb"
58};
59
60Float_t EtaToTheta(Float_t arg);
61
62static PprTrigConf_t strig = kDefaultPPTrig;// default PP trigger configuration
63
64void Config()
65{
66 // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
67 // Theta range given through pseudorapidity limits 22/6/2001
68
69 // Set Random Number seed
70 gRandom->SetSeed(0); // Set 0 to use the currecnt time
71
72
73 // libraries required by geant321
74#if defined(__CINT__)
75 gSystem->Load("liblhapdf");
76 gSystem->Load("libEGPythia6");
77 gSystem->Load("libpythia6");
78 gSystem->Load("libAliPythia6");
79 gSystem->Load("libgeant321");
80#endif
81
82 new TGeant3TGeo("C++ Interface to Geant3");
83
84 AliRunLoader* rl=0x0;
85
86
87 rl = AliRunLoader::Open("galice.root",
88 AliConfig::GetDefaultEventFolderName(),
89 "recreate");
90 if (rl == 0x0)
91 {
92 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
93 return;
94 }
95 rl->SetCompressionLevel(2);
96 rl->SetNumberOfEventsPerFile(2000);
97 gAlice->SetRunLoader(rl);
98
99 // Set the trigger configuration
100 // gAlice->SetTriggerDescriptor(pprTrigConfName[strig]);
101 //cout<<"Trigger configuration is set to "<<pprTrigConfName[strig]<<endl;
102 AliSimulation::Instance()->SetTriggerConfig(pprTrigConfName[strig]);
103 cout<<"Trigger configuration is set to pprTrigConfName[strig] "<<endl;
104
105 //
106 // Set External decayer
107 TVirtualMCDecayer *decayer = new AliDecayerPythia();
108
109 decayer->SetForceDecay(kAll);
110 decayer->Init();
111 gMC->SetExternalDecayer(decayer);
112 //=======================================================================
113 // ************* STEERING parameters FOR ALICE SIMULATION **************
114 // --- Specify event type to be tracked through the ALICE setup
115 // --- All positions are in cm, angles in degrees, and P and E in GeV
116
117
118 gMC->SetProcess("DCAY",1);
119 gMC->SetProcess("PAIR",1);
120 gMC->SetProcess("COMP",1);
121 gMC->SetProcess("PHOT",1);
122 gMC->SetProcess("PFIS",0);
123 gMC->SetProcess("DRAY",0);
124 gMC->SetProcess("ANNI",1);
125 gMC->SetProcess("BREM",1);
126 gMC->SetProcess("MUNU",1);
127 gMC->SetProcess("CKOV",1);
128 gMC->SetProcess("HADR",0);
129 gMC->SetProcess("LOSS",2);
130 gMC->SetProcess("MULS",1);
131 gMC->SetProcess("RAYL",1);
132
133 Float_t cut = 1.e-3; // 1MeV cut by default
134 Float_t tofmax = 1.e10;
135
136 gMC->SetCut("CUTGAM", cut);
137 gMC->SetCut("CUTELE", cut);
138 gMC->SetCut("CUTNEU", cut);
139 gMC->SetCut("CUTHAD", cut);
140 gMC->SetCut("CUTMUO", cut);
141 gMC->SetCut("BCUTE", cut);
142 gMC->SetCut("BCUTM", cut);
143 gMC->SetCut("DCUTE", cut);
144 gMC->SetCut("DCUTM", cut);
145 gMC->SetCut("PPCUTM", cut);
146 gMC->SetCut("TOFMAX", tofmax);
147
148 // Special generation for Valgrind tests
149 // Each detector is fired by few particles selected
150 // to cover specific cases
151
152
153 // The cocktail itself
154
155 AliGenCocktail *gener = new AliGenCocktail();
156 gener->SetPhiRange(0, 360);
157 // Set pseudorapidity range from -8 to 8.
158 Float_t thmin = EtaToTheta(8); // theta min. <---> eta max
159 Float_t thmax = EtaToTheta(-8); // theta max. <---> eta min
160 gener->SetThetaRange(thmin,thmax);
161 gener->SetOrigin(0., 0., 0); //vertex position
162 gener->SetSigma(0., 0., 0); //Sigma in (X,Y,Z) (cm) on IP position
163
164 AliGenBox *gbox2 = new AliGenBox(1);
165 gbox2->SetPtRange(0.99,1.0001); //
166 gbox2->SetPhiRange(0,360.);
167 gbox2->SetThetaRange(40.,140.);
168 gbox2->SetPart(kPiMinus);
169 gener->AddGenerator(gbox2,"GENBOX PIONS for ITS",1);
170
171
172
173 gener->Init();
174
175
176 //
177 // Activate this line if you want the vertex smearing to happen
178 // track by track
179 //
180 //VertexSmear_t perTrack;
181 //gener->SetVertexSmear(perTrack);
182 // Field (L3 0.5 T)
183 //AliMagF* field = new AliMagF("map","map",2, -1.,1., 15, AliMagF::k5kGUniform);
184 //TGeoGlobalMagField::Instance()->SetField(field);
185 TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", -1., -1., AliMagF::k5kG));
186
187 Int_t iABSO = 0;
188 Int_t iDIPO = 0;
189 Int_t iFMD = 0;
190 Int_t iFRAME = 0;
191 Int_t iHALL = 0;
192 Int_t iITS = 1;
193 Int_t iMAG = 0;
194 Int_t iMUON = 0;
195 Int_t iPHOS = 0;
196 Int_t iPIPE = 0;
197 Int_t iPMD = 0;
198 Int_t iHMPID = 0;
199 Int_t iSHIL = 0;
200 Int_t iT0 = 0;
201 Int_t iTOF = 0;
202 Int_t iTPC = 0;
203 Int_t iTRD = 0;
204 Int_t iZDC = 0;
205 Int_t iEMCAL = 0;
206 Int_t iACORDE = 0;
207 Int_t iVZERO = 0;
208 rl->CdGAFile();
209 //=================== Alice BODY parameters =============================
210 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
211
212 if (iMAG)
213 {
214 //=================== MAG parameters ============================
215 // --- Start with Magnet since detector layouts may be depending ---
216 // --- on the selected Magnet dimensions ---
217 AliMAG *MAG = new AliMAG("MAG", "Magnet");
218 }
219
220
221 if (iABSO)
222 {
223 //=================== ABSO parameters ============================
224 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
225 }
226
227 if (iDIPO)
228 {
229 //=================== DIPO parameters ============================
230
231 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
232 }
233
234 if (iHALL)
235 {
236 //=================== HALL parameters ============================
237
238 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
239 }
240
241
242 if (iFRAME)
243 {
244 //=================== FRAME parameters ============================
245
246 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
247 FRAME->SetHoles(1);
248 }
249
250 if (iSHIL)
251 {
252 //=================== SHIL parameters ============================
253
254 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
255 }
256
257
258 if (iPIPE)
259 {
260 //=================== PIPE parameters ============================
261
262 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
263 }
264
265 if (iITS)
266 {
267 //=================== ITS parameters ============================
268 Bool_t isUpgrade = kTRUE;
269// AliITS *ITS = 0x0;
270 if(isUpgrade) {
271 AliITSvUpgrade *ITS = new AliITSvUpgrade("ITS","ITS Upgrade",4);
272 ITS->DefineLayer(0, 4.0, 14.1, 10, 6);
273 ITS->DefineLayer(1, 7.6, 14.1, 10, 6);
274 ITS->DefineLayerTurbo(2,14.9, 22.2, 12, 8, 4.8, 10);
275 ITS->DefineLayer(3,23.8, 29.7, 16, 8);
362fe8e0 276 ITS->AddBeamPipe(2.0, 2.08);
29998a6e 277 }
362fe8e0 278 else AliITS *ITS = new AliITSv11Hybrid("ITS","ITS v11Hybrid");
29998a6e 279
280 }
281
282
283 if (iTPC)
284 {
285 //============================ TPC parameters ===================
286 AliTPC *TPC = new AliTPCv2("TPC", "Default");
287 }
288
289
290 if (iTOF) {
291 //=================== TOF parameters ============================
292 AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
293 }
294
295
296 if (iHMPID)
297 {
298 //=================== HMPID parameters ===========================
299 AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
300
301 }
302
303
304 if (iZDC)
305 {
306 //=================== ZDC parameters ============================
307
308 AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
309 }
310
311 if (iTRD)
312 {
313 //=================== TRD parameters ============================
314
315 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
316 AliTRDgeometry *geoTRD = TRD->GetGeometry();
317 // Partial geometry: modules at 2,3,4,6,11,12,14,15
318 // starting at 6h in positive direction
319 geoTRD->SetSMstatus(0,0);
320 geoTRD->SetSMstatus(1,0);
321 geoTRD->SetSMstatus(5,0);
322 geoTRD->SetSMstatus(7,0);
323 geoTRD->SetSMstatus(8,0);
324 geoTRD->SetSMstatus(9,0);
325 geoTRD->SetSMstatus(10,0);
326 geoTRD->SetSMstatus(13,0);
327 geoTRD->SetSMstatus(16,0);
328 geoTRD->SetSMstatus(17,0);
329 }
330
331 if (iFMD)
332 {
333 //=================== FMD parameters ============================
334 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
335 }
336
337 if (iMUON)
338 {
339 //=================== MUON parameters ===========================
340 // New MUONv1 version (geometry defined via builders)
341 AliMUON *MUON = new AliMUONv1("MUON","default");
342 }
343 //=================== PHOS parameters ===========================
344
345 if (iPHOS)
346 {
347 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
348 }
349
350
351 if (iPMD)
352 {
353 //=================== PMD parameters ============================
354 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
355 }
356
357 if (iT0)
358 {
359 //=================== T0 parameters ============================
360 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
361 }
362
363 if (iEMCAL)
364 {
365 //=================== EMCAL parameters ============================
366 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETEV1");
367 }
368
369 if (iACORDE)
370 {
371 //=================== ACORDE parameters ============================
372 AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
373 }
374
375 if (iVZERO)
376 {
377 //=================== VZERO parameters ============================
378 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
379 }
380
381
382}
383
384Float_t EtaToTheta(Float_t arg){
385 return (180./TMath::Pi())*2.*atan(exp(-arg));
386}