3 /// One can use the configuration macro in compiled mode by
6 /// gSystem->Load("libgeant321");
7 /// gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include\
8 /// -I$ALICE_ROOT -I$ALICE/geant3/TGeant3");
9 /// .x grun.C(1,"ConfigKr.C++")
12 #if !defined(__CINT__) || defined(__MAKECINT__)
13 #include <Riostream.h>
16 #include <TVirtualMC.h>
17 #include <TGeant3TGeo.h>
18 #include "STEER/AliRunLoader.h"
19 #include "STEER/AliRun.h"
20 #include "STEER/AliConfig.h"
21 #include "PYTHIA6/AliDecayerPythia.h"
22 #include "EVGEN/AliGenCocktail.h"
23 #include "EVGEN/AliGenHIJINGpara.h"
24 #include "STEER/AliMagF.h"
25 #include "STRUCT/AliBODY.h"
26 #include "STRUCT/AliMAG.h"
27 #include "STRUCT/AliABSOv3.h"
28 #include "STRUCT/AliDIPOv3.h"
29 #include "STRUCT/AliHALLv3.h"
30 #include "STRUCT/AliFRAMEv2.h"
31 #include "STRUCT/AliSHILv3.h"
32 #include "STRUCT/AliPIPEv3.h"
33 #include "ITS/AliITSvPPRasymmFMD.h"
34 #include "TPC/AliTPCv2.h"
35 #include "TOF/AliTOFv6T0.h"
36 #include "HMPID/AliHMPIDv1.h"
37 #include "ZDC/AliZDCv2.h"
38 #include "TRD/AliTRDv1.h"
39 #include "FMD/AliFMDv1.h"
40 #include "MUON/AliMUONv1.h"
41 #include "PHOS/AliPHOSv1.h"
42 #include "PMD/AliPMDv1.h"
43 #include "T0/AliT0v1.h"
44 #include "EMCAL/AliEMCALv2.h"
45 #include "ACORDE/AliACORDEv1.h"
46 #include "VZERO/AliVZEROv7.h"
49 Float_t EtaToTheta(Float_t arg);
53 // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
54 // Theta range given through pseudorapidity limits 22/6/2001
56 // Set Random Number seed
57 gRandom->SetSeed(123456); // Set 0 to use the currecnt time
58 AliLog::Message(AliLog::kInfo, Form("Seed for random number generation = %d",gRandom->GetSeed()), "Config.C", "Config.C", "Config()","Config.C", __LINE__);
61 // libraries required by geant321
63 gSystem->Load("libgeant321");
66 new TGeant3TGeo("C++ Interface to Geant3");
70 AliLog::Message(AliLog::kInfo, "Creating Run Loader", "Config.C", "Config.C", "Config()"," Config.C", __LINE__);
72 rl = AliRunLoader::Open("galice.root",
73 AliConfig::GetDefaultEventFolderName(),
77 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
80 rl->SetCompressionLevel(2);
81 rl->SetNumberOfEventsPerFile(3);
82 gAlice->SetRunLoader(rl);
84 // Set the trigger configuration
85 AliSimulation::Instance()->SetTriggerConfig("Pb-Pb");
86 cout<<"Trigger configuration is set to Pb-Pb"<<endl;
89 // Set External decayer
90 TVirtualMCDecayer *decayer = new AliDecayerPythia();
92 decayer->SetForceDecay(kAll);
94 gMC->SetExternalDecayer(decayer);
95 //=======================================================================
96 // ************* STEERING parameters FOR ALICE SIMULATION **************
97 // --- Specify event type to be tracked through the ALICE setup
98 // --- All positions are in cm, angles in degrees, and P and E in GeV
101 gMC->SetProcess("DCAY",1);
102 gMC->SetProcess("PAIR",1);
103 gMC->SetProcess("COMP",1);
104 gMC->SetProcess("PHOT",1);
105 gMC->SetProcess("PFIS",0);
106 gMC->SetProcess("DRAY",0);
107 gMC->SetProcess("ANNI",1);
108 gMC->SetProcess("BREM",1);
109 gMC->SetProcess("MUNU",1);
110 gMC->SetProcess("CKOV",1);
111 gMC->SetProcess("HADR",1);
112 gMC->SetProcess("LOSS",2);
113 gMC->SetProcess("MULS",1);
114 gMC->SetProcess("RAYL",1);
116 Float_t cut = 1.e-3; // 1MeV cut by default
117 Float_t tofmax = 1.e10;
119 gMC->SetCut("CUTGAM", cut);
120 gMC->SetCut("CUTELE", cut);
121 gMC->SetCut("CUTNEU", cut);
122 gMC->SetCut("CUTHAD", cut);
123 gMC->SetCut("CUTMUO", cut);
124 gMC->SetCut("BCUTE", cut);
125 gMC->SetCut("BCUTM", cut);
126 gMC->SetCut("DCUTE", cut);
127 gMC->SetCut("DCUTM", cut);
128 gMC->SetCut("PPCUTM", cut);
129 gMC->SetCut("TOFMAX", tofmax);
132 AliGenCocktail *gener = new AliGenCocktail();
134 Int_t nKrDecays = 100; // number of Kr decays
135 for(Int_t i=0;i<nKrDecays;i++){
136 AliGenKrypton *krypton = new AliGenKrypton();
137 gener->AddGenerator(krypton,"Krypton",1);
142 TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 1., 1., AliMagF::k5kG));
144 // detectors - only the TPC is relevant
168 //=================== Alice BODY parameters =============================
169 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
173 //=================== MAG parameters ============================
174 // --- Start with Magnet since detector layouts may be depending ---
175 // --- on the selected Magnet dimensions ---
176 AliMAG *MAG = new AliMAG("MAG", "Magnet");
182 //=================== ABSO parameters ============================
183 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
188 //=================== DIPO parameters ============================
190 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
195 //=================== HALL parameters ============================
197 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
203 //=================== FRAME parameters ============================
205 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
210 //=================== SHIL parameters ============================
212 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
218 //=================== PIPE parameters ============================
220 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
225 //=================== ITS parameters ============================
227 // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
228 // almost all other detectors. This involves the fact that the ITS geometry
229 // still has several options to be followed in parallel in order to determine
230 // the best set-up which minimizes the induced background. All the geometries
231 // available to date are described in the following. Read carefully the comments
232 // and use the default version (the only one uncommented) unless you are making
233 // comparisons and you know what you are doing. In this case just uncomment the
234 // ITS geometry you want to use and run Aliroot.
236 // Detailed geometries:
240 AliITSvPPRasymmFMD *ITS = new AliITSvPPRasymmFMD("ITS","ITS PPR detailed version with asymmetric services");
241 ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
242 ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
243 // ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer
244 ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
245 ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
246 ITS->SetThicknessChip1(150.); // chip thickness on layer 1 must be in the range [150,300]
247 ITS->SetThicknessChip2(150.); // chip thickness on layer 2 must be in the range [150,300]
248 ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
249 ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
253 // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful
254 // for reconstruction !):
257 //AliITSvPPRcoarseasymm *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
258 //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
259 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
261 //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
262 //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
263 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
267 // Geant3 <-> EUCLID conversion
268 // ============================
270 // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
271 // media to two ASCII files (called by default ITSgeometry.euc and
272 // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
273 // The default (=0) means that you dont want to use this facility.
280 //============================ TPC parameters ===================
281 AliTPC *TPC = new AliTPCv4("TPC", "Default");
286 //=================== TOF parameters ============================
287 AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
293 //=================== HMPID parameters ===========================
294 AliHMPID *HMPID = new AliHMPIDv1("HMPID", "normal HMPID");
301 //=================== ZDC parameters ============================
303 AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
308 //=================== TRD parameters ============================
310 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
315 //=================== FMD parameters ============================
316 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
321 //=================== MUON parameters ===========================
322 // New MUONv1 version (geometry defined via builders)
323 AliMUON *MUON = new AliMUONv1("MUON", "default");
325 //=================== PHOS parameters ===========================
329 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
335 //=================== PMD parameters ============================
336 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
341 //=================== T0 parameters ============================
342 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
347 //=================== EMCAL parameters ============================
348 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETE");
353 //=================== ACORDE parameters ============================
354 AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
359 //=================== ACORDE parameters ============================
360 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
363 AliLog::Message(AliLog::kInfo, "End of Config", "Config.C", "Config.C", "Config()"," Config.C", __LINE__);
367 Float_t EtaToTheta(Float_t arg){
368 return (180./TMath::Pi())*2.*atan(exp(-arg));