Visualisation, (G)UI and Analysis The full set of lecture notes of this Geant4 Course is available at

Slides:



Advertisements
Similar presentations
2D Graphics Drawing Things. Graphics In your GUI, you might want to draw graphics E.g. draw lines, circles, shapes, draw strings etc The Graphics class.
Advertisements

User Interface The full set of lecture notes of this Geant4 Course is available at
Tutorial 12: Enhancing Excel with Visual Basic for Applications
11 January 2011 Geant4 Visualization Commands J. Perl 1 DAWN OpenGL Geant4 Visualization Commands Basic Visualization Commands Makoto Asai (SLAC) slides.
Introduction to Geant4 Visualization
Chapter Day 5. © 2007 Pearson Addison-Wesley. All rights reserved2-2 Agenda Day 5 Questions from last Class?? Problem set 1 Posted  Introduction on developing.
Makoto Asai (SLAC) Geant4 Users SLAC Feb. 18 th, 2002 Getting Started.
Fall 2007ACS-1903 BlueJ Ron McFadyen Lab 1: Using BlueJ at UofW The purpose of this lab is to give you some experience with BlueJ. Over the course of the.
15 Sept 2007 J. Perl Overview of Geant4 Visualization 1 HepRep/HepRApp DAWN OpenGL Overview of Geant4 Visualization Geant4 Mini-Tutorial Hebden Bridge.
1 Applets Chapter 1 To understand:  why applets are used to extend the capabilities of Web pages  how an applet is executed and know about the restrictions.
Geant4 Visualization Review
12 May 2007 Geant4 Visualization Commands J. Perl 1 DAWN OpenGL Geant4 Visualization Commands Basic Visualization Commands Joseph Perl, SLAC HepRep/HepRApp.
Introduction to a Programming Environment
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Software Installation, release 4.0 Geant4 Users’ Workshop Tutorial SLAC February 18-22, 2002 Takashi Sasaki, Gabriele Cosmo,
Victor Serbo, SLAC30 September 2004, Interlaken, Switzerland JASSimApp plugin for JAS3: Interactive Geant4 GUI Serbo, Victor (SLAC) - presenter Donszelmann,
Abstraction: Polymorphism, pt. 1 Abstracting Objects.
Software Installation The full set of lecture notes of this Geant4 Course is available at
Chapter 3 Introduction to Event Handling and Windows Forms Applications.
G.Barrand, LAL-Orsay Geant4 and interactive frameworks.
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
Java Programming, 2E Introductory Concepts and Techniques Chapter 2 Creating a Java Application and Applet.
A First Program Using C#
Introduction to Hall-D Software February 27, 2009 David Lawrence - JLab.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 26 – CheckWriter Application Introducing Graphics.
Visualisation and (G)UI Authors: Hajime Yoshida and Satoshi Tanaka.
Chapter 8: Writing Graphical User Interfaces
School of Computer Science & Information Technology G6DICP - Lecture 22 The Theory of Object Oriented Programming.
Automating Database Processing Chapter 6. Chapter Introduction Design and implement user-friendly menu – Called navigation form Macros – Automate repetitive.
1 k Jarek Rossignac,  2008 Processing  Install Processing  Learn how to edit, run, save, export, post programs  Understand.
S. Guatelli, CPS Innovations, Knoxville, 13 th -21 st January Brachytherapy exercise.
Chapter 3 Syntax, Errors, and Debugging Fundamentals of Java.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved CheckWriter Application Introducing Graphics and Printing.
V. Serbo, SLAC ACAT03, 1-5 December 2003 Interactive GUI for Geant4 by Victor Serbo, SLAC.
Maria Grazia Pia Detector Response Acknowledgements: A. Lechner, J. Apostolakis, M. Asai, G. Cosmo, A. Howard.
S. Guatelli, M.G Pia, INFN Genova G. Cosmo, S. Guatelli, M.G Pia Salamanca, July 2002
Geant4 Visualization 1 OpenGL DAWN VRML. Visualization Visualization Seeing what one does usually helps One can visualize geometry, hits, trajectories.
1 CSC 221: Computer Programming I Spring 2008 Objects and classes: a broad view  software objects, classes, object-oriented design  BlueJ IDE, compilation.
C++ Programming Basic Learning Prepared By The Smartpath Information systems
User Application Luciano Pandola INFN-LNGS Partially based on a presentation by Maria Grazia Pia (INFN-Ge)
7 June 2005 Visualization & GGE Demo J. Perl 1 HepRep/WIRED DAWN OpenGL Geant4 Visualization & GGE Demo Joseph Perl, SLAC.
The GeoModel Toolkit for Detector Description Joe Boudreau Vakho Tsulaia University of Pittsburgh CHEP’04 Interlaken.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
12 October 2006 G4Vis: Status, New Features and Issues 1 HepRep/WIRED DAWN OpenGL G4Vis: Status, New Features and Issues Geant4 Collaboration Workshop.
© TMC Computer School HC20203 VRML HIGHER DIPLOMA IN COMPUTING Chapter 2 – Basic VRML.
Maria Grazia Pia INFN Genova Salamanca, July 2002
C++ / G4MICE Course Session 5 Materials in G4MICE Units in G4MICE Visualisation in G4MICE G4MICE Modelling.
Chapter 5 Introduction to Defining Classes
May 20, 2005Wah-kai Ngai1 Basic Visualization Tutorial Using Geant4.
Creating a Java Application and Applet
Geant4 examples Sébastien Incerti On behalf of the Geant4 collaboration with special thanks to Luciano Pandola, INFN.
Makoto Asai (SLAC) Getting Started MGP: added class diagram of basic user application.
1.1: Objects and Classes msklug.weebly.com. Agenda: Attendance Let’s get started What is Java? Work Time.
June 4-8, G4 Paris Visualization II P. Gueye/J. Perl 1 DAWN OpenGL Geant4 Visualization Commands Basic Visualization Commands Paul Guèye, HU Courtesy:
Geometry 3 I.Hrivnacova IPN, Orsay Most slides thanks to M. Asai, SLAC Cours Paris June 2007.
Chapter 5 Introduction to Defining Classes Fundamentals of Java.
Trajectory and Hit Visualisation Jane Tinslay, SLAC October 2006.
The full set of lecture notes of this Geant4 Course is available at
Visualisation and (G)UI
Basics of a user application
User Interface
Geant4 Visualization Commands
The full set of lecture notes of this Geant4 Course is available at
Geometry checking tools
Visualisation, (G)UI and Analysis
Software Installation
Geant4 Workshop, CERN - 1 October 2002 Joseph Perl
Software Installation, release 4.0
Visualization Status/Development
Visualisation and (G)UI
Presentation transcript:

