2 // Configuration for p-p Diffraction studies
5 // One can use the configuration macro in compiled mode by
6 // root [0] gSystem->Load("libgeant321");
7 // root [0] gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include\
8 // -I$ALICE_ROOT -I$ALICE/geant3/TGeant3");
9 // root [0] .x grun.C(1,"Config.C++")
11 #if !defined(__CINT__) || defined(__MAKECINT__)
12 #include <Riostream.h>
16 #include <TVirtualMC.h>
17 #include <TGeant3TGeo.h>
18 #include "STEER/AliRunLoader.h"
19 #include "STEER/AliRun.h"
20 #include "STEER/AliConfig.h"
21 #include "PYTHIA6/AliDecayerPythia.h"
22 #include "PYTHIA6/AliGenPythia.h"
23 #include "TDPMjet/AliGenDPMjet.h"
24 #include "STEER/AliMagFCheb.h"
25 #include "STRUCT/AliBODY.h"
26 #include "STRUCT/AliMAG.h"
27 #include "STRUCT/AliABSOv3.h"
28 #include "STRUCT/AliDIPOv3.h"
29 #include "STRUCT/AliHALLv3.h"
30 #include "STRUCT/AliFRAMEv2.h"
31 #include "STRUCT/AliSHILv3.h"
32 #include "STRUCT/AliPIPEv3.h"
33 #include "ITS/AliITSv11Hybrid.h"
34 #include "TPC/AliTPCv2.h"
35 #include "TOF/AliTOFv6T0.h"
36 #include "HMPID/AliHMPIDv3.h"
37 #include "ZDC/AliZDCv3.h"
38 #include "TRD/AliTRDv1.h"
39 #include "TRD/AliTRDgeometry.h"
40 #include "FMD/AliFMDv1.h"
41 #include "MUON/AliMUONv1.h"
42 #include "PHOS/AliPHOSv1.h"
43 #include "PHOS/AliPHOSSimParam.h"
44 #include "PMD/AliPMDv1.h"
45 #include "T0/AliT0v1.h"
46 #include "EMCAL/AliEMCALv2.h"
47 #include "ACORDE/AliACORDEv1.h"
48 #include "VZERO/AliVZEROv7.h"
57 const char * pprRunName[] = {
63 kNoField, k5kG, kFieldMax
66 const char * pprField[] = {
71 void ProcessEnvironmentVars();
73 // Generator, field, beam energy
74 static PDC06Proc_t proc = kStarlight;
75 static Mag_t mag = k5kG;
76 static Float_t energy = 7000; // energy in CMS
77 static Float_t pBeamEnergy = 3500.; // energy p-Beam
78 static Int_t runNumber = 0;
79 static Int_t eventOffset = 0;
81 //========================//
82 // Set Random Number seed //
83 //========================//
85 static UInt_t seed = dt.Get();
88 static TString comment;
92 // Get settings from environment variables
93 ProcessEnvironmentVars();
95 gRandom->SetSeed(seed);
96 cerr<<"Seed for random number generation= "<<seed<<endl;
98 // Libraries required by geant321
100 gSystem->Load("liblhapdf"); // Parton density functions
101 gSystem->Load("libEGPythia6"); // TGenerator interface
102 // if (proc == kPythia6 || proc == kPhojet) {
103 // gSystem->Load("libpythia6"); // Pythia 6.2
105 gSystem->Load("libpythia6.4.21"); // Pythia 6.4
107 gSystem->Load("libAliPythia6"); // ALICE specific implementations
108 gSystem->Load("libgeant321");
111 new TGeant3TGeo("C++ Interface to Geant3");
113 //=======================================================================
114 // Create the output file
117 AliRunLoader* rl=0x0;
119 cout<<"Config.C: Creating Run Loader ..."<<endl;
120 rl = AliRunLoader::Open("galice.root",
121 AliConfig::GetDefaultEventFolderName(),
125 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
128 rl->SetCompressionLevel(2);
129 rl->SetNumberOfEventsPerFile(1000);
132 gAlice->SetRunLoader(rl);
133 // gAlice->SetGeometryFromFile("geometry.root");
134 // gAlice->SetGeometryFromCDB();
136 // Set the trigger configuration: proton-proton
137 AliSimulation::Instance()->SetTriggerConfig("p-p");
140 //=======================================================================
141 // ************* STEERING parameters FOR ALICE SIMULATION **************
142 // --- Specify event type to be tracked through the ALICE setup
143 // --- All positions are in cm, angles in degrees, and P and E in GeV
145 gMC->SetProcess("DCAY",1);
146 gMC->SetProcess("PAIR",1);
147 gMC->SetProcess("COMP",1);
148 gMC->SetProcess("PHOT",1);
149 gMC->SetProcess("PFIS",0);
150 gMC->SetProcess("DRAY",0);
151 gMC->SetProcess("ANNI",1);
152 gMC->SetProcess("BREM",1);
153 gMC->SetProcess("MUNU",1);
154 gMC->SetProcess("CKOV",1);
155 gMC->SetProcess("HADR",1);
156 gMC->SetProcess("LOSS",2);
157 gMC->SetProcess("MULS",1);
158 gMC->SetProcess("RAYL",1);
160 Float_t cut = 1.e-3; // 1MeV cut by default
161 Float_t tofmax = 1.e10;
163 gMC->SetCut("CUTGAM", cut);
164 gMC->SetCut("CUTELE", cut);
165 gMC->SetCut("CUTNEU", cut);
166 gMC->SetCut("CUTHAD", cut);
167 gMC->SetCut("CUTMUO", cut);
168 gMC->SetCut("BCUTE", cut);
169 gMC->SetCut("BCUTM", cut);
170 gMC->SetCut("DCUTE", cut);
171 gMC->SetCut("DCUTM", cut);
172 gMC->SetCut("PPCUTM", cut);
173 gMC->SetCut("TOFMAX", tofmax);
175 //======================//
176 // Set External decayer //
177 //======================//
178 TVirtualMCDecayer* decayer = new AliDecayerPythia();
179 decayer->SetForceDecay(kAll);
182 gMC->SetExternalDecayer(decayer);
184 //=========================//
185 // Generator Configuration //
186 //=========================//
187 AliGenerator* gener = 0x0;
189 if (proc == kStarlight) {
190 TString ap="../../build/lib/tgt_linux/";
191 gSystem->Load(ap+"libStarLight.so");
192 gSystem->Load(ap+"libAliStarLight.so");
194 AliGenStarLight* sl = new AliGenStarLight(1000*1000);
196 sl->SetParameter("BEAM_1_Z = 1 #Z of projectile");
197 sl->SetParameter("BEAM_1_A = 1 #A of projectile");
198 sl->SetParameter("BEAM_2_Z = 82 #Z of target");
199 sl->SetParameter("BEAM_2_A = 208 #A of target");
200 sl->SetParameter("BEAM_1_GAMMA = 4264.4 #Gamma of the colliding ions");
201 sl->SetParameter("BEAM_2_GAMMA = 1682.4 #Gamma of the colliding ions");
202 sl->SetParameter("W_MAX = 15 #Max value of w");
203 sl->SetParameter("W_MIN = -1 #Min value of w");
204 sl->SetParameter("W_N_BINS = 40 #Bins i w");
205 sl->SetParameter("RAP_MAX = 8. #max y");
206 sl->SetParameter("RAP_N_BINS = 80 #Bins i y");
207 sl->SetParameter("CUT_PT = 0 #Cut in pT? 0 = (no, 1 = yes)");
208 sl->SetParameter("PT_MIN = 1.0 #Minimum pT in GeV");
209 sl->SetParameter("PT_MAX = 3.0 #Maximum pT in GeV");
210 sl->SetParameter("CUT_ETA = 0 #Cut in pseudorapidity? (0 = no, 1 = yes)");
211 sl->SetParameter("ETA_MIN = -10 #Minimum pseudorapidity");
212 sl->SetParameter("ETA_MAX = 10 #Maximum pseudorapidity");
213 sl->SetParameter("PROD_MODE = 4 #gg or gP switch (1 = 2-photon, 2 = coherent vector meson (narrow), 3 = coherent vector meson (wide), # 4 = incoherent vector meson, 5 = A+A DPMJet single, 6 = A+A DPMJet double, 7 = p+A DPMJet single, 8 = p+A Pythia single )");
214 sl->SetParameter("PROD_PID = 913 #Channel of interest (not relevant for photonuclear processes)");
215 sl->SetParameter("RND_SEED = 34533 #Random number seed");
216 sl->SetParameter("BREAKUP_MODE = 5 #Controls the nuclear breakup");
217 sl->SetParameter("INTERFERENCE = 0 #Interference (0 = off, 1 = on)");
218 sl->SetParameter("IF_STRENGTH = 1. #% of intefernce (0.0 - 0.1)");
219 sl->SetParameter("COHERENT = 1 #Coherent=1,Incoherent=0");
220 sl->SetParameter("INCO_FACTOR = 1. #percentage of incoherence");
221 sl->SetParameter("INT_PT_MAX = 0.24 #Maximum pt considered, when interference is turned on");
222 sl->SetParameter("INT_PT_N_BINS = 120 #Number of pt bins when interference is turned on");
224 sl->SetRapidityMotherRange(-1., 1.);
227 sl->GetTStarLight()->PrintInputs(std::cout);
229 AliGenerator* gener = sl;
230 gener->SetOrigin(0, 0, 0); // vertex position
231 gener->SetSigma(0, 0, 5.3); // Sigma in (X,Y,Z) (cm) on IP position
232 gener->SetCutVertexZ(1.); // Truncate at 1 sigma
233 gener->SetVertexSmear(kPerEvent);
234 gener->SetTrackingFlag(1);
235 // gener->SetYRange(-0.9, 0.9);
241 // Size of the interaction diamond
243 Float_t sigmaz = 5.4 / TMath::Sqrt(2.); // [cm]
244 // if (energy == 900)
245 //sigmaz = 10.5 / TMath::Sqrt(2.); // [cm]
248 sigmaz = 6.3 / TMath::Sqrt(2.); // [cm]
252 Float_t betast = 10; // beta* [m]
253 if (runNumber >= 117048) betast = 2.;
254 if (runNumber > 122375) betast = 3.5; // starting with fill 1179
256 Float_t eps = 5.e-6; // emittance [m]
257 Float_t gamma = energy / 2.0 / 0.938272; // relativistic gamma [1]
258 Float_t sigmaxy = TMath::Sqrt(eps * betast / gamma) / TMath::Sqrt(2.) * 100.; // [cm]
259 printf("\n \n Diamond size x-y: %10.3e z: %10.3e\n \n", sigmaxy, sigmaz);
261 gener->SetSigma(sigmaxy, sigmaxy, sigmaz); // Sigma in (X,Y,Z) (cm) on IP position
262 gener->SetVertexSmear(kPerEvent);
265 printf("\n \n Comment: %s \n \n", comment.Data());
267 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
268 TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", -1., -1., AliMagF::k5kG,
269 AliMagF::kBeamTypepp, pBeamEnergy));
296 //=================== Alice BODY parameters =============================
297 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
302 //=================== MAG parameters ============================
303 // --- Start with Magnet since detector layouts may be depending ---
304 // --- on the selected Magnet dimensions ---
305 AliMAG *MAG = new AliMAG("MAG", "Magnet");
311 //=================== ABSO parameters ============================
312 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
317 //=================== DIPO parameters ============================
319 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
324 //=================== HALL parameters ============================
326 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
332 //=================== FRAME parameters ============================
334 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
340 //=================== SHIL parameters ============================
342 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
348 //=================== PIPE parameters ============================
350 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
355 //=================== ITS parameters ============================
357 AliITS *ITS = new AliITSv11("ITS","ITS v11");
362 //============================ TPC parameters =====================
364 AliTPC *TPC = new AliTPCv2("TPC", "Default");
369 //=================== TOF parameters ============================
371 AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
377 //=================== HMPID parameters ===========================
379 AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
386 //=================== ZDC parameters ============================
388 AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
393 //=================== TRD parameters ============================
395 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
396 AliTRDgeometry *geoTRD = TRD->GetGeometry();
397 // Partial geometry: modules at 0,1,7,8,9,16,17
398 // starting at 3h in positive direction
399 geoTRD->SetSMstatus(2,0);
400 geoTRD->SetSMstatus(3,0);
401 geoTRD->SetSMstatus(4,0);
402 geoTRD->SetSMstatus(5,0);
403 geoTRD->SetSMstatus(6,0);
404 geoTRD->SetSMstatus(11,0);
405 geoTRD->SetSMstatus(12,0);
406 geoTRD->SetSMstatus(13,0);
407 geoTRD->SetSMstatus(14,0);
408 geoTRD->SetSMstatus(15,0);
409 geoTRD->SetSMstatus(16,0);
414 //=================== FMD parameters ============================
416 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
421 //=================== MUON parameters ===========================
422 // New MUONv1 version (geometry defined via builders)
424 AliMUON *MUON = new AliMUONv1("MUON", "default");
429 //=================== PHOS parameters ===========================
431 AliPHOS *PHOS = new AliPHOSv1("PHOS", "noCPV_Modules123");
438 //=================== PMD parameters ============================
440 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
445 //=================== T0 parameters ============================
446 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
451 //=================== EMCAL parameters ============================
453 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_FIRSTYEAR");
458 //=================== ACORDE parameters ============================
460 AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
465 //=================== ACORDE parameters ============================
467 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
471 void ProcessEnvironmentVars()
474 if (gSystem->Getenv("CONFIG_RUN_TYPE")) {
475 for (Int_t iRun = 0; iRun < kRunMax; iRun++) {
476 if (strcmp(gSystem->Getenv("CONFIG_RUN_TYPE"), pprRunName[iRun])==0) {
477 proc = (PDC06Proc_t)iRun;
478 cout<<"Run type set to "<<pprRunName[iRun]<<endl;
483 if (gSystem->Getenv("CONFIG_FIELD")) {
484 for (Int_t iField = 0; iField < kFieldMax; iField++) {
485 if (strcmp(gSystem->Getenv("CONFIG_FIELD"), pprField[iField])==0) {
487 cout<<"Field set to "<<pprField[iField]<<endl;
492 if (gSystem->Getenv("CONFIG_ENERGY")) {
493 energy = atoi(gSystem->Getenv("CONFIG_ENERGY"));
494 cout<<"Energy set to "<<energy<<" GeV"<<endl;
496 // Random Number seed
497 if (gSystem->Getenv("CONFIG_SEED")) {
498 seed = atoi(gSystem->Getenv("CONFIG_SEED"));
501 if (gSystem->Getenv("DC_RUN")) {
502 runNumber = atoi(gSystem->Getenv("DC_RUN"));
505 if (gSystem->Getenv("DC_EVENT")) {
506 eventOffset = 400*(atoi(gSystem->Getenv("DC_EVENT")) - 1); // 400 events per job (->sim.C)
507 std::cout << "eventOffset= " << eventOffset << std::endl;