1 enum gentype_t {hijing, gun, box, pythia, param, cocktail, fluka, halo, ntuple, scan, doublescan};
9 new AliGeant3("C++ Interface to Geant3");
11 //=======================================================================
12 // Create the output file
14 TFile *rootfile = new TFile("galice.root","recreate");
15 rootfile->SetCompressionLevel(2);
16 TGeant3 *geant3 = (TGeant3*)gMC;
18 //geant3->Grndmq(0,0,5," ");
20 //=======================================================================
21 // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
22 geant3->SetTRIG(1); //Number of events to be processed
23 geant3->SetSWIT(4,100);
24 geant3->SetDEBU(0,0,1);
25 //geant3->SetSWIT(2,2);
36 geant3->SetHADR(3); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
40 geant3->SetAUTO(1); //Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
41 geant3->SetABAN(0); //Restore 3.16 behaviour for abandoned tracks
42 geant3->SetOPTI(2); //Select optimisation level for GEANT geometry searches (0,1,2)
43 Float_t cut = 1.e-1; // 100MeV cut by default
44 Float_t tofmax = 1.e10;
45 // GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
46 geant3->SetCUTS(1.e-5,5.e-5, 1.e-3, 1.e-4, cut, cut, cut, cut, cut, cut, tofmax);
49 //=======================================================================
50 // ************* STEERING parameters FOR ALICE SIMULATION **************
51 // --- Specify event type to be tracked through the ALICE setup
52 // --- All positions are in cm, angles in degrees, and P and E in GeV
57 //*********************************************
58 // Example for Fixed Particle Gun *
59 //*********************************************
60 AliGenFixed *gener = new AliGenFixed(ntracks);
61 gener->SetMomentum(3);
62 gener->SetPhiRange(90);
63 gener->SetThetaRange(92);
64 gener->SetOrigin(0,0,0); //vertex position
65 gener->SetPart(kPiPlus); //GEANT particle type
68 //*********************************************
69 // Example for Moving Particle Gun *
70 //*********************************************
71 AliGenBox *gener = new AliGenBox(ntracks);
72 gener->SetMomentumRange(3,3);
73 gener->SetPhiRange(82,98);
74 gener->SetThetaRange(85,98);
75 gener->SetOrigin(0,0,0);
76 gener->SetVertexSmear(kPerTrack);
78 gener->SetSigma(1.8, 1.8,0); //Sigma in (X,Y,Z) (cm) on IP position
79 gener->SetPart(kPiPlus); //GEANT particle type
82 //*********************************************
83 // Scanning on a grid *
84 //*********************************************
85 AliGenScan *gener = new AliGenScan(-1);
86 gener->SetMomentumRange(3,3);
87 gener->SetPhiRange(90,90);
88 gener->SetThetaRange(90,90);
90 gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
91 gener->SetPart(kPiPlus);
92 gener->SetRange(5, -80, 60, 1, 480, 480, 5, -80, 60);
95 //*********************************************
96 // Scanning on a grid *
97 //*********************************************
98 AliGenDoubleScan *gener = new AliGenDoubleScan(-1);
99 gener->SetMomentumRange(3,3);
100 gener->SetPhiRange(0,360);
101 gener->SetThetaRange(0,0);
103 gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
104 gener->SetPart(kPiPlus);
105 gener->SetRange(20, -60, 60, 1, 480, 480, 20, -60, 60);
106 gener->SetDistance(1);
111 AliGenHIJINGpara *gener = new AliGenHIJINGpara(ntracks);
112 gener->SetMomentumRange(0,999);
113 gener->SetPhiRange(0,360);
114 gener->SetThetaRange(.77,179.23);
115 gener->SetOrigin(0,0,0); //vertex position
116 gener->SetSigma(0,0,5.6); //Sigma in (X,Y,Z) (cm) on IP position
120 //********************************************
121 // Example for Charm Production with Pythia *
122 //********************************************
124 AliGenPythia *gener = new AliGenPythia(ntracks);
125 gener->SetMomentumRange(0,999);
126 gener->SetPhiRange(0,360);
127 gener->SetThetaRange(0., 180.);
128 gener->SetYRange(-10,10);
129 gener->SetPtRange(0,100);
130 gener->SetOrigin(0,0,0); // vertex position
131 gener->SetVertexSmear(perEvent);
132 gener->SetSigma(0,0,5.6); // Sigma in (X,Y,Z) (cm) on IP position
133 // gener->SetStrucFunc(DO_Set_1);
134 gener->SetProcess(mb);
135 gener->SetEnergyCMS(5500.);
139 //*******************************************************
140 // Example for J/psi Production from Parameterisation *
141 //*******************************************************
142 AliGenParam *gener = new AliGenParam(178,Eta,
143 AliGenPHOSlib::GetPt(Eta),
144 AliGenPHOSlib::GetY(Eta),
145 AliGenPHOSlib::GetIp(Eta) );
147 gener->SetMomentumRange(0,999);
148 gener->SetPhiRange(0,360);
149 gener->SetYRange(2.5,4);
150 gener->SetThetaRange(2,9);
151 gener->SetPtRange(0,10);
152 gener->SetOrigin(0,0,0); //vertex position
153 gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
154 gener->SetCutOnChild(1);
158 //*******************************************************
159 // Example for a FLUKA Boundary Source *
160 //*******************************************************
161 AliGenFLUKAsource *gener = new AliGenFLUKAsource(-1);
162 gener->AddFile("$(ALICE_ROOT)/data/all32.root");
164 gener->SetPartFlag(9);
165 gener->SetMomentumRange(0,999);
166 gener->SetPhiRange(0,360);
167 gener->SetThetaRange(0., 180.);
168 gener->SetAgeMax(1.e-5);
171 gener->SetFraction(0.0315);
175 //*******************************************************
176 // Example for reading from a external file *
177 //*******************************************************
178 AliGenExtFile *gener = new AliGenExtFile(-1);
179 gener->SetFileName("$(ALICE_ROOT)/data/dtujet93.root");
180 gener->SetVertexSmear(perEvent);
181 gener->SetTrackingFlag(1);
185 //*******************************************************
186 // Example for Tunnel Halo Source *
187 //*******************************************************
188 AliGenHalo *gener = new AliGenHalo(ntracks);
189 gener->SetFileName("/h1/morsch/marsip/marsip5.mu");
193 //*******************************************************
194 // Example for a Cocktail *
195 //*******************************************************
196 AliGenCocktail *gener = new AliGenCocktail();
197 gener->SetMomentumRange(0,10);
198 gener->SetPhiRange(0,360);
199 gener->SetThetaRange(45.,135);
201 pions = new AliGenParam(100, pion_p);
202 // kaons = new AliGenParam(10 , kaon_p);
203 // protons = new AliGenParam(10 , proton_p);
204 gener->AddGenerator(pions , "Pions" , 100);
205 // gener->AddGenerator(kaons , "Kaons" , 10);
206 // gener->AddGenerator(protons, "Protons", 10);
212 Float_t (*f1)(Float_t);
213 Double_t (*f2)(Double_t);
218 Float_t p2(Float_t x)
223 Float_t x = TMath::Sqrt(2);
227 printf("\n Result %f %f \n", (*f1)(2.), TMath::Sqrt(2));
233 // Activate this line if you want the vertex smearing to happen
236 gener->SetVertexSmear(kPerTrack);
238 gAlice->SetField(0,2); //Specify maximum magnetic field in Tesla (neg. ==> default field)
260 //=================== Alice BODY parameters =============================
261 AliBODY *BODY = new AliBODY("BODY","Alice envelop");
265 //=================== MAG parameters ============================
266 // --- Start with Magnet since detector layouts may be depending ---
267 // --- on the selected Magnet dimensions ---
268 AliMAG *MAG = new AliMAG("MAG","Magnet");
273 //=================== ABSO parameters ============================
274 AliABSO *ABSO = new AliABSOv0("ABSO","Muon Absorber");
278 //=================== DIPO parameters ============================
280 AliDIPO *DIPO = new AliDIPOv2("DIPO","Dipole version 2");
284 //=================== HALL parameters ============================
286 AliHALL *HALL = new AliHALL("HALL","Alice Hall");
291 //=================== FRAME parameters ============================
293 AliFRAME *FRAME = new AliFRAMEv1("FRAME","Space Frame");
298 //=================== SHIL parameters ============================
300 AliSHIL *SHIL = new AliSHILv0("SHIL","Shielding");
305 //=================== PIPE parameters ============================
307 AliPIPE *PIPE = new AliPIPEv0("PIPE","Beam Pipe");
312 //=================== ITS parameters ============================
314 // EUCLID is a flag to output (=1) both geometry and media to two ASCII files
315 // (called by default ITSgeometry.euc and ITSgeometry.tme) in a format
316 // understandable to the CAD system EUCLID. The default (=0) means that you
317 // dont want to use this facility.
319 AliITS *ITS = new AliITSv1("ITS","normal ITS");
325 //============================ TPC parameters ================================
326 // --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
327 // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
328 // --- sectors are specified, any value other than that requires at least one
329 // --- sector (lower or upper)to be specified!
330 // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
331 // --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
332 // --- SecLows - number of lower sectors specified (up to 6)
333 // --- SecUps - number of upper sectors specified (up to 12)
334 // --- Sens - sensitive strips for the Slow Simulator !!!
335 // --- This does NOT work if all S or L-sectors are specified, i.e.
336 // --- if SecAL or SecAU < 0
339 //-----------------------------------------------------------------------------
341 gROOT->LoadMacro("SetTPCParam.C");
342 AliTPCParam *param = SetTPCParam();
343 AliTPC *TPC = new AliTPCv0("TPC","Normal TPC"); //v1 is default
344 TPC->SetParam(param); // pass the parameter object to the TPC
348 TPC->SetGasMixt(2,20,10,-1,0.9,0.1,0.);
351 TPC->SetSecLows(1, 2, 3, 19, 20, 21);
352 TPC->SetSecUps(37, 38, 39, 37+18, 38+18, 39+18, -1, -1, -1, -1, -1, -1);
355 if (TPC->IsVersion()==1) param->Write(param->GetTitle());
359 //=================== TOF parameters ============================
360 AliTOF *TOF = new AliTOFv0("TOF","normal TOF");
364 //=================== RICH parameters ===========================
365 AliRICH *RICH = new AliRICHv2("RICH","normal RICH");
369 // Default Segmentation
370 AliRICHSegmentationV1* Segmentation = new AliRICHSegmentationV1;
372 // Segmentation parameters
373 Segmentation->SetPadSize(0.84,0.8);
374 Segmentation->SetDAnod(0.84/2);
376 // Geometry parameters
377 AliRICHGeometry* Geometry = new AliRICHGeometry;
378 Geometry->SetGapThickness(8);
379 Geometry->SetProximityGapThickness(.4);
380 Geometry->SetQuartzLength(133);
381 Geometry->SetQuartzWidth(127.9);
382 Geometry->SetQuartzThickness(.5);
383 Geometry->SetOuterFreonLength(133);
384 Geometry->SetOuterFreonWidth(41.3);
385 Geometry->SetInnerFreonLength(133);
386 Geometry->SetInnerFreonWidth(41.3);
387 Geometry->SetFreonThickness(1.5);
389 // Response parameters
390 AliRICHResponseV0* Response = new AliRICHResponseV0;
391 Response->SetSigmaIntegration(5.);
392 Response->SetChargeSlope(27.);
393 Response->SetChargeSpread(0.18, 0.18);
394 Response->SetMaxAdc(4096);
395 Response->SetAlphaFeedback(0.036);
396 Response->SetEIonisation(26.e-9);
397 Response->SetSqrtKx3(0.77459667);
398 Response->SetKx2(0.962);
399 Response->SetKx4(0.379);
400 Response->SetSqrtKy3(0.77459667);
401 Response->SetKy2(0.962);
402 Response->SetKy4(0.379);
403 Response->SetPitch(0.25);
404 Response->SetWireSag(1); // 1->On, 0->Off
405 Response->SetVoltage(2150); // Should only be 2000, 2050, 2100 or 2150
408 for (Int_t i=0; i<7; i++) {
409 RICH->SetGeometryModel(i,Geometry);
410 RICH->SetSegmentationModel(i, Segmentation);
411 RICH->SetResponseModel(i, Response);
413 RICH->SetDebugLevel(0);
418 //=================== ZDC parameters ============================
420 AliZDC *ZDC = new AliZDCv1("ZDC","normal ZDC");
424 //=================== CASTOR parameters ============================
426 AliCASTOR *CASTOR = new AliCASTORv1("CASTOR","normal CASTOR");
430 //=================== TRD parameters ============================
432 AliTRD *TRD = new AliTRDv1("TRD","TRD version 0");
433 // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
435 // With hole in front of PHOS
437 // With hole in front of RICH
443 //=================== FMD parameters ============================
445 AliFMD *FMD = new AliFMDv1("FMD","normal FMD");
449 //=================== MUON parameters ===========================
451 AliMUON *MUON = new AliMUONv0("MUON","normal MUON");
455 //=================== PHOS parameters ===========================
458 AliPHOS *PHOS = new AliPHOSv0("PHOS","GPS2");
463 //=================== PMD parameters ============================
465 AliPMD *PMD = new AliPMDv0("PMD","normal PMD");
466 PMD->SetPAR(1., 1., 0.8, 0.02);
467 PMD->SetIN(6., 18., -580., 27., 27.);
468 PMD->SetGEO(0.0, 0.2, 4.);
469 PMD->SetPadSize(0.8, 1.0, 1.0, 1.5);
474 //=================== START parameters ============================
475 AliSTART *START = new AliSTARTv0("START","START Detector");