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/AliABSOv0.h"
17 #include "STRUCT/AliDIPOv2.h"
18 #include "STRUCT/AliHALL.h"
19 #include "STRUCT/AliFRAMEv2.h"
20 #include "STRUCT/AliSHILv2.h"
21 #include "STRUCT/AliPIPEv0.h"
22 #include "ITS/AliITSvPPRasymm.h"
23 #include "TPC/AliTPCv2.h"
24 #include "TOF/AliTOFv5T0.h"
25 #include "HMPID/AliHMPIDv1.h"
26 #include "ZDC/AliZDCv1.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"
40 // Set Random Number seed
42 UInt_t curtime=dt.Get();
43 UInt_t procid=gSystem->GetPid();
44 UInt_t seed=curtime-procid;
46 // gRandom->SetSeed(seed);
47 gRandom->SetSeed(12345);
48 cerr<<"Seed for random number generation= "<<seed<<endl;
50 // libraries required by geant321
52 gSystem->Load("libgeant321");
55 new TGeant3TGeo("C++ Interface to Geant3");
57 //=======================================================================
58 // Create the output file
62 cout<<"Config.C: Creating Run Loader ..."<<endl;
63 rl = AliRunLoader::Open("galice.root",
64 AliConfig::GetDefaultEventFolderName(),
68 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
71 rl->SetCompressionLevel(2);
72 rl->SetNumberOfEventsPerFile(3);
73 gAlice->SetRunLoader(rl);
75 // Set the trigger configuration
76 gAlice->SetTriggerDescriptor("Pb-Pb");
77 cout<<"Trigger configuration is set to Pb-Pb"<<endl;
80 // Set External decayer
81 AliDecayer* decayer = new AliDecayerPythia();
82 decayer->SetForceDecay(kAll);
84 gMC->SetExternalDecayer(decayer);
88 //=======================================================================
89 // ************* STEERING parameters FOR ALICE SIMULATION **************
90 // --- Specify event type to be tracked through the ALICE setup
91 // --- All positions are in cm, angles in degrees, and P and E in GeV
93 gMC->SetProcess("DCAY",1);
94 gMC->SetProcess("PAIR",1);
95 gMC->SetProcess("COMP",1);
96 gMC->SetProcess("PHOT",1);
97 gMC->SetProcess("PFIS",0);
98 gMC->SetProcess("DRAY",0);
99 gMC->SetProcess("ANNI",1);
100 gMC->SetProcess("BREM",1);
101 gMC->SetProcess("MUNU",1);
102 gMC->SetProcess("CKOV",1);
103 gMC->SetProcess("HADR",1);
104 gMC->SetProcess("LOSS",2);
105 gMC->SetProcess("MULS",1);
106 gMC->SetProcess("RAYL",1);
108 Float_t cut = 1.e-3; // 1MeV cut by default
109 Float_t tofmax = 1.e10;
111 gMC->SetCut("CUTGAM", cut);
112 gMC->SetCut("CUTELE", cut);
113 gMC->SetCut("CUTNEU", cut);
114 gMC->SetCut("CUTHAD", cut);
115 gMC->SetCut("CUTMUO", cut);
116 gMC->SetCut("BCUTE", cut);
117 gMC->SetCut("BCUTM", cut);
118 gMC->SetCut("DCUTE", cut);
119 gMC->SetCut("DCUTM", cut);
120 gMC->SetCut("PPCUTM", cut);
121 gMC->SetCut("TOFMAX", tofmax);
124 // AliGenPythia *gener = new AliGenPythia(ntracks);
125 AliGenPythia *gener = new AliGenPythia(-1);
127 gener->SetMomentumRange(0,999);
128 gener->SetPhiRange(0.,360.);
129 gener->SetThetaRange(0,180);
130 gener->SetYRange(-999,999);
131 //gener->SetPtRange(0,100);
132 gener->SetOrigin(0,0,0); // vertex position
133 //gener->SetVertexSmear(kPerEvent);
134 gener->SetSigma(0,0,5.3); // Sigma in (X,Y,Z) (cm) on IP position
135 gener->SetTrackingFlag(0);
136 // gener->SetForceDecay(kHadronicD);
139 // The following settings select the Pythia parameters tuned to agree
140 // with beauty NLO calculation for Pb-Pb @ 5.5 TeV with MNR code.
142 gener->SetProcess(kPyBeautyPbPbMNR);
143 gener->SetStrucFunc(kCTEQ4L);
144 gener->SetPtHard(2.75,-1.0);
145 gener->SetEnergyCMS(5500.);
146 gener->SetNuclei(208,208); // Pb-Pb collisions
147 // Force no decay heavy quark mesons
148 gener->SetForceDecay(kNoDecayHeavy);
152 // Activate this line if you want the vertex smearing to happen
155 //gener->SetVertexSmear(perTrack);
158 AliMagFCM* field = new AliMagFCM(
159 "Map2","$(ALICE_ROOT)/data/field01.dat", 2, 1., 10.);
160 field->SetSolenoidField(4.);
161 gAlice->SetField(field);
183 //=================== Alice BODY parameters =============================
184 AliBODY *BODY = new AliBODY("BODY","Alice envelop");
187 //=================== MAG parameters ============================
188 // --- Start with Magnet since detector layouts may be depending ---
189 // --- on the selected Magnet dimensions ---
190 AliMAG *MAG = new AliMAG("MAG","Magnet");
195 //=================== ABSO parameters ============================
196 AliABSO *ABSO = new AliABSOv0("ABSO","Muon Absorber");
200 //=================== DIPO parameters ============================
202 AliDIPO *DIPO = new AliDIPOv2("DIPO","Dipole version 2");
206 //=================== HALL parameters ============================
208 AliHALL *HALL = new AliHALL("HALL","Alice Hall");
213 //=================== FRAME parameters ============================
215 AliFRAME *FRAME = new AliFRAMEv2("FRAME","Space Frame");
220 //=================== SHIL parameters ============================
222 AliSHIL *SHIL = new AliSHILv2("SHIL","Shielding");
227 //=================== PIPE parameters ============================
229 AliPIPE *PIPE = new AliPIPEv0("PIPE","Beam Pipe");
235 //=================== ITS parameters ============================
237 // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
238 // almost all other detectors. This involves the fact that the ITS geometry
239 // still has several options to be followed in parallel in order to determine
240 // the best set-up which minimizes the induced background. All the geometries
241 // available to date are described in the following. Read carefully the comments
242 // and use the default version (the only one uncommented) unless you are making
243 // comparisons and you know what you are doing. In this case just uncomment the
244 // ITS geometry you want to use and run Aliroot.
246 // Detailed geometries:
249 //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
251 //AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
253 AliITSvPPRasymm *ITS = new AliITSvPPRasymm("ITS","New ITS PPR detailed version with asymmetric services");
254 ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
255 ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
256 ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer
257 ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [150,300]
258 ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [150,300]
259 ITS->SetThicknessChip1(150.); // chip thickness on layer 1 must be in the range [100,300]
260 ITS->SetThicknessChip2(150.); // chip thickness on layer 2 must be in the range [100,300]
261 ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
262 ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
264 // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful
265 // for reconstruction !):
268 //AliITSvPPRcoarseasymm *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
269 //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
270 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
272 //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
273 //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
274 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
278 // Geant3 <-> EUCLID conversion
279 // ============================
281 // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
282 // media to two ASCII files (called by default ITSgeometry.euc and
283 // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
284 // The default (=0) means that you dont want to use this facility.
291 //============================ TPC parameters ===================
292 AliTPC *TPC = new AliTPCv2("TPC","Default");
297 //=================== TOF parameters ============================
298 AliTOF *TOF = new AliTOFv5T0("TOF","normal TOF");
302 //=================== HMPID parameters ===========================
303 AliHMPID *HMPID = new AliHMPIDv1("HMPID","normal HMPID");
309 //=================== ZDC parameters ============================
311 AliZDC *ZDC = new AliZDCv1("ZDC","normal ZDC");
315 //=================== ACORDE parameters ============================
317 AliACORDE *ACORDE = new AliACORDEv1("ACORDE","normal ACORDE");
321 //=================== TRD parameters ============================
323 AliTRD *TRD = new AliTRDv1("TRD","TRD slow simulator");
327 //=================== FMD parameters ============================
329 AliFMD *FMD = new AliFMDv0("FMD","normal FMD");
333 //=================== MUON parameters ===========================
334 AliMUON *MUON = new AliMUONv1("MUON","default");
337 //=================== PHOS parameters ===========================
340 AliPHOS *PHOS = new AliPHOSv1("PHOS","GPS2");
345 //=================== PMD parameters ============================
347 AliPMD *PMD = new AliPMDv1("PMD","normal PMD");
348 PMD->SetPAR(1., 1., 0.8, 0.02);
349 PMD->SetIN(6., 18., -580., 27., 27.);
350 PMD->SetGEO(0.0, 0.2, 4.);
351 PMD->SetPadSize(0.8, 1.0, 1.0, 1.5);
356 //=================== T0 parameters ============================
357 AliT0 *T0 = new AliT0v1("T0","T0 Detector");