/[PAMELA software]/PamVMC/macro/PamG4Libs.C
ViewVC logotype

Annotation of /PamVMC/macro/PamG4Libs.C

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (hide annotations) (download)
Fri Jun 12 18:39:23 2009 UTC (15 years, 5 months ago) by pam-rm2
Branch: MAIN
CVS Tags: v1r0, HEAD
Changes since 1.2: +1 -0 lines
File MIME type: text/plain
- Introduced user-defined names of output files and random seeds number.
Users can do it use options of PamVMCApplication constructor:
PamVMCApplication(const char* name,  const char *title, const char*
filename="pamtest", Int_t seed=0).
The Random object that I use is TRandom3 object which has astronomical
large period (in case of default initialization 0). All random generators
in the code use this object by calling of gRandom singleton which keeps
it.

- Corrected TOF digitization routine. No problems with TDC hits due to
hadronic interactions anymore.

- Some small changes was done to compile code under Root 5.23. +
geant4_vmc v. 2.6 without any warnings

- Some classes of PamG4RunConfiguartion was changed for geant4_vmc v.
2.6.Some obsolete classes was deleted as soon as developers implemented
regions.

- Navigation was changed from "geomRootToGeant4" to "geomRoot", because on
VMC web page written that as soon as Geant4 has no option ONLY/MANY
translation of overlapped geometry to Geant4 through VGM could be wrong.
I'd like to stay with Root navigation:
http://root.cern.ch/root/vmc/Geant4VMC.html. This should be default
option.

- New Tracker digitization routine written by Sergio was implemented

- PamVMC again became compatible with geant4_vmc v.2.5 and ROOT 5.20.
 The problem was that ROOT developers introduced in TVirtualMC class a new
method SetMagField and new base class:TVirtualMagField from which
user-defined classes shoukd be derived

1 nikolas 1.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 pam-rm2 1.5 gSystem->Load("libG4emhighenergy");
181 nikolas 1.1 gSystem->Load("libG4xrays");
182     gSystem->Load("libG4optical");
183    
184     gSystem->Load("libG4hadronic_util");
185     gSystem->Load("libG4hadronic_xsect");
186     gSystem->Load("libG4hadronic_stop");
187     gSystem->Load("libG4hadronic_mgt");
188     gSystem->Load("libG4hadronic_proc");
189     gSystem->Load("libG4had_mod_man.so");
190     gSystem->Load("libG4had_im_r_matrix.so");
191     gSystem->Load("libG4had_string_man.so");
192     gSystem->Load("libG4had_string_diff.so");
193     gSystem->Load("libG4had_string_frag.so");
194     gSystem->Load("libG4had_mod_util.so");
195     gSystem->Load("libG4hadronic_qgstring");
196     gSystem->Load("libG4hadronic_HE");
197     gSystem->Load("libG4hadronic_LE");
198     gSystem->Load("libG4hadronic_deex_util");
199     gSystem->Load("libG4hadronic_bert_cascade.so");
200     gSystem->Load("libG4had_muon_nuclear.so");
201     gSystem->Load("libG4had_neu_hp.so");
202     gSystem->Load("libG4had_preequ_exciton.so");
203     gSystem->Load("libG4had_theo_max.so");
204     gSystem->Load("libG4hadronic_binary.so");
205     gSystem->Load("libG4hadronic_body_ci.so");
206     gSystem->Load("libG4hadronic_coherent_elastic.so");
207     gSystem->Load("libG4hadronic_deex_management.so");
208     gSystem->Load("libG4hadronic_deex_gem_evaporation.so");
209     gSystem->Load("libG4hadronic_deex_evaporation.so");
210     gSystem->Load("libG4hadronic_deex_fermi_breakup.so");
211     gSystem->Load("libG4hadronic_deex_fission.so");
212     gSystem->Load("libG4hadronic_deex_handler.so");
213     gSystem->Load("libG4hadronic_deex_multifragmentation.so");
214     gSystem->Load("libG4hadronic_deex_photon_evaporation.so");
215     gSystem->Load("libG4hadronic_hetcpp_evaporation.so");
216     gSystem->Load("libG4hadronic_hetcpp_utils.so");
217     gSystem->Load("libG4hadronic_interface_ci.so");
218     gSystem->Load("libG4hadronic_iso.so");
219     gSystem->Load("libG4hadronic_leading_particle.so");
220     gSystem->Load("libG4hadronic_radioactivedecay.so");
221    
222     // tracking
223     gSystem->Load("libG4tracking");
224    
225     // digits_hits
226     gSystem->Load("libG4hits");
227     gSystem->Load("libG4digits");
228 nikolas 1.2 gSystem->Load("libG4detector");
229     gSystem->Load("libG4detutils");
230 nikolas 1.1
231     // parameterisation
232     gSystem->Load("libG4gflash");
233     //gSystem->Load("libG4trdmodels");
234    
235     // event
236     gSystem->Load("libG4event");
237    
238     // readout
239     gSystem->Load("libG4readout");
240    
241     // run
242     gSystem->Load("libG4run");
243    
244     // g3tog4
245     gSystem->Load("libG3toG4");
246    
247     // interfaces and graphics
248     PamG4Libs_graphics();
249    
250     // VGM libraries
251     vgmlibs();
252    
253     // G4Root library (if available)
254     if ( isLibrary("libG4root") )
255     gSystem->Load("libG4root");
256    
257     // Geant4 VMC library
258     gSystem->Load("libgeant4vmc");
259    
260     cout << "Loading libraries ... finished" << endl;
261     }
262    
263     void PamG4Libs_global()
264     {
265     // Loads G4 global libraries,
266     // external packages: CLHEP, graphics drivers, .. used by G4
267     // and Alice G4 libraries: AliGeant4, TGeant4
268     // ---
269    
270     cout << "Loading Geant4 global libraries ..." << endl;
271    
272     // CLHEP
273     gSystem->Load("$(CLHEP_BASE_DIR)/lib/libCLHEP");
274    
275     // Geant4
276     gSystem->Load("libG4global");
277     gSystem->Load("libG4graphics_reps");
278     gSystem->Load("libG4intercoms");
279     gSystem->Load("libG4materials");
280     gSystem->Load("libG4geometry");
281     gSystem->Load("libG4particles");
282     gSystem->Load("libG4track");
283     gSystem->Load("libG4processes");
284     gSystem->Load("libG4tracking");
285     gSystem->Load("libG4digits_hits");
286     gSystem->Load("libG4event");
287     gSystem->Load("libG4readout");
288     gSystem->Load("libG4run");
289     gSystem->Load("libG3toG4");
290    
291     // interfaces and graphics
292     PamG4ibs_graphics(false);
293    
294     // VGM libraries
295     vgmlibs();
296    
297     // geant4 VMC
298     gSystem->Load("libgeant4vmc");
299    
300     cout << "Loading libraries ... finished" << endl;
301     }
302    

  ViewVC Help
Powered by ViewVC 1.1.23