2 // Simple Config macro to generate some gammas heading toward the
5 static Int_t eventsPerRun = 100;
10 static PprGeo_t geo = kHoles;
15 // AliLoader::SetDebug(5) ;
16 // Set Random Number seed
17 // gRandom->SetSeed(12345);
19 TDatime *t = new TDatime();
20 UInt_t seed = t.Get();
21 //UInt_t seed = 613378658;
23 gRandom->SetSeed(seed);
24 cout<<"Seed for random number generation= "<<gRandom->GetSeed()<<endl;
26 // libraries required by geant321
27 gSystem->Load("libgeant321");
29 new TGeant3TGeo("C++ Interface to Geant3");
31 if (!gSystem->Getenv("CONFIG_FILE"))
33 cout<<"Config.C: Creating Run Loader ..."<<endl;
34 AliRunLoader* rl = AliRunLoader::Open("galice.root",AliConfig::GetDefaultEventFolderName(),
38 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
41 rl->SetCompressionLevel(2);
42 rl->SetNumberOfEventsPerFile(1000);
43 gAlice->SetRunLoader(rl);
46 TGeant3 *geant3 = (TGeant3 *) gMC;
49 // Set External decayer
50 TVirtualMCDecayer *decayer = new AliDecayerPythia();
52 decayer->SetForceDecay(kAll);
54 gMC->SetExternalDecayer(decayer);
57 //=======================================================================
58 // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
59 geant3->SetTRIG(1); //Number of events to be processed
60 geant3->SetSWIT(4, 10);
61 geant3->SetDEBU(0, 0, 1);
62 //geant3->SetSWIT(2,2);
73 geant3->SetHADR(1); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
77 geant3->SetAUTO(1); //Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
78 geant3->SetABAN(0); //Restore 3.16 behaviour for abandoned tracks
79 geant3->SetOPTI(2); //Select optimisation level for GEANT geometry searches (0,1,2)
80 geant3->SetERAN(5.e-7);
82 Float_t cut = 1.e-3; // 1MeV cut by default
83 Float_t tofmax = 1.e10;
85 // GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
86 geant3->SetCUTS(cut, cut, cut, cut, cut, cut, cut, cut, cut, cut,
89 //=======================================================================
90 // ************* STEERING parameters FOR ALICE SIMULATION **************
91 // --- Specify event type to be tracked through the ALICE setup
92 // --- All positions are in cm, angles in degrees, and P and E in GeV
94 AliGenBox *gener = new AliGenBox(5);
95 gener->SetMomentumRange(50.,100.);
96 gener->SetPhiRange(80.0,180.0);
97 gener->SetThetaRange(EtaToTheta(-0.7), EtaToTheta(0.7));
99 gener->SetOrigin(0,0,0); //vertex position
100 gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
101 gener->SetPart(kGamma);
105 // Activate this line if you want the vertex smearing to happen
108 //gener->SetVertexSmear(perTrack);
110 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
111 gAlice->SetField(field);
138 //=================== Alice BODY parameters =============================
139 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
143 //=================== MAG parameters ============================
144 // --- Start with Magnet since detector layouts may be depending ---
145 // --- on the selected Magnet dimensions ---
146 AliMAG *MAG = new AliMAG("MAG", "Magnet");
152 //=================== ABSO parameters ============================
153 AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
158 //=================== DIPO parameters ============================
160 AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
165 //=================== HALL parameters ============================
167 AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
173 //=================== FRAME parameters ============================
175 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
185 //=================== SHIL parameters ============================
187 AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding Version 2");
193 //=================== PIPE parameters ============================
195 AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
200 //=================== ITS parameters ============================
202 // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
203 // almost all other detectors. This involves the fact that the ITS geometry
204 // still has several options to be followed in parallel in order to determine
205 // the best set-up which minimizes the induced background. All the geometries
206 // available to date are described in the following. Read carefully the comments
207 // and use the default version (the only one uncommented) unless you are making
208 // comparisons and you know what you are doing. In this case just uncomment the
209 // ITS geometry you want to use and run Aliroot.
211 // Detailed geometries:
213 AliITSvPPRasymm *ITS = new AliITSvPPRasymm("ITS","New ITS PPR detailed version with asymmetric services");
214 ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
215 ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
216 // ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer
217 ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
218 ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
219 ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300]
220 ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300]
221 ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
222 ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
224 // Geant3 <-> EUCLID conversion
225 // ============================
227 // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
228 // media to two ASCII files (called by default ITSgeometry.euc and
229 // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
230 // The default (=0) means that you dont want to use this facility.
237 //============================ TPC parameters ================================
238 // --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
239 // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
240 // --- sectors are specified, any value other than that requires at least one
241 // --- sector (lower or upper)to be specified!
242 // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
243 // --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
244 // --- SecLows - number of lower sectors specified (up to 6)
245 // --- SecUps - number of upper sectors specified (up to 12)
246 // --- Sens - sensitive strips for the Slow Simulator !!!
247 // --- This does NOT work if all S or L-sectors are specified, i.e.
248 // --- if SecAL or SecAU < 0
251 //-----------------------------------------------------------------------------
253 // gROOT->LoadMacro("SetTPCParam.C");
254 // AliTPCParam *param = SetTPCParam();
255 AliTPC *TPC = new AliTPCv2("TPC", "Default");
257 // All sectors included
265 //=================== TOF parameters ============================
266 AliTOF *TOF = new AliTOFv2FHoles("TOF", "TOF with Holes");
268 AliTOF *TOF = new AliTOFv4T0("TOF", "normal TOF");
275 //=================== HMPID parameters ===========================
276 AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
283 //=================== ZDC parameters ============================
285 AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
290 //=================== TRD parameters ============================
292 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
294 // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
297 // With hole in front of PHOS
299 // With hole in front of HMPID
303 AliTRDsim *TRDsim = TRD->CreateTR();
308 //=================== FMD parameters ============================
309 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
310 FMD->SetRingsSi1(256);
311 FMD->SetRingsSi2(128);
312 FMD->SetSectorsSi1(20);
313 FMD->SetSectorsSi2(40);
318 //=================== MUON parameters ===========================
320 AliMUON *MUON = new AliMUONv1("MUON", "default");
322 //=================== PHOS parameters ===========================
326 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
332 //=================== PMD parameters ============================
333 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
338 //=================== START parameters ============================
339 AliSTART *START = new AliSTARTv1("START", "START Detector");
344 //=================== EMCAL parameters ============================
345 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "SHISH_77_TRD1_2X2_FINAL_110DEG");
350 //=================== CRT parameters ============================
351 AliCRT *CRT = new AliCRTv0("CRT", "normal ACORDE");
356 //=================== CRT parameters ============================
357 AliVZERO *VZERO = new AliVZEROv2("VZERO", "normal VZERO");
362 Float_t EtaToTheta(Float_t arg){
363 return (180./TMath::Pi())*2.*atan(exp(-arg));