1 static Int_t eventsPerRun = 100;
5 // Switch on Transition Radiation simulation. 6/12/00 18:00
6 // iZDC=1 7/12/00 09:00
7 // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
8 // Theta range given through pseudorapidity limits 22/6/2001
10 // Set Random Number seed
11 // gRandom->SetSeed(12345);
13 new AliGeant3("C++ Interface to Geant3");
15 if (!gSystem->Getenv("CONFIG_FILE"))
17 TFile *rootfile = new TFile("galice.root", "recreate");
19 rootfile->SetCompressionLevel(2);
22 TGeant3 *geant3 = (TGeant3 *) gMC;
25 // Set External decayer
26 AliDecayer *decayer = new AliDecayerPythia();
28 decayer->SetForceDecay(kAll);
30 gMC->SetExternalDecayer(decayer);
33 //=======================================================================
34 // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
35 geant3->SetTRIG(1); //Number of events to be processed
36 geant3->SetSWIT(4, 10);
37 geant3->SetDEBU(0, 0, 1);
38 //geant3->SetSWIT(2,2);
49 geant3->SetHADR(1); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
53 geant3->SetAUTO(1); //Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
54 geant3->SetABAN(0); //Restore 3.16 behaviour for abandoned tracks
55 geant3->SetOPTI(2); //Select optimisation level for GEANT geometry searches (0,1,2)
56 geant3->SetERAN(5.e-7);
58 Float_t cut = 1.e-3; // 1MeV cut by default
59 Float_t tofmax = 1.e10;
61 // GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
62 geant3->SetCUTS(cut, cut, cut, cut, cut, cut, cut, cut, cut, cut,
65 //=======================================================================
66 // ************* STEERING parameters FOR ALICE SIMULATION **************
67 // --- Specify event type to be tracked through the ALICE setup
68 // --- All positions are in cm, angles in degrees, and P and E in GeV
69 if (gSystem->Getenv("CONFIG_NPARTICLES"))
71 int nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
76 AliGenHIJINGpara *gener = new AliGenHIJINGpara(nParticles);
78 gener->SetMomentumRange(0, 999);
79 gener->SetPhiRange(0, 360);
80 // Set pseudorapidity range from -8 to 8.
81 Float_t thmin = EtaToTheta(8); // theta min. <---> eta max
82 Float_t thmax = EtaToTheta(-8); // theta max. <---> eta min
83 gener->SetThetaRange(thmin,thmax);
84 gener->SetOrigin(0, 0, 0); //vertex position
85 gener->SetSigma(0, 0, 0); //Sigma in (X,Y,Z) (cm) on IP position
88 // Activate this line if you want the vertex smearing to happen
91 //gener->SetVertexSmear(perTrack);
93 gAlice->SetField(-999, 2); //Specify maximum magnetic field in Tesla (neg. ==> default field)
116 //=================== Alice BODY parameters =============================
117 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
122 //=================== MAG parameters ============================
123 // --- Start with Magnet since detector layouts may be depending ---
124 // --- on the selected Magnet dimensions ---
125 AliMAG *MAG = new AliMAG("MAG", "Magnet");
131 //=================== ABSO parameters ============================
132 AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
137 //=================== DIPO parameters ============================
139 AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
144 //=================== HALL parameters ============================
146 AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
152 //=================== FRAME parameters ============================
154 AliFRAME *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
160 //=================== SHIL parameters ============================
162 AliSHIL *SHIL = new AliSHILvF("SHIL", "Shielding");
168 //=================== PIPE parameters ============================
170 AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
175 //=================== ITS parameters ============================
177 // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
178 // almost all other detectors. This involves the fact that the ITS geometry
179 // still has several options to be followed in parallel in order to determine
180 // the best set-up which minimizes the induced background. All the geometries
181 // available to date are described in the following. Read carefully the comments
182 // and use the default version (the only one uncommented) unless you are making
183 // comparisons and you know what you are doing. In this case just uncomment the
184 // ITS geometry you want to use and run Aliroot.
186 // Detailed geometries:
189 //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
191 //AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
193 AliITSvPPRasymm *ITS = new AliITSvPPRasymm("ITS","New ITS PPR detailed version with asymmetric services");
194 ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
195 ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
196 // ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer
197 ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
198 ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
199 ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300]
200 ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300]
201 ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
202 ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
204 //AliITSvPPRsymm *ITS = new AliITSvPPRsymm("ITS","New ITS PPR detailed version with symmetric services");
205 //ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
206 //ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
207 //ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRsymm2.det"); // don't touch this parameter if you're not an ITS developer
208 //ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
209 //ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
210 //ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300]
211 //ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300]
212 //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
213 //ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
216 // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful
217 // for reconstruction !):
220 //AliITSvPPRcoarseasymm *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
221 //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
222 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
224 //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
225 //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
226 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
230 // Geant3 <-> EUCLID conversion
231 // ============================
233 // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
234 // media to two ASCII files (called by default ITSgeometry.euc and
235 // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
236 // The default (=0) means that you dont want to use this facility.
244 //============================ TPC parameters ================================
245 // --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
246 // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
247 // --- sectors are specified, any value other than that requires at least one
248 // --- sector (lower or upper)to be specified!
249 // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
250 // --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
251 // --- SecLows - number of lower sectors specified (up to 6)
252 // --- SecUps - number of upper sectors specified (up to 12)
253 // --- Sens - sensitive strips for the Slow Simulator !!!
254 // --- This does NOT work if all S or L-sectors are specified, i.e.
255 // --- if SecAL or SecAU < 0
258 //-----------------------------------------------------------------------------
260 // gROOT->LoadMacro("SetTPCParam.C");
261 // AliTPCParam *param = SetTPCParam();
262 AliTPC *TPC = new AliTPCv2("TPC", "Default");
264 // All sectors included
272 //=================== TOF parameters ============================
273 AliTOF *TOF = new AliTOFv2("TOF", "normal TOF");
278 //=================== RICH parameters ===========================
279 AliRICH *RICH = new AliRICHv1("RICH", "normal RICH");
286 //=================== ZDC parameters ============================
288 AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
293 //=================== CASTOR parameters ============================
295 AliCASTOR *CASTOR = new AliCASTORv1("CASTOR", "normal CASTOR");
300 //=================== TRD parameters ============================
302 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
304 // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
307 // With hole in front of PHOS
309 // With hole in front of RICH
312 AliTRDsim *TRDsim = TRD->CreateTR();
317 //=================== FMD parameters ============================
319 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
320 FMD->SetRingsSi1(256);
321 FMD->SetRingsSi2(64);
322 FMD->SetSectorsSi1(20);
323 FMD->SetSectorsSi2(24);
328 //=================== MUON parameters ===========================
330 AliMUON *MUON = new AliMUONv1("MUON", "default");
332 //=================== PHOS parameters ===========================
336 AliPHOS *PHOS = new AliPHOSv1("PHOS", "GPS2");
342 //=================== PMD parameters ============================
344 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
346 PMD->SetPAR(1., 1., 0.8, 0.02);
347 PMD->SetIN(6., 18., -580., 27., 27.);
348 PMD->SetGEO(0.0, 0.2, 4.);
349 PMD->SetPadSize(0.8, 1.0, 1.0, 1.5);
353 if (iEMCAL && !iRICH)
355 //=================== EMCAL parameters ============================
356 AliEMCAL *EMCAL = new AliEMCALv1("EMCAL", "EMCALArch1a");
361 //=================== START parameters ============================
362 AliSTART *START = new AliSTARTv1("START", "START Detector");
368 Float_t EtaToTheta(Float_t arg){
369 return (180./TMath::Pi())*2.*atan(exp(-arg));