Fixed Warning (Jens)
[u/mrichter/AliRoot.git] / test / vmctest / ppbench / commonConfig.C
CommitLineData
e6dc94be 1// $Id$
2//
3// AliRoot Configuration for running aliroot with Monte Carlo.
4// commonConfig() includes the common setting for all MCs
5// which has to be called before MC is instantiated.
6// Called from MC specific configs (g3Config.C, g4Config.C).
7//
8// Extracted from G3 specific Config.C
9// by I. Hrivnacova, IPN Orsay
10
11enum PprTrigConf_t {
12 kDefaultPPTrig, kDefaultPbPbTrig
13};
14
15const char * pprTrigConfName[] = {
16 "p-p","Pb-Pb"
17};
18
19// Options
20static AliMagF::BMap_t smag = AliMagF::k5kG;
21static PprTrigConf_t strig = kDefaultPPTrig; // default PP trigger configuration
22static TString comment;
23
24// Functions
25void LoadPythia();
26
27void commonConfig(Bool_t setRootGeometry = kFALSE)
28{
29 cout << "Running commonConfig.C ... " << endl;
30
31 // Set Random Number seed
32 gRandom->SetSeed(123456); // Set 0 to use the currecnt time
33 AliLog::Message(AliLog::kInfo, Form("Seed for random number generation = %d",gRandom->GetSeed()), "Config.C", "Config.C", "Config()","Config.C", __LINE__);
34
35
36 //=======================================================================
37 // Load Pythia libraries
38 //=======================================================================
39
40 LoadPythia();
41
42 //=======================================================================
43 // ALICE steering object (AliRunLoader)
44 //=======================================================================
45
46 // Set Root geometry file
47 if ( setRootGeometry ) {
3fa450a8 48 AliSimulation::Instance()->SetGeometryFile("geometry.root");
e6dc94be 49 }
50
51 AliRunLoader* rl
52 = AliRunLoader::Open("galice.root",
53 AliConfig::GetDefaultEventFolderName(),
54 "recreate");
55 if ( ! rl ) {
56 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
57 return;
58 }
59 rl->SetCompressionLevel(2);
60 rl->SetNumberOfEventsPerFile(3);
61 gAlice->SetRunLoader(rl);
62
63 //======================================================================
64 // Trigger configuration
65 //=======================================================================
66
28da60d3 67 AliSimulation::Instance()->SetTriggerConfig(pprTrigConfName[strig]);
e6dc94be 68 cout << "Trigger configuration is set to " << pprTrigConfName[strig] << endl;
69
70 // =============================
71 // Magnetic field
72 // =============================
73
74 // Field (L3 0.5 T)
75 AliMagF* field = new AliMagF("Maps","Maps", -1., -1., AliMagF::k5kG);
76 TGeoGlobalMagField::Instance()->SetField(field);
77
78 printf("\n \n Comment: %s \n \n", comment.Data());
79
80 // =============================
81 // Modules
82 // =============================
83
84 rl->CdGAFile();
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;
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 rl->CdGAFile();
131 //=================== Alice BODY parameters =============================
132 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
133
134 if (iMAG)
135 {
136 //=================== MAG parameters ============================
137 // --- Start with Magnet since detector layouts may be depending ---
138 // --- on the selected Magnet dimensions ---
139 AliMAG *MAG = new AliMAG("MAG", "Magnet");
140 }
141
142
143 if (iABSO)
144 {
145 //=================== ABSO parameters ============================
146 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
147 }
148
149 if (iDIPO)
150 {
151 //=================== DIPO parameters ============================
152
153 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
154 }
155
156 if (iHALL)
157 {
158 //=================== HALL parameters ============================
159
160 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
161 }
162
163
164 if (iFRAME)
165 {
166 //=================== FRAME parameters ============================
167
168 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
169 FRAME->SetHoles(1);
170 }
171
172 if (iSHIL)
173 {
174 //=================== SHIL parameters ============================
175
176 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
177 }
178
179
180 if (iPIPE)
181 {
182 //=================== PIPE parameters ============================
183
184 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
185 }
186
187 if (iITS)
188 {
189 //=================== ITS parameters ============================
190
191 AliITS *ITS = new AliITSv11Hybrid("ITS","ITS v11Hybrid");
192 }
193
194 if (iTPC)
195 {
196 //============================ TPC parameters ===================
197 AliTPC *TPC = new AliTPCv2("TPC", "Default");
198 }
199
200
201 if (iTOF) {
202 //=================== TOF parameters ============================
203 AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
204 }
205
206
207 if (iHMPID)
208 {
209 //=================== HMPID parameters ===========================
210 AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
211
212 }
213
214
215 if (iZDC)
216 {
217 //=================== ZDC parameters ============================
218
219 AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
220 }
221
222 if (iTRD)
223 {
224 //=================== TRD parameters ============================
225
226 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
227 }
228
229 if (iFMD)
230 {
231 //=================== FMD parameters ============================
232 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
233 }
234
235 if (iMUON)
236 {
237 //=================== MUON parameters ===========================
238 // New MUONv1 version (geometry defined via builders)
239 AliMUON *MUON = new AliMUONv1("MUON", "default");
240 }
241 //=================== PHOS parameters ===========================
242
243 if (iPHOS)
244 {
245 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
246 }
247
248
249 if (iPMD)
250 {
251 //=================== PMD parameters ============================
252 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
253 }
254
255 if (iT0)
256 {
257 //=================== T0 parameters ============================
258 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
259 }
260
261 if (iEMCAL)
262 {
263 //=================== EMCAL parameters ============================
264 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETE");
265 }
266
267 if (iACORDE)
268 {
269 //=================== ACORDE parameters ============================
270 AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
271 }
272
273 if (iVZERO)
274 {
275 //=================== ACORDE parameters ============================
276 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
277 }
278
279 AliLog::Message(AliLog::kInfo, "End of Config", "Config.C", "Config.C", "Config()"," Config.C", __LINE__);
280
281 cout << "Running commonConfig.C finished ... " << endl;
282}
283
284void LoadPythia()
285{
286 // Load Pythia related libraries
287 gSystem->Load("liblhapdf.so"); // Parton density functions
288 gSystem->Load("libEGPythia6.so"); // TGenerator interface
289 gSystem->Load("libpythia6.so"); // Pythia
290 gSystem->Load("libAliPythia6.so"); // ALICE specific implementations
291}