Scenarios file

After having read a GDML file, you can use (see the "Opening a GDML file" section) the "geom" panel to create interactively scene graphs visualizing part of the geometry.

But operating like that at each g4view session may be tedious. XML scenarios files had been created to strongly customize a geometry visualization but also a simulation.

From the main menu, choose "Files" and then ".scenarios". At least the g4view.scenarios file coming with the application should be proposed. Select this file. When done, the list of scenarion contained in the file is mapped. Here lhcbvelo and lhcbhcal. Choose lhcbhcal, you should see :

scenarios_lhcbhcal.png

The XML scenario code is :

  <scenario name="lhcbhcal">

    <file>lhcbhcal.gdml</file>

    <background>black</background>

    <camera>
      <class>ortho</class>
      <height>20000</height>

      <znear>2000</znear>
      <zfar>200000</zfar>
      <focal>20000</focal>
      <dx>20</dx>
      <da>0.017</da> <!--one degree -->
      <ds>0.99</ds>

      <position>0 0 20000</position>
    </camera>
  
    <volume>
      <min_depth>2</min_depth>
      <max_depth>4</max_depth>
      <colormap>
        <color>yellow</color>
        <color>cyan</color>
        <color>magenta</color>
        <color>yellow</color>
      </colormap>
    </volume>

    <gun>
      <particle>pi0</particle>
<!--  <particle>proton</particle> -->
      <momentum>1000</momentum>
      <pos_x>0</pos_x>
      <pos_y>0</pos_y>
      <pos_z>-1000</pos_z>
      <dir_x>0</dir_x>
      <dir_y>0</dir_y>
      <dir_z>1</dir_z>
      <sigma_momentum>0</sigma_momentum>
      <sigma_angle>0.17</sigma_angle> <!-- 1 degree = 0.017 -->
    </gun>

    <trajectories>
      <particle name="e-" color="yellow"/>
      <particle name="e+" color="yellow"/>
      <particle name="gamma" color="blue"/>
    </trajectories>
<!--
    <trajectories>
      <particle name="e-" color="green"/>
      <particle name="e+" color="blue"/>
      <particle name="gamma" color="red"/>
      <particle name="pi+" color="magenta"/>
      <particle name="pi-" color="magenta"/>
      <particle name="proton" color="cyan"/>
      <particle name="neutron" color="yellow"/>
    </trajectories>
-->

  </scenario>

In this "scenario", not only the gdml file to work with is specified but also the camera setup, some volume to visualize with coloring, the particle gun (here 1 GeV pi0 shooting is requested) but also the coloring of the trajectories.

If you do a "Start run", you should see (after an interactive zoom on the last event) :

scenarios_lhcbhcal_event.png

The two blue spots are the two electromagnetic showers produced by the two photons issued by the quick decay of the initial pi0.