2 // Configuration for the Physics Data Challenge 2006 modified to generate
3 // e,mu,pi,K,p for PID studies of the TRD.
4 // Per event, AliGenBox is used to generate 100 particles per species
5 // (50 positive and 50 negative ones). Barrel detectors only.
9 // One can use the configuration macro in compiled mode by
10 // root [0] gSystem->Load("libgeant321");
11 // root [0] gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include\
12 // -I$ALICE_ROOT -I$ALICE/geant3/TGeant3");
13 // root [0] .x grun.C(1,"Config_PDC06.C++")
15 #if !defined(__CINT__) || defined(__MAKECINT__)
16 #include <Riostream.h>
20 #include <TVirtualMC.h>
21 #include <TGeant3TGeo.h>
22 #include "EVGEN/AliGenCocktail.h"
23 #include "EVGEN/AliGenParam.h"
24 #include "EVGEN/AliGenMUONlib.h"
25 #include "STEER/AliRunLoader.h"
26 #include "STEER/AliRun.h"
27 #include "STEER/AliConfig.h"
28 #include "PYTHIA6/AliDecayerPythia.h"
29 #include "PYTHIA6/AliGenPythia.h"
30 #include "STEER/AliMagFMaps.h"
31 #include "STRUCT/AliBODY.h"
32 #include "STRUCT/AliMAG.h"
33 #include "STRUCT/AliABSOv0.h"
34 #include "STRUCT/AliDIPOv2.h"
35 #include "STRUCT/AliHALL.h"
36 #include "STRUCT/AliFRAMEv2.h"
37 #include "STRUCT/AliSHILv2.h"
38 #include "STRUCT/AliPIPEv0.h"
39 #include "ITS/AliITSgeom.h"
40 #include "ITS/AliITSvPPRasymmFMD.h"
41 #include "TPC/AliTPCv2.h"
42 #include "TOF/AliTOFv5T0.h"
43 #include "RICH/AliRICHv1.h"
44 #include "ZDC/AliZDCv2.h"
45 #include "TRD/AliTRDv1.h"
46 #include "FMD/AliFMDv1.h"
47 #include "MUON/AliMUONv1.h"
48 #include "PHOS/AliPHOSv1.h"
49 #include "PMD/AliPMDv1.h"
50 #include "START/AliSTARTv1.h"
51 #include "EMCAL/AliEMCALv2.h"
52 #include "CRT/AliCRTv0.h"
53 #include "VZERO/AliVZEROv6.h"
59 //--- Heavy Flavour Production ---
60 kCharmPbPb5500, kCharmpPb8800, kCharmpp14000, kCharmpp14000wmi,
61 kD0PbPb5500, kD0pPb8800, kD0pp14000,
62 kDPlusPbPb5500, kDPluspPb8800, kDPluspp14000,
63 kBeautyPbPb5500, kBeautypPb8800, kBeautypp14000, kBeautypp14000wmi,
65 kPyMbNoHvq, kPyOmegaPlus, kPyOmegaMinus, kRunMax
68 const char * pprRunName[] = {
69 "kCharmPbPb5500", "kCharmpPb8800", "kCharmpp14000", "kCharmpp14000wmi",
70 "kD0PbPb5500", "kD0pPb8800", "kD0pp14000",
71 "kDPlusPbPb5500", "kDPluspPb8800", "kDPluspp14000",
72 "kBeautyPbPb5500", "kBeautypPb8800", "kBeautypp14000", "kBeautypp14000wmi",
73 "kPyMbNoHvq", "kPyOmegaPlus", "kPyOmegaMinus"
80 kNature, kHadr, kSemiEl, kSemiMu
82 //--- Rapidity Cut ---
85 kFull, kBarrel, kMuonArm
87 //--- Magnetic Field ---
93 AliGenPythia *PythiaHVQ(PDC06Proc_t proc);
94 AliGenerator *MbCocktail();
95 AliGenerator *PyMbTriggered(Int_t pdg);
96 void ProcessEnvironmentVars();
97 Float_t EtaToTheta(Float_t arg){
98 return (180./TMath::Pi())*2.*atan(exp(-arg));
101 // This part for configuration
102 static DecayHvFl_t decHvFl = kNature;
103 static YCut_t ycut = kBarrel;
104 static Mag_t mag = k5kG;
105 //========================//
106 // Set Random Number seed //
107 //========================//
109 static UInt_t seed = dt.Get();
111 // nEvts = -1 : you get 1 QQbar pair and all the fragmentation and
113 // nEvts = N>0 : you get N charm / beauty Hadrons
115 // stars = kTRUE : all heavy resonances and their decay stored
116 // = kFALSE: only final heavy hadrons and their decays stored
117 Bool_t stars = kTRUE;
119 // To be used only with kCharmppMNRwmi and kBeautyppMNRwmi
120 // To get a "reasonable" agreement with MNR results, events have to be
121 // generated with the minimum ptHard set to 2.76 GeV.
122 // To get a "perfect" agreement with MNR results, events have to be
123 // generated in four ptHard bins with the following relative
135 Float_t ptHardMin = 2.76;
136 Float_t ptHardMax = -1.;
140 static TString comment;
146 // Get settings from environment variables
147 ProcessEnvironmentVars();
149 gRandom->SetSeed(seed);
150 cerr<<"Seed for random number generation= "<<seed<<endl;
152 // libraries required by geant321
153 #if defined(__CINT__)
154 gSystem->Load("libgeant321");
157 new TGeant3TGeo("C++ Interface to Geant3");
159 //=======================================================================
160 // Create the output file
163 AliRunLoader* rl=0x0;
165 cout<<"Config.C: Creating Run Loader ..."<<endl;
166 rl = AliRunLoader::Open("galice.root",
167 AliConfig::GetDefaultEventFolderName(),
171 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
174 rl->SetCompressionLevel(2);
175 rl->SetNumberOfEventsPerFile(1000);
176 gAlice->SetRunLoader(rl);
179 //=======================================================================
180 // ************* STEERING parameters FOR ALICE SIMULATION **************
181 // --- Specify event type to be tracked through the ALICE setup
182 // --- All positions are in cm, angles in degrees, and P and E in GeV
185 gMC->SetProcess("DCAY",1);
186 gMC->SetProcess("PAIR",1);
187 gMC->SetProcess("COMP",1);
188 gMC->SetProcess("PHOT",1);
189 gMC->SetProcess("PFIS",0);
190 gMC->SetProcess("DRAY",0);
191 gMC->SetProcess("ANNI",1);
192 gMC->SetProcess("BREM",1);
193 gMC->SetProcess("MUNU",1);
194 gMC->SetProcess("CKOV",1);
195 gMC->SetProcess("HADR",1);
196 gMC->SetProcess("LOSS",2);
197 gMC->SetProcess("MULS",1);
198 gMC->SetProcess("RAYL",1);
200 Float_t cut = 1.e-3; // 1MeV cut by default
201 Float_t tofmax = 1.e10;
203 gMC->SetCut("CUTGAM", cut);
204 gMC->SetCut("CUTELE", cut);
205 gMC->SetCut("CUTNEU", cut);
206 gMC->SetCut("CUTHAD", cut);
207 gMC->SetCut("CUTMUO", cut);
208 gMC->SetCut("BCUTE", cut);
209 gMC->SetCut("BCUTM", cut);
210 gMC->SetCut("DCUTE", cut);
211 gMC->SetCut("DCUTM", cut);
212 gMC->SetCut("PPCUTM", cut);
213 gMC->SetCut("TOFMAX", tofmax);
218 // Set External decayer //
219 //======================//
220 TVirtualMCDecayer* decayer = new AliDecayerPythia();
225 decayer->SetForceDecay(kAll);
228 decayer->SetForceDecay(kHadronicD);
231 decayer->SetForceDecay(kSemiElectronic);
234 decayer->SetForceDecay(kSemiMuonic);
238 gMC->SetExternalDecayer(decayer);
240 //=========================//
241 // Generator Configuration //
242 //=========================//
244 AliGenCocktail *gener = new AliGenCocktail();
245 Double_t momen = 0.6;
247 // Set pseudorapidity range from -1 to 1.
248 Float_t thmin = EtaToTheta(1.); // theta min. <---> eta max
249 Float_t thmax = EtaToTheta(-1.); // theta max. <---> eta min
251 // electron generator
252 AliGenBox *eminus= new AliGenBox(Npart);
254 eminus->SetMomentumRange(momen,momen);
255 eminus->SetPhiRange(0,360);
256 eminus->SetThetaRange(thmin,thmax);
257 eminus->SetOrigin(0., 0., 0.); // primary vertex position
258 eminus->SetSigma(0.,0.,0.); // sigma (x,y,z) in cm, on position
260 // positron generator
261 AliGenBox *eplus= new AliGenBox(Npart);
263 eplus->SetMomentumRange(momen,momen);
264 eplus->SetPhiRange(0,360);
265 eplus->SetThetaRange(thmin,thmax);
266 eplus->SetOrigin(0., 0., 0.); // primary vertex position
267 eplus->SetSigma(0.,0.,0.); // sigma (x,y,z) in cm, on position
270 AliGenBox *muminus= new AliGenBox(Npart);
271 muminus->SetPart(13);
272 muminus->SetMomentumRange(momen,momen);
273 muminus->SetPhiRange(0,360);
274 muminus->SetThetaRange(thmin,thmax);
275 muminus->SetOrigin(0., 0., 0.); // primary vertex position
276 muminus->SetSigma(0.,0.,0.); // sigma (x,y,z) in cm, on position
279 AliGenBox *muplus= new AliGenBox(Npart);
280 muplus->SetPart(-13);
281 muplus->SetMomentumRange(momen,momen);
282 muplus->SetPhiRange(0,360);
283 muplus->SetThetaRange(thmin,thmax);
284 muplus->SetOrigin(0., 0., 0.); // primary vertex position
285 muplus->SetSigma(0.,0.,0.); // sigma (x,y,z) in cm, on position
288 AliGenBox *piminus= new AliGenBox(Npart);
289 piminus->SetPart(-211);
290 piminus->SetMomentumRange(momen,momen);
291 piminus->SetPhiRange(0,360);
292 piminus->SetThetaRange(thmin,thmax);
293 piminus->SetOrigin(0., 0., 0.); // primary vertex position
294 piminus->SetSigma(0.,0.,0.); // sigma (x,y,z) in cm, on position
297 AliGenBox *piplus= new AliGenBox(Npart);
298 piplus->SetPart(211);
299 piplus->SetMomentumRange(momen,momen);
300 piplus->SetPhiRange(0,360);
301 piplus->SetThetaRange(thmin,thmax);
302 piplus->SetOrigin(0., 0., 0.); // primary vertex position
303 piplus->SetSigma(0.,0.,0.); // sigma (x,y,z) in cm, on position
306 AliGenBox *kminus= new AliGenBox(Npart);
307 kminus->SetPart(-321);
308 kminus->SetMomentumRange(momen,momen);
309 kminus->SetPhiRange(0,360);
310 kminus->SetThetaRange(thmin,thmax);
311 kminus->SetOrigin(0., 0., 0.); // primary vertex position
312 kminus->SetSigma(0.,0.,0.); // sigma (x,y,z) in cm, on position
315 AliGenBox *kplus= new AliGenBox(Npart);
317 kplus->SetMomentumRange(momen,momen);
318 kplus->SetPhiRange(0,360);
319 kplus->SetThetaRange(thmin,thmax);
320 kplus->SetOrigin(0., 0., 0.); // primary vertex position
321 kplus->SetSigma(0.,0.,0.); // sigma (x,y,z) in cm, on position
324 AliGenBox *proton= new AliGenBox(Npart);
325 proton->SetPart(2212);
326 proton->SetMomentumRange(momen,momen);
327 proton->SetPhiRange(0,360);
328 proton->SetThetaRange(thmin,thmax);
329 proton->SetOrigin(0., 0., 0.); // primary vertex position
330 proton->SetSigma(0.,0.,0.); // sigma (x,y,z) in cm, on position
333 AliGenBox *aproton= new AliGenBox(Npart);
334 aproton->SetPart(-2212);
335 aproton->SetMomentumRange(momen,momen);
336 aproton->SetPhiRange(0,360);
337 aproton->SetThetaRange(thmin,thmax);
338 aproton->SetOrigin(0., 0., 0.); // primary vertex position
339 aproton->SetSigma(0.,0.,0.); // sigma (x,y,z) in cm, on position
343 gener->AddGenerator(eminus,"e-",1);
344 gener->AddGenerator(eplus,"e+",1);
345 gener->AddGenerator(muminus,"mu-",1);
346 gener->AddGenerator(muplus,"mu+",1);
347 gener->AddGenerator(piminus,"pi-",1);
348 gener->AddGenerator(piplus,"pi+",1);
349 gener->AddGenerator(kminus,"K-",1);
350 gener->AddGenerator(kplus,"K+",1);
351 gener->AddGenerator(proton,"p",1);
352 gener->AddGenerator(aproton,"anti-p",1);
359 comment = comment.Append(" | L3 field 0.2 T");
360 } else if (mag == k4kG) {
361 comment = comment.Append(" | L3 field 0.4 T");
362 } else if (mag == k5kG) {
363 comment = comment.Append(" | L3 field 0.5 T");
365 printf("\n \n Comment: %s \n \n", comment.Data());
367 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., mag);
368 field->SetL3ConstField(0); //Using const. field in the barrel
370 gAlice->SetField(field);
395 //=================== Alice BODY parameters =============================
396 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
401 //=================== MAG parameters ============================
402 // --- Start with Magnet since detector layouts may be depending ---
403 // --- on the selected Magnet dimensions ---
404 AliMAG *MAG = new AliMAG("MAG", "Magnet");
410 //=================== ABSO parameters ============================
411 AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
416 //=================== DIPO parameters ============================
418 AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
423 //=================== HALL parameters ============================
425 AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
431 //=================== FRAME parameters ============================
433 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
439 //=================== SHIL parameters ============================
441 AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding Version 2");
447 //=================== PIPE parameters ============================
449 AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
454 //=================== ITS parameters ============================
456 // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
457 // almost all other detectors. This involves the fact that the ITS geometry
458 // still has several options to be followed in parallel in order to determine
459 // the best set-up which minimizes the induced background. All the geometries
460 // available to date are described in the following. Read carefully the comments
461 // and use the default version (the only one uncommented) unless you are making
462 // comparisons and you know what you are doing. In this case just uncomment the
463 // ITS geometry you want to use and run Aliroot.
465 // Detailed geometries:
468 //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
470 //AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
472 AliITSvPPRasymmFMD *ITS = new AliITSvPPRasymmFMD("ITS","New ITS PPR detailed version with asymmetric services");
473 ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
474 ITS->SetReadDet(kTRUE); // don't touch this parameter if you're not an ITS developer
475 // ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer
476 ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
477 ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
478 ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300]
479 ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300]
480 ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
481 ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
483 // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful
484 // for reconstruction !):
487 //AliITSvPPRcoarseasymm *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
488 //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
489 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
491 //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
492 //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
493 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
497 // Geant3 <-> EUCLID conversion
498 // ============================
500 // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
501 // media to two ASCII files (called by default ITSgeometry.euc and
502 // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
503 // The default (=0) means that you dont want to use this facility.
510 //============================ TPC parameters =====================
511 AliTPC *TPC = new AliTPCv2("TPC", "Default");
516 //=================== TOF parameters ============================
517 AliTOF *TOF = new AliTOFv5T0("TOF", "normal TOF");
523 //=================== RICH parameters ===========================
524 AliRICH *RICH = new AliRICHv1("RICH", "normal RICH");
531 //=================== ZDC parameters ============================
533 AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
538 //=================== TRD parameters ============================
540 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
541 AliTRDgeometry *geoTRD = TRD->GetGeometry();
547 //=================== FMD parameters ============================
548 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
553 //=================== MUON parameters ===========================
554 // New MUONv1 version (geometry defined via builders)
555 AliMUON *MUON = new AliMUONv1("MUON", "default");
557 //=================== PHOS parameters ===========================
561 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
567 //=================== PMD parameters ============================
568 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
573 //=================== START parameters ============================
574 AliSTART *START = new AliSTARTv1("START", "START Detector");
579 //=================== EMCAL parameters ============================
580 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "SHISH");
585 //=================== CRT parameters ============================
586 AliCRT *CRT = new AliCRTv0("CRT", "normal ACORDE");
591 //=================== CRT parameters ============================
592 AliVZERO *VZERO = new AliVZEROv6("VZERO", "normal VZERO");
597 void ProcessEnvironmentVars()
600 if (gSystem->Getenv("CONFIG_RUN_TYPE")) {
601 for (Int_t iRun = 0; iRun < kRunMax; iRun++) {
602 if (strcmp(gSystem->Getenv("CONFIG_RUN_TYPE"), pprRunName[iRun])==0) {
603 proc = (PDC06Proc_t)iRun;
604 cout<<"Run type set to "<<pprRunName[iRun]<<endl;
609 // Random Number seed
610 if (gSystem->Getenv("CONFIG_SEED")) {
611 seed = atoi(gSystem->Getenv("CONFIG_SEED"));