1 // One can use the configuration macro in compiled mode by
2 // root [0] gSystem->Load("libgeant321");
3 // root [0] gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include\
4 // -I$ALICE_ROOT -I$ALICE/geant3/TGeant3");
5 // root [0] .x grun.C(1,"ConfigHBT.C++")
7 #if !defined(__CINT__) || defined(__MAKECINT__)
11 #include <TVirtualMC.h>
13 #include "STEER/AliRunLoader.h"
14 #include "STEER/AliRun.h"
15 #include "STEER/AliConfig.h"
16 #include "PYTHIA6/AliDecayerPythia.h"
17 #include "EVGEN/AliGenCocktailAfterBurner.h"
18 #include "TMEVSIM/AliMevSimConfig.h"
19 #include "TMEVSIM/AliMevSimParticle.h"
20 #include "TMEVSIM/AliGenMevSim.h"
21 #include "THbtp/AliGenHBTprocessor.h"
22 #include "STRUCT/AliBODY.h"
23 #include "STRUCT/AliMAG.h"
24 #include "STRUCT/AliABSOv0.h"
25 #include "STRUCT/AliDIPOv2.h"
26 #include "STRUCT/AliHALL.h"
27 #include "STRUCT/AliFRAMEv2.h"
28 #include "STRUCT/AliSHILv2.h"
29 #include "STRUCT/AliPIPEv0.h"
30 #include "ITS/AliITSvPPRasymmFMD.h"
31 #include "TPC/AliTPCv2.h"
32 #include "TOF/AliTOFv4T0.h"
33 #include "RICH/AliRICHv1.h"
34 #include "ZDC/AliZDCv1.h"
35 #include "TRD/AliTRDv1.h"
36 #include "FMD/AliFMDv1.h"
37 #include "MUON/AliMUONv1.h"
38 #include "MUON/AliMUONSt1GeometryBuilder.h"
39 #include "MUON/AliMUONSt2GeometryBuilder.h"
40 #include "MUON/AliMUONSlatGeometryBuilder.h"
41 #include "MUON/AliMUONTriggerGeometryBuilder.h"
42 #include "PHOS/AliPHOSv1.h"
43 #include "PMD/AliPMDv1.h"
44 #include "START/AliSTARTv1.h"
45 #include "EMCAL/AliEMCALv1.h"
46 #include "CRT/AliCRTv1.h"
51 // Set Random Number seed
52 // gRandom->SetSeed(12345);
54 // libraries required by geant321
56 gSystem->Load("libgeant321");
59 new TGeant3TGeo("C++ Interface to Geant3");
61 cout<<"Config.C: Creating Run Loader ..."<<endl;
62 AliRunLoader* rl = AliRunLoader::Open("galice.root",AliConfig::GetDefaultEventFolderName(),
66 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
69 rl->SetCompressionLevel(2);
70 rl->SetNumberOfEventsPerFile(6);
71 gAlice->SetRunLoader(rl);
74 // Set External decayer
75 AliDecayer *decayer = new AliDecayerPythia();
77 decayer->SetForceDecay(kAll);
79 gMC->SetExternalDecayer(decayer);
81 //=======================================================================
82 // ************* STEERING parameters FOR ALICE SIMULATION **************
83 // --- Specify event type to be tracked through the ALICE setup
84 // --- All positions are in cm, angles in degrees, and P and E in GeV
88 gMC->SetProcess("DCAY",1);
89 gMC->SetProcess("PAIR",1);
90 gMC->SetProcess("COMP",1);
91 gMC->SetProcess("PHOT",1);
92 gMC->SetProcess("PFIS",0);
93 gMC->SetProcess("DRAY",0);
94 gMC->SetProcess("ANNI",1);
95 gMC->SetProcess("BREM",1);
96 gMC->SetProcess("MUNU",1);
97 gMC->SetProcess("CKOV",1);
98 gMC->SetProcess("HADR",1);
99 gMC->SetProcess("LOSS",2);
100 gMC->SetProcess("MULS",1);
101 gMC->SetProcess("RAYL",1);
103 Float_t cut = 1.e-3; // 1MeV cut by default
104 Float_t tofmax = 1.e10;
106 gMC->SetCut("CUTGAM", cut);
107 gMC->SetCut("CUTELE", cut);
108 gMC->SetCut("CUTNEU", cut);
109 gMC->SetCut("CUTHAD", cut);
110 gMC->SetCut("CUTMUO", cut);
111 gMC->SetCut("BCUTE", cut);
112 gMC->SetCut("BCUTM", cut);
113 gMC->SetCut("DCUTE", cut);
114 gMC->SetCut("DCUTM", cut);
115 gMC->SetCut("PPCUTM", cut);
116 gMC->SetCut("TOFMAX", tofmax);
119 if (gSystem->Getenv("CONFIG_NPARTICLES"))
121 int nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
124 int nParticles = 10000;
127 /*********************************************************************************/
128 /*********************************************************************************/
129 /***************** G E N E R A T O R S *********************************/
131 /** 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 **/
132 /***************** (WRAPPER GENERATOR) *********************************/
136 AliGenCocktailAfterBurner* gener = new AliGenCocktailAfterBurner();
137 gener->SetPhiRange(0, 360);
138 gener->SetThetaRange(40., 140.);
139 gener->SetOrigin(0, 0, 0); //vertex position
140 gener->SetSigma(0, 0, 0); //Sigma in (X,Y,Z) (cm) on IP position
142 /***************** HIJING PARAMETRIZATION ********************************/
144 //AliGenHIJINGpara *g2 = new AliGenHIJINGpara(5);
145 //g2->SetMomentumRange(0, 999);
147 /***************** G E N B O X ***********************************/
149 // AliGenBox *g1 = new AliGenBox(5);
150 // g1->SetMomentumRange(0, 3);
151 // g1->SetOrigin(0,0,0); //vertex position
152 // g1->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
153 // g1->SetPart(310); //K0short(310), Lambda(3122)
156 /***************** M E V S I M ********************************/
158 AliMevSimConfig *c = new AliMevSimConfig(1);
159 c->SetRectPlane(1); // reaction plane control, model 4
162 AliGenMevSim *g3 = new AliGenMevSim(c);
163 g3->SetPtRange(0.001, 3);
164 g3->SetMomentumRange(0.1, 3);
166 g3->SetTrackingFlag(1);
167 g3->SetOrigin(0.0, 0.0, 0.0);
168 g3->SetSigma(0.0, 0.0, 0.0);
169 //g3->SetEtaCutRange(-4,4);
171 AliMevSimParticle *piPlus = new AliMevSimParticle(kPiPlus, 100, 3, 0.2, 0.01, 3, 0.1, 0.0, 0.0);
172 AliMevSimParticle *piMinus = new AliMevSimParticle(kPiMinus, 100, 3, 0.2, 0.01, 3, 0.1, 0.0, 0.0);
173 //AliMevSimParticle *KPlus = new AliMevSimParticle(kKPlus, 10, 0, 0.25, 0.0, 2, 0.15, 0.0, 0.0 );
174 //AliMevSimParticle *KMinus = new AliMevSimParticle(kKMinus, 10, 0, 0.25, 0.0, 2, 0.15, 0.0, 0.0 );
175 //AliMevSimParticle *protonPlus = new AliMevSimParticle(kProton, 3, 0, 0.4, 0.0, 2, 0.15, 0.0, 0.0);
176 //AliMevSimParticle *protonMinus = new AliMevSimParticle(kProtonBar, 2, 0, 0.4, 0.0, 2, 0.15, 0.0, 0.0);
178 g3->AddParticleType(piPlus);
179 g3->AddParticleType(piMinus);
180 //g3->AddParticleType(KPlus);
181 //g3->AddParticleType(KMinus);
182 //g3->AddParticleType(protonPlus);
183 //g3->AddParticleType(protonMinus);
186 /***************** H B T P R O C E S S O R ********************************/
188 AliGenHBTprocessor *hbtp = new AliGenHBTprocessor();
189 hbtp->SetRefControl(2);
190 hbtp->SetSwitch1D(1);
191 hbtp->SetSwitch3D(1);
192 hbtp->SetSwitchCoulomb(1);
193 hbtp->SetSwitchCoherence(0);
194 hbtp->SetSwitchFermiBose(-1);
195 hbtp->SetDeltap(0.1);
196 hbtp->SetDelChi(0.1);
197 hbtp->SetLambda(0.5);
200 hbtp->SetRParallel(8.0);
205 hbtp->SetPtRange(0.1,0.98);
206 hbtp->SetPIDs(211,-211); //pi+ pi-
207 hbtp->SetSwitchType(3); // fit both the like and unlike pair correl
208 hbtp->SetMaxIterations(300);
209 /***********************************************************************************/
211 // gener->AddGenerator(g2,"HIJING PARAMETRIZATION",1);
212 // gener->AddGenerator(g1,"BOX (K0short)",1);
213 gener->AddGenerator(g3,"MEVSIM",1);
215 gener->AddAfterBurner(hbtp,"HBT PROCESSOR",1);
219 // Activate this line if you want the vertex smearing to happen
222 //gener->SetVertexSmear(perTrack);
224 gAlice->SetField(-999, 2); //Specify maximum magnetic field in Tesla (neg. ==> default field)
225 // gAlice->SetField(-999, 2, 2.); //Specify maximum magnetic field in Tesla (neg. ==> default field)
226 //Last number indicates the scale factor
249 //=================== Alice BODY parameters =============================
250 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
255 //=================== MAG parameters ============================
256 // --- Start with Magnet since detector layouts may be depending ---
257 // --- on the selected Magnet dimensions ---
258 AliMAG *MAG = new AliMAG("MAG", "Magnet");
264 //=================== ABSO parameters ============================
265 AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
270 //=================== DIPO parameters ============================
272 AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
277 //=================== HALL parameters ============================
279 AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
285 //=================== FRAME parameters ============================
287 AliFRAME *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
293 //=================== SHIL parameters ============================
295 AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding");
301 //=================== PIPE parameters ============================
303 AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
308 //=================== ITS parameters ============================
310 // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
311 // almost all other detectors. This involves the fact that the ITS geometry
312 // still has several options to be followed in parallel in order to determine
313 // the best set-up which minimizes the induced background. All the geometries
314 // available to date are described in the following. Read carefully the comments
315 // and use the default version (the only one uncommented) unless you are making
316 // comparisons and you know what you are doing. In this case just uncomment the
317 // ITS geometry you want to use and run Aliroot.
319 // Detailed geometries:
322 //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
324 //AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
326 AliITSvPPRasymmFMD *ITS = new AliITSvPPRasymmFMD("ITS","New ITS PPR detailed version with asymmetric services");
327 ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
328 ITS->SetReadDet(kTRUE); // don't touch this parameter if you're not an ITS developer
329 // ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer
330 ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
331 ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
332 ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300]
333 ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300]
334 ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
335 ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
337 //AliITSvPPRsymm *ITS = new AliITSvPPRsymm("ITS","New ITS PPR detailed version with symmetric services");
338 //ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
339 //ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
340 //ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRsymm2.det"); // don't touch this parameter if you're not an ITS developer
341 //ITS->SetThicknessDet1(300.); // detector thickness on layer 1 must be in the range [100,300]
342 //ITS->SetThicknessDet2(300.); // detector thickness on layer 2 must be in the range [100,300]
343 //ITS->SetThicknessChip1(300.); // chip thickness on layer 1 must be in the range [150,300]
344 //ITS->SetThicknessChip2(300.); // chip thickness on layer 2 must be in the range [150,300]
345 //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
346 //ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
349 // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful
350 // for reconstruction !):
353 //AliITSvPPRcoarseasymm *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
354 //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
355 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
357 //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
358 //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
359 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
363 // Geant3 <-> EUCLID conversion
364 // ============================
366 // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
367 // media to two ASCII files (called by default ITSgeometry.euc and
368 // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
369 // The default (=0) means that you dont want to use this facility.
377 //============================ TPC parameters ================================
378 // --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
379 // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
380 // --- sectors are specified, any value other than that requires at least one
381 // --- sector (lower or upper)to be specified!
382 // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
383 // --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
384 // --- SecLows - number of lower sectors specified (up to 6)
385 // --- SecUps - number of upper sectors specified (up to 12)
386 // --- Sens - sensitive strips for the Slow Simulator !!!
387 // --- This does NOT work if all S or L-sectors are specified, i.e.
388 // --- if SecAL or SecAU < 0
391 //-----------------------------------------------------------------------------
393 // gROOT->LoadMacro("SetTPCParam.C");
394 // AliTPCParam *param = SetTPCParam();
395 AliTPC *TPC = new AliTPCv2("TPC", "Default");
397 // All sectors included
405 //=================== TOF parameters ============================
406 AliTOF *TOF = new AliTOFv4T0("TOF", "normal TOF");
411 //=================== RICH parameters ===========================
412 AliRICH *RICH = new AliRICHv1("RICH", "normal RICH");
419 //=================== ZDC parameters ============================
421 AliZDC *ZDC = new AliZDCv1("ZDC", "normal ZDC");
426 //=================== CRT parameters ============================
428 AliCRT *CRT = new AliCRTv1("CRT", "normal CRT");
433 //=================== TRD parameters ============================
435 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
437 // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
440 // With hole in front of PHOS
442 // With hole in front of RICH
445 AliTRDsim *TRDsim = TRD->CreateTR();
450 //=================== FMD parameters ============================
452 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
457 //=================== MUON parameters ===========================
459 AliMUON *MUON = new AliMUONv1("MUON", "default");
460 MUON->AddGeometryBuilder(new AliMUONSt1GeometryBuilder(MUON));
461 MUON->AddGeometryBuilder(new AliMUONSt2GeometryBuilder(MUON));
462 MUON->AddGeometryBuilder(new AliMUONSlatGeometryBuilder(MUON));
463 MUON->AddGeometryBuilder(new AliMUONTriggerGeometryBuilder(MUON));
465 //=================== PHOS parameters ===========================
469 AliPHOS *PHOS = new AliPHOSv1("PHOS", "GPS2");
475 //=================== PMD parameters ============================
477 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
479 PMD->SetPAR(1., 1., 0.8, 0.02);
480 PMD->SetIN(6., 18., -580., 27., 27.);
481 PMD->SetGEO(0.0, 0.2, 4.);
482 PMD->SetPadSize(0.8, 1.0, 1.0, 1.5);
485 if (iEMCAL && !iRICH)
487 //=================== EMCAL parameters ============================
488 AliEMCAL *EMCAL = new AliEMCALv1("EMCAL", "EMCAL_55_25");
493 //=================== START parameters ============================
494 AliSTART *START = new AliSTARTv1("START", "START Detector");