Visualisation, (G)UI and Analysis The full set of lecture notes of this Geant4 Course is available at

Visualisation & (G)UI - Geant4 Course2 Contents (1) Part 1: How to perform visualisation Introduction Visualisable Objects Visualisation Attributes Polyline and Marker Visualisation Drivers main() Function Visualisation Commands How to Visualise from C++ Codes Exercises Information

Visualisation & (G)UI - Geant4 Course3 Contents (2) Part 2: Geant4 GUI Select (G)UI Environmental variables Useful GUI Tools Released by Geant4 Developers

Visualisation & (G)UI - Geant4 Course4 Contents (3) Part 3: DAVID and DTREE Graphically detecting overlaps in geometry Display of the detector geometry tree

Visualisation & (G)UI - Geant4 Course5 Contents (4) Part 4: AIDA and binding to analysis AIDA abstract interfaces Geant4 setup and analysis tools

PART 1 Geant4Visualisation

Visualisation & (G)UI - Geant4 Course7 1. Introduction Geant4 Visualisation must respond to varieties of user requirements Quick response to survey successive events Impressive special effects for demonstration High-quality output to prepare journal papers Flexible camera control for debugging geometry Highlighting overlapping of physical volumes Interactive picking of visualised objects …

Visualisation & (G)UI - Geant4 Course8 2. Visualisable Objects (1) Simulation data can be visualised such as: Detector components A hierarchical structure of physical volumes A piece of physical volume, logical volume, and solid Particle trajectories and tracking steps Hits of particles in detector components Visualisation is performed either with commands or by writing C++ source codes of user-action classes

Visualisation & (G)UI - Geant4 Course9 2. Visualisable Objects (2) You can also visualise other user defined objects such as: A polyline, that is, a set of successive line segments (example: coordinate axes) A marker which marks an arbitrary 3D position (example: eye guides) Texts character strings for description comments or titles …

