]> git.uio.no Git - u/mrichter/AliRoot.git/blame - macros/g4ConfigCommon.C
Use PDG code incude
[u/mrichter/AliRoot.git] / macros / g4ConfigCommon.C
CommitLineData
1fccbbe0 1// $Id$
2//
3// AliRoot Configuration for running aliroot with Monte Carlo.
4// Called from g4Config.C
e14b4d5a 5//
6// By I. Hrivnacova, IPN Orsay
7
8enum PprGeo_t
9 {
10 kHoles, kNoHoles
11 };
12static PprGeo_t geo = kHoles;
1fccbbe0 13
913c1adf 14Float_t EtaToTheta(Float_t arg);
e14b4d5a 15void LoadPythia();
9ac91a91 16static Int_t eventsPerRun = 50;
1fccbbe0 17
e14b4d5a 18void ConfigCommon(Bool_t setRootGeometry = kTRUE)
1fccbbe0 19{
e14b4d5a 20 cout << "Running ConfigCommon.C ... " << endl;
21
22 // Load Pythia libraries
23 LoadPythia();
1fccbbe0 24
25 // Create the output file
913c1adf 26 AliRunLoader* rl = 0;
27 rl = AliRunLoader::Open("galice.root",
f5a857b2 28 AliConfig::GetDefaultEventFolderName(),
913c1adf 29 "recreate");
30 if (!rl) {
31 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
32 return;
33 }
34 rl->SetCompressionLevel(2);
35 rl->SetNumberOfEventsPerFile(3);
36 gAlice->SetRunLoader(rl);
e14b4d5a 37
38 // Set Root geometry file
39 //
40 if ( setRootGeometry ) {
41 gAlice->SetRootGeometry();
42 gAlice->SetGeometryFromFile("geometry.root");
43 }
9ac91a91 44
45 // Set the trigger configuration
46 gAlice->SetTriggerDescriptor("Pb-Pb");
47 cout<<"Trigger configuration is set to Pb-Pb"<<endl;
48
49 // Set Random Number seed
50 gRandom->SetSeed(123456); // Set 0 to use the currecnt time
51 AliLog::Message(AliLog::kInfo, Form("Seed for random number generation = %d",gRandom->GetSeed()), "Config.C", "Config.C", "Config()","Config.C", __LINE__);
e14b4d5a 52 int nParticles = 100;
9ac91a91 53 if (gSystem->Getenv("CONFIG_NPARTICLES"))
54 {
55 nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
56 }
1fccbbe0 57
9ac91a91 58 AliGenCocktail *gener = new AliGenCocktail();
59 gener->SetPhiRange(0, 360);
60 // Set pseudorapidity range from -8 to 8.
61 Float_t thmin = EtaToTheta(8); // theta min. <---> eta max
62 Float_t thmax = EtaToTheta(-8); // theta max. <---> eta min
63 gener->SetThetaRange(thmin,thmax);
64 gener->SetOrigin(0, 0, 0); //vertex position
65 gener->SetSigma(0, 0, 0); //Sigma in (X,Y,Z) (cm) on IP position
66
67 AliGenHIJINGpara *hijingparam = new AliGenHIJINGpara(nParticles);
68 hijingparam->SetMomentumRange(0.2, 999);
69 gener->AddGenerator(hijingparam,"HIJING PARAM",1);
70 gener->Init();
71
72 //
73 // Activate this line if you want the vertex smearing to happen
74 // track by track
75 //
76 //gener->SetVertexSmear(perTrack);
1fccbbe0 77
78 // =============================
79 // Magnetic field
80 // =============================
81
9ac91a91 82 // Field (L3 0.4 T)
83 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
84 gAlice->SetField(field);
85
86 Int_t iABSO = 1;
87 Int_t iDIPO = 1;
88 Int_t iFMD = 1;
89 Int_t iFRAME = 1;
90 Int_t iHALL = 1;
91 Int_t iITS = 1;
92 Int_t iMAG = 1;
93 Int_t iMUON = 1;
94 Int_t iPHOS = 1;
95 Int_t iPIPE = 1;
96 Int_t iPMD = 1;
97 Int_t iHMPID = 1;
98 Int_t iSHIL = 1;
99 Int_t iT0 = 1;
100 Int_t iTOF = 1;
101 Int_t iTPC = 1;
102 Int_t iTRD = 1;
103 Int_t iZDC = 1;
104 Int_t iEMCAL = 1;
105 Int_t iACORDE = 0;
106 Int_t iVZERO = 1;
e14b4d5a 107/*
108 Int_t iABSO = 0;
109 Int_t iDIPO = 0;
110 Int_t iFMD = 0;
111 Int_t iFRAME = 0;
112 Int_t iHALL = 0;
113 Int_t iITS = 0;
114 Int_t iMAG = 0;
115 Int_t iMUON = 0;
116 Int_t iPHOS = 0;
117 Int_t iPIPE = 0;
118 Int_t iPMD = 0;
119 Int_t iHMPID = 0;
120 Int_t iSHIL = 0;
121 Int_t iT0 = 0;
122 Int_t iTOF = 0;
123 Int_t iTPC = 1;
124 Int_t iTRD = 0;
125 Int_t iZDC = 0;
126 Int_t iEMCAL = 0;
127 Int_t iACORDE = 0;
128 Int_t iVZERO = 0;
129*/
130// Exluded for problems
9ac91a91 131
132 rl->CdGAFile();
1fccbbe0 133 //=================== Alice BODY parameters =============================
134 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
135
1fccbbe0 136 if (iMAG)
137 {
138 //=================== MAG parameters ============================
139 // --- Start with Magnet since detector layouts may be depending ---
140 // --- on the selected Magnet dimensions ---
141 AliMAG *MAG = new AliMAG("MAG", "Magnet");
142 }
143
144
145 if (iABSO)
146 {
147 //=================== ABSO parameters ============================
9ac91a91 148 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
1fccbbe0 149 }
150
151 if (iDIPO)
152 {
153 //=================== DIPO parameters ============================
154
9ac91a91 155 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
1fccbbe0 156 }
157
158 if (iHALL)
159 {
160 //=================== HALL parameters ============================
161
9ac91a91 162 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
1fccbbe0 163 }
164
165
166 if (iFRAME)
167 {
168 //=================== FRAME parameters ============================
169
170 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
e14b4d5a 171 if (geo == kHoles) {
172 FRAME->SetHoles(1);
173 } else {
174 FRAME->SetHoles(0);
175 }
1fccbbe0 176 }
177
178 if (iSHIL)
179 {
180 //=================== SHIL parameters ============================
181
9ac91a91 182 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
1fccbbe0 183 }
184
185
186 if (iPIPE)
187 {
188 //=================== PIPE parameters ============================
189
9ac91a91 190 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
1fccbbe0 191 }
192
e14b4d5a 193 if (iITS)
194 {
195 //=================== ITS parameters ============================
9ac91a91 196
e14b4d5a 197 AliITS *ITS = new AliITSv11Hybrid("ITS","ITS v11Hybrid");
9ac91a91 198 }
1fccbbe0 199
200 if (iTPC)
201 {
26ca4b4a 202 //============================ TPC parameters ===================
1fccbbe0 203 AliTPC *TPC = new AliTPCv2("TPC", "Default");
1fccbbe0 204 }
205
9ac91a91 206
207 if (iTOF) {
1fccbbe0 208 //=================== TOF parameters ============================
0d7ef405 209 AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
1fccbbe0 210 }
211
9ac91a91 212
de1857bb 213 if (iHMPID)
1fccbbe0 214 {
de1857bb 215 //=================== HMPID parameters ===========================
e14b4d5a 216 AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
9ac91a91 217
1fccbbe0 218 }
219
220
221 if (iZDC)
222 {
223 //=================== ZDC parameters ============================
224
9d07603a 225 AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
1fccbbe0 226 }
227
228 if (iTRD)
229 {
230 //=================== TRD parameters ============================
231
232 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
1fccbbe0 233 }
234
235 if (iFMD)
236 {
237 //=================== FMD parameters ============================
9ac91a91 238 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
239 }
1fccbbe0 240
241 if (iMUON)
242 {
243 //=================== MUON parameters ===========================
9ac91a91 244 // New MUONv1 version (geometry defined via builders)
1fccbbe0 245 AliMUON *MUON = new AliMUONv1("MUON", "default");
246 }
247 //=================== PHOS parameters ===========================
248
249 if (iPHOS)
250 {
9cc36300 251 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
1fccbbe0 252 }
253
254
255 if (iPMD)
256 {
257 //=================== PMD parameters ============================
258 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
259 }
260
ababa197 261 if (iT0)
1fccbbe0 262 {
ababa197 263 //=================== T0 parameters ============================
264 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
1fccbbe0 265 }
266
267 if (iEMCAL)
268 {
269 //=================== EMCAL parameters ============================
e14b4d5a 270 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETE");
1fccbbe0 271 }
272
9ac91a91 273 if (iACORDE)
1fccbbe0 274 {
b384f8a4 275 //=================== ACORDE parameters ============================
f7882672 276 AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
1fccbbe0 277 }
278
9ac91a91 279 if (iVZERO)
1fccbbe0 280 {
b384f8a4 281 //=================== ACORDE parameters ============================
4a2f6442 282 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
1fccbbe0 283 }
284
9ac91a91 285 AliLog::Message(AliLog::kInfo, "End of Config", "Config.C", "Config.C", "Config()"," Config.C", __LINE__);
67d736ee 286
e14b4d5a 287 cout << "Running ConfigCommon.C finished ... " << endl;
288
1fccbbe0 289}
290
291Float_t EtaToTheta(Float_t arg){
292 return (180./TMath::Pi())*2.*atan(exp(-arg));
293}
e14b4d5a 294
295void LoadPythia()
296{
297 // Load Pythia related libraries
298 gSystem->Load("liblhapdf.so"); // Parton density functions
299 gSystem->Load("libEGPythia6.so"); // TGenerator interface
300 gSystem->Load("libpythia6.so"); // Pythia
301 gSystem->Load("libAliPythia6.so"); // ALICE specific implementations
302}