| [834] | 1 | This G4 Graphics Driver creates a HepRep File suitable for viewing
|
|---|
| 2 | by the HepRApp, Wired4 or FRED Event Display clients.
|
|---|
| 3 | It requires no external packages.
|
|---|
| 4 |
|
|---|
| 5 | The HepRep graphics format is further described at
|
|---|
| 6 | http://www.slac.stanford.edu/~perl/heprep/
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 | Two different drivers are available for either HepRep1 or HepRep2.
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 | Driver: HepRepFile
|
|---|
| 13 | ------------------
|
|---|
| 14 | The version of HepRep produced by this driver is HepRep Version 1.
|
|---|
| 15 |
|
|---|
| 16 | Writes files with file extension .heprep.
|
|---|
| 17 |
|
|---|
| 18 | First file is written to current directory and is named G4Data0.heprep.
|
|---|
| 19 | Subsequent files increment the number, as in G4Data1.heprep, G4Data2.heprep...
|
|---|
| 20 |
|
|---|
| 21 | To specify a different output file directory (instead of current directory),
|
|---|
| 22 | set G4HEPREPFILE_DIR
|
|---|
| 23 |
|
|---|
| 24 | To specify a different output file name (instead of G4Data),
|
|---|
| 25 | set G4HEPREPFILE_NAME
|
|---|
| 26 |
|
|---|
| 27 | To repeatedly overwrite the same output file (instead of having incremental
|
|---|
| 28 | numbers at the end of the file name),
|
|---|
| 29 | set G4HEPREPFILE_OVERWRITE
|
|---|
| 30 |
|
|---|
| 31 | By default, invisible objects are not culled but are left in the heprep file
|
|---|
| 32 | with their visibility initially set to false (so that you can subsequently
|
|---|
| 33 | choose to make them visible from within the heprep browser).
|
|---|
| 34 | To force culling of invisible objects,
|
|---|
| 35 | set G44HEPREPFILE_CULL
|
|---|
| 36 |
|
|---|
| 37 | View the file using the HepRApp HepRep Browser, available from:
|
|---|
| 38 | http://www.slac.stanford.edu/~perl/HepRApp
|
|---|
| 39 |
|
|---|
| 40 | HepRApp can read xml files in zipped format as well as unzipped,
|
|---|
| 41 | so you can save space by applying gzip to the xml file.
|
|---|
| 42 | This will reduce the file to about five percent of its original size.
|
|---|
| 43 |
|
|---|
| 44 | Joseph Perl
|
|---|
| 45 | 15 November 2007
|
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 | Driver: HepRepXML
|
|---|
| 49 | -----------------
|
|---|
| 50 | The version of HepRep produced by this driver is HepRep Version 2.
|
|---|
| 51 |
|
|---|
| 52 | This driver can write both Binary HepRep (.bheprep) and XML HepRep
|
|---|
| 53 | (.heprep) files. Binary HepRep files are a one-to-one translation
|
|---|
| 54 | of XML HepRep files, but they are considerably shorter and faster
|
|---|
| 55 | to parse by a HepRepViewer such as WIRED 4.
|
|---|
| 56 |
|
|---|
| 57 | You can view the files using the WIRED 4 Event Display, available from:
|
|---|
| 58 |
|
|---|
| 59 | http://wired4.freehep.org
|
|---|
| 60 |
|
|---|
| 61 | Both Binary HepRep and XML HepRep can be compressed using the standard
|
|---|
| 62 | zlib library if linked into Geant4 using G4LIB_USE_ZLIB. If a standard
|
|---|
| 63 | zlib is not available (WIN32-VC for instance) you should also set
|
|---|
| 64 | G4LIB_BUILD_ZLIB to build G4zlib included with Geant4.
|
|---|
| 65 |
|
|---|
| 66 | HepRep files (Binary and XML) can contain multiple HepRep events/geometries.
|
|---|
| 67 | If the file contains more than one HepRep it is not strictly XML anymore.
|
|---|
| 68 | Files can be written in .heprep.zip, .heprep.gz or .heprep format and their
|
|---|
| 69 | binary versions .bheprep.zip, .bheprep.gz or .bheprep.
|
|---|
| 70 |
|
|---|
| 71 | The .heprep.zip is the default for file output, the .heprep is the default
|
|---|
| 72 | for stdout and stderr.
|
|---|
| 73 |
|
|---|
| 74 | (Optional) To set the filename with a particular extension such as:
|
|---|
| 75 | .heprep.zip, .heprep.gz, .heprep, .bheprep.zip, .bheprep.gz or .bheprep
|
|---|
| 76 | use for instance:
|
|---|
| 77 |
|
|---|
| 78 | /vis/scene/create filename.bheprep.zip
|
|---|
| 79 |
|
|---|
| 80 |
|
|---|
| 81 | (Optional) To create separate files for each event, you can set a suffix such as
|
|---|
| 82 | "-0001" to start writing files from filename-0001.bheprep.zip to
|
|---|
| 83 | filename-9999.bheprep.zip (or up), while "-55-sub" will start write files
|
|---|
| 84 | filename-55-sub.bheprep.zip to filename-99-sub.bheprep.zip (or up).
|
|---|
| 85 |
|
|---|
| 86 | /vis/heprep/setEventNumberSuffix -0001
|
|---|
| 87 | (Note: suffix has to contain at least one digit)
|
|---|
| 88 |
|
|---|
| 89 |
|
|---|
| 90 | (Optional) To route the HepRep XML output to stdout (or stderr),
|
|---|
| 91 | by default uncompressed, use:
|
|---|
| 92 |
|
|---|
| 93 | /vis/scene/create stdout
|
|---|
| 94 |
|
|---|
| 95 |
|
|---|
| 96 | To select the driver, where the file if not create by scene is set to
|
|---|
| 97 | G4HepRepOutput.heprep.zip, use:
|
|---|
| 98 |
|
|---|
| 99 | /vis/open HepRepXML
|
|---|
| 100 |
|
|---|
| 101 |
|
|---|
| 102 | (Optional) To write a geometry, use:
|
|---|
| 103 |
|
|---|
| 104 | /vis/viewer/flush
|
|---|
| 105 |
|
|---|
| 106 |
|
|---|
| 107 | (Optional) To signal a change in geometry (to be written with the next event), use:
|
|---|
| 108 |
|
|---|
| 109 | /vis/viewer/refresh
|
|---|
| 110 |
|
|---|
| 111 |
|
|---|
| 112 | To write 10 events (and geometries), use:
|
|---|
| 113 |
|
|---|
| 114 | /run/beamOn 10
|
|---|
| 115 |
|
|---|
| 116 |
|
|---|
| 117 | (Optional) To accumulate multiple (5) G4 events into one HepRep event, use:
|
|---|
| 118 | /vis/scene/endOfEventAction accumulate
|
|---|
| 119 | /run/beamOn 5
|
|---|
| 120 | /vis/viewer/update
|
|---|
| 121 |
|
|---|
| 122 |
|
|---|
| 123 | (Optional) To add attributes to each point on a trajectory, use:
|
|---|
| 124 | /vis/heprep/addPointAttributes 1
|
|---|
| 125 | Be aware that this may increase the size of the output dramatically.
|
|---|
| 126 |
|
|---|
| 127 |
|
|---|
| 128 | (Optional) You may use the commands:
|
|---|
| 129 | /vis/viewer/zoom to set an initial zoom factor
|
|---|
| 130 | /vis/viewer/set/viewpointThetaPhi to set an initial view point
|
|---|
| 131 | /vis/heprep/setCoordinateSystem uvw to change the coordinate system, where uvw can be "xyz", "zxy", ...
|
|---|
| 132 |
|
|---|
| 133 |
|
|---|
| 134 | (Optional) You may decide to write .zip files with events and geometry separated (but linked).
|
|---|
| 135 | This results in a smaller zip file, as the geometry is only written once. Use the command:
|
|---|
| 136 |
|
|---|
| 137 | /vis/heprep/appendGeometry false
|
|---|
| 138 |
|
|---|
| 139 |
|
|---|
| 140 | (Optional) To close the file, remove the SceneHandler, use:
|
|---|
| 141 |
|
|---|
| 142 | /vis/sceneHandler/remove scene-handler-0
|
|---|
| 143 |
|
|---|
| 144 |
|
|---|
| 145 | Limitations:
|
|---|
| 146 |
|
|---|
| 147 | Only one SceneHandler can exist at any time, connected to a single Viewer.
|
|---|
| 148 | Since the HepRep format is a model rather than a view this is not a real
|
|---|
| 149 | limitation. In WIRED 4 you can create as many views (SceneHandlers) as you like.
|
|---|
| 150 |
|
|---|
| 151 | 1 June 2005
|
|---|
| 152 | Mark.Donszelmann@slac.stanford.edu
|
|---|