]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STARLIGHT/test/Config_.C
fix in calling of gaussian spread function
[u/mrichter/AliRoot.git] / STARLIGHT / test / Config_.C
CommitLineData
da32329d
AM
1//Configuration of simulation
2
3enum PprRun_t
4{
5 kSTARLIGHT,
6 kRunMax
7};
8
9const char* pprRunName[] = {
10 "kSTARLIGHT"
11};
12
13enum PprTrigConf_t
14{
15 kDefaultPPTrig, kDefaultPbPbTrig
16};
17
18const char * pprTrigConfName[] = {
19 "p-p","Pb-Pb"
20};
21
22// This part for configuration
23
24static PprRun_t srun = kSTARLIGHT;
25static AliMagF::BMap_t smag = AliMagF::k5kG;
26static Int_t sseed = 12345; //Set 0 to use the current time
27static PprTrigConf_t strig = kDefaultPPTrig; // default pp trigger configuration
28
29// Comment line
30static TString comment;
31
32// Functions
33Float_t EtaToTheta(Float_t arg);
34void ProcessEnvironmentVars();
35
36void Config()
37{
38 // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
39 // Theta range given through pseudorapidity limits 22/6/2001
40
41 // Get settings from environment variables
42 ProcessEnvironmentVars();
43
44 // Set Random Number seed
45 gRandom->SetSeed(sseed);
46 cout<<"Seed for random number generation= "<<gRandom->GetSeed()<<endl;
47
48
49 // libraries required by geant321 and Pythia: loaded in sim.C
50
51 new TGeant3TGeo("C++ Interface to Geant3");
52
53 // Output every 100 tracks
54
55 TVirtualMC * vmc = TVirtualMC::GetMC();
56
57// ((TGeant3*)vmc)->SetSWIT(4,100);
58
59 AliRunLoader* rl=0x0;
60
61 AliLog::Message(AliLog::kInfo, "Creating Run Loader", "", "", "Config()"," ConfigPPR.C", __LINE__);
62
63 rl = AliRunLoader::Open("galice.root",
64 AliConfig::GetDefaultEventFolderName(),
65 "recreate");
66 if (rl == 0x0)
67 {
68 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
69 return;
70 }
71 rl->SetCompressionLevel(2);
72 rl->SetNumberOfEventsPerFile(100);
73 gAlice->SetRunLoader(rl);
74
75 // Set the trigger configuration
76 AliSimulation::Instance()->SetTriggerConfig(pprTrigConfName[strig]);
77 cout<<"Trigger configuration is set to "<<pprTrigConfName[strig]<<endl;
78
79 //
80 // Set External decayer
81 AliDecayer *decayer = new AliDecayerPythia();
82
83 decayer->Init();
84 vmc->SetExternalDecayer(decayer);
85 //
86 //
87 //=======================================================================
88 //
89 //=======================================================================
90 // ************* STEERING parameters FOR ALICE SIMULATION **************
91 // --- Specify event type to be tracked through the ALICE setup
92 // --- All positions are in cm, angles in degrees, and P and E in GeV
93
94 vmc->SetProcess("DCAY",1);
95 vmc->SetProcess("PAIR",1);
96 vmc->SetProcess("COMP",1);
97 vmc->SetProcess("PHOT",1);
98 vmc->SetProcess("PFIS",0);
99 vmc->SetProcess("DRAY",0);
100 vmc->SetProcess("ANNI",1);
101 vmc->SetProcess("BREM",1);
102 vmc->SetProcess("MUNU",1);
103 vmc->SetProcess("CKOV",1);
104 vmc->SetProcess("HADR",1);
105 vmc->SetProcess("LOSS",2);
106 vmc->SetProcess("MULS",1);
107 vmc->SetProcess("RAYL",1);
108
109 Float_t cut = 1.e-3; // 1MeV cut by default
110 Float_t tofmax = 1.e10;
111
112 vmc->SetCut("CUTGAM", cut);
113 vmc->SetCut("CUTELE", cut);
114 vmc->SetCut("CUTNEU", cut);
115 vmc->SetCut("CUTHAD", cut);
116 vmc->SetCut("CUTMUO", cut);
117 vmc->SetCut("BCUTE", cut);
118 vmc->SetCut("BCUTM", cut);
119 vmc->SetCut("DCUTE", cut);
120 vmc->SetCut("DCUTM", cut);
121 vmc->SetCut("PPCUTM", cut);
122 vmc->SetCut("TOFMAX", tofmax);
123
124 // Generator Configuration
125 gSystem->AddDynamicPath("../../objdir/lib/tgt_linux");
126 gSystem->Load("libStarLight");
127 gSystem->Load("libAliStarLight.so");
128
129 AliGenStarLight* sl = new AliGenStarLight(1000*1000);
130
131 sl->SetParameter("BEAM_1_Z = 82 #Z of projectile");
132 sl->SetParameter("BEAM_1_A = 208 #A of projectile");
133 sl->SetParameter("BEAM_2_Z = 82 #Z of target");
134 sl->SetParameter("BEAM_2_A = 208 #A of target");
135 sl->SetParameter("BEAM_1_GAMMA = 1470 #Gamma of the colliding ions");
136 sl->SetParameter("BEAM_2_GAMMA = 1470 #Gamma of the colliding ions");
137 sl->SetParameter("W_MAX = 12.0 #Max value of w");
138 sl->SetParameter("W_MIN = 2.0 #Min value of w");
139 sl->SetParameter("W_N_BINS = 40 #Bins i w");
140 sl->SetParameter("RAP_MAX = 8. #max y");
141 sl->SetParameter("RAP_N_BINS = 80 #Bins i y");
142 sl->SetParameter("CUT_PT = 0 #Cut in pT? 0 = (no, 1 = yes)");
143 sl->SetParameter("PT_MIN = 1.0 #Minimum pT in GeV");
144 sl->SetParameter("PT_MAX = 3.0 #Maximum pT in GeV");
145 sl->SetParameter("CUT_ETA = 0 #Cut in pseudorapidity? (0 = no, 1 = yes)");
146 sl->SetParameter("ETA_MIN = -10 #Minimum pseudorapidity");
147 sl->SetParameter("ETA_MAX = 10 #Maximum pseudorapidity");
148 sl->SetParameter("PROD_MODE = 2 #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 )");
149 // is N_EVENTS valid
150 sl->SetParameter("N_EVENTS = 10000000 #Number of events");
151 sl->SetParameter("PROD_PID = 113 #Channel of interest (not relevant for photonuclear processes)");
152 sl->SetParameter(Form("RND_SEED = %d #Random number seed", sseed));
153 sl->SetParameter("OUTPUT_FORMAT = 2 #Form of the output");
154 sl->SetParameter("BREAKUP_MODE = 5 #Controls the nuclear breakup");
155 sl->SetParameter("INTERFERENCE = 0 #Interference (0 = off, 1 = on)");
156 sl->SetParameter("IF_STRENGTH = 1. #% of intefernce (0.0 - 0.1)");
157 sl->SetParameter("COHERENT = 1 #Coherent=1,Incoherent=0");
158 sl->SetParameter("INCO_FACTOR = 1. #percentage of incoherence");
159 sl->SetParameter("BFORD = 9.5 #");
160 sl->SetParameter("INT_PT_MAX = 0.24 #Maximum pt considered, when interference is turned on");
161 sl->SetParameter("INT_PT_N_BINS = 120 #Number of pt bins when interference is turned on");
162
163 sl->Init();
164 sl->GetTStarLight()->PrintInputs(std::cout);
165
166 AliGenerator* gener = sl;
167 gener->SetOrigin(0, 0, 0); // vertex position
168 gener->SetSigma(0, 0, 5.3); // Sigma in (X,Y,Z) (cm) on IP position
169 gener->SetCutVertexZ(1.); // Truncate at 1 sigma
170 gener->SetVertexSmear(kPerEvent);
171 gener->SetTrackingFlag(1);
172 gener->Init();
173
174 if (smag == AliMagF::k2kG) {
175 comment = comment.Append(" | L3 field 0.2 T");
176 } else if (smag == AliMagF::k5kG) {
177 comment = comment.Append(" | L3 field 0.5 T");
178 }
179
180
181 printf("\n \n Comment: %s \n \n", comment.Data());
182
183
184// Field
185 TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", -1., -1., smag));
186
187 rl->CdGAFile();
188//
189 Int_t iABSO = 1;
190 Int_t iDIPO = 1;
191 Int_t iFMD = 1;
192 Int_t iFRAME = 1;
193 Int_t iHALL = 1;
194 Int_t iITS = 1;
195 Int_t iMAG = 1;
196 Int_t iMUON = 1;
197 Int_t iPHOS = 1;
198 Int_t iPIPE = 1;
199 Int_t iPMD = 1;
200 Int_t iHMPID = 1;
201 Int_t iSHIL = 1;
202 Int_t iT0 = 1;
203 Int_t iTOF = 1;
204 Int_t iTPC = 1;
205 Int_t iTRD = 1;
206 Int_t iZDC = 1;
207 Int_t iEMCAL = 1;
208 Int_t iVZERO = 1;
209 Int_t iACORDE = 1;
210
211 //=================== Alice BODY parameters =============================
212 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
213
214
215 if (iMAG)
216 {
217 //=================== MAG parameters ============================
218 // --- Start with Magnet since detector layouts may be depending ---
219 // --- on the selected Magnet dimensions ---
220 AliMAG *MAG = new AliMAG("MAG", "Magnet");
221 }
222
223
224 if (iABSO)
225 {
226 //=================== ABSO parameters ============================
227 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
228 }
229
230 if (iDIPO)
231 {
232 //=================== DIPO parameters ============================
233
234 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
235 }
236
237 if (iHALL)
238 {
239 //=================== HALL parameters ============================
240
241 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
242 }
243
244
245 if (iFRAME)
246 {
247 //=================== FRAME parameters ============================
248
249 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
250 FRAME->SetHoles(1);
251 }
252
253 if (iSHIL)
254 {
255 //=================== SHIL parameters ============================
256
257 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
258 }
259
260
261 if (iPIPE)
262 {
263 //=================== PIPE parameters ============================
264
265 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
266 }
267
268 if (iITS)
269 {
270 //=================== ITS parameters ============================
271
272 AliITS *ITS = new AliITSv11("ITS","ITS v11");
273 }
274
275 if (iTPC)
276 {
277 //============================ TPC parameters =====================
278 AliTPC *TPC = new AliTPCv2("TPC", "Default");
279 }
280
281
282 if (iTOF) {
283 //=================== TOF parameters ============================
284 AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
285 }
286
287
288 if (iHMPID)
289 {
290 //=================== HMPID parameters ===========================
291 AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
292
293 }
294
295
296 if (iZDC)
297 {
298 //=================== ZDC parameters ============================
299
300 AliZDC *ZDC = new AliZDCv4("ZDC", "normal ZDC");
301 }
302
303 if (iTRD)
304 {
305 //=================== TRD parameters ============================
306
307 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
308 }
309
310 if (iFMD)
311 {
312 //=================== FMD parameters ============================
313 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
314 }
315
316 if (iMUON)
317 {
318 //=================== MUON parameters ===========================
319 // New MUONv1 version (geometry defined via builders)
320 AliMUON *MUON = new AliMUONv1("MUON", "default");
321 }
322 //=================== PHOS parameters ===========================
323
324 if (iPHOS)
325 {
326 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
327 }
328
329
330 if (iPMD)
331 {
332 //=================== PMD parameters ============================
333 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
334 }
335
336 if (iT0)
337 {
338 //=================== T0 parameters ============================
339 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
340 }
341
342 if (iEMCAL)
343 {
344 //=================== EMCAL parameters ============================
345 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETEV1");
346 }
347
348 if (iACORDE)
349 {
350 //=================== ACORDE parameters ============================
351 AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
352 }
353
354 if (iVZERO)
355 {
356 //=================== VZERO parameters ============================
357 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
358 }
359
360
361}
362
363Float_t EtaToTheta(Float_t arg){
364 return (180./TMath::Pi())*2.*atan(exp(-arg));
365}
366
367
368void ProcessEnvironmentVars()
369{
370 // Run type
371 if (gSystem->Getenv("CONFIG_RUN_TYPE")) {
372 for (Int_t iRun = 0; iRun < kRunMax; iRun++) {
373 if (strcmp(gSystem->Getenv("CONFIG_RUN_TYPE"), pprRunName[iRun])==0) {
374 srun = (PprRun_t)iRun;
375 cout<<"Run type set to "<<pprRunName[iRun]<<endl;
376 }
377 }
378 }
379
380 // Random Number seed
381 if (gSystem->Getenv("CONFIG_SEED")) {
382 sseed = atoi(gSystem->Getenv("CONFIG_SEED"));
383 }
384}