1 |
// $Id: PamG4Libs.C,v 1.0 2007/06/01 |
2 |
// |
3 |
|
4 |
|
5 |
#include <iostream> |
6 |
|
7 |
void PamG4Libs() |
8 |
{ |
9 |
// Loads granular Geant4 libraries. |
10 |
// Change the comment if global libraries are used. |
11 |
// --- |
12 |
|
13 |
PamG4Libs_granular(); |
14 |
// PamG4Libs_global(); |
15 |
} |
16 |
|
17 |
Bool_t isSet(const char* variable) |
18 |
{ |
19 |
// Checks if the specified environment variable is set |
20 |
// --- |
21 |
|
22 |
TString value = gSystem->Getenv(variable); |
23 |
if ( value != "") return true; |
24 |
|
25 |
return false; |
26 |
} |
27 |
|
28 |
Bool_t isLibrary(const char* libName) |
29 |
{ |
30 |
if (TString(gSystem->DynamicPathName(libName, kTRUE)) != TString("")) |
31 |
return kTRUE; |
32 |
else |
33 |
return kFALSE; |
34 |
} |
35 |
|
36 |
void vgmlibs() |
37 |
{ |
38 |
if (isSet("USE_VGM")) { |
39 |
cout << "Loading VGM libraries ... " << endl; |
40 |
gSystem->Load("libClhepVGM"); |
41 |
gSystem->Load("libBaseVGM"); |
42 |
gSystem->Load("libGeant4GM"); |
43 |
gSystem->Load("libRootGM"); |
44 |
gSystem->Load("libXmlVGM"); |
45 |
} |
46 |
} |
47 |
|
48 |
void PamG4Libs_graphics(Bool_t granular = true) |
49 |
{ |
50 |
// Loads G4 graphics libraries, |
51 |
// external packages: graphics drivers, .. used by G4 |
52 |
// --- |
53 |
|
54 |
// Graphics configuration |
55 |
Bool_t isXt = isSet("G4VIS_BUILD_OPACS_DRIVER") || |
56 |
isSet("G4VIS_BUILD_OPENGLXM_DRIVER") || |
57 |
isSet("G4VIS_BUILD_OIX_DRIVER") || |
58 |
isSet("G4UI_BUILD_XM_SESSION") || |
59 |
isSet("G4UI_BUILD_XAW_SESSION") || |
60 |
isSet("G4UI_BUILD_WO_SESSION"); |
61 |
Bool_t isXm = isSet("G4VIS_BUILD_OPENGLXM_DRIVER") || |
62 |
isSet("G4UI_BUILD_XM_SESSION"); |
63 |
Bool_t isXaw = isSet("G4UI_BUILD_XAW_SESSION"); |
64 |
Bool_t isGAG = !isSet("G4UI_NONE") && isSet("G4UI_USE_GAG"); |
65 |
Bool_t isDAWN = !isSet("G4VIS_NONE"); |
66 |
Bool_t isOpenGL = !isSet("G4VIS_NONE") && |
67 |
(isSet("G4VIS_BUILD_OPENGLX_DRIVER") || |
68 |
isSet("G4VIS_BUILD_OPENGLXM_DRIVER")); |
69 |
Bool_t isVRML = !isSet("G4VIS_NONE"); |
70 |
Bool_t isRayTracer = !isSet("G4VIS_NONE"); |
71 |
Bool_t isZLIB = isSet("G4_BUILD_ZLIB"); |
72 |
|
73 |
// Geant4 interfaces |
74 |
// |
75 |
if (isXt) { |
76 |
gSystem->Load("libXt"); |
77 |
} |
78 |
if (isXm) { |
79 |
gSystem->Load("libXm"); |
80 |
} |
81 |
if (isXaw) { |
82 |
gSystem->Load("libXaw"); |
83 |
} |
84 |
if (isZLIB){ |
85 |
gSystem->Load("libG4zlib"); |
86 |
} |
87 |
if (granular) { |
88 |
gSystem->Load("libG4UIcommon"); |
89 |
gSystem->Load("libG4UIbasic"); |
90 |
} |
91 |
else |
92 |
gSystem->Load("libG4interfaces"); |
93 |
|
94 |
if (isGAG) |
95 |
gSystem->Load("libG4UIGAG"); |
96 |
|
97 |
// Geant4 visualization |
98 |
// |
99 |
gSystem->Load("libG4modeling"); |
100 |
gSystem->Load("libG4vis_management"); |
101 |
gSystem->Load("libG4Tree"); |
102 |
gSystem->Load("libG4visHepRep"); |
103 |
gSystem->Load("libG4visXXX"); |
104 |
if (isDAWN) |
105 |
gSystem->Load("libG4FR"); |
106 |
if (isOpenGL) { |
107 |
gSystem->Load("libGLU"); |
108 |
gSystem->Load("libGL"); |
109 |
gSystem->Load("libG4OpenGL"); |
110 |
} |
111 |
if (isVRML) |
112 |
gSystem->Load("libG4VRML"); |
113 |
if (isRayTracer) |
114 |
gSystem->Load("libG4RayTracer"); |
115 |
} |
116 |
|
117 |
|
118 |
void PamG4Libs_granular() |
119 |
{ |
120 |
// Loads G4 granular libraries and G4 VMC library. |
121 |
// external packages: CLHEP, graphics drivers, .. used by G4 |
122 |
// --- |
123 |
|
124 |
cout << "Loading Geant4 granular libraries ..." << endl; |
125 |
|
126 |
// CLHEP |
127 |
gSystem->Load("libCLHEP"); |
128 |
|
129 |
// G4 categories |
130 |
|
131 |
// global |
132 |
gSystem->Load("libG4globman"); |
133 |
gSystem->Load("libG4hepnumerics"); |
134 |
|
135 |
// graphics_reps |
136 |
gSystem->Load("libG4graphics_reps"); |
137 |
|
138 |
// intercoms |
139 |
gSystem->Load("libG4intercoms"); |
140 |
|
141 |
// materials |
142 |
gSystem->Load("libG4materials"); |
143 |
|
144 |
// geometry |
145 |
gSystem->Load("libG4geometrymng"); |
146 |
gSystem->Load("libG4magneticfield"); |
147 |
gSystem->Load("libG4volumes"); |
148 |
gSystem->Load("libG4navigation"); |
149 |
gSystem->Load("libG4geomBoolean"); |
150 |
gSystem->Load("libG4csg"); |
151 |
gSystem->Load("libG4brep"); |
152 |
gSystem->Load("libG4specsolids"); |
153 |
gSystem->Load("libG4geombias"); |
154 |
gSystem->Load("libG4geomdivision"); |
155 |
|
156 |
// particles |
157 |
gSystem->Load("libG4partman"); |
158 |
gSystem->Load("libG4partutils"); |
159 |
gSystem->Load("libG4bosons"); |
160 |
gSystem->Load("libG4baryons"); |
161 |
gSystem->Load("libG4ions"); |
162 |
gSystem->Load("libG4mesons"); |
163 |
gSystem->Load("libG4leptons"); |
164 |
gSystem->Load("libG4shortlived"); |
165 |
|
166 |
// track |
167 |
gSystem->Load("libG4track"); |
168 |
|
169 |
// processes |
170 |
gSystem->Load("libG4procman"); |
171 |
gSystem->Load("libG4parameterisation"); |
172 |
gSystem->Load("libG4transportation"); |
173 |
gSystem->Load("libG4cuts"); |
174 |
gSystem->Load("libG4decay"); |
175 |
|
176 |
gSystem->Load("libG4emutils"); |
177 |
gSystem->Load("libG4emstandard"); |
178 |
gSystem->Load("libG4emlowenergy"); |
179 |
gSystem->Load("libG4muons"); |
180 |
gSystem->Load("libG4xrays"); |
181 |
gSystem->Load("libG4optical"); |
182 |
|
183 |
gSystem->Load("libG4hadronic_util"); |
184 |
gSystem->Load("libG4hadronic_xsect"); |
185 |
gSystem->Load("libG4hadronic_stop"); |
186 |
gSystem->Load("libG4hadronic_mgt"); |
187 |
gSystem->Load("libG4hadronic_proc"); |
188 |
gSystem->Load("libG4had_mod_man.so"); |
189 |
gSystem->Load("libG4had_im_r_matrix.so"); |
190 |
gSystem->Load("libG4had_string_man.so"); |
191 |
gSystem->Load("libG4had_string_diff.so"); |
192 |
gSystem->Load("libG4had_string_frag.so"); |
193 |
gSystem->Load("libG4had_mod_util.so"); |
194 |
gSystem->Load("libG4hadronic_qgstring"); |
195 |
gSystem->Load("libG4hadronic_HE"); |
196 |
gSystem->Load("libG4hadronic_LE"); |
197 |
gSystem->Load("libG4hadronic_deex_util"); |
198 |
gSystem->Load("libG4hadronic_bert_cascade.so"); |
199 |
gSystem->Load("libG4had_muon_nuclear.so"); |
200 |
gSystem->Load("libG4had_neu_hp.so"); |
201 |
gSystem->Load("libG4had_preequ_exciton.so"); |
202 |
gSystem->Load("libG4had_theo_max.so"); |
203 |
gSystem->Load("libG4hadronic_binary.so"); |
204 |
gSystem->Load("libG4hadronic_body_ci.so"); |
205 |
gSystem->Load("libG4hadronic_coherent_elastic.so"); |
206 |
gSystem->Load("libG4hadronic_deex_management.so"); |
207 |
gSystem->Load("libG4hadronic_deex_gem_evaporation.so"); |
208 |
gSystem->Load("libG4hadronic_deex_evaporation.so"); |
209 |
gSystem->Load("libG4hadronic_deex_fermi_breakup.so"); |
210 |
gSystem->Load("libG4hadronic_deex_fission.so"); |
211 |
gSystem->Load("libG4hadronic_deex_handler.so"); |
212 |
gSystem->Load("libG4hadronic_deex_multifragmentation.so"); |
213 |
gSystem->Load("libG4hadronic_deex_photon_evaporation.so"); |
214 |
gSystem->Load("libG4hadronic_hetcpp_evaporation.so"); |
215 |
gSystem->Load("libG4hadronic_hetcpp_utils.so"); |
216 |
gSystem->Load("libG4hadronic_interface_ci.so"); |
217 |
gSystem->Load("libG4hadronic_iso.so"); |
218 |
gSystem->Load("libG4hadronic_leading_particle.so"); |
219 |
gSystem->Load("libG4hadronic_radioactivedecay.so"); |
220 |
|
221 |
// tracking |
222 |
gSystem->Load("libG4tracking"); |
223 |
|
224 |
// digits_hits |
225 |
gSystem->Load("libG4hits"); |
226 |
gSystem->Load("libG4digits"); |
227 |
gSystem->Load("libG4detector"); |
228 |
|
229 |
// parameterisation |
230 |
gSystem->Load("libG4gflash"); |
231 |
//gSystem->Load("libG4trdmodels"); |
232 |
|
233 |
// event |
234 |
gSystem->Load("libG4event"); |
235 |
|
236 |
// readout |
237 |
gSystem->Load("libG4readout"); |
238 |
|
239 |
// run |
240 |
gSystem->Load("libG4run"); |
241 |
|
242 |
// g3tog4 |
243 |
gSystem->Load("libG3toG4"); |
244 |
|
245 |
// interfaces and graphics |
246 |
PamG4Libs_graphics(); |
247 |
|
248 |
// VGM libraries |
249 |
vgmlibs(); |
250 |
|
251 |
// G4Root library (if available) |
252 |
if ( isLibrary("libG4root") ) |
253 |
gSystem->Load("libG4root"); |
254 |
|
255 |
// Geant4 VMC library |
256 |
gSystem->Load("libgeant4vmc"); |
257 |
|
258 |
cout << "Loading libraries ... finished" << endl; |
259 |
} |
260 |
|
261 |
void PamG4Libs_global() |
262 |
{ |
263 |
// Loads G4 global libraries, |
264 |
// external packages: CLHEP, graphics drivers, .. used by G4 |
265 |
// and Alice G4 libraries: AliGeant4, TGeant4 |
266 |
// --- |
267 |
|
268 |
cout << "Loading Geant4 global libraries ..." << endl; |
269 |
|
270 |
// CLHEP |
271 |
gSystem->Load("$(CLHEP_BASE_DIR)/lib/libCLHEP"); |
272 |
|
273 |
// Geant4 |
274 |
gSystem->Load("libG4global"); |
275 |
gSystem->Load("libG4graphics_reps"); |
276 |
gSystem->Load("libG4intercoms"); |
277 |
gSystem->Load("libG4materials"); |
278 |
gSystem->Load("libG4geometry"); |
279 |
gSystem->Load("libG4particles"); |
280 |
gSystem->Load("libG4track"); |
281 |
gSystem->Load("libG4processes"); |
282 |
gSystem->Load("libG4tracking"); |
283 |
gSystem->Load("libG4digits_hits"); |
284 |
gSystem->Load("libG4event"); |
285 |
gSystem->Load("libG4readout"); |
286 |
gSystem->Load("libG4run"); |
287 |
gSystem->Load("libG3toG4"); |
288 |
|
289 |
// interfaces and graphics |
290 |
PamG4ibs_graphics(false); |
291 |
|
292 |
// VGM libraries |
293 |
vgmlibs(); |
294 |
|
295 |
// geant4 VMC |
296 |
gSystem->Load("libgeant4vmc"); |
297 |
|
298 |
cout << "Loading libraries ... finished" << endl; |
299 |
} |
300 |
|