5 kPythia6, kPhojet, kRunMax
8 const char * pprRunName[] = {
14 kNoField, k5kG, kFieldMax
17 const char * pprField[] = {
23 AliGenerator *MbPythia();
24 AliGenerator *MbPhojet();
25 void ProcessEnvironmentVars();
27 // Geterator, field, beam energy
28 static PDC06Proc_t proc = kPhojet;
29 static Mag_t mag = k5kG;
30 static Float_t energy = 10000; // energy in CMS
31 //========================//
32 // Set Random Number seed //
33 //========================//
35 static UInt_t seed = dt.Get();
38 static TString comment;
44 // Get settings from environment variables
45 ProcessEnvironmentVars();
47 gRandom->SetSeed(seed);
48 cerr<<"Seed for random number generation= "<<seed<<endl;
50 new TGeant3TGeo("C++ Interface to Geant3");
52 //=======================================================================
53 // Create the output file
58 cout<<"Config.C: Creating Run Loader ..."<<endl;
59 rl = AliRunLoader::Open("galice.root",
60 AliConfig::GetDefaultEventFolderName(),
64 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
67 rl->SetCompressionLevel(2);
68 rl->SetNumberOfEventsPerFile(1000);
69 gAlice->SetRunLoader(rl);
70 // gAlice->SetGeometryFromFile("geometry.root");
71 // gAlice->SetGeometryFromCDB();
73 // Set the trigger configuration: proton-proton
74 AliSimulation::Instance()->SetTriggerConfig("p-p");
77 //=======================================================================
78 // ************* STEERING parameters FOR ALICE SIMULATION **************
79 // --- Specify event type to be tracked through the ALICE setup
80 // --- All positions are in cm, angles in degrees, and P and E in GeV
82 TVirtualMC * vmc = TVirtualMC::GetMC();
84 vmc->SetProcess("DCAY",1);
85 vmc->SetProcess("PAIR",1);
86 vmc->SetProcess("COMP",1);
87 vmc->SetProcess("PHOT",1);
88 vmc->SetProcess("PFIS",0);
89 vmc->SetProcess("DRAY",0);
90 vmc->SetProcess("ANNI",1);
91 vmc->SetProcess("BREM",1);
92 vmc->SetProcess("MUNU",1);
93 vmc->SetProcess("CKOV",1);
94 vmc->SetProcess("HADR",1);
95 vmc->SetProcess("LOSS",2);
96 vmc->SetProcess("MULS",1);
97 vmc->SetProcess("RAYL",1);
99 Float_t cut = 1.e-3; // 1MeV cut by default
100 Float_t tofmax = 1.e10;
102 vmc->SetCut("CUTGAM", cut);
103 vmc->SetCut("CUTELE", cut);
104 vmc->SetCut("CUTNEU", cut);
105 vmc->SetCut("CUTHAD", cut);
106 vmc->SetCut("CUTMUO", cut);
107 vmc->SetCut("BCUTE", cut);
108 vmc->SetCut("BCUTM", cut);
109 vmc->SetCut("DCUTE", cut);
110 vmc->SetCut("DCUTM", cut);
111 vmc->SetCut("PPCUTM", cut);
112 vmc->SetCut("TOFMAX", tofmax);
117 //======================//
118 // Set External decayer //
119 //======================//
120 TVirtualMCDecayer* decayer = new AliDecayerPythia();
121 decayer->SetForceDecay(kAll);
123 vmc->SetExternalDecayer(decayer);
125 //=========================//
126 // Generator Configuration //
127 //=========================//
128 // Create pileup generator
129 AliGenPileup *pileup = new AliGenPileup();
131 AliGenerator* gener = 0x0;
133 if (proc == kPythia6) {
135 } else if (proc == kPhojet) {
139 // Set the pileup interaction generator
140 // The second argument is the pileup rate
141 // in terms of event rate per bunch crossing
142 pileup->SetGenerator(gener,0.01);
143 // Set the beam time structure
144 // Details on the syntax in STEER/AliTriggerBCMask
145 pileup->SetBCMask("72(1H1L)3420L");
146 // Examples of the pileup rate and beam structure settings
147 // Most of the information is taken from the LHC commissionning page
148 // rate from 0.01 (at 900GeV) to 0.76 (at 14TeV)
149 // 1 bunch/orbit - bc-mask = "1H3563L"
150 // 43 bunches/orbit - bc-mask = "43(1H80L)81L"
151 // 72 bunches/orbit - bc-mask = "72(1H1L)3420L" (50ns mode)
152 // Please note that most of these setting should be cross-checked because
153 // for example the 43 bunches mode is taken at CMS IP and not the ALICE one.
155 // Generate the trigger interaction
156 pileup->GenerateTrigInteraction(kTRUE);
160 pileup->SetOrigin(0., 0., 0.); // vertex position
163 // Size of the interaction diamond
165 Float_t sigmaz = 5.4 / TMath::Sqrt(2.); // [cm]
167 sigmaz = 10.5 / TMath::Sqrt(2.); // [cm]
170 Float_t betast = 10; // beta* [m]
171 Float_t eps = 3.75e-6; // emittance [m]
172 Float_t gamma = energy / 2.0 / 0.938272; // relativistic gamma [1]
173 Float_t sigmaxy = TMath::Sqrt(eps * betast / gamma) / TMath::Sqrt(2.) * 100.; // [cm]
174 printf("\n \n Diamond size x-y: %10.3e z: %10.3e\n \n", sigmaxy, sigmaz);
176 pileup->SetSigma(sigmaxy, sigmaxy, sigmaz); // Sigma in (X,Y,Z) (cm) on IP position
177 pileup->SetCutVertexZ(3.); // Truncate at 3 sigma
178 pileup->SetVertexSmear(kPerEvent);
184 AliMagF* field = 0x0;
185 if (mag == kNoField) {
186 comment = comment.Append(" | L3 field 0.0 T");
187 field = new AliMagF("Maps","Maps", 0., 0., AliMagF::k5kGUniform);
188 } else if (mag == k5kG) {
189 comment = comment.Append(" | L3 field 0.5 T");
190 field = new AliMagF("Maps","Maps", -1., -1., AliMagF::k5kG);
192 printf("\n \n Comment: %s \n \n", comment.Data());
193 TGeoGlobalMagField::Instance()->SetField(field);
220 //=================== Alice BODY parameters =============================
221 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
226 //=================== MAG parameters ============================
227 // --- Start with Magnet since detector layouts may be depending ---
228 // --- on the selected Magnet dimensions ---
229 AliMAG *MAG = new AliMAG("MAG", "Magnet");
235 //=================== ABSO parameters ============================
236 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
241 //=================== DIPO parameters ============================
243 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
248 //=================== HALL parameters ============================
250 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
256 //=================== FRAME parameters ============================
258 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
264 //=================== SHIL parameters ============================
266 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
272 //=================== PIPE parameters ============================
274 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
279 //=================== ITS parameters ============================
281 AliITS *ITS = new AliITSv11("ITS","ITS v11");
286 //============================ TPC parameters =====================
288 AliTPC *TPC = new AliTPCv2("TPC", "Default");
293 //=================== TOF parameters ============================
295 AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
301 //=================== HMPID parameters ===========================
303 AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
310 //=================== ZDC parameters ============================
312 AliZDC *ZDC = new AliZDCv4("ZDC", "normal ZDC");
317 //=================== TRD parameters ============================
319 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
320 AliTRDgeometry *geoTRD = TRD->GetGeometry();
321 // Partial geometry: modules at 0,1,7,8,9,10,17
322 // starting at 3h in positive direction
323 geoTRD->SetSMstatus(2,0);
324 geoTRD->SetSMstatus(3,0);
325 geoTRD->SetSMstatus(4,0);
326 geoTRD->SetSMstatus(5,0);
327 geoTRD->SetSMstatus(6,0);
328 geoTRD->SetSMstatus(11,0);
329 geoTRD->SetSMstatus(12,0);
330 geoTRD->SetSMstatus(13,0);
331 geoTRD->SetSMstatus(14,0);
332 geoTRD->SetSMstatus(15,0);
333 geoTRD->SetSMstatus(16,0);
338 //=================== FMD parameters ============================
340 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
345 //=================== MUON parameters ===========================
346 // New MUONv1 version (geometry defined via builders)
348 AliMUON *MUON = new AliMUONv1("MUON", "default");
353 //=================== PHOS parameters ===========================
355 AliPHOS *PHOS = new AliPHOSv1("PHOS", "noCPV_Modules123");
361 //=================== PMD parameters ============================
363 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
368 //=================== T0 parameters ============================
369 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
374 //=================== EMCAL parameters ============================
376 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_FIRSTYEAR");
381 //=================== ACORDE parameters ============================
383 AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
388 //=================== ACORDE parameters ============================
390 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
397 AliGenerator* MbPythia()
399 comment = comment.Append(" pp at 14 TeV: Pythia low-pt");
402 AliGenPythia* pythia = new AliGenPythia(-1);
403 pythia->SetMomentumRange(0, 999999.);
404 pythia->SetThetaRange(0., 180.);
405 pythia->SetYRange(-12.,12.);
406 pythia->SetPtRange(0,1000.);
407 pythia->SetProcess(kPyMb);
408 pythia->SetEnergyCMS(energy);
413 AliGenerator* MbPhojet()
415 comment = comment.Append(" pp at 14 TeV: Pythia low-pt");
418 AliGenDPMjet* dpmjet = new AliGenDPMjet(-1);
419 dpmjet->SetMomentumRange(0, 999999.);
420 dpmjet->SetThetaRange(0., 180.);
421 dpmjet->SetYRange(-12.,12.);
422 dpmjet->SetPtRange(0,1000.);
423 dpmjet->SetProcess(kDpmMb);
424 dpmjet->SetEnergyCMS(energy);
429 void ProcessEnvironmentVars()
432 if (gSystem->Getenv("CONFIG_RUN_TYPE")) {
433 for (Int_t iRun = 0; iRun < kRunMax; iRun++) {
434 if (strcmp(gSystem->Getenv("CONFIG_RUN_TYPE"), pprRunName[iRun])==0) {
435 proc = (PDC06Proc_t)iRun;
436 cout<<"Run type set to "<<pprRunName[iRun]<<endl;
442 if (gSystem->Getenv("CONFIG_FIELD")) {
443 for (Int_t iField = 0; iField < kFieldMax; iField++) {
444 if (strcmp(gSystem->Getenv("CONFIG_FIELD"), pprField[iField])==0) {
446 cout<<"Field set to "<<pprField[iField]<<endl;
452 if (gSystem->Getenv("CONFIG_ENERGY")) {
453 energy = atoi(gSystem->Getenv("CONFIG_ENERGY"));
454 cout<<"Energy set to "<<energy<<" GeV"<<endl;
457 // Random Number seed
458 if (gSystem->Getenv("CONFIG_SEED")) {
459 seed = atoi(gSystem->Getenv("CONFIG_SEED"));