Visualisation & (G)UI - Geant4 Course10 2. Visualisable Objects (3) A typical application is the DrawTrajectory and DrawHit methods The default G4VTrajectory:: DrawTrajectory(G4int imode) draws positive/negative/neutral particle trajectories blue/red/green with yellow markers. The user must write DrawHit (see later)

Visualisation & (G)UI - Geant4 Course11 3. Visualisation Attributes Control the appearance of visualisable objects Colour, visibility, forced-wireframe style, etc A set of visualisation attributes is held by the class G4VisAttributes A G4VisAttributes object is assigned to a visualisable object with its method SetVisAttributes() : experimentalHall_logical -> SetVisAttributes (G4VisAttributes::Invisible)

Visualisation & (G)UI - Geant4 Course12  The following constructors are supported by class G4VisAttributes : G4VisAttributes G4VisAttributes () G4VisAttributes (G4bool visibility) G4VisAttributes (const G4Colour& colour) G4VisAttributes (G4bool visibility, const G4Colour& colour) or use Set methods… 3.1 Constructors of G4VisAttributes

Visualisation & (G)UI - Geant4 Course Visibility A boolean flag ( G4bool ) to control the visibility of objects Access function G4VisAttributes::SetVisibility (G4bool visibility) If false is given as argument, objects are culled (not shown) if culling is on. The default value of visibility is true. The default is culling of invisible objects.

Visualisation & (G)UI - Geant4 Course Colour (1) Class G4VisAttributes holds its colour entry as an instance of class G4Colour An equivalent class name, G4Color, is also available G4Colour is instantiated by giving RGB components and opacity(alpha): G4Colour::G4Colour(G4double red = 1.0, G4double green = 1.0, G4double blue = 1.0, G4double alpha = 1.0) The default arguments define a white object that will be opaque when drawn in solid mode (opacity does not affect wireframe mode)

Visualisation & (G)UI - Geant4 Course Colour (2) Access functions of G4VisAttributes to set G4Colour SetColour(const G4Colour& colour) SetColour( G4double red, G4double green, G4double blue, G4double alpha = 1.) (or SetColor)

Visualisation & (G)UI - Geant4 Course Assigning G4VisAttributes to a logical volume Class G4LogicalVolume holds a pointer of G4VisAttributes Access functions of G4LogicalVolume SetVisAttributes ( const G4VisAttributes* pva ) Remember, G4VisAttributes are held by a pointer; it must have a life as least as long as the holder…

Visualisation & (G)UI - Geant4 Course17 //----- C++ source codes: Assigning G4VisAttributes to a logical volume // Instantiation of a logical volume myTargetLog = new G4LogicalVolume( myTargetTube,BGO, "TLog", 0, 0, 0); // Instantiation of a set of visualization // attributes with cyan colour G4VisAttributes * calTubeVisAtt = new G4VisAttributes(G4Colour(0.,1.,1.)); // Set the forced wireframe style calTubeVisAtt->SetForceWireframe(true); // Assignment of the visualization attributes // to the logical volume myTargetLog->SetVisAttributes(calTubeVisAtt); Sample C++ Code:

Visualisation & (G)UI - Geant4 Course18 4. Polyline and Marker Polyline and marker are defined in the graphics_reps category They are available to model 3D scenes for visualisation

Visualisation & (G)UI - Geant4 Course Polyline A set of successive line segments Defined with a class G4Polyline Used to visualise tracking steps, particle trajectories, coordinate axes, etc (but note availability of commands: /vis/scene/add/trajectories etc.) G4Polyline is defined as a list of G4Point3D objects.

Visualisation & (G)UI - Geant4 Course20 //-- C++ source code: An example of defining a line segment // Instantiation G4Polyline x_axis; // Vertex positions x_axis.append ( G4Point3D ( 0., 0., 0.) ); x_axis.append ( G4Point3D ( 5. * cm, 0., 0.) ); // Color G4Colour red ( 1.0, 0.0, 0.0 ); // color for x-axis G4VisAttributes att ( red ); x_axis.SetVisAttributes( att ); //-- end of C++ source code Sample C++ Code:

Visualisation & (G)UI - Geant4 Course Marker (1) Set a mark to an arbitrary 3D position Usually used to visualise hits of particles Designed as a 2-dimensional primitive with shape (square, circle, etc), color, and special properties of (a) always facing the camera and (b) having the possibility of its size (diameter) defined either in real 3D or 2D screen units (pixels)

