Back to home page

EIC code displayed by LXR

 
 

    


Warning, /geant4/examples/basic/B5/plotter.mac is written in an unsupported language. File is not indexed.

0001 #
0002 #  Use with a TSG vis driver.
0003 # Activate with:
0004 #   /control/execute plotter.mac
0005 #   /run/beamOn 10  # it will update the plotter regions at end of run.
0006 #
0007 
0008 #/vis/verbose errors
0009 #/vis/verbose confirmations
0010 
0011 #///////////////////////////////////////////////////////////////////////
0012 #/// activate the TSG vis driver: //////////////////////////////////////
0013 #///////////////////////////////////////////////////////////////////////
0014 /vis/sceneHandler/create TSG scene-handler-plotter
0015 
0016 #///////////////////////////////////////////////////////////////////////
0017 #/// viewer: ///////////////////////////////////////////////////////////
0018 #///////////////////////////////////////////////////////////////////////
0019 /vis/viewer/create scene-handler-plotter viewer-plotter 600x600-0+0
0020 
0021 /vis/viewer/set/background 1 1 1
0022 /vis/viewer/zoomTo 1
0023 /vis/viewer/set/viewpointVector 0 0 1
0024 
0025 #///////////////////////////////////////////////////////////////////////
0026 #/// scene: ////////////////////////////////////////////////////////////
0027 #///////////////////////////////////////////////////////////////////////
0028 /vis/plotter/create plotter-0
0029 
0030 /vis/scene/create scene-plotter
0031 /vis/scene/add/plotter plotter-0
0032 /vis/sceneHandler/attach scene-plotter
0033 
0034 #///////////////////////////////////////////////////////////////////////
0035 #/// create plotter regions and attach histograms to them: /////////////
0036 #///////////////////////////////////////////////////////////////////////
0037 /vis/plotter/setLayout plotter-0 2 2  # create 2x2 plotting regions.
0038 
0039 # B5 specific:
0040 /vis/plotter/add/h1 0 plotter-0 0
0041 /vis/plotter/add/h1 1 plotter-0 1
0042 /vis/plotter/add/h2 0 plotter-0 2
0043 /vis/plotter/add/h2 1 plotter-0 3
0044 
0045 #///////////////////////////////////////////////////////////////////////
0046 #/// plotters customisation: ///////////////////////////////////////////
0047 #///////////////////////////////////////////////////////////////////////
0048 
0049 #  For texts, as titles and axis labels, the good old Hershey vectorial font is used
0050 # by default, but you can also specify a freetype font  To use a freetype font, you
0051 # must build Geant4 by specifying -DGEANT4_USE_FREETYPE=ON yin your cmake flags.
0052 # (The ROOT_default and hippodraw styles (see below) uses freetype fonts).
0053 #  Two embedded ttf fonts comes with the ToolsSG plotting: roboto_bold (some open source
0054 # kind of the Microsoft arialbd) and lato_regular (close to an helvetica).
0055 #  You can use your own .ttf files by using the TOOLS_FONT_PATH environment variable
0056 # to specify the directory where they could be found.
0057 
0058 #///////////////////////////////////////////////////////////////////////
0059 #/// using styles: /////////////////////////////////////////////////////
0060 #///////////////////////////////////////////////////////////////////////
0061 /vis/plotter/style/list
0062 
0063 /vis/plotter/addStyle plotter-0 reset
0064 
0065 #
0066 #  The below lines show how to customise a plotter by using an embedded style
0067 # (for example ROOT_default, hippodraw, default) or a style defined with commands.
0068 # The description of the embedded styles can be seen in Geant4 source code at:
0069 #   source/externals/g4tools/include/tools/sg/plotter_some_styles
0070 #
0071 #  A style can be applied on all regions by using:
0072 #   /vis/plotter/addStyle <plotter> <style>
0073 # or on one region only by using:
0074 #   /vis/plotter/addRegionStyle <plotter> <region> <style>
0075 #
0076 #  The "all regions" styles are applied first, and then the per region ones.
0077 #
0078 #  Without using a style, you can customise anyway directly by using
0079 # the command:
0080 #   /vis/plotter/addRegionParameter
0081 # See below for examples.
0082 #
0083 #/vis/plotter/addStyle plotter-0 ROOT_default
0084 #/vis/plotter/addStyle plotter-0 hippodraw
0085 
0086 #///////////////////////////////////////////////////////////////////////
0087 #/// create and use style-0 style: /////////////////////////////////////
0088 #///////////////////////////////////////////////////////////////////////
0089 ##/vis/plotter/style/remove style-0
0090 #/vis/plotter/style/select style-0
0091 #/vis/plotter/style/add infos_width             0.2   # percent of plotter width.
0092 #/vis/plotter/style/add bins_style.0.color      blue
0093 #/vis/plotter/style/add bins_style.0.line_width 3
0094 #/vis/plotter/style/add infos_style.visible     true
0095 #/vis/plotter/style/add infos_style.font        roboto_bold.ttf
0096 #/vis/plotter/style/add infos_style.front_face  cw
0097 
0098 #///////////////////////////////////////////////////////////////////////
0099 # example to have x_axis as ROOT_default:
0100 #/vis/plotter/style/add x_axis.modeling      hplot
0101 #/vis/plotter/style/add x_axis.divisions     510
0102 #/vis/plotter/style/add x_axis.title_hjust   right
0103 #/vis/plotter/style/add x_axis.label_to_axis 0.005
0104 #/vis/plotter/style/add x_axis.label_height  0.04
0105 #/vis/plotter/style/add x_axis.tick_length   0.03
0106 #/vis/plotter/style/add x_axis.title_to_axis 0.05
0107 #/vis/plotter/style/add x_axis.title_height  0.04
0108 #/vis/plotter/style/add x_axis.is_log        false
0109 
0110 #/vis/plotter/style/add x_axis.line_style.color       black
0111 #/vis/plotter/style/add x_axis.line_style.line_width  1
0112 
0113 #/vis/plotter/style/add x_axis.ticks_style.color      black
0114 #/vis/plotter/style/add x_axis.ticks_style.line_width 1
0115 
0116 #/vis/plotter/style/add x_axis.labels_style.color      black
0117 #/vis/plotter/style/add x_axis.labels_style.scale      0.6
0118 #/vis/plotter/style/add x_axis.labels_style.font       roboto_bold.ttf
0119 #/vis/plotter/style/add x_axis.labels_style.front_face cw
0120 #/vis/plotter/style/add x_axis.labels_style.smoothing  true
0121 
0122 #/vis/plotter/style/add x_axis.title_style.color       black
0123 #/vis/plotter/style/add x_axis.title_style.visible     true
0124 #/vis/plotter/style/add x_axis.title_style.scale       0.6
0125 #/vis/plotter/style/add x_axis.title_style.font        roboto_bold.ttf
0126 #/vis/plotter/style/add x_axis.title_style.front_face  cw
0127 #/vis/plotter/style/add x_axis.title_style.smoothing   true
0128 
0129 #/vis/plotter/style/add x_axis.mag_style.color       black
0130 #/vis/plotter/style/add x_axis.mag_style.scale       0.6
0131 #/vis/plotter/style/add x_axis.mag_style.font        roboto_bold.ttf
0132 #/vis/plotter/style/add x_axis.mag_style.front_face  cw
0133 #/vis/plotter/style/add x_axis.mag_style.smoothing   true
0134 #///////////////////////////////////////////////////////////////////////
0135 
0136 #/vis/plotter/style/list
0137 #/vis/plotter/style/print style-0
0138 
0139 #/vis/plotter/addRegionStyle plotter-0 0 style-0
0140 #/vis/plotter/addRegionStyle plotter-0 1 style-0
0141 
0142 #///////////////////////////////////////////////////////////////////////
0143 #/// set directly region parameters: ///////////////////////////////////
0144 #///////////////////////////////////////////////////////////////////////
0145 #
0146 #  Without passing by a style, a plotting region can be customised directly
0147 # by using the command:
0148 #   /vis/plotter/addRegionParameter
0149 #  Use:
0150 #   /vis/tsg/plotter/printParameters
0151 # to see the available parameters.
0152 #  The declared parameters to be changed are applied after styles.
0153 #
0154 
0155 # to see region borders:
0156 #/vis/plotter/addRegionParameter plotter-0 0 background_style.line_width 0.001
0157 #/vis/plotter/addRegionParameter plotter-0 1 background_style.line_width 0.001
0158 #/vis/plotter/addRegionParameter plotter-0 2 background_style.line_width 0.001
0159 #/vis/plotter/addRegionParameter plotter-0 3 background_style.line_width 0.001
0160 
0161 /vis/plotter/addRegionParameter plotter-0 0 infos_width 0.2
0162 /vis/plotter/addRegionParameter plotter-0 1 infos_width 0.2
0163 /vis/plotter/addRegionParameter plotter-0 2 infos_width 0.2
0164 /vis/plotter/addRegionParameter plotter-0 3 infos_width 0.2
0165 #
0166 /vis/plotter/addRegionParameter plotter-0 0 bins_style.0.color blue
0167 /vis/plotter/addRegionParameter plotter-0 0 bins_style.0.line_width 3
0168 /vis/plotter/addRegionParameter plotter-0 1 bins_style.0.color blue
0169 /vis/plotter/addRegionParameter plotter-0 1 bins_style.0.line_width 3
0170 
0171 /vis/plotter/addRegionParameter plotter-0 2 bins_style.0.color blue
0172 /vis/plotter/addRegionParameter plotter-0 2 bins_style.0.line_width 1
0173 /vis/plotter/addRegionParameter plotter-0 3 bins_style.0.color blue
0174 /vis/plotter/addRegionParameter plotter-0 3 bins_style.0.line_width 1
0175 #
0176 /vis/plotter/addRegionParameter plotter-0 0 x_axis.title detector
0177 #/vis/plotter/addRegionParameter plotter-0 0 x_axis_automated false
0178 #/vis/plotter/addRegionParameter plotter-0 0 x_axis_min 0
0179 #/vis/plotter/addRegionParameter plotter-0 0 x_axis_max 50
0180 #/vis/plotter/addRegionParameter plotter-0 0 x_axis_is_log true
0181 #
0182 #/vis/plotter/addRegionParameter plotter-0 3 title_automated false
0183 #/vis/plotter/addRegionParameter plotter-0 3 title "my title"
0184 /vis/plotter/addRegionParameter plotter-0 1 bins_style.0.color red
0185 /vis/plotter/addRegionParameter plotter-0 3 background_style.back_color "0.95 0.95 0.95"
0186 
0187 #///////////////////////////////////////////////////////////////////////
0188 #/// let's go: /////////////////////////////////////////////////////////
0189 #///////////////////////////////////////////////////////////////////////
0190 #/run/beamOn 100  #it will update the plotters at end of run.
0191 
0192 #///////////////////////////////////////////////////////////////////////
0193 #/// To produce some "paper" output: ///////////////////////////////////
0194 #///////////////////////////////////////////////////////////////////////
0195 # Use gl2ps to produce a PostScript file (may be long if the scene as a lot of primitives):
0196 #/control/shell rm ./out.eps
0197 #/vis/tsg/export                   # it produces out.eps
0198 #/control/shell open    ./out.eps  # if on a Mac.
0199 #/control/shell display ./out.eps  # with ImageMagick on a Linux.
0200 
0201 # Use gl2ps to produce a pdf file (may be long if the scene as a lot of primitives):
0202 #/control/shell rm ./out.pdf
0203 #/vis/tsg/export gl2ps_pdf out.pdf
0204 #/control/shell open ./out.pdf     # if on a Mac.
0205 #/control/shell display ./out.pdf  # with ImageMagick on a Linux.
0206 
0207 # Use the tools::sg offscreen zbuffer to produce an image and put it in a PostScript file:
0208 #/control/shell rm ./out.ps
0209 #/vis/tsg/export zb_ps out.ps
0210 #/control/shell open ./out.ps      # if on a Mac.
0211 #/control/shell display ./out.ps   # with ImageMagick on a Linux.