source: tags/before-XString-Modif/HepRep/README

Last change on this file was 834, checked in by garnier, 16 years ago

import all except CVS

File size: 4.8 KB
Line 
1This G4 Graphics Driver creates a HepRep File suitable for viewing
2by the HepRApp, Wired4 or FRED Event Display clients.
3It requires no external packages.
4
5The HepRep graphics format is further described at
6http://www.slac.stanford.edu/~perl/heprep/
7
8
9Two different drivers are available for either HepRep1 or HepRep2.
10
11
12Driver: HepRepFile
13------------------
14The version of HepRep produced by this driver is HepRep Version 1.
15
16Writes files with file extension .heprep.
17
18First file is written to current directory and is named G4Data0.heprep.
19Subsequent files increment the number, as in G4Data1.heprep, G4Data2.heprep...
20
21To specify a different output file directory (instead of current directory),
22set G4HEPREPFILE_DIR
23
24To specify a different output file name (instead of G4Data),
25set G4HEPREPFILE_NAME
26
27To repeatedly overwrite the same output file (instead of having incremental
28numbers at the end of the file name),
29set G4HEPREPFILE_OVERWRITE
30
31By default, invisible objects are not culled but are left in the heprep file
32with their visibility initially set to false (so that you can subsequently
33choose to make them visible from within the heprep browser).
34To force culling of invisible objects,
35set G44HEPREPFILE_CULL
36
37View the file using the HepRApp HepRep Browser, available from:
38http://www.slac.stanford.edu/~perl/HepRApp
39
40HepRApp can read xml files in zipped format as well as unzipped,
41so you can save space by applying gzip to the xml file.
42This will reduce the file to about five percent of its original size.
43
44Joseph Perl
4515 November 2007
46
47
48Driver: HepRepXML
49-----------------
50The version of HepRep produced by this driver is HepRep Version 2.
51
52This driver can write both Binary HepRep (.bheprep) and XML HepRep
53(.heprep) files. Binary HepRep files are a one-to-one translation
54of XML HepRep files, but they are considerably shorter and faster
55to parse by a HepRepViewer such as WIRED 4.
56
57You can view the files using the WIRED 4 Event Display, available from:
58
59http://wired4.freehep.org
60
61Both Binary HepRep and XML HepRep can be compressed using the standard
62zlib library if linked into Geant4 using G4LIB_USE_ZLIB. If a standard
63zlib is not available (WIN32-VC for instance) you should also set
64G4LIB_BUILD_ZLIB to build G4zlib included with Geant4.
65
66HepRep files (Binary and XML) can contain multiple HepRep events/geometries.
67If the file contains more than one HepRep it is not strictly XML anymore.
68Files can be written in .heprep.zip, .heprep.gz or .heprep format and their
69binary versions .bheprep.zip, .bheprep.gz or .bheprep.
70
71The .heprep.zip is the default for file output, the .heprep is the default
72for 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
76use 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
83filename-9999.bheprep.zip (or up), while "-55-sub" will start write files
84filename-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),
91by default uncompressed, use:
92
93/vis/scene/create stdout
94
95
96To select the driver, where the file if not create by scene is set to
97G4HepRepOutput.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
112To 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
125Be 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).
135This 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
145Limitations:
146
147Only one SceneHandler can exist at any time, connected to a single Viewer.
148Since the HepRep format is a model rather than a view this is not a real
149limitation. In WIRED 4 you can create as many views (SceneHandlers) as you like.
150
1511 June 2005
152Mark.Donszelmann@slac.stanford.edu
Note: See TracBrowser for help on using the repository browser.