3 // Set Random Number seed
4 // gRandom->SetSeed(12345);
6 // libraries required by geant321
7 gSystem->Load("libgeant321");
9 new TGeant3("C++ Interface to Geant3");
11 if (!gSystem->Getenv("CONFIG_FILE"))
13 TFile *rootfile = new TFile("galice.root", "recreate");
15 rootfile->SetCompressionLevel(2);
18 TGeant3 *geant3 = (TGeant3 *) gMC;
21 // Set External decayer
22 AliDecayer *decayer = new AliDecayerPythia();
24 decayer->SetForceDecay(kAll);
26 gMC->SetExternalDecayer(decayer);
29 //=======================================================================
30 // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
31 geant3->SetTRIG(1); //Number of events to be processed
32 geant3->SetSWIT(4, 10);
33 geant3->SetDEBU(0, 0, 1);
34 //geant3->SetSWIT(2,2);
45 geant3->SetHADR(1); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
49 geant3->SetAUTO(1); //Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
50 geant3->SetABAN(0); //Restore 3.16 behaviour for abandoned tracks
51 geant3->SetOPTI(2); //Select optimisation level for GEANT geometry searches (0,1,2)
52 geant3->SetERAN(5.e-7);
54 Float_t cut = 1.e-3; // 1MeV cut by default
55 Float_t tofmax = 1.e10;
57 // GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
58 geant3->SetCUTS(cut, cut, cut, cut, cut, cut, cut, cut, cut, cut,
61 //=======================================================================
62 // ************* STEERING parameters FOR ALICE SIMULATION **************
63 // --- Specify event type to be tracked through the ALICE setup
64 // --- All positions are in cm, angles in degrees, and P and E in GeV
65 if (gSystem->Getenv("CONFIG_NPARTICLES"))
67 int nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
70 int nParticles = 10000;
73 /*********************************************************************************/
74 /*********************************************************************************/
75 /***************** G E N E R A T O R S *********************************/
77 /** C O C K T A I L W I T H A F T E R B U R N E R S A F T E R W A R D S **/
78 /***************** (WRAPPER GENERATOR) *********************************/
82 AliGenCocktailAfterBurner* gener = new AliGenCocktailAfterBurner();
83 gener->SetPhiRange(0, 360);
84 gener->SetThetaRange(40., 140.);
85 gener->SetOrigin(0, 0, 0); //vertex position
86 gener->SetSigma(0, 0, 0); //Sigma in (X,Y,Z) (cm) on IP position
88 /***************** HIJING PARAMETRIZATION ********************************/
90 //AliGenHIJINGpara *g2 = new AliGenHIJINGpara(5);
91 //g2->SetMomentumRange(0, 999);
93 /***************** G E N B O X ***********************************/
95 // AliGenBox *g1 = new AliGenBox(5);
96 // g1->SetMomentumRange(0, 3);
97 // g1->SetOrigin(0,0,0); //vertex position
98 // g1->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
99 // g1->SetPart(310); //K0short(310), Lambda(3122)
102 /***************** M E V S I M ********************************/
104 AliMevSimConfig *c = new AliMevSimConfig(1);
105 c->SetRectPlane(1); // reaction plane control, model 4
108 AliGenMevSim *g3 = new AliGenMevSim(c);
109 g3->SetPtRange(0.001, 3);
110 g3->SetMomentumRange(0.1, 3);
112 g3->SetTrackingFlag(1);
113 g3->SetOrigin(0.0, 0.0, 0.0);
114 g3->SetSigma(0.0, 0.0, 0.0);
115 //g3->SetEtaCutRange(-4,4);
117 AliMevSimParticle *piPlus = new AliMevSimParticle(kPiPlus, 3000, 3, 0.2, 0.01, 3, 0.1, 0.0, 0.0);
118 AliMevSimParticle *piMinus = new AliMevSimParticle(kPiMinus, 3000, 3, 0.2, 0.01, 3, 0.1, 0.0, 0.0);
119 //AliMevSimParticle *KPlus = new AliMevSimParticle(kKPlus, 10, 0, 0.25, 0.0, 2, 0.15, 0.0, 0.0 );
120 //AliMevSimParticle *KMinus = new AliMevSimParticle(kKMinus, 10, 0, 0.25, 0.0, 2, 0.15, 0.0, 0.0 );
121 //AliMevSimParticle *protonPlus = new AliMevSimParticle(kProton, 3, 0, 0.4, 0.0, 2, 0.15, 0.0, 0.0);
122 //AliMevSimParticle *protonMinus = new AliMevSimParticle(kProtonBar, 2, 0, 0.4, 0.0, 2, 0.15, 0.0, 0.0);
124 g3->AddParticleType(piPlus);
125 g3->AddParticleType(piMinus);
126 //g3->AddParticleType(KPlus);
127 //g3->AddParticleType(KMinus);
128 //g3->AddParticleType(protonPlus);
129 //g3->AddParticleType(protonMinus);
132 /***************** H B T P R O C E S S O R ********************************/
134 AliGenHBTprocessor *hbtp = new AliGenHBTprocessor();
135 hbtp->SetRefControl(2);
136 hbtp->SetSwitch1D(1);
137 hbtp->SetSwitch3D(1);
138 hbtp->SetSwitchCoulomb(0);
139 hbtp->SetSwitchCoherence(0);
140 hbtp->SetSwitchFermiBose(1);
141 hbtp->SetDeltap(0.1);
142 hbtp->SetDelChi(0.1);
143 hbtp->SetLambda(0.5);
146 hbtp->SetRParallel(8.0);
151 hbtp->SetPtRange(0.1,0.98);
152 hbtp->SetPIDs(211,-211); //pi+ pi-
153 hbtp->SetSwitchType(3); // fit both the like and unlike pair correl
155 /***********************************************************************************/
157 // gener->AddGenerator(g2,"HIJING PARAMETRIZATION",1);
158 // gener->AddGenerator(g1,"BOX (K0short)",1);
159 gener->AddGenerator(g3,"MEVSIM",1);
161 gener->AddAfterBurner(hbtp,"HBT PROCESSOR",1);
165 // Activate this line if you want the vertex smearing to happen
168 //gener->SetVertexSmear(perTrack);
170 gAlice->SetField(-999, 2); //Specify maximum magnetic field in Tesla (neg. ==> default field)
171 // gAlice->SetField(-999, 2, 2.); //Specify maximum magnetic field in Tesla (neg. ==> default field)
172 //Last number indicates the scale factor
195 //=================== Alice BODY parameters =============================
196 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
201 //=================== MAG parameters ============================
202 // --- Start with Magnet since detector layouts may be depending ---
203 // --- on the selected Magnet dimensions ---
204 AliMAG *MAG = new AliMAG("MAG", "Magnet");
210 //=================== ABSO parameters ============================
211 AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
216 //=================== DIPO parameters ============================
218 AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
223 //=================== HALL parameters ============================
225 AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
231 //=================== FRAME parameters ============================
233 AliFRAME *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
239 //=================== SHIL parameters ============================
241 AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding");
247 //=================== PIPE parameters ============================
249 AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
254 //=================== ITS parameters ============================
256 // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
257 // almost all other detectors. This involves the fact that the ITS geometry
258 // still has several options to be followed in parallel in order to determine
259 // the best set-up which minimizes the induced background. All the geometries
260 // available to date are described in the following. Read carefully the comments
261 // and use the default version (the only one uncommented) unless you are making
262 // comparisons and you know what you are doing. In this case just uncomment the
263 // ITS geometry you want to use and run Aliroot.
265 // Detailed geometries:
268 //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
270 //AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
272 AliITSvPPRasymm *ITS = new AliITSvPPRasymm("ITS","New ITS PPR detailed version with asymmetric services");
273 ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
274 ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
275 // ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer
276 ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
277 ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
278 ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300]
279 ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300]
280 ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
281 ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
283 //AliITSvPPRsymm *ITS = new AliITSvPPRsymm("ITS","New ITS PPR detailed version with symmetric services");
284 //ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
285 //ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
286 //ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRsymm2.det"); // don't touch this parameter if you're not an ITS developer
287 //ITS->SetThicknessDet1(300.); // detector thickness on layer 1 must be in the range [100,300]
288 //ITS->SetThicknessDet2(300.); // detector thickness on layer 2 must be in the range [100,300]
289 //ITS->SetThicknessChip1(300.); // chip thickness on layer 1 must be in the range [150,300]
290 //ITS->SetThicknessChip2(300.); // chip thickness on layer 2 must be in the range [150,300]
291 //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
292 //ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
295 // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful
296 // for reconstruction !):
299 //AliITSvPPRcoarseasymm *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
300 //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
301 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
303 //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
304 //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
305 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
309 // Geant3 <-> EUCLID conversion
310 // ============================
312 // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
313 // media to two ASCII files (called by default ITSgeometry.euc and
314 // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
315 // The default (=0) means that you dont want to use this facility.
323 //============================ TPC parameters ================================
324 // --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
325 // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
326 // --- sectors are specified, any value other than that requires at least one
327 // --- sector (lower or upper)to be specified!
328 // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
329 // --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
330 // --- SecLows - number of lower sectors specified (up to 6)
331 // --- SecUps - number of upper sectors specified (up to 12)
332 // --- Sens - sensitive strips for the Slow Simulator !!!
333 // --- This does NOT work if all S or L-sectors are specified, i.e.
334 // --- if SecAL or SecAU < 0
337 //-----------------------------------------------------------------------------
339 // gROOT->LoadMacro("SetTPCParam.C");
340 // AliTPCParam *param = SetTPCParam();
341 AliTPC *TPC = new AliTPCv2("TPC", "Default");
343 // All sectors included
351 //=================== TOF parameters ============================
352 AliTOF *TOF = new AliTOFv2("TOF", "normal TOF");
357 //=================== RICH parameters ===========================
358 AliRICH *RICH = new AliRICHv1("RICH", "normal RICH");
365 //=================== ZDC parameters ============================
367 AliZDC *ZDC = new AliZDCv1("ZDC", "normal ZDC");
372 //=================== CRT parameters ============================
374 AliCRT *CRT = new AliCRTv1("CRT", "normal CRT");
379 //=================== TRD parameters ============================
381 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
383 // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
386 // With hole in front of PHOS
388 // With hole in front of RICH
391 AliTRDsim *TRDsim = TRD->CreateTR();
396 //=================== FMD parameters ============================
398 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
403 //=================== MUON parameters ===========================
405 AliMUON *MUON = new AliMUONv1("MUON", "default");
407 //=================== PHOS parameters ===========================
411 AliPHOS *PHOS = new AliPHOSv1("PHOS", "GPS2");
417 //=================== PMD parameters ============================
419 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
421 PMD->SetPAR(1., 1., 0.8, 0.02);
422 PMD->SetIN(6., 18., -580., 27., 27.);
423 PMD->SetGEO(0.0, 0.2, 4.);
424 PMD->SetPadSize(0.8, 1.0, 1.0, 1.5);
427 if (iEMCAL && !iRICH)
429 //=================== EMCAL parameters ============================
430 AliEMCAL *EMCAL = new AliEMCALv1("EMCAL", "G56_2_55_19_104_14");
435 //=================== START parameters ============================
436 AliSTART *START = new AliSTARTv1("START", "START Detector");