00001 00002 /* 00003 * 00004 * Copyright: Mathieu Trocme, mathieu.trocme@gmail.com (01 october 2009) 00005 * 00006 * This software is a computer program whose purpose is to: convert any GDML file to any G4 visualization driver file. 00007 * 00008 * This software is governed by the CeCILL license under French law and abiding by the rules of distribution of free software. 00009 * You can use, modify and/or redistribute the software under the terms of the CeCILL license as circulated by CEA, CNRS and INRIA at the following URL "http://www.cecill.info". 00010 * As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license, users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the successive licensors have only limited liability. 00011 * In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or developing or reproducing the software by the user in light of its specific status of free software, that may mean that it is complicated to manipulate, and that also therefore means that it is reserved for developers and experienced professionals having in-depth computer knowledge. 00012 * Users are therefore encouraged to load and test the software's suitability as regards their requirements in conditions enabling the security of their systems and/or data to be ensured and, more generally, to use and operate it in the same conditions as regards security. 00013 * 00014 * The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. 00015 * 00016 */ 00017 00018 00019 00020 /* ****************************************************************************************************************************** 00021 00022 00023 This program is a minimalist program the goal of which's just to convert a .gdml file to a g4 visulation driver output file. 00024 00025 00026 #################################################### 00027 # OVERVIEW 00028 #################################################### 00029 00030 Since no event are to be generated (we just care about geometry), the minimum number of files is being used: 00031 - No file for the physics list (any physics list can be called from the main file gdml2G4viz.cc (see $G4SOURCE/physics_lists/lists/src/G4PhysListFactory.cc)) 00032 - Two files (.hh & .cc) for the PrimaryGeneratorAction (this part might be skipt someday: http://hypernews.slac.stanford.edu/HyperNews/geant4/get/eventtrackmanage/895.html) 00033 - One file (.hh) for the DetectorConstruction (all the implementation is in the .hh, this cannot be done for the PrimaryGeneratorAction for some reason...) 00034 00035 The following outputs are provided in gdml2G4viz.mac (feel free to add more) 00036 - OGL* 00037 - VRML 00038 - DAWN 00039 - Wired3 00040 - Wired4 00041 Several can be chosen at the same time. 00042 Of course, the corresponding drivers should be installed (see https://sbgtrac.in2p3.fr/projects/ramses/wiki/G4_MyTuto) 00043 and Geant4 should have been installed accordingly (see https://sbgtrac.in2p3.fr/projects/ramses/wiki/G4_Installation) . 00044 00045 If the following drivers are installed: 00046 - VRML 00047 - DAWN 00048 - WIRED3 00049 - WIRED4 00050 the default output file will be renamed automatically according to the GDML file root name (e.g. foo.gdml -> foo.heprep.zip, foo.wrl, ...) 00051 See the gdml2G4viz.cc. 00052 00053 With respect to some conditions, some ouputs will display directly after geant4 has finished: 00054 - VRML if you link the firefox executable in $G4BINDIR 00055 - DAWN if you link the dawn executable in $G4BINDIR 00056 - WIRED3 if you COPY HepRApp.jar in $G4BINDIR 00057 See https://sbgtrac.in2p3.fr/projects/ramses/wiki/G4_Installation if this doesn't ring any bell. 00058 For Wired4, you still have to click... http://forum.freehep.org/index.php?t=msg&th=936&start=0&rid=0&S=7a7fcf2ac3b842d246213ec1f395643b 00059 00060 Futher notes are available in gdml2G4viz.mac. 00061 00062 00063 #################################################### 00064 # HOW TO START? 00065 #################################################### 00066 00067 The GDML files created by FastRad cannot be directly opened by Geant4 for some reason... 00068 00069 So first, create a suitable .gdml file by executing the following script at the GDML_* directory level 00070 >./gdmlify.pl GDML_myGDMLfileConvertedFromFastRad/ 00071 This will create an all-in-one file (geometry+materials) entitled myGDMLfileConvertedFromFastRad.gdml at the directory level. 00072 Copy it in $G4BINDIR... 00073 00074 ... then: 00075 - Compile and link the example to create the executable 00076 > cd gdml2G4viz 00077 > make -j $(cat /proc/cpuinfo | grep "processor.*:" | wc -l) 00078 00079 - Make your changes in gdml2G4viz.mac (or create your own macrofile) 00080 00081 - Launch the "convertor" 00082 > cd $G4BINDIR 00083 > [ ! -a gdml2G4viz.mac ] && ln -s $G4MYSIMU/gdml2G4viz.mac 00084 > ./gdml2G4viz gdml2G4viz.mac myGDMLfile.gdml 00085 00086 00087 Have fun! 00088 00089 00090 #################################################### 00091 # CONTENT OF THE ARCHIVE 00092 #################################################### 00093 . 00094 |-- GNUmakefile 00095 |-- doc.html -> z_html/files.html 00096 |-- gdml2G4viz.cc 00097 |-- gdml2G4viz.mac 00098 |-- gdmlify.pl 00099 |-- include 00100 | |-- TGDML_DetectorConstruction.hh 00101 | `-- TGPS_PrimaryGeneratorAction.hh 00102 |-- readme 00103 |-- src 00104 | `-- TGPS_PrimaryGeneratorAction.cc 00105 `-- z_html 00106 |-- ... 00107 00108 00109 ****************************************************************************************************************************** */