1 static Int_t eventsPerRun = 100;
4 cout << "==> Config.C..." << endl;
6 // Set Random Number seed
7 // gRandom->SetSeed(12345);
10 // libraries required by fluka21
12 if (!gSystem->Getenv("WITH_ROOT")) {
13 cout << "=== RUNNING TFluka with FLUGG ===\n";
14 char * gvmc = gSystem->ExpandPathName("$(G4VMC)/examples/macro/g4libs.C");
15 gROOT->LoadMacro(gvmc);
18 cout << "\t* Loading Flugg..." << endl;
19 gSystem->Load("libFlugg");
21 cout << "=== RUNNING TFluka with TGeo ===\n";
22 gSystem->Load("libGeom");
24 cout << "\t* Loading TFluka..." << endl;
25 gSystem->Load("libTFluka");
27 cout << "\t* Instantiating TFluka..." << endl;
28 new TFluka("C++ Interface to Fluka", 3/*verbositylevel*/);
30 cout << "\t* Recreating galice.root if needed..." << endl;
32 if (!gSystem->Getenv("CONFIG_FILE"))
34 cout<<"Config.C: Creating Run Loader ..."<<endl;
35 AliRunLoader* rl = AliRunLoader::Open("galice.root",AliConfig::fgkDefaultEventFolderName,
39 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
42 rl->SetCompressionLevel(2);
43 rl->SetNumberOfEventsPerFile(3);
44 gAlice->SetRunLoader(rl);
48 TFluka *fluka = (TFluka *) gMC;
49 fluka->SetCoreInputFileName("corealice.inp");
50 fluka->SetInputFileName("alice.inp");
52 // Set External decayer
53 TVirtualMCDecayer *decayer = new AliDecayerPythia();
54 decayer->SetForceDecay(kAll);
56 gMC->SetExternalDecayer(decayer);
59 // Physics process control
60 gMC ->SetProcess("DCAY",1);
61 gMC ->SetProcess("PAIR",0);
62 gMC ->SetProcess("COMP",0);
63 gMC ->SetProcess("PHOT",0);
64 gMC ->SetProcess("PFIS",0);
65 gMC ->SetProcess("DRAY",0);
66 gMC ->SetProcess("ANNI",0);
67 gMC ->SetProcess("BREM",0);
68 gMC ->SetProcess("MUNU",1);
69 gMC ->SetProcess("HADR",1); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
70 gMC ->SetProcess("LOSS",2);
71 gMC ->SetProcess("MULS",1);
72 //xx gMC ->SetProcess("RAYL",1);
76 Float_t cut = 1.e-1; // 100 MeV cut by default
77 Float_t tofmax = 1.e10;
79 gMC ->SetCut("CUTGAM",cut);
80 gMC ->SetCut("CUTELE",cut);
81 gMC ->SetCut("CUTNEU",cut);
82 gMC ->SetCut("CUTHAD",cut);
83 gMC ->SetCut("CUTMUO",cut);
84 gMC ->SetCut("BCUTE",cut);
85 gMC ->SetCut("BCUTM",cut);
86 gMC ->SetCut("DCUTE",cut);
87 gMC ->SetCut("DCUTM",cut);
88 gMC ->SetCut("PPCUTM",cut);
89 gMC ->SetCut("TOFMAX",tofmax);
92 //=======================================================================
93 // ************* STEERING parameters FOR ALICE SIMULATION **************
94 // --- Specify event type to be tracked through the ALICE setup
95 // --- All positions are in cm, angles in degrees, and P and E in GeV
96 if (gSystem->Getenv("CONFIG_NPARTICLES"))
97 int nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
101 cout << "\t* Creating and configuring generator for " << nParticles
102 << " particles..." << endl;
104 AliGenHIJINGpara *gener = new AliGenHIJINGpara(nParticles);
106 gener->SetMomentumRange(0, 999);
107 gener->SetPhiRange(0, 360);
108 // Set pseudorapidity range from -8 to 8.
109 Float_t thmin = EtaToTheta( 0.1); // theta min. <---> eta max
110 Float_t thmax = EtaToTheta(-0.1); // theta max. <---> eta min
111 gener->SetThetaRange(thmin,thmax);
112 gener->SetOrigin(0, 0, 0); //vertex position
113 gener->SetSigma(0, 0, 0); //Sigma in (X,Y,Z) (cm) on IP position
116 // Activate this line if you want the vertex smearing to happen
120 gAlice->SetField(-999, 2); //Specify maximum magnetic field in Tesla (neg. ==> default field)
121 gAlice->SetDebug(10);
124 Int_t iCRT = 0; //Not good ?
127 Int_t iFRAME = 0; //1
131 Int_t iMUON = 0; //1. Not good (newFlagLttc=10000 is outside array bounds)
134 Int_t iPMD = 0; //Not good (too many regions)
135 Int_t iRICH = 1; //1. Not good (no tracking with FRAME)
136 Int_t iSHIL = 0; //1. Not good (no tracking) (it works alone)
137 Int_t iSTART = 0; //1. Not good (no tracking) (it works alone)
138 Int_t iTOF = 0; //1. Not good (no tracking) (newFlagLttc=10000 is outside array bounds if alone)
140 Int_t iTRD = 0; //1. Not good (no tracking) (Crash alone with FRAME)
141 Int_t iZDC = 0; //1. Needs SHIL and others
142 Int_t iEMCAL = 0; //Not good (Crash)
145 cout << "\t* Creating the detectors ..." << endl;
146 //=================== Alice BODY parameters =============================
147 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
148 cout << "\t\t+ BODY..." << endl;
153 //=================== MAG parameters ============================
154 // --- Start with Magnet since detector layouts may be depending ---
155 // --- on the selected Magnet dimensions ---
156 cout << "\t\t+ Magnet..." << endl;
157 AliMAG *MAG = new AliMAG("MAG", "Magnet");
163 //=================== ABSO parameters ============================
164 cout << "\t\t+ ABSO..." << endl;
165 AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
170 //=================== DIPO parameters ============================
171 cout << "\t\t+ DIPO..." << endl;
172 AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
177 //=================== HALL parameters ============================
178 cout << "\t\t+ HALL..." << endl;
179 AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
185 //=================== FRAME parameters ============================
187 cout << "\t\t+ FRAME..." << endl;
188 AliFRAME *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
194 //=================== SHIL parameters ============================
196 cout << "\t\t+ SHIL..." << endl;
197 AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding");
203 //=================== PIPE parameters ============================
205 cout << "\t\t+ PIPE..." << endl;
206 AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
210 cout << "\t\t+ ITS..." << endl;
212 //=================== ITS parameters ============================
214 // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
215 // almost all other detectors. This involves the fact that the ITS geometry
216 // still has several options to be followed in parallel in order to determine
217 // the best set-up which minimizes the induced background. All the geometries
218 // available to date are described in the following. Read carefully the comments
219 // and use the default version (the only one uncommented) unless you are making
220 // comparisons and you know what you are doing. In this case just uncomment the
221 // ITS geometry you want to use and run Aliroot.
223 // Detailed geometries:
226 //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
228 //AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
230 AliITSvPPRasymm *ITS = new AliITSvPPRasymm("ITS","New ITS PPR detailed version with asymmetric services");
231 ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
232 ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
233 // ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer
234 ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
235 ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
236 ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300]
237 ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300]
238 ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
239 ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
241 //AliITSvPPRsymm *ITS = new AliITSvPPRsymm("ITS","New ITS PPR detailed version with symmetric services");
242 //ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
243 //ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
244 //ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRsymm2.det"); // don't touch this parameter if you're not an ITS developer
245 //ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
246 //ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
247 //ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300]
248 //ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300]
249 //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
250 //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(1); // 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(1); // 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.
281 cout << "\t\t+ TPC..." << endl;
282 //============================ TPC parameters ================================
283 // --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
284 // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
285 // --- sectors are specified, any value other than that requires at least one
286 // --- sector (lower or upper)to be specified!
287 // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
288 // --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
289 // --- SecLows - number of lower sectors specified (up to 6)
290 // --- SecUps - number of upper sectors specified (up to 12)
291 // --- Sens - sensitive strips for the Slow Simulator !!!
292 // --- This does NOT work if all S or L-sectors are specified, i.e.
293 // --- if SecAL or SecAU < 0
296 //-----------------------------------------------------------------------------
298 // gROOT->LoadMacro("SetTPCParam.C");
299 // AliTPCParam *param = SetTPCParam();
300 AliTPC *TPC = new AliTPCv1("TPC", "Default");
301 // All sectors included
308 cout << "\t\t+ TOF..." << endl;
309 //=================== TOF parameters ============================
310 AliTOF *TOF = new AliTOFv2("TOF", "normal TOF");
315 cout << "\t\t+ RICH..." << endl;
316 //=================== RICH parameters ===========================
317 AliRICH *RICH = new AliRICHv1("RICH", "normal RICH");
324 cout << "\t\t+ ZDC..." << endl;
325 //=================== ZDC parameters ============================
327 AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
332 cout << "\t\t+ CRT..." << endl;
333 //=================== CRT parameters ============================
335 AliCRT *CRT = new AliCRTv0("CRT", "normal CRT");
340 cout << "\t\t+ TRD..." << endl;
341 //=================== TRD parameters ============================
343 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
345 // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
348 // With hole in front of PHOS
350 // With hole in front of RICH
353 AliTRDsim *TRDsim = TRD->CreateTR();
358 cout << "\t\t+ FMD..." << endl;
359 //=================== FMD parameters ============================
361 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
362 FMD->SetRingsSi1(256);
363 FMD->SetRingsSi2(64);
364 FMD->SetSectorsSi1(20);
365 FMD->SetSectorsSi2(24);
370 cout << "\t\t+ MUON..." << endl;
371 //=================== MUON parameters ===========================
373 AliMUON *MUON = new AliMUONv1("MUON", "default");
375 //=================== PHOS parameters ===========================
379 cout << "\t\t+ PHOS..." << endl;
380 AliPHOS *PHOS = new AliPHOSv1("PHOS", "GPS2");
386 cout << "\t\t+ PMD..." << endl;
387 //=================== PMD parameters ============================
389 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
391 PMD->SetPAR(1., 1., 0.8, 0.02);
392 PMD->SetIN(6., 18., -580., 27., 27.);
393 PMD->SetGEO(0.0, 0.2, 4.);
394 PMD->SetPadSize(0.8, 1.0, 1.0, 1.5);
398 if (iEMCAL && !iRICH)
400 cout << "\t\t+ EMCAL (no RICH)..." << endl;
401 //=================== EMCAL parameters ============================
402 AliEMCAL *EMCAL = new AliEMCALv1("EMCAL", "EMCALArch1a");
407 cout << "\t\t+ START..." << endl;
408 //=================== START parameters ============================
409 AliSTART *START = new AliSTARTv1("START", "START Detector");
413 cout << "\t\t+ VZERO..." << endl;
414 //=================== CRT parameters ============================
415 AliVZERO *VZERO = new AliVZEROv2("VZERO", "normal VZERO");
419 Float_t EtaToTheta(Float_t arg){
420 return (180./TMath::Pi())*2.*atan(exp(-arg));