4 static PprMag_t smag = k2kG; // k2kG->L3 field 0.2T
5 //static PprMag_t smag = k4kG; // k4kG->L3 field 0.4T
6 //static PprMag_t smag = k5kG; // k5kG->L3 field 0.5T
8 Float_t EtaToTheta(Float_t arg);
9 static Int_t eventsPerRun = 100;
13 static PprGeo_t sgeo = kHoles;
17 // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
18 // Theta range given through pseudorapidity limits 22/6/2001
20 // Set Random Number seed
21 gRandom->SetSeed(9956646); // Set 0 to use the current time
22 cout<<"Seed for random number generation= "<<gRandom->GetSeed()<<endl;
25 // libraries required by geant321
27 gSystem->Load("libgeant321");
30 new TGeant3("C++ Interface to Geant3");
34 cout<<"Config.C: Creating Run Loader ..."<<endl;
35 rl = AliRunLoader::Open("galice.root",
36 AliConfig::GetDefaultEventFolderName(),
39 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
42 rl->SetCompressionLevel(2);
43 rl->SetNumberOfEventsPerFile(3);
44 gAlice->SetRunLoader(rl);
45 //gAlice->SetDebug(1);
48 // Set External decayer
49 AliDecayer *decayer = new AliDecayerPythia();
51 decayer->SetForceDecay(kAll);
53 gMC->SetExternalDecayer(decayer);
54 //=======================================================================
55 // ************* STEERING parameters FOR ALICE SIMULATION **************
56 // --- Specify event type to be tracked through the ALICE setup
57 // --- All positions are in cm, angles in degrees, and P and E in GeV
59 ((TGeant3*)gMC)->SetDEBU(1, 2, 1);
60 ((TGeant3*)gMC)->SetSWIT(4,10);
61 ((TGeant3*)gMC)->SetSWIT(2,2);
62 ((TGeant3*)gMC)->SetSWIT(2,1); // to draw tracks
64 gMC->SetProcess("DCAY",1);
65 gMC->SetProcess("PAIR",1);
66 gMC->SetProcess("COMP",1);
67 gMC->SetProcess("PHOT",1);
68 gMC->SetProcess("PFIS",0);
69 gMC->SetProcess("DRAY",0);
70 gMC->SetProcess("ANNI",1);
71 gMC->SetProcess("BREM",1);
72 gMC->SetProcess("MUNU",1);
73 gMC->SetProcess("CKOV",1);
74 //gMC->SetProcess("HADR",1);
75 gMC->SetProcess("HADR",0); // If option NoShower() is switched on
76 gMC->SetProcess("LOSS",2);
77 gMC->SetProcess("MULS",1);
78 gMC->SetProcess("RAYL",1);
80 Float_t cut = 1.e-3; // 1MeV cut by default
81 Float_t tofmax = 1.e10;
83 gMC->SetCut("CUTGAM", cut);
84 gMC->SetCut("CUTELE", cut);
85 gMC->SetCut("CUTNEU", cut);
86 gMC->SetCut("CUTHAD", cut);
87 gMC->SetCut("CUTMUO", cut);
88 gMC->SetCut("BCUTE", cut);
89 gMC->SetCut("BCUTM", cut);
90 gMC->SetCut("DCUTE", cut);
91 gMC->SetCut("DCUTM", cut);
92 gMC->SetCut("PPCUTM", cut);
93 gMC->SetCut("TOFMAX", tofmax);
97 if (gSystem->Getenv("CONFIG_NPARTICLES"))
98 nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
101 // #### AliGenZDC generation ######################################
102 AliGenZDC *gener = new AliGenZDC();
103 gener->SetOrigin(0, 0, 0); // vertex position
104 //gener->SetParticle(kNeutron);
105 gener->SetParticle(kProton);
106 gener->SetMomentum(2760.);
107 gener->SetDirection(0.,0.,0.,-1.);
108 gener->SetFermi(1); // Fermi momentum
109 //gener->SetDiv(0.,0.,2); // Divergence and crossing angle
110 gener->SetDiv(0.000032,0.0001,2); // Divergence and crossing angle
113 gener->SetTrackingFlag(1);
117 // Activate this line if you want the vertex smearing to happen
120 //gener->SetVertexSmear(perTrack);
122 AliMagF* field = new AliMagF("Maps","Maps", 2, 1., 1., 10., smag);
123 field->SetL3ConstField(0); //Using const. field in the barrel
124 TGeoGlobalMagField::Instance()->SetField(field);
150 //=================== Alice BODY parameters =============================
151 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
156 //=================== MAG parameters ============================
157 // --- Start with Magnet since detector layouts may be depending ---
158 // --- on the selected Magnet dimensions ---
159 AliMAG *MAG = new AliMAG("MAG", "Magnet");
165 //=================== ABSO parameters ============================
166 AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
171 //=================== DIPO parameters ============================
173 AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
178 //=================== HALL parameters ============================
180 AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
186 //=================== FRAME parameters ============================
188 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
189 if (sgeo == kHoles) {
198 //=================== SHIL parameters ============================
200 AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding Version 2");
206 //=================== PIPE parameters ============================
208 AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
213 //=================== ITS parameters ============================
215 // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
216 // almost all other detectors. This involves the fact that the ITS geometry
217 // still has several options to be followed in parallel in order to determine
218 // the best set-up which minimizes the induced background. All the geometries
219 // available to date are described in the following. Read carefully the comments
220 // and use the default version (the only one uncommented) unless you are making
221 // comparisons and you know what you are doing. In this case just uncomment the
222 // ITS geometry you want to use and run Aliroot.
224 // Detailed geometries:
227 //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
229 //AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
231 AliITSvPPRasymmFMD *ITS = new AliITSvPPRasymmFMD("ITS","New ITS PPR detailed version with asymmetric services");
232 ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
233 ITS->SetReadDet(kTRUE); // don't touch this parameter if you're not an ITS developer
234 // ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer
235 ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
236 ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
237 ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300]
238 ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300]
239 ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
240 ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
242 // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful
243 // for reconstruction !):
246 //AliITSvPPRcoarseasymm *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
247 //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
248 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
250 //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
251 //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
252 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
256 // Geant3 <-> EUCLID conversion
257 // ============================
259 // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
260 // media to two ASCII files (called by default ITSgeometry.euc and
261 // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
262 // The default (=0) means that you dont want to use this facility.
269 //============================ TPC parameters ================================
270 // --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
271 // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
272 // --- sectors are specified, any value other than that requires at least one
273 // --- sector (lower or upper)to be specified!
274 // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
275 // --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
276 // --- SecLows - number of lower sectors specified (up to 6)
277 // --- SecUps - number of upper sectors specified (up to 12)
278 // --- Sens - sensitive strips for the Slow Simulator !!!
279 // --- This does NOT work if all S or L-sectors are specified, i.e.
280 // --- if SecAL or SecAU < 0
283 //-----------------------------------------------------------------------------
285 // gROOT->LoadMacro("SetTPCParam.C");
286 // AliTPCParam *param = SetTPCParam();
287 AliTPC *TPC = new AliTPCv2("TPC", "Default");
289 // All sectors included
297 //=================== TOF parameters ============================
298 AliTOF *TOF = new AliTOFv4T0("TOF", "normal TOF");
304 //=================== HMPID parameters ===========================
305 AliHMPID *HMPID = new AliHMPIDv1("HMPID", "normal HMPID");
312 //=================== ZDC parameters ============================
314 AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
320 //=================== TRD parameters ============================
322 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
324 // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
326 if (sgeo == kHoles) {
327 // With hole in front of PHOS
329 // With hole in front of HMPID
333 AliTRDsim *TRDsim = TRD->CreateTR();
338 //=================== FMD parameters ============================
339 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
344 //=================== MUON parameters ===========================
346 AliMUON *MUON = new AliMUONv1("MUON", "default");
347 MUON->AddGeometryBuilder(new AliMUONSt1GeometryBuilderV2(MUON));
348 MUON->AddGeometryBuilder(new AliMUONSt2GeometryBuilder(MUON));
349 MUON->AddGeometryBuilder(new AliMUONSlatGeometryBuilder(MUON));
350 MUON->AddGeometryBuilder(new AliMUONTriggerGeometryBuilder(MUON));
352 //=================== PHOS parameters ===========================
356 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
362 //=================== PMD parameters ============================
363 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
368 //=================== T0 parameters ============================
369 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
374 //=================== EMCAL parameters ============================
375 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETE");
380 //=================== ACORDE parameters ============================
381 AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
386 //=================== ACORDE parameters ============================
387 AliVZERO *VZERO = new AliVZEROv2("VZERO", "normal VZERO");
390 cout << "End of Config.C" << endl;
394 Float_t EtaToTheta(Float_t arg){
395 return (180./TMath::Pi())*2.*atan(exp(-arg));