2 // Set Random Number seed
3 // gRandom->SetSeed(12345);
4 // libraries required by geant321
5 gSystem->Load("libgeant321");
6 new TGeant3("C++ Interface to Geant3");
7 if (!gSystem->Getenv("CONFIG_FILE")){
8 TFile *rootfile = new TFile("galice.root", "recreate");
9 rootfile->SetCompressionLevel(2);
11 TGeant3 *geant3 = (TGeant3 *) gMC;
12 // Set External decayer
13 AliDecayer *decayer = new AliDecayerPythia();
14 decayer->SetForceDecay(kAll);
16 gMC->SetExternalDecayer(decayer);
17 //=======================================================================
18 // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
19 geant3->SetTRIG(1); //Number of events to be processed
20 geant3->SetSWIT(4, 10);
21 geant3->SetDEBU(0, 0, 1);
22 //geant3->SetSWIT(2,2);
33 geant3->SetHADR(1);//Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
37 geant3->SetAUTO(1);//Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
38 geant3->SetABAN(0);//Restore 3.16 behaviour for abandoned tracks
39 geant3->SetOPTI(2);//Select optimisation level for GEANT geometry searches (0,1,2)
40 geant3->SetERAN(5.e-7);
41 Float_t cut = 1.e-3; // 1MeV cut by default
42 Float_t tofmax = 1.e10;
43 // GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
44 geant3->SetCUTS(cut, cut, cut, cut, cut, cut, cut, cut, cut, cut,
46 //=======================================================================
47 // ************* STEERING parameters FOR ALICE SIMULATION **************
48 // --- Specify event type to be tracked through the ALICE setup
49 // --- All positions are in cm, angles in degrees, and P and E in GeV
50 if (gSystem->Getenv("CONFIG_NPARTICLES")){
51 int nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
55 //*********************************************
56 // Example for Moving Particle Gun *
57 //*********************************************
58 AliGenBox *gener = new AliGenBox(nParticles);
59 gener->SetMomentumRange(100.,300.);
60 gener->SetPhiRange(0,0.01);
61 gener->SetThetaRange(0.0, 1.0);
62 gener->SetOrigin(0.,0.,-100.);
64 gener->SetSigma(1.0,1.00,0); //Sigma in (X,Y,Z) (cm) on IP position
65 gener->SetPart(211); //GEANT particle type
67 // Activate this line if you want the vertex smearing to happen
70 //gener->SetVertexSmear(perTrack);
72 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
74 gAlice->SetField(field);
78 //=================== Alice BODY parameters =============================
79 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
82 //=================== HALL parameters ============================
83 AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
86 //=================== ITS parameters ============================
87 AliITSvSPD02 *ITS = new AliITSvSPD02("SPD test beam 2002");
92 Float_t EtaToTheta(Float_t arg){
93 return (180./TMath::Pi())*2.*atan(exp(-arg));