Visualisation & (G)UI - Geant4 Course Marker (2) Kinds of markers Square : G4Square Circle : G4Circle Text : G4Text Constructors G4Circle (const G4Point3D& pos) G4Square (const G4Point3D& pos) G4Text (const G4String& text, const G4Point3D& pos)

Visualisation & (G)UI - Geant4 Course Marker (3) Each marker class inherits class G4VMarker All access functions of G4VMarker are available. For example, SetPosition( const G4Point3D& ) SetWorldSize( G4double real_3d_size ) SetScreenSize( G4double 2d_size_pixel ) SetScreenRadius( G4double r ) etc.

Visualisation & (G)UI - Geant4 Course24 Sample C++ Code: Definition of a small red circle as a marker : G4Circle circle(position); // Instantiate a circle with its 3D position. The // argument "position" is defined as G4Point3D instance circle.SetScreenDiameter (1.0); circle.SetFillStyle (G4Circle::filled); // Make it a filled circle G4Colour colour(1.,0.,0.); // Define red color G4VisAttributes attribs(colour); // Define a red visualization attribute circle.SetVisAttributes(attribs); // Assign the red attribute to the circle //-- end of C++ source code

Visualisation & (G)UI - Geant4 Course Draw methods of G4VVisManager G4VVisManager is the user interface to the concrete vis manager. It resides in the intercoms category. Always protect your code by obtaining a pointer to the concrete instance through G4VVisManager ::GetConcreteInstance ( it also ensures a valid view is available)

Visualisation & (G)UI - Geant4 Course Draw methods of G4VVisManager (2) The Draw methods are available for: G4Circle G4NURBS G4Polyhedron G4Polyline G4Polymarker G4Scale G4Square G4Text G4LogicalVolume G4PhysicalVolume G4Solid Also G4VHit and G4VTrajectory for convenience, but use commands, such as /vis/scene/add/trajectories.

Visualisation & (G)UI - Geant4 Course27 A typical DrawHit method void ExN02TrackerHit::Draw() { G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance(); if(pVVisManager) { G4Circle circle(pos); circle.SetScreenSize(2.); circle.SetFillStyle(G4Circle::filled); G4Colour colour(1.,0.,0.); G4VisAttributes attribs(colour); circle.SetVisAttributes(attribs); pVVisManager->Draw(circle); }

Visualisation & (G)UI - Geant4 Course28 5. Visualisation Drivers Visualisation drivers are interfaces to 3D graphics software You can select your favorite one(s) depending on your purposes such as Seeing detector and events Preparing precise figures for journal papers Publication of results on Web Debugging geometry Demonstration Etc

Visualisation & (G)UI - Geant4 Course29 Geant4 provides visualisation drivers: DAWN : Technical High-quality PostScript output OpenGL: Quick and flexible visualisation OpenInventor: Interactivity, virtual reality, etc RayTracer : Photo-realistic rendering VRML: Interactivity, 3D graphics on Web HepRep: connection to variety of viewers 5.1 Available Graphics Software

Visualisation & (G)UI - Geant4 Course Available Visualisation Drivers DAWN(FILE)  Fukui Renderer DAWN OPENGLX(m)  OpenGL with Xlib (Xm) HepRep  HepRep viewers OIX  OpenInventor with Xlib RayTracer  JPEG files VRML  VRML 1.0/2.0 A/GAGTree  geometry hierarchy Etc (see “help /vis/open”)

Visualisation & (G)UI - Geant4 Course How to Use Visualisation Drivers Users can install visualisation driver(s) by setting G4VIS_BUILD… environment variables before building Geant4 libraries (use Configure) Similarly, G4VIS_USE… environment variables before compiling user code. For example, Configure produces : setenv G4VIS_USE_DAWN 1 setenv G4VIS_USE_OPENGLX 1 setenv G4VIS_USE_VRML 1 Note: force a rebuild/recompile if you change environment

Visualisation & (G)UI - Geant4 Course32 6. main() Function (1) Instantiate a visualisation manager, e.g., G4VisExecutive (but you may write your own). Near the start of your program, e.g., in main() : Include the header file of the chosen visualisation manager Instantiate and initialise the visualisation manager. The Initialise() method instantiates the chosen visualisation driver “factories” Delete the visualisation manager at the end You can use the C macro “ G4VIS_USE ”, which is automatically set if you incorporate a visualisation driver in compilation

Visualisation & (G)UI - Geant4 Course33 6. main() Function (2) From a typical main() function : // Include the header file of your vis manager #ifdef G4VIS_USE #include “G4VisExecutive.hh” #endif … // Instantiate and initialize the vis manager #ifdef G4VIS_USE G4VisManager* visManager = new G4VisExecutive; visManager->Initialize(); #endif … // Delete the visualisation manager #ifdef G4VIS_USE delete visManager; #endif

Visualisation & (G)UI - Geant4 Course34 7. Visualisation commands Here, we introduce some frequently-used built-in visualisation commands See command web page cationDeveloper/html/Control/commands.html cationDeveloper/html/Control/commands.html For simplicity, we assume that the Geant4 executable is compiled, incorporating DAWN, OPENGLX, and VRMLFILE drivers setenv G4VIS_USE_DAWN 1 setenv G4VIS_USE_OPENGLX 1 setenv G4VIS_USE_VRMLFILE 1

Visualisation & (G)UI - Geant4 Course Scene, Scene Hander, Viewer In order to use visualisation commands, you need to understand the concepts of “scene”, “scene handler”, and “viewer”. Scene: A set of visualisable 3D objects Scene handler: Interprets the scene for a particular graphics system Viewer: Image generator Each scene handler is assigned to a scene Each viewer is assigned to a scene handler “visualisation driver” = “scene handler” + “viewer”

Visualisation & (G)UI - Geant4 Course36 7.1(2) Scene Objects Physical volume, which is assumed to include descendants to unlimited or specified depth Logical volume, showing daughters, Boolean components, voxels and readout geometry Ghost volume Trajectories, drawn at end of event Hits, drawn at end of event Axes Logo Scale Text User action

Visualisation & (G)UI - Geant4 Course37 7.1(3) Standard View The scene computes its “bounding sphere” The viewer computes the “standard view” that shows the whole scene Pan, dolly and zoom from there /vis/viewer/reset restores the standard view

Visualisation & (G)UI - Geant4 Course38 7.1(4) Culling Policy There exists a primitive culling (elimination) mechanism /vis/viewer/set/culling global (T), enables all other culling options invisible (T) covered daughters (F) density (F) (lower than given density) Defaults in brackets (T = true, F = false)

Visualisation & (G)UI - Geant4 Course Steps of Visualisation Step 1: Create a scene handler and a viewer Step 2: Create an empty scene Step 3: Add objects to the created scene Step 4: Attach the current scene handler to the current scene Step 5: Set camera parameters, drawing style (wireframe/surface), etc Step 6: “Execute” the visualisation Step 7: Declare the end of visualisation

Visualisation & (G)UI - Geant4 Course An Example of Visualising Detector # Invoke the OGLIX driver: # Create a scene handler and a viewer. /vis/open OGLIX # Set camera and drawing style /vis/viewer/reset /vis/viewer/viewpointThetaPhi /vis/viewer/set/style wireframe # Visualize of the whole detector geometry # The “/vis/drawVolume” creates a scene, adds the # world volume to it, and makes viewer render # visualisation. /vis/drawVolume # Declare the end of visualisation /vis/viewer/update

Visualisation & (G)UI - Geant4 Course An Example of Visualizing Events # Store particle trajactories for visualisation /tracking/storeTrajectory # Invoke the DAWN driver: Create a scene # handler and a viewer. /vis/open DAWN # Camera setting, and drawing style selection, # if necessary … # Create a new empty scene /vis/scene/create # Add the world volume and trajectories to the # current scene /vis/scene/add/volume /vis/scene/add/trajectories # Let the viewer visualise the scene, and declare # the end of visualisation /run/beamOn 10

Visualisation & (G)UI - Geant4 Course /vis/open Command Command Idle> /vis/open The “ driver_tag_name ” is a name which shows “ driver name ” + “ mode ” Action: Create a visualisation driver In other words, create a scene hander and a viewer Example: Creating the OPENGLX driver in the immediate mode: Idle> /vis/open OGLIX How to list available driver_tag_name Idle> help /vis/open or Idle> help /vis/sceneHandler/create

Visualisation & (G)UI - Geant4 Course /vis/viewer/… commands Commands Viewpoint setting: Idle> /vis/viewer/viewpointThetaPhi Zooming Idle> /vis/viewer/zoom Initialization of camera parameters: Idle> /vis/viewer/reset

Visualisation & (G)UI - Geant4 Course /vis/viewer/set/… commands /vis/viewer/set/style The “ style_name ” can be “ wireframe ” or “ surface ” /vis/viewer/set/all The viewer name is the short name, e.g., viewer-0. (Use /vis/viewer/list to see.) This copies all the view parameters from named viewer to current viewer. E.g: Find a good view with OpenGL, render to high quality with DAWN.

Visualisation & (G)UI - Geant4 Course /vis/drawVolume and /vis/viewer/update Commands Commands: Idle> /vis/drawVolume (Default: world) Idle> /vis/viewer/update Note that /vis/viewer/update should be executed to declare end of visualisation. You can add visualisation commands of, say, coordinate axes between the two commands. For example, Idle> /vis/drawVolume Idle> /vis/scene/add/axes Idle> /vis/viewer/update

Visualisation & (G)UI - Geant4 Course Commands to Visualize Events Commands Idle> /tracking/storeTrajectory 1 Idle> /vis/scene/add/trajectories Idle> /run/beamOn Action: Automatic visualisation of events

Visualisation & (G)UI - Geant4 Course47 Sample Visualisation (1) Slide 2

HepRep/WIRED DAWN OpenGL From Introduction to Geant4 Visualization by Joseph Perl, SLAC

DAWN HepRep/FRED OpenInventor From Introduction to Geant4 Visualization by Joseph Perl, SLAC

Visualisation & (G)UI - Geant4 Course50

Visualisation & (G)UI - Geant4 Course51

Visualisation & (G)UI - Geant4 Course52

Visualisation & (G)UI - Geant4 Course53

Visualisation & (G)UI - Geant4 Course54 8. Visualisation from C++ codes It is also possible to perform visualisation from the C++ code You can describe the visualisation commands in C++ codes via the ApplyCommand() method of the UI manager, as for any other command: pUI->ApplyCommand(“/vis/…”); Or you can use Draw() methods of visualizable classes

Visualisation & (G)UI - Geant4 Course55 9. Exercises Read and execute sample visualisation macros for examples/novice/N03 The macro files are “ exN03VisX.mac ”, where X=0,1,2,… Explanation of macros is all described in the macro files as comment lines

Visualisation & (G)UI - Geant4 Course Information Geant4 User Guide (and source codes) On-line documentation on Geant4 visualisation ForApplicationDeveloper/html/Visualization ForApplicationDeveloper/html/Visualization For commands UsersGuides/ForApplicationDeveloper/html/Control/com mands.html UsersGuides/ForApplicationDeveloper/html/Control/com mands.html SLAC tutorial

PART 2 Geant4GUI

Visualisation & (G)UI - Geant4 Course58 1. Select (G)UI (1) In the main(), according to the computer environments, construct a G4UIsession concrete class provided by Geant4 and invoke its sessionStart() method. Example: G4UIsession* session=0; if (argc==1) // Define UI session for interactive mode. { // G4UIterminal is a (dumb) terminal session = new G4UIterminal; }

Visualisation & (G)UI - Geant4 Course59 1. Select (G)UI (2) Geant4 provides the following interfaces for various (G)UI: G4UIterminal : C-shell like character terminal G4UItcsh : tcsh-like character terminal with command completion, history, etc G4UIGAG : Java based GUI G4UIXm : Motif-based GUI, command completion, etc Note for G4UItcsh : Use G4UIterminal with argument G4UItcsh* : session = new G4UIterminal (new G4UItcsh);

Visualisation & (G)UI - Geant4 Course60 2. Environmental Variables Users should use Configure to select and plug in (G)UI (or by setting environmental variables) setenv G4UI_USE_GUINAME Example: setenv G4UI_USE_TERMINAL 1 setenv G4UI_USE_GAG 1 setenv G4UI_USE_XM 1 Note that Geant4 library should be installed with setting the corresponding G4UI_BUILD_GUINAME_SESSION

Visualisation & (G)UI - Geant4 Course61 3. Useful GUI Tools Released by Geant4 Developers GGE: Geometry editor based on Java GUI GPE: Physics editor based on Java GUI OpenScientist: Interactive environment

PART 3 Geant4 DAVID & DTREE

Visualisation & (G)UI - Geant4 Course63 1. Volume-Overlapping Detection with DAVID (1) DAVID (DAWN-based Visual Volume Intersection Debugger) Automatically detects and highlights overlapping volumes Precise visualization with DAWN Interactive visualisation with VRML DAVID also generates log files describing detailed information on the detected overlaps Info & source:

Visualisation & (G)UI - Geant4 Course64 1. Volume-Overlapping Detection with DAVID (2) Usage of DAVID Switch the viewer of the DAWNFILE driver from renderer DAWN (default) to DAVID. setenv G4DAWNFILE_VIEWER david Then visualize volumes as usual with the DAWNFILE driver Overlapping volumes (if any) are visualized The view is stored in files g4david.prim (DAWN format) and g4david.eps (PostScript format) Log file: g4david.log

Visualisation & (G)UI - Geant4 Course65 1. Volume-Overlapping Detection with DAVID (3) Sample visualisation with overlapping volumes highlighted

Visualisation & (G)UI - Geant4 Course66 1. Volume-Overlapping Detection with DAVID (4) Log file format PhysVolName.CopyNo Shape line_num The “line_num” is the line number of the overlapping volume in the DAWN-fomat file “g4.prim file” generated by Geant4 Sample log file :..... !!! INTERSECTED VOLUMES !!! caloPhys.0: Tubs: line 17 caloPhys.1: Tubs: line

Visualisation & (G)UI - Geant4 Course67 1. Volume-Overlapping Dection with DAVID (5) If no overlaps are detected, DAVID displays the following message: !!! Number of intersected volumes : 0 !!! !!! Congratulations ! \(^o^)/ !!!

Visualisation & (G)UI - Geant4 Course68 2. Visualising the Detector Geometry Tree (DTREE) (1) Selection of outputs: ASCII-text format GAG-window XML file How to display a tree: Idle> /vis/drawTree ! XXXTree (XXXTree = ATree, GAGTree, XMLTree, etc) (Default is Atree) Detail level is controlled with the “verbose” command: /vis/XXXTree/verbose n

Visualisation & (G)UI - Geant4 Course69 2. DTREE:Visualising Detector Geometry Tree (3-1) ASCII Tree (ATree) : verbose level 0 (default) Format: PV_name + copy_number World "Calorimeter", copy no. 0 "Layer", copy no. -1 (10 replicas) "Absorber", copy no. 0 "Gap", copy no. 0

Visualisation & (G)UI - Geant4 Course70 2. DTREE:Visualising Detector Geometry Tree (3-2) ASCII Tree (ATree) For other outputs, see guidance (help /vis/ASCIITree/verbose) or header of output Possibilities — with or without repetition Physical volume and corresponding logical volume & solid Volume Mass of tree to specified depth Mass of all descendants "thePit":0 / "thePit" / "aBox"(G4Box), 8000 m3, 0.1 mg/cm3 "theMother1":0 / "aTest1" / "aBox"(G4Box), 1000 m3, 0.1 mg/cm3 Calculating mass(es)... Overall volume of "thePit":0, is 8000 m3 Mass of tree, ignoring daughters at depth 1 and below, is 800 kg

Visualisation & (G)UI - Geant4 Course71 2. DTREE:Visualising Detector Geometry Tree (4) GAG Tree

Visualisation & (G)UI - Geant4 Course72 2. DTREE:Visualising Detector Geometry Tree (5-1) XML Tree

Visualisation & (G)UI - Geant4 Course73 2. DTREE:Visualising Detector Geometry Tree (5-2) XML Tree (find)

PART 4 Geant4 AIDA & analysis

Visualisation & (G)UI - Geant4 Course75 Java Analysis Studio PI AIDA AIDA & Analysis Tools 1. Interface to AIDA  No dependence  Minimize coupling of components Through abstract interfaces

Visualisation & (G)UI - Geant4 Course76 2. Interfacing to Geant4 AIDA (Abstract Interfaces for Data Analysis) can be used in Geant4 by selecting the environmental variable G4ANALYSIS_USE Requires AIDA headers installed in the system Requires an AIDA compliant tool for analysis Tools for analysis compliant with AIDA interfaces currently are: PI (Physicist Interfaces for AIDA Analysis) JAS (Java Analysis Studio) Open Scientist Lab

Visualisation & (G)UI - Geant4 Course77 3. References … AIDA PI JAS (Java Analysis Studio) Open Scientist Lab