2 #if !defined(__CINT__) || defined(__MAKECINT__)
7 #include <TVirtualMC.h>
9 #include "STEER/AliRunLoader.h"
10 #include "STEER/AliRun.h"
11 #include "STEER/AliConfig.h"
12 #include "PYTHIA6/AliDecayerPythia.h"
13 #include "EVGEN/AliGenCocktail.h"
14 #include "EVGEN/AliGenHIJINGpara.h"
15 #include "STEER/AliMagFMaps.h"
16 #include "STRUCT/AliBODY.h"
17 #include "STRUCT/AliMAG.h"
18 #include "STRUCT/AliABSOv0.h"
19 #include "STRUCT/AliDIPOv2.h"
20 #include "STRUCT/AliHALL.h"
21 #include "STRUCT/AliFRAMEv2.h"
22 #include "STRUCT/AliSHILv2.h"
23 #include "STRUCT/AliPIPEv0.h"
24 #include "ITS/AliITSvSPD02.h"
27 Float_t EtaToTheta(Float_t arg){
28 return (180./TMath::Pi())*2.*atan(exp(-arg));
30 //------------------------------------------------------------------
32 // Set Random Number seed
33 // gRandom->SetSeed(12345);
34 // libraries required by geant321
36 gSystem->Load("libgeant321");
38 new TGeant3("C++ Interface to Geant3");
40 rl = AliRunLoader::Open("galice.root",
41 AliConfig::GetDefaultEventFolderName(),"recreate");
43 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
46 rl->SetCompressionLevel(2);
47 rl->SetNumberOfEventsPerFile(1000);
48 gAlice->SetRunLoader(rl);
50 // Set External decayer
51 TVirtualMCDecayer *decayer = new AliDecayerPythia();
52 decayer->SetForceDecay(kAll);
54 gMC->SetExternalDecayer(decayer);
55 //=======================================================================
56 gMC->SetProcess("DCAY",1);
57 gMC->SetProcess("PAIR",1);
58 gMC->SetProcess("COMP",1);
59 gMC->SetProcess("PHOT",1);
60 gMC->SetProcess("PFIS",0);
61 gMC->SetProcess("DRAY",0);
62 gMC->SetProcess("ANNI",1);
63 gMC->SetProcess("BREM",1);
64 gMC->SetProcess("MUNU",1);
65 gMC->SetProcess("CKOV",1);
66 gMC->SetProcess("HADR",1);
67 gMC->SetProcess("LOSS",2);
68 gMC->SetProcess("MULS",1);
69 gMC->SetProcess("RAYL",1);
70 Float_t cut = 1.e-3; // 1MeV cut by default
71 Float_t tofmax = 1.e10;
72 gMC->SetCut("CUTGAM", cut);
73 gMC->SetCut("CUTELE", cut);
74 gMC->SetCut("CUTNEU", cut);
75 gMC->SetCut("CUTHAD", cut);
76 gMC->SetCut("CUTMUO", cut);
77 gMC->SetCut("BCUTE", cut);
78 gMC->SetCut("BCUTM", cut);
79 gMC->SetCut("DCUTE", cut);
80 gMC->SetCut("DCUTM", cut);
81 gMC->SetCut("PPCUTM", cut);
82 gMC->SetCut("TOFMAX", tofmax);
84 if (gSystem->Getenv("CONFIG_NPARTICLES")){
85 nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
87 //*********************************************
88 // Example for Moving Particle Gun *
89 //*********************************************
90 AliGenBox *gener = new AliGenBox(nParticles);
91 gener->SetMomentumRange(100.,300.);
92 gener->SetPhiRange(0,0.1);
93 gener->SetThetaRange(0.0, .1);
94 gener->SetOrigin(0.,0.,-50.);
96 gener->SetSigma(0.1,0.1,0.0); //Sigma in (X,Y,Z) (cm) on IP position
97 gener->SetPart(kPiPlus);
99 // Activate this line if you want the vertex smearing to happen
102 //gener->SetVertexSmear(perTrack);
104 //gAlice->SetField(field);
109 //=================== Alice BODY parameters =============================
110 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
113 //=================== HALL parameters ============================
114 AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
117 //=================== ITS parameters ============================
118 AliITSvSPD02 *ITS = new AliITSvSPD02("SPD test beam 2002",2002);