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,"ConfigPPR.C++")
7 #if !defined(__CINT__) || defined(__MAKECINT__)
11 #include <TVirtualMC.h>
12 #include <TGeant3TGeo.h>
15 #include "STEER/AliRunLoader.h"
16 #include "STEER/AliRun.h"
17 #include "STEER/AliConfig.h"
18 #include "STEER/AliGenerator.h"
19 #include "STEER/AliLog.h"
20 #include "PYTHIA6/AliDecayerPythia.h"
21 #include "EVGEN/AliGenHIJINGpara.h"
22 #include "THijing/AliGenHijing.h"
23 #include "EVGEN/AliGenCocktail.h"
24 #include "EVGEN/AliGenSlowNucleons.h"
25 #include "EVGEN/AliSlowNucleonModelExp.h"
26 #include "EVGEN/AliGenParam.h"
27 #include "EVGEN/AliGenMUONlib.h"
28 #include "EVGEN/AliGenSTRANGElib.h"
29 #include "EVGEN/AliGenMUONCocktail.h"
30 #include "EVGEN/AliGenCocktail.h"
31 #include "EVGEN/AliGenGeVSim.h"
32 #include "EVGEN/AliGeVSimParticle.h"
33 #include "PYTHIA6/AliGenPythia.h"
34 #include "STEER/AliMagFMaps.h"
35 #include "STRUCT/AliBODY.h"
36 #include "STRUCT/AliMAG.h"
37 #include "STRUCT/AliABSOv0.h"
38 #include "STRUCT/AliDIPOv2.h"
39 #include "STRUCT/AliHALL.h"
40 #include "STRUCT/AliFRAMEv2.h"
41 #include "STRUCT/AliSHILv2.h"
42 #include "STRUCT/AliPIPEv0.h"
43 #include "ITS/AliITSvPPRasymmFMD.h"
44 #include "TPC/AliTPCv2.h"
45 #include "TOF/AliTOFv6T0.h"
46 #include "HMPID/AliHMPIDv1.h"
47 #include "ZDC/AliZDCv2.h"
48 #include "TRD/AliTRDv1.h"
49 #include "FMD/AliFMDv1.h"
50 #include "MUON/AliMUONv1.h"
51 #include "EMCAL/AliEMCALv2.h"
52 #include "PHOS/AliPHOSv1.h"
53 #include "PMD/AliPMDv1.h"
54 #include "T0/AliT0v1.h"
55 #include "EMCAL/AliEMCALv2.h"
56 #include "ACORDE/AliACORDEv0.h"
57 #include "VZERO/AliVZEROv7.h"
58 #include "EVGEN/AliGenExtFile.h"
59 #include "EVGEN/AliGenReaderTreeK.h"
64 kGluonRadiation, kNoGluonRadiation
74 kDefaultPPTrig, kDefaultPbPbTrig
77 const char * pprTrigConfName[] = {
81 // This part for configuration
83 static PprRad_t srad = kGluonRadiation;
84 static PprMag_t smag = k5kG;
85 static Int_t sseed = 12345; //Set 0 to use the current time
87 static PprTrigConf_t strig = kDefaultPPTrig; // default PbPb trigger configuration
89 static TString comment;
92 Float_t EtaToTheta(Float_t arg);
93 AliGenerator* GeneratorFactory();
97 // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
98 // Theta range given through pseudorapidity limits 22/6/2001
100 // Set Random Number seed
101 gRandom->SetSeed(sseed);
102 cout<<"Seed for random number generation= "<<gRandom->GetSeed()<<endl;
106 // libraries required by geant321
107 #if defined(__CINT__)
108 gSystem->Load("libgeant321");
111 new TGeant3TGeo("C++ Interface to Geant3");
113 AliRunLoader* rl=0x0;
115 cout<<"Config.C: Creating Run Loader ..."<<endl;
116 rl = AliRunLoader::Open("galice.root",
117 AliConfig::GetDefaultEventFolderName(),
121 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
124 rl->SetCompressionLevel(2);
125 rl->SetNumberOfEventsPerFile(100);
126 gAlice->SetRunLoader(rl);
128 // Set the trigger configuration
129 gAlice->SetTriggerDescriptor(pprTrigConfName[strig]);
130 cout<<"Trigger configuration is set to "<<pprTrigConfName[strig]<<endl;
134 // Set External decayer
135 AliDecayer *decayer = new AliDecayerPythia();
136 decayer->SetForceDecay(kAll);
140 AliPythia * py= AliPythia::Instance();
141 py->SetMDME(731,1,0); //forbid D*+->D+ + pi0
142 py->SetMDME(732,1,0);//forbid D*+->D+ + gamma
144 for(Int_t d=741; d<=756; d++){
148 for(Int_t d=758; d<=801; d++){
154 gMC->SetExternalDecayer(decayer);
157 //=======================================================================
159 //=======================================================================
160 // ************* STEERING parameters FOR ALICE SIMULATION **************
161 // --- Specify event type to be tracked through the ALICE setup
162 // --- All positions are in cm, angles in degrees, and P and E in GeV
164 gMC->SetProcess("DCAY",1);
165 gMC->SetProcess("PAIR",1);
166 gMC->SetProcess("COMP",1);
167 gMC->SetProcess("PHOT",1);
168 gMC->SetProcess("PFIS",0);
169 gMC->SetProcess("DRAY",0);
170 gMC->SetProcess("ANNI",1);
171 gMC->SetProcess("BREM",1);
172 gMC->SetProcess("MUNU",1);
173 gMC->SetProcess("CKOV",1);
174 gMC->SetProcess("HADR",1);
175 gMC->SetProcess("LOSS",2);
176 gMC->SetProcess("MULS",1);
177 gMC->SetProcess("RAYL",1);
179 Float_t cut = 1.e-3; // 1MeV cut by default
180 Float_t tofmax = 1.e10;
182 gMC->SetCut("CUTGAM", cut);
183 gMC->SetCut("CUTELE", cut);
184 gMC->SetCut("CUTNEU", cut);
185 gMC->SetCut("CUTHAD", cut);
186 gMC->SetCut("CUTMUO", cut);
187 gMC->SetCut("BCUTE", cut);
188 gMC->SetCut("BCUTM", cut);
189 gMC->SetCut("DCUTE", cut);
190 gMC->SetCut("DCUTM", cut);
191 gMC->SetCut("PPCUTM", cut);
192 gMC->SetCut("TOFMAX", tofmax);
194 // Debug and log level
195 // AliLog::SetGlobalDebugLevel(0);
196 // AliLog::SetGlobalLogLevel(AliLog::kError);
198 // Generator Configuration
199 AliGenerator* gener = GeneratorFactory();
200 gener->SetOrigin(0, 0, 0); // vertex position
201 gener->SetSigma(0, 0, 5.3); // Sigma in (X,Y,Z) (cm) on IP position
202 gener->SetCutVertexZ(1.); // Truncate at 1 sigma
203 gener->SetVertexSmear(kPerEvent);
204 gener->SetTrackingFlag(1);
208 comment = comment.Append(" | L3 field 0.2 T");
209 } else if (smag == k4kG) {
210 comment = comment.Append(" | L3 field 0.4 T");
211 } else if (smag == k5kG) {
212 comment = comment.Append(" | L3 field 0.5 T");
216 if (srad == kGluonRadiation)
218 comment = comment.Append(" | Gluon Radiation On");
221 comment = comment.Append(" | Gluon Radiation Off");
225 printf("\n \n Comment: %s \n \n", comment.Data());
229 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., smag);
230 field->SetL3ConstField(0); //Using const. field in the barrel
232 gAlice->SetField(field);
256 //=================== Alice BODY parameters =============================
257 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
262 //=================== MAG parameters ============================
263 // --- Start with Magnet since detector layouts may be depending ---
264 // --- on the selected Magnet dimensions ---
265 AliMAG *MAG = new AliMAG("MAG", "Magnet");
271 //=================== ABSO parameters ============================
272 AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
277 //=================== DIPO parameters ============================
279 AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
284 //=================== HALL parameters ============================
286 AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
292 //=================== FRAME parameters ============================
294 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
299 //=================== SHIL parameters ============================
301 AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding Version 2");
307 //=================== PIPE parameters ============================
309 AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
314 //=================== ITS parameters ============================
316 // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
317 // almost all other detectors. This involves the fact that the ITS geometry
318 // still has several options to be followed in parallel in order to determine
319 // the best set-up which minimizes the induced background. All the geometries
320 // available to date are described in the following. Read carefully the comments
321 // and use the default version (the only one uncommented) unless you are making
322 // comparisons and you know what you are doing. In this case just uncomment the
323 // ITS geometry you want to use and run Aliroot.
325 // Detailed geometries:
328 //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
330 //AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
332 AliITSvPPRasymmFMD *ITS = new AliITSvPPRasymmFMD("ITS","New ITS PPR detailed version with asymmetric services");
333 ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
334 ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
335 // ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer
336 ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
337 ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
338 ITS->SetThicknessChip1(150.); // chip thickness on layer 1 must be in the range [150,300]
339 ITS->SetThicknessChip2(150.); // chip thickness on layer 2 must be in the range [150,300]
340 ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
341 ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
343 // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful
344 // for reconstruction !):
347 //AliITSvPPRcoarseasymm *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
348 //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
349 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
351 //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
352 //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
353 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
357 // Geant3 <-> EUCLID conversion
358 // ============================
360 // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
361 // media to two ASCII files (called by default ITSgeometry.euc and
362 // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
363 // The default (=0) means that you dont want to use this facility.
370 //============================ TPC parameters =====================
371 AliTPC *TPC = new AliTPCv2("TPC", "Default");
376 //=================== TOF parameters ============================
377 AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
383 //=================== HMPID parameters ===========================
384 AliHMPID *HMPID = new AliHMPIDv1("HMPID", "normal HMPID");
391 //=================== ZDC parameters ============================
393 AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
398 //=================== TRD parameters ============================
400 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
405 //=================== FMD parameters ============================
406 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
411 //=================== MUON parameters ===========================
412 // New MUONv1 version (geometry defined via builders)
413 AliMUON *MUON = new AliMUONv1("MUON", "default");
415 //=================== PHOS parameters ===========================
419 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
425 //=================== PMD parameters ============================
426 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
431 //=================== T0 parameters ============================
432 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
437 //=================== EMCAL parameters ============================
438 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "SHISH_77_TRD1_2X2_FINAL_110DEG");
443 //=================== ACORDE parameters ============================
444 AliACORDE *ACORDE = new AliACORDEv0("ACORDE", "normal ACORDE");
449 //=================== VZERO parameters ============================
450 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
456 Float_t EtaToTheta(Float_t arg){
457 return (180./TMath::Pi())*2.*atan(exp(-arg));
462 AliGenerator* GeneratorFactory() {
464 AliGenExtFile *gener = new AliGenExtFile(-1);
465 AliGenReaderTreeK * reader = new AliGenReaderTreeK();
467 reader->SetFileName("galice.root");
468 reader->AddDir("../gen");
469 gener->SetReader(reader);