Cerenkov production switched off.
[u/mrichter/AliRoot.git] / TFluka / macro / loadlibs.C
CommitLineData
d428922f 1// Macro for loading Geant4, Geant4 VMC and Flugg libraries
2// Based on the very similar file g4libs.C in the geant4_vmc package
3
4#include <iostream>
5
dc3912b3 6void loadlibs()
d428922f 7{
8// Loads granular Geant4 libraries.
9// Change the comment if global libraries are used.
10// ---
11
12 g4libs_granular();
13 // g4libs_global();
14}
15
16Bool_t isSet(const char* variable)
17{
18// Checks if the specified environment variable is set
19// ---
20
21 TString value = gSystem->Getenv(variable);
22 if ( value != "") return true;
23
24 return false;
25}
26
27void g4libs_graphics()
28{
29// Loads G4 graphics libraries,
30// external packages: graphics drivers, .. used by G4
31// ---
32
33 // Graphics configuration
34 Bool_t isXm = !isSet("G4UI_NONE") &&
35 (isSet("G4VIS_BUILD_OPENGLXM_DRIVER") ||
36 isSet("G4UI_BUILD_XM_SESSION"));
37 Bool_t isGAG = !isSet("G4UI_NONE") && isSet("G4UI_USE_GAG");
38 Bool_t isDAWN = !isSet("G4VIS_NONE");
39 Bool_t isOpenGL = !isSet("G4VIS_NONE") &&
40 (isSet("G4VIS_BUILD_OPENGLX_DRIVER") ||
41 isSet("G4VIS_BUILD_OPENGLXM_DRIVER"));
42 Bool_t isVRML = !isSet("G4VIS_NONE");
43 Bool_t isRayTracer = !isSet("G4VIS_NONE");
44
45 // Geant4 interfaces
46 //
47 if (isXm) {
48 gSystem->Load("libXt");
49 gSystem->Load("libXm");
50 }
51 gSystem->Load("libG4UIcommon");
52 gSystem->Load("libG4UIbasic");
53 if (isGAG)
54 gSystem->Load("libG4UIGAG");
55
56 // Geant4 visualization
57 //
58 if (isOpenGL) {
59 gSystem->Load("libGLU");
60 gSystem->Load("libGL");
61 }
62 gSystem->Load("libG4modeling");
63 gSystem->Load("libG4vis_management");
64 if (isDAWN)
65 gSystem->Load("libG4FR");
66 if (isOpenGL)
67 gSystem->Load("libG4OpenGL");
68 if (isVRML)
69 gSystem->Load("libG4VRML");
70 if (isRayTracer)
71 gSystem->Load("libG4RayTracer");
72}
73
74
75void g4libs_granular()
76{
77// Loads G4 granular libraries and G4 VMC library.
78// external packages: CLHEP, graphics drivers, .. used by G4
79// ---
80
81 cout << "Loading Geant4 granular libraries ..." << endl;
82
83 // CLHEP
84 gSystem->Load("libCLHEP");
85
86 // G4 categories
87
88 // global
89 gSystem->Load("libG4globman");
90 gSystem->Load("libG4hepnumerics");
91
92// // graphics_reps
93// gSystem->Load("libG4graphics_reps");
94
95 // intercoms
96 gSystem->Load("libG4intercoms");
97
98 // materials
99 gSystem->Load("libG4materials");
100
101 // geometry
102 gSystem->Load("libG4geomver");
103 gSystem->Load("libG4volumes");
104 gSystem->Load("libG4magneticfield");
105 // I.G.C.
106 gSystem->Load("libFlugg");
107 gSystem->Load("libG4geometrymng");
108 gSystem->Load("libG4geomBoolean");
109 gSystem->Load("libG4csg");
110 gSystem->Load("libG4step");
111 gSystem->Load("libG4brep");
112 gSystem->Load("libG4specsolids");
113 gSystem->Load("libG4stepinterface");
114
115
116
117 // particles
118 gSystem->Load("libG4partman");
119 gSystem->Load("libG4bosons");
120 gSystem->Load("libG4baryons");
121 gSystem->Load("libG4ions");
122 gSystem->Load("libG4mesons");
123 gSystem->Load("libG4leptons");
124 gSystem->Load("libG4shortlived");
125
126 // track
127 gSystem->Load("libG4track");
128
129 // processes
130 gSystem->Load("libG4procman");
131 gSystem->Load("libG4parameterisation");
132 gSystem->Load("libG4decay");
133 gSystem->Load("libG4emutils");
134 gSystem->Load("libG4emstandard");
135 gSystem->Load("libG4emlowenergy");
136 gSystem->Load("libG4muons");
137 gSystem->Load("libG4xrays");
138 gSystem->Load("libG4hadronic_xsect");
139 gSystem->Load("libG4hadronic_mgt");
140 gSystem->Load("libG4hadronic_proc");
141 gSystem->Load("libG4hadronic_util");
142 gSystem->Load("libG4hadronic_man_gen");
143 gSystem->Load("libG4hadronic_util_gen");
144 gSystem->Load("libG4hadronic_string_common");
145 gSystem->Load("libG4hadronic_diffstring");
146 gSystem->Load("libG4hadronic_stringfrag");
147 gSystem->Load("libG4hadronic_HE_gen");
148 gSystem->Load("libG4hadronic_kinetic");
149 gSystem->Load("libG4hadronic_qgstring");
150 gSystem->Load("libG4hadronic_HE");
151 gSystem->Load("libG4hadronic_LE");
152 gSystem->Load("libG4hadronic_deex");
153 gSystem->Load("libG4hadronic_preequ");
154 gSystem->Load("libG4hadronic_stop");
155 gSystem->Load("libG4hadronic_neu");
156 gSystem->Load("libG4hadronic_iso");
157 gSystem->Load("libG4optical");
158 gSystem->Load("libG4photolepton_hadron");
159 gSystem->Load("libG4transportation");
160
161 // tracking
162 gSystem->Load("libG4tracking");
163
164 // digits+hits
165 gSystem->Load("libG4hits");
166 gSystem->Load("libG4digits");
167 gSystem->Load("libG4detector");
168
169 // event
170 gSystem->Load("libG4event");
171
172 // readout
173 gSystem->Load("libG4readout");
174
175 // run
176 gSystem->Load("libG4run");
177
178 // g3tog4
179 gSystem->Load("libG3toG4");
180
181 // interfaces and graphics
182 g4libs_graphics();
183
184 // geant4 mc
185 gSystem->Load("libgeant4vmc");
186
187 cout << "Loading Geant4 granular libraries ... finished" << endl;
188}
189
190void g4libs_global()
191{
192// Loads G4 global libraries,
193// external packages: CLHEP, graphics drivers, .. used by G4
194// and Alice G4 libraries: AliGeant4, TGeant4
195// ---
196
197 cout << "Loading Geant4 global libraries ..." << endl;
198
199 // CLHEP
200 gSystem->Load("$(CLHEP_BASE_DIR)/lib/libCLHEP");
201
202 // Geant4
203 gSystem->Load("libG4global");
204 gSystem->Load("libG4graphics_reps");
205 gSystem->Load("libG4intercoms");
206 gSystem->Load("libG4materials");
207 gSystem->Load("libG4geometry");
208 gSystem->Load("libG4particles");
209 gSystem->Load("libG4track");
210 gSystem->Load("libG4processes");
211 gSystem->Load("libG4tracking");
212 gSystem->Load("libG4digits+hits");
213 gSystem->Load("libG4event");
214 gSystem->Load("libG4readout");
215 gSystem->Load("libG4run");
216 gSystem->Load("libG3toG4");
217
218 // interfaces and graphics
219 g4libs_graphics();
220
221 // geant4 mc
222 gSystem->Load("libgeant4_vmc");
223
224 cout << "Loading Geant4 global libraries ... finished" << endl;
225}
226