1 enum gentype_t {hijing, gun, box, pythia, param, cocktail, fluka, halo, ntuple, scan, doublescan};
9 new AliGeant3("C++ Interface to Geant3");
11 //=======================================================================
12 // Create the output file
14 TFile *rootfile = new TFile("galice.root","recreate");
15 rootfile->SetCompressionLevel(2);
16 TGeant3 *geant3 = (TGeant3*)gMC;
19 // Set Random Number seed
22 //=======================================================================
23 // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
24 geant3->SetTRIG(1); //Number of events to be processed
25 geant3->SetSWIT(4,100);
26 geant3->SetDEBU(0,0,1);
27 //geant3->SetSWIT(2,2);
38 geant3->SetHADR(3); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
42 geant3->SetAUTO(1); //Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
43 geant3->SetABAN(0); //Restore 3.16 behaviour for abandoned tracks
44 geant3->SetOPTI(2); //Select optimisation level for GEANT geometry searches (0,1,2)
45 Float_t cut = 1.e-1; // 100MeV cut by default
46 Float_t tofmax = 1.e10;
47 // GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
48 geant3->SetCUTS(1.e-5,5.e-5, 1.e-3, 1.e-4, cut, cut, cut, cut, cut, cut, tofmax);
51 //=======================================================================
52 // ************* STEERING parameters FOR ALICE SIMULATION **************
53 // --- Specify event type to be tracked through the ALICE setup
54 // --- All positions are in cm, angles in degrees, and P and E in GeV
59 //*********************************************
60 // Example for Fixed Particle Gun *
61 //*********************************************
62 AliGenFixed *gener = new AliGenFixed(ntracks);
63 gener->SetMomentum(3);
64 gener->SetPhiRange(90);
65 gener->SetThetaRange(101);
66 gener->SetOrigin(0,480,-20); //vertex position
67 gener->SetPart(kPiPlus); //GEANT particle type
70 //*********************************************
71 // Example for Moving Particle Gun *
72 //*********************************************
73 AliGenBox *gener = new AliGenBox(ntracks);
74 gener->SetMomentumRange(3,3);
75 gener->SetPhiRange(82,98);
76 gener->SetThetaRange(85,98);
77 gener->SetOrigin(0,0,0);
78 gener->SetVertexSmear(kPerTrack);
80 gener->SetSigma(1.8, 1.8,0); //Sigma in (X,Y,Z) (cm) on IP position
81 gener->SetPart(kPiPlus); //GEANT particle type
84 //*********************************************
85 // Scanning on a grid *
86 //*********************************************
87 AliGenScan *gener = new AliGenScan(-1);
88 gener->SetMomentumRange(3,3);
89 gener->SetPhiRange(90,90);
90 gener->SetThetaRange(90,90);
92 gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
93 gener->SetPart(kPiPlus);
94 gener->SetRange(1, 430, 430, 1, 430, 430, 1, 430, 430);
97 //*********************************************
98 // Scanning on a grid *
99 //*********************************************
100 AliGenDoubleScan *gener = new AliGenDoubleScan(-1);
101 gener->SetMomentumRange(3,3);
102 gener->SetPhiRange(0,360);
103 gener->SetThetaRange(0,0);
105 gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
106 gener->SetPart(kPiPlus);
107 gener->SetRange(20, -60, 60, 1, 480, 480, 20, -60, 60);
108 gener->SetDistance(1);
113 AliGenHIJINGpara *gener = new AliGenHIJINGpara(ntracks);
114 gener->SetMomentumRange(0,999);
115 gener->SetPhiRange(0,360);
116 gener->SetThetaRange(.77,179.23);
117 gener->SetOrigin(0,0,0); //vertex position
118 gener->SetSigma(0,0,5.6); //Sigma in (X,Y,Z) (cm) on IP position
122 //********************************************
123 // Example for Charm Production with Pythia *
124 //********************************************
126 AliGenPythia *gener = new AliGenPythia(ntracks);
127 gener->SetMomentumRange(0,999);
128 gener->SetPhiRange(0,360);
129 gener->SetThetaRange(0., 180.);
130 gener->SetYRange(-10,10);
131 gener->SetPtRange(0,100);
132 gener->SetOrigin(0,0,0); // vertex position
133 gener->SetVertexSmear(perEvent);
134 gener->SetSigma(0,0,5.6); // Sigma in (X,Y,Z) (cm) on IP position
135 // gener->SetStrucFunc(DO_Set_1);
136 gener->SetProcess(mb);
137 gener->SetEnergyCMS(5500.);
141 //*******************************************************
142 // Example for J/psi Production from Parameterisation *
143 //*******************************************************
144 AliGenParam *gener = new AliGenParam(178,Eta,
145 AliGenPHOSlib::GetPt(Eta),
146 AliGenPHOSlib::GetY(Eta),
147 AliGenPHOSlib::GetIp(Eta) );
149 gener->SetMomentumRange(0,999);
150 gener->SetPhiRange(0,360);
151 gener->SetYRange(2.5,4);
152 gener->SetThetaRange(2,9);
153 gener->SetPtRange(0,10);
154 gener->SetOrigin(0,0,0); //vertex position
155 gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
156 gener->SetCutOnChild(1);
160 //*******************************************************
161 // Example for a FLUKA Boundary Source *
162 //*******************************************************
163 AliGenFLUKAsource *gener = new AliGenFLUKAsource(-1);
164 gener->AddFile("$(ALICE_ROOT)/data/all32.root");
166 gener->SetPartFlag(9);
167 gener->SetMomentumRange(0,999);
168 gener->SetPhiRange(0,360);
169 gener->SetThetaRange(0., 180.);
170 gener->SetAgeMax(1.e-5);
173 gener->SetFraction(0.0315);
177 //*******************************************************
178 // Example for reading from a external file *
179 //*******************************************************
180 AliGenExtFile *gener = new AliGenExtFile(-1);
181 gener->SetFileName("$(ALICE_ROOT)/data/dtujet93.root");
182 gener->SetVertexSmear(perEvent);
183 gener->SetTrackingFlag(1);
187 //*******************************************************
188 // Example for Tunnel Halo Source *
189 //*******************************************************
190 AliGenHalo *gener = new AliGenHalo(ntracks);
191 gener->SetFileName("/h1/morsch/marsip/marsip5.mu");
195 //*******************************************************
196 // Example for a Cocktail *
197 //*******************************************************
198 AliGenCocktail *gener = new AliGenCocktail();
199 gener->SetMomentumRange(0,10);
200 gener->SetPhiRange(0,360);
201 gener->SetThetaRange(45.,135);
203 pions = new AliGenParam(100, pion_p);
204 // kaons = new AliGenParam(10 , kaon_p);
205 // protons = new AliGenParam(10 , proton_p);
206 gener->AddGenerator(pions , "Pions" , 100);
207 // gener->AddGenerator(kaons , "Kaons" , 10);
208 // gener->AddGenerator(protons, "Protons", 10);
214 Float_t (*f1)(Float_t);
215 Double_t (*f2)(Double_t);
220 Float_t p2(Float_t x)
225 Float_t x = TMath::Sqrt(2);
229 printf("\n Result %f %f \n", (*f1)(2.), TMath::Sqrt(2));
235 // Activate this line if you want the vertex smearing to happen
238 gener->SetVertexSmear(kPerTrack);
240 gAlice->SetField(0,2); //Specify maximum magnetic field in Tesla (neg. ==> default field)
262 //=================== Alice BODY parameters =============================
263 AliBODY *BODY = new AliBODY("BODY","Alice envelop");
267 //=================== MAG parameters ============================
268 // --- Start with Magnet since detector layouts may be depending ---
269 // --- on the selected Magnet dimensions ---
270 AliMAG *MAG = new AliMAG("MAG","Magnet");
275 //=================== ABSO parameters ============================
276 AliABSO *ABSO = new AliABSOv0("ABSO","Muon Absorber");
280 //=================== DIPO parameters ============================
282 AliDIPO *DIPO = new AliDIPOv2("DIPO","Dipole version 2");
286 //=================== HALL parameters ============================
288 AliHALL *HALL = new AliHALL("HALL","Alice Hall");
293 //=================== FRAME parameters ============================
295 AliFRAME *FRAME = new AliFRAMEv1("FRAME","Space Frame");
300 //=================== SHIL parameters ============================
302 AliSHIL *SHIL = new AliSHILv0("SHIL","Shielding");
307 //=================== PIPE parameters ============================
309 AliPIPE *PIPE = new AliPIPEv0("PIPE","Beam Pipe");
314 //=================== ITS parameters ===========================
316 // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
317 // almost all other detectors. This involves the fact that the ITS geometry
318 // still has several options to be followed in parallel in order to determine
319 // the best set-up which minimizes the induced background. All the geometries
320 // available to date are described in the following. Read carefully the comments
321 // and use the default version (the only one uncommented) unless you are making
322 // comparisons and you know what you are doing. In this case just uncomment the
323 // ITS geometry you want to use and run Aliroot.
325 // Detailed geometries:
326 // ====================
329 //AliITS *ITS = new AliITSv3("ITS","Old ITS detailed version as of the ALICE TP");
331 //AliITS *ITS = new AliITSv5("ITS","Current ITS detailed version used for the ITS TDR");
333 //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
335 //AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
338 // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful for reconstruction !):
339 // ======================================================================================================================
342 //AliITS *ITS = new AliITSv1("ITS","Old ITS coarse version as of the ALICE TP");
344 AliITS *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS coarse version with asymmetric services");
346 //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS coarse version with symmetric services");
349 // Geant3 <-> EUCLID conversion
350 // ============================
352 // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
353 // media to two ASCII files (called by default ITSgeometry.euc and
354 // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
355 // The default (=0) means that you dont want to use this facility.
362 //============================ TPC parameters ================================
363 // --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
364 // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
365 // --- sectors are specified, any value other than that requires at least one
366 // --- sector (lower or upper)to be specified!
367 // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
368 // --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
369 // --- SecLows - number of lower sectors specified (up to 6)
370 // --- SecUps - number of upper sectors specified (up to 12)
371 // --- Sens - sensitive strips for the Slow Simulator !!!
372 // --- This does NOT work if all S or L-sectors are specified, i.e.
373 // --- if SecAL or SecAU < 0
376 //-----------------------------------------------------------------------------
378 /* gROOT->LoadMacro("SetTPCParam.C");
379 AliTPCParam *param = SetTPCParam();
380 AliTPC *TPC = new AliTPCv0("TPC","Normal TPC"); //v1 is default
381 TPC->SetParam(param); // pass the parameter object to the TPC
385 TPC->SetGasMixt(2,20,10,-1,0.9,0.1,0.);
388 TPC->SetSecLows(1, 2, 3, 19, 20, 21);
389 TPC->SetSecUps(37, 38, 39, 37+18, 38+18, 39+18, -1, -1, -1, -1, -1, -1);
392 if (TPC->IsVersion()==1) param->Write(param->GetTitle());*/
394 AliTPC *TPC = new AliTPCv0("TPC","Default");
395 // All sectors included
402 //=================== TOF parameters ============================
403 AliTOF *TOF = new AliTOFv2("TOF","normal TOF");
407 //=================== RICH parameters ===========================
408 AliRICH *RICH = new AliRICHv2("RICH","normal RICH");
412 // Default Segmentation
413 AliRICHSegmentationV1* Segmentation = new AliRICHSegmentationV1;
415 // Segmentation parameters
416 Segmentation->SetPadSize(0.84,0.8);
417 Segmentation->SetDAnod(0.84/2);
419 // Geometry parameters
420 AliRICHGeometry* Geometry = new AliRICHGeometry;
421 Geometry->SetGapThickness(8);
422 Geometry->SetProximityGapThickness(.4);
423 Geometry->SetQuartzLength(133);
424 Geometry->SetQuartzWidth(127.9);
425 Geometry->SetQuartzThickness(.5);
426 Geometry->SetOuterFreonLength(133);
427 Geometry->SetOuterFreonWidth(41.3);
428 Geometry->SetInnerFreonLength(133);
429 Geometry->SetInnerFreonWidth(41.3);
430 Geometry->SetFreonThickness(1.5);
432 // Response parameters
433 AliRICHResponseV0* Response = new AliRICHResponseV0;
434 Response->SetSigmaIntegration(5.);
435 Response->SetChargeSlope(27.);
436 Response->SetChargeSpread(0.18, 0.18);
437 Response->SetMaxAdc(4096);
438 Response->SetAlphaFeedback(0.036);
439 Response->SetEIonisation(26.e-9);
440 Response->SetSqrtKx3(0.77459667);
441 Response->SetKx2(0.962);
442 Response->SetKx4(0.379);
443 Response->SetSqrtKy3(0.77459667);
444 Response->SetKy2(0.962);
445 Response->SetKy4(0.379);
446 Response->SetPitch(0.25);
447 Response->SetWireSag(1); // 1->On, 0->Off
448 Response->SetVoltage(2150); // Should only be 2000, 2050, 2100 or 2150
451 for (Int_t i=0; i<7; i++) {
452 RICH->SetGeometryModel(i,Geometry);
453 RICH->SetSegmentationModel(i, Segmentation);
454 RICH->SetResponseModel(i, Response);
456 RICH->SetDebugLevel(0);
461 //=================== ZDC parameters ============================
463 AliZDC *ZDC = new AliZDCv1("ZDC","normal ZDC");
467 //=================== CASTOR parameters ============================
469 AliCASTOR *CASTOR = new AliCASTORv1("CASTOR","normal CASTOR");
473 //=================== TRD parameters ============================
475 AliTRD *TRD = new AliTRDv1("TRD","TRD version 0");
476 // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
478 // With hole in front of PHOS
480 // With hole in front of RICH
486 //=================== FMD parameters ============================
488 AliFMD *FMD = new AliFMDv1("FMD","normal FMD");
492 //=================== MUON parameters ===========================
494 AliMUON *MUON = new AliMUONv0("MUON","normal MUON");
498 //=================== PHOS parameters ===========================
501 AliPHOS *PHOS = new AliPHOSv0("PHOS","GPS2");
506 //=================== PMD parameters ============================
508 AliPMD *PMD = new AliPMDv0("PMD","normal PMD");
509 PMD->SetPAR(1., 1., 0.8, 0.02);
510 PMD->SetIN(6., 18., -580., 27., 27.);
511 PMD->SetGEO(0.0, 0.2, 4.);
512 PMD->SetPadSize(0.8, 1.0, 1.0, 1.5);
517 //=================== START parameters ============================
518 AliSTART *START = new AliSTARTv0("START","START Detector");