1 #if !defined(__CINT__) || defined(__MAKECINT__)
6 #include <TVirtualMC.h>
8 #include "STEER/AliRunLoader.h"
9 #include "STEER/AliRun.h"
10 #include "STEER/AliConfig.h"
11 #include "PYTHIA6/AliDecayerPythia.h"
12 #include "PYTHIA6/AliGenPythia.h"
13 #include "STEER/AliMagFCM.h"
14 #include "STRUCT/AliBODY.h"
15 #include "STRUCT/AliMAG.h"
16 #include "STRUCT/AliABSOv3.h"
17 #include "STRUCT/AliDIPOv3.h"
18 #include "STRUCT/AliHALLv3.h"
19 #include "STRUCT/AliFRAMEv2.h"
20 #include "STRUCT/AliSHILv3.h"
21 #include "STRUCT/AliPIPEv3.h"
22 #include "ITS/AliITSv11.h"
23 #include "TPC/AliTPCv2.h"
24 #include "TOF/AliTOFv6T0.h"
25 #include "HMPID/AliHMPIDv3.h"
26 #include "ZDC/AliZDCv3.h"
27 #include "TRD/AliTRDv1.h"
28 #include "FMD/AliFMDv0.h"
29 #include "MUON/AliMUONv1.h"
30 #include "PHOS/AliPHOSv1.h"
31 #include "PMD/AliPMDv1.h"
32 #include "T0/AliT0v1.h"
33 #include "ACORDE/AliACORDEv1.h"
42 // Set Random Number seed
44 UInt_t curtime=dt.Get();
45 UInt_t procid=gSystem->GetPid();
46 UInt_t seed=curtime-procid;
48 // gRandom->SetSeed(seed);
49 gRandom->SetSeed(12345);
50 cerr<<"Seed for random number generation= "<<seed<<endl;
51 // Load Pythia libraries
53 // libraries required by geant321
55 gSystem->Load("libgeant321");
58 new TGeant3TGeo("C++ Interface to Geant3");
60 //=======================================================================
61 // Create the output file
63 if(!AliCDBManager::Instance()->IsDefaultStorageSet()){
64 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
65 AliCDBManager::Instance()->SetRun(0);
70 cout<<"Config.C: Creating Run Loader ..."<<endl;
71 rl = AliRunLoader::Open("galice.root",
72 AliConfig::GetDefaultEventFolderName(),
76 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
79 rl->SetCompressionLevel(2);
80 rl->SetNumberOfEventsPerFile(3);
81 gAlice->SetRunLoader(rl);
82 // gAlice->SetGeometryFromFile("geometry.root");
83 // gAlice->SetGeometryFromCDB();
85 // Set the trigger configuration
86 AliSimulation::Instance()->SetTriggerConfig("Pb-Pb");
87 cout<<"Trigger configuration is set to Pb-Pb"<<endl;
90 // Set External decayer
91 AliDecayer* decayer = new AliDecayerPythia();
92 decayer->SetForceDecay(kAll);
94 gMC->SetExternalDecayer(decayer);
98 //=======================================================================
99 // ************* STEERING parameters FOR ALICE SIMULATION **************
100 // --- Specify event type to be tracked through the ALICE setup
101 // --- All positions are in cm, angles in degrees, and P and E in GeV
103 gMC->SetProcess("DCAY",1);
104 gMC->SetProcess("PAIR",1);
105 gMC->SetProcess("COMP",1);
106 gMC->SetProcess("PHOT",1);
107 gMC->SetProcess("PFIS",0);
108 gMC->SetProcess("DRAY",0);
109 gMC->SetProcess("ANNI",1);
110 gMC->SetProcess("BREM",1);
111 gMC->SetProcess("MUNU",1);
112 gMC->SetProcess("CKOV",1);
113 gMC->SetProcess("HADR",1);
114 gMC->SetProcess("LOSS",2);
115 gMC->SetProcess("MULS",1);
116 gMC->SetProcess("RAYL",1);
118 Float_t cut = 1.e-3; // 1MeV cut by default
119 Float_t tofmax = 1.e10;
121 gMC->SetCut("CUTGAM", cut);
122 gMC->SetCut("CUTELE", cut);
123 gMC->SetCut("CUTNEU", cut);
124 gMC->SetCut("CUTHAD", cut);
125 gMC->SetCut("CUTMUO", cut);
126 gMC->SetCut("BCUTE", cut);
127 gMC->SetCut("BCUTM", cut);
128 gMC->SetCut("DCUTE", cut);
129 gMC->SetCut("DCUTM", cut);
130 gMC->SetCut("PPCUTM", cut);
131 gMC->SetCut("TOFMAX", tofmax);
134 // AliGenPythia *gener = new AliGenPythia(ntracks);
135 AliGenPythia *gener = new AliGenPythia(-1);
137 gener->SetMomentumRange(0,999);
138 gener->SetPhiRange(0.,360.);
139 gener->SetThetaRange(0,180);
140 gener->SetYRange(-999,999);
141 //gener->SetPtRange(0,100);
142 gener->SetOrigin(0,0,0); // vertex position
143 //gener->SetVertexSmear(kPerEvent);
144 gener->SetSigma(0,0,5.3); // Sigma in (X,Y,Z) (cm) on IP position
145 gener->SetTrackingFlag(0);
146 // gener->SetForceDecay(kHadronicD);
149 // The following settings select the Pythia parameters tuned to agree
150 // with beauty NLO calculation for Pb-Pb @ 5.5 TeV with MNR code.
152 gener->SetProcess(kPyBeautyPbPbMNR);
153 gener->SetStrucFunc(kCTEQ4L);
154 gener->SetPtHard(2.75,-1.0);
155 gener->SetEnergyCMS(5500.);
156 gener->SetNuclei(208,208); // Pb-Pb collisions
157 // Force no decay heavy quark mesons
158 gener->SetForceDecay(kNoDecayHeavy);
162 // Activate this line if you want the vertex smearing to happen
165 //gener->SetVertexSmear(perTrack);
168 AliMagFCM* field = new AliMagFCM(
169 "Map2","$(ALICE_ROOT)/data/field01.dat", 2, 1., 10.);
170 field->SetSolenoidField(4.);
171 gAlice->SetField(field);
193 //=================== Alice BODY parameters =============================
194 AliBODY *BODY = new AliBODY("BODY","Alice envelop");
197 //=================== MAG parameters ============================
198 // --- Start with Magnet since detector layouts may be depending ---
199 // --- on the selected Magnet dimensions ---
200 AliMAG *MAG = new AliMAG("MAG","Magnet");
205 //=================== ABSO parameters ============================
206 AliABSO *ABSO = new AliABSOv3("ABSO","Muon Absorber");
210 //=================== DIPO parameters ============================
212 AliDIPO *DIPO = new AliDIPOv3("DIPO","Dipole version 3");
216 //=================== HALL parameters ============================
218 AliHALL *HALL = new AliHALLv3("HALL","Alice Hall");
223 //=================== FRAME parameters ============================
225 AliFRAME *FRAME = new AliFRAMEv2("FRAME","Space Frame");
230 //=================== SHIL parameters ============================
232 AliSHIL *SHIL = new AliSHILv3("SHIL","Shielding");
237 //=================== PIPE parameters ============================
239 AliPIPE *PIPE = new AliPIPEv3("PIPE","Beam Pipe");
244 //=================== ITS parameters ============================
246 AliITS *ITS = new AliITSv11("ITS","ITS v11");
251 //============================ TPC parameters ===================
252 AliTPC *TPC = new AliTPCv2("TPC","Default");
257 //=================== TOF parameters ============================
258 AliTOF *TOF = new AliTOFv6T0("TOF","normal TOF");
262 //=================== HMPID parameters ===========================
263 AliHMPID *HMPID = new AliHMPIDv3("HMPID","normal HMPID");
269 //=================== ZDC parameters ============================
271 AliZDC *ZDC = new AliZDCv3("ZDC","normal ZDC");
275 //=================== ACORDE parameters ============================
277 AliACORDE *ACORDE = new AliACORDEv1("ACORDE","normal ACORDE");
281 //=================== TRD parameters ============================
283 AliTRD *TRD = new AliTRDv1("TRD","TRD slow simulator");
287 //=================== FMD parameters ============================
289 AliFMD *FMD = new AliFMDv0("FMD","normal FMD");
293 //=================== MUON parameters ===========================
294 AliMUON *MUON = new AliMUONv1("MUON","default");
297 //=================== PHOS parameters ===========================
300 AliPHOS *PHOS = new AliPHOSv1("PHOS","GPS2");
305 //=================== PMD parameters ============================
307 AliPMD *PMD = new AliPMDv1("PMD","normal PMD");
308 PMD->SetPAR(1., 1., 0.8, 0.02);
309 PMD->SetIN(6., 18., -580., 27., 27.);
310 PMD->SetGEO(0.0, 0.2, 4.);
311 PMD->SetPadSize(0.8, 1.0, 1.0, 1.5);
316 //=================== T0 parameters ============================
317 AliT0 *T0 = new AliT0v1("T0","T0 Detector");
326 // Load Pythia related libraries
327 gSystem->Load("liblhapdf.so"); // Parton density functions
328 gSystem->Load("libEGPythia6.so"); // TGenerator interface
329 gSystem->Load("libpythia6.so"); // Pythia
330 gSystem->Load("libAliPythia6.so"); // ALICE specific implementations