]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/testMC/ConfigCosmicField05.C
doxy: TPC/testMC converted
[u/mrichter/AliRoot.git] / TPC / testMC / ConfigCosmicField05.C
CommitLineData
d37e991a 1/// \file ConfigCosmicField05.C
2/// One can use the configuration macro in compiled mode by
3/// ~~~
4/// root [0] gSystem->Load("libgeant321");
5/// root [0] gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include\
6/// -I$ALICE_ROOT -I$ALICE/geant3/TGeant3");
7/// root [0] .x grun.C(1,"Config.C++")
8/// ~~~
7f47f7fe 9
10#if !defined(__CINT__) || defined(__MAKECINT__)
11#include <Riostream.h>
12#include <TPDGCode.h>
13#include <TRandom.h>
14#include <TSystem.h>
15#include <TVirtualMC.h>
16#include <TGeant3TGeo.h>
17#include "STEER/AliRunLoader.h"
18#include "STEER/AliRun.h"
19#include "STEER/AliConfig.h"
20#include "PYTHIA6/AliDecayerPythia.h"
21#include "EVGEN/AliGenCocktail.h"
22#include "EVGEN/AliGenHIJINGpara.h"
23#include "STEER/AliMagF.h"
24#include "STRUCT/AliBODY.h"
25#include "STRUCT/AliMAG.h"
26#include "STRUCT/AliABSOv3.h"
27#include "STRUCT/AliDIPOv3.h"
28#include "STRUCT/AliHALLv3.h"
29#include "STRUCT/AliFRAMEv2.h"
30#include "STRUCT/AliSHILv3.h"
31#include "STRUCT/AliPIPEv3.h"
3a5fcc75 32#include "ITS/AliITSv11.h"
7f47f7fe 33#include "TPC/AliTPCv2.h"
34#include "TOF/AliTOFv6T0.h"
35#include "HMPID/AliHMPIDv3.h"
36#include "ZDC/AliZDCv3.h"
37#include "TRD/AliTRDv1.h"
38#include "FMD/AliFMDv1.h"
39#include "MUON/AliMUONv1.h"
40#include "PHOS/AliPHOSv1.h"
41#include "PMD/AliPMDv1.h"
42#include "T0/AliT0v1.h"
43#include "EMCAL/AliEMCALv2.h"
44#include "ACORDE/AliACORDEv1.h"
45#include "VZERO/AliVZEROv7.h"
46#include "EVGEN/AliGenCosmicsParam.h"
47
48#endif
49
50Float_t EtaToTheta(Float_t arg);
51void LoadPythia();
52
53
54void Config()
55{
d37e991a 56 /// ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
57 /// Theta range given through pseudorapidity limits 22/6/2001
7f47f7fe 58
59 // Set Random Number seed
8e575b2e 60 gRandom->SetSeed(0); // Set 0 to use the current time
7f47f7fe 61
62 AliLog::Message(AliLog::kInfo, Form("Seed for random number generation = %d",gRandom->GetSeed()), "Config.C", "Config.C", "Config()","Config.C", __LINE__);
63
64 // Load Pythia libraries
65 LoadPythia();
66 // Libraries required by geant321
67#if defined(__CINT__)
68 gSystem->Load("libgeant321");
69#endif
70
71 new TGeant3TGeo("C++ Interface to Geant3");
72
73 AliRunLoader* rl=0x0;
74
75 AliLog::Message(AliLog::kInfo, "Creating Run Loader", "Config.C", "Config.C", "Config()"," Config.C", __LINE__);
76
77 rl = AliRunLoader::Open("galice.root",
78 AliConfig::GetDefaultEventFolderName(),
79 "recreate");
80 if (rl == 0x0)
81 {
82 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
83 return;
84 }
85 rl->SetCompressionLevel(2);
86 rl->SetNumberOfEventsPerFile(3);
87 gAlice->SetRunLoader(rl);
88
89 // gAlice->SetGeometryFromFile("geometry.root");
90
91 // Uncomment if you want to load geometry from OCDB! >>>>
92/*
93 if(!AliCDBManager::Instance()->IsDefaultStorageSet()){
94 cout << "#####################################################" << endl;
95 cout << "# #" << endl;
96 cout << "# WARNING: CDB DEFAULT STORAGE NOT SET !!! #" << endl;
97 cout << "# SETTING IT TO local://$ALICE_ROOT/OCDB !!! #" << endl;
98 cout << "# #" << endl;
99 cout << "#####################################################" << endl;
100
101 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
102 }
103
104 if(AliCDBManager::Instance()->GetRun() < 0){
105 cout << "#####################################################" << endl;
106 cout << "# #" << endl;
107 cout << "# WARNING: RUN NUMBER NOT SET !!! #" << endl;
108 cout << "# SETTING IT TO 0 !!! #" << endl;
109 cout << "# #" << endl;
110 cout << "#####################################################" << endl;
111
112 AliCDBManager::Instance()->SetRun(0);
113 }
114 gAlice->SetGeometryFromCDB();
115*/
116 // Uncomment if you want to load geometry from OCDB! <<<<
117
118 // Set the trigger configuration
28da60d3 119 AliSimulation::Instance()->SetTriggerConfig("Pb-Pb");
7f47f7fe 120 cout<<"Trigger configuration is set to Pb-Pb"<<endl;
121
122 //
123 // Set External decayer
124 TVirtualMCDecayer *decayer = new AliDecayerPythia();
125
126 decayer->SetForceDecay(kAll);
127 decayer->Init();
128 gMC->SetExternalDecayer(decayer);
129 //=======================================================================
130 // ************* STEERING parameters FOR ALICE SIMULATION **************
131 // --- Specify event type to be tracked through the ALICE setup
132 // --- All positions are in cm, angles in degrees, and P and E in GeV
133
134
135 gMC->SetProcess("DCAY",1);
136 gMC->SetProcess("PAIR",1);
137 gMC->SetProcess("COMP",1);
138 gMC->SetProcess("PHOT",1);
139 gMC->SetProcess("PFIS",0);
140 gMC->SetProcess("DRAY",0);
141 gMC->SetProcess("ANNI",1);
142 gMC->SetProcess("BREM",1);
143 gMC->SetProcess("MUNU",1);
144 gMC->SetProcess("CKOV",1);
145 gMC->SetProcess("HADR",1);
146 gMC->SetProcess("LOSS",2);
147 gMC->SetProcess("MULS",1);
148 gMC->SetProcess("RAYL",1);
149
150 Float_t cut = 1.e-3; // 1MeV cut by default
151 Float_t tofmax = 1.e10;
152
153 gMC->SetCut("CUTGAM", cut);
154 gMC->SetCut("CUTELE", cut);
155 gMC->SetCut("CUTNEU", cut);
156 gMC->SetCut("CUTHAD", cut);
157 gMC->SetCut("CUTMUO", cut);
158 gMC->SetCut("BCUTE", cut);
159 gMC->SetCut("BCUTM", cut);
160 gMC->SetCut("DCUTE", cut);
161 gMC->SetCut("DCUTM", cut);
162 gMC->SetCut("PPCUTM", cut);
163 gMC->SetCut("TOFMAX", tofmax);
164
165
166 int nParticles = 100;
167 if (gSystem->Getenv("CONFIG_NPARTICLES"))
168 {
169 nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
170 }
171
172 AliGenCosmicsParam *gener = new AliGenCosmicsParam();
8e575b2e 173 gener->SetNumberParticles(20);
7f47f7fe 174 gener->SetParamACORDE();
175 gener->SetYOrigin(900.); // above ACORDE
176 gener->SetMomentumRange(0.2,100.);
8e575b2e 177 gener->SetMaxAngleWRTVertical(3.1415/4);
7f47f7fe 178 gener->SetInTPC(); // "acceptance trigger"
179 gener->SetBkG(0.); // needed for "acceptance trigger"
180 gener->Init();
181
182
183 //
184 // Activate this line if you want the vertex smearing to happen
185 // track by track
186 //
187 //gener->SetVertexSmear(perTrack);
188 // Field (L3 0.4 T)
4642ac4b 189 TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 1., 1., AliMagF::k5kG));
190 //TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 0., 0., AliMagF::k5kG));
7f47f7fe 191
192 Int_t iABSO = 1;
193 Int_t iDIPO = 1;
194 Int_t iFMD = 0;
195 Int_t iFRAME = 1;
196 Int_t iHALL = 1;
197 Int_t iITS = 1;
198 Int_t iMAG = 1;
199 Int_t iMUON = 0;
200 Int_t iPHOS = 0;
201 Int_t iPIPE = 1;
202 Int_t iPMD = 0;
203 Int_t iHMPID = 0;
204 Int_t iSHIL = 1;
205 Int_t iT0 = 0;
206 Int_t iTOF = 1;
207 Int_t iTPC = 1;
208 Int_t iTRD = 1;
209 Int_t iZDC = 0;
210 Int_t iEMCAL = 0;
211 Int_t iACORDE = 1;
212 Int_t iVZERO = 1;
213 rl->CdGAFile();
214 //=================== Alice BODY parameters =============================
215 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
216
217 if (iMAG)
218 {
219 //=================== MAG parameters ============================
220 // --- Start with Magnet since detector layouts may be depending ---
221 // --- on the selected Magnet dimensions ---
222 AliMAG *MAG = new AliMAG("MAG", "Magnet");
223 }
224
225
226 if (iABSO)
227 {
228 //=================== ABSO parameters ============================
229 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
230 }
231
232 if (iDIPO)
233 {
234 //=================== DIPO parameters ============================
235
236 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
237 }
238
239 if (iHALL)
240 {
241 //=================== HALL parameters ============================
242
243 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
244 }
245
246
247 if (iFRAME)
248 {
249 //=================== FRAME parameters ============================
250
251 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
252 FRAME->SetHoles(1);
253 }
254
255 if (iSHIL)
256 {
257 //=================== SHIL parameters ============================
258
259 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
260 }
261
262
263 if (iPIPE)
264 {
265 //=================== PIPE parameters ============================
266
267 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
268 }
269
270 if (iITS)
271 {
272 //=================== ITS parameters ============================
273
3a5fcc75 274 AliITS *ITS = new AliITSv11("ITS","ITS v11");
7f47f7fe 275 }
276
277 if (iTPC)
278 {
279 //============================ TPC parameters ===================
280 AliTPC *TPC = new AliTPCv2("TPC", "Default");
281 }
282
283
284 if (iTOF) {
285 //=================== TOF parameters ============================
286 AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
287 }
288
289
290 if (iHMPID)
291 {
292 //=================== HMPID parameters ===========================
293 AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
294
295 }
296
297
298 if (iZDC)
299 {
300 //=================== ZDC parameters ============================
301
302 AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
303 }
304
305 if (iTRD)
306 {
307 //=================== TRD parameters ============================
308
309 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
310 }
311
312 if (iFMD)
313 {
314 //=================== FMD parameters ============================
315 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
316 }
317
318 if (iMUON)
319 {
320 //=================== MUON parameters ===========================
321 // New MUONv1 version (geometry defined via builders)
322 AliMUON *MUON = new AliMUONv1("MUON", "default");
323 }
324 //=================== PHOS parameters ===========================
325
326 if (iPHOS)
327 {
328 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
329 }
330
331
332 if (iPMD)
333 {
334 //=================== PMD parameters ============================
335 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
336 }
337
338 if (iT0)
339 {
340 //=================== T0 parameters ============================
341 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
342 }
343
344 if (iEMCAL)
345 {
346 //=================== EMCAL parameters ============================
347 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETE");
348 }
349
350 if (iACORDE)
351 {
352 //=================== ACORDE parameters ============================
353 AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
354 }
355
356 if (iVZERO)
357 {
358 //=================== VZERO parameters ============================
359 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
360 }
361
362 AliLog::Message(AliLog::kInfo, "End of Config", "Config.C", "Config.C", "Config()"," Config.C", __LINE__);
363
364}
365
366Float_t EtaToTheta(Float_t arg){
367 return (180./TMath::Pi())*2.*atan(exp(-arg));
368}
369
370
371void LoadPythia()
372{
d37e991a 373 /// Load Pythia related libraries
374
b0635849 375 gSystem->Load("liblhapdf"); // Parton density functions
376 gSystem->Load("libEGPythia6"); // TGenerator interface
377 gSystem->Load("libpythia6"); // Pythia
378 gSystem->Load("libAliPythia6"); // ALICE specific implementations
7f47f7fe 379}