visualisation, (g)ui and analysis

77
Visualisation, (G)UI and Analysis http://cern.ch/geant4 The full set of lecture notes of this Geant4 Course is available at http://geant4.web.cern.ch/geant4/meetings/school2005/

Upload: betha

Post on 05-Feb-2016

72 views

Category:

Documents


0 download

DESCRIPTION

Visualisation, (G)UI and Analysis. http://cern.ch/geant4 The full set of lecture notes of this Geant4 Course is available at http://geant4.web.cern.ch/geant4/meetings/school2005/. Contents (1). Part 1: How to perform visualisation Introduction Visualisable Objects Visualisation Attributes - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Visualisation, (G)UI and Analysis

Visualisation, (G)UI and Analysis

http://cern.ch/geant4

The full set of lecture notes of this Geant4 Course is available athttp://geant4.web.cern.ch/geant4/meetings/school2005/

Page 2: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 2

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

Page 3: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 3

Contents (2)

Part 2: Geant4 GUI Select (G)UI Environmental variables Useful GUI Tools Released by Geant4

Developers

Page 4: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 4

Contents (3)

Part 3: DAVID and DTREE Graphically detecting overlaps in geometry Display of the detector geometry tree

Page 5: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 5

Contents (4)

Part 4: AIDA and binding to analysis AIDA abstract interfaces Geant4 setup and analysis tools

Page 6: Visualisation, (G)UI and Analysis

PART 1

Geant4Geant4

VisualisationVisualisation

Page 7: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 7

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 …

Page 8: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 8

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

Page 9: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 9

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 …

Page 10: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 10

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)

Page 11: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 11

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)

Page 12: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 12

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

Page 13: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 13

3.2 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.

Page 14: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 14

3.3 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)

Page 15: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 15

3.3 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)

Page 16: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 16

3.4 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…

Page 17: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 17

//----- 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:

Page 18: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 18

4. Polyline and Marker

Polyline and marker are defined in the graphics_reps category

They are available to model 3D scenes for visualisation

Page 19: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 19

4.1 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.

Page 20: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 20

//-- 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:

Page 21: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 21

4.2 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)

Page 22: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 22

4.2 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)

Page 23: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 23

4.2 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.

Page 24: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 24

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

Page 25: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 25

4.3 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 concreteinstance through G4VVisManager ::GetConcreteInstance (it also ensures a valid view is available)

Page 26: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 26

4.3 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.

Page 27: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 27

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); }}

Page 28: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 28

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

Page 29: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 29

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

Page 30: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 30

5.2 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”)

Page 31: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 31

5.3 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

Page 32: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 32

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

Page 33: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 33

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

Page 34: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 34

7. Visualisation commands

Here, we introduce some frequently-used built-in visualisation commands

See command web page http://geant4.web.cern.ch/geant4/G4UsersDocuments/UsersGuides/ForApplicationDeveloper/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

Page 35: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 35

7.1 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”

Page 36: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 36

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

Page 37: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 37

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

Page 38: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 38

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)

Page 39: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 39

7.2 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

Page 40: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 40

7.3 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 70 20/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

Page 41: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 41

7.4 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

Page 42: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 42

7.5 /vis/open Command

Command Idle> /vis/open <driver_tag_name> 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

Page 43: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 43

7.6 /vis/viewer/… commands

Commands Viewpoint setting:Idle> /vis/viewer/viewpointThetaPhi

<theta_deg> <phi_deg>

ZoomingIdle> /vis/viewer/zoom <scale_factor>

Initialization of camera parameters:Idle> /vis/viewer/reset

Page 44: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 44

7.7 /vis/viewer/set/… commands

/vis/viewer/set/style <style_name> The “style_name” can be “wireframe” or “surface”

/vis/viewer/set/all <viewer-name> 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.

Page 45: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 45

7.8 /vis/drawVolume and/vis/viewer/update Commands

Commands: Idle> /vis/drawVolume <physical-volume-name> (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 <Ox> <Oy> <Oz>

<length> <unit> Idle> /vis/viewer/update

Page 46: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 46

7.9 Commands to Visualize Events

Commands Idle> /tracking/storeTrajectory 1Idle> /vis/scene/add/trajectoriesIdle> /run/beamOn <number_of_events>

Action: Automatic visualisation of events

Page 47: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 47

Sample Visualisation (1)

Slide 2Slide 2

Page 48: Visualisation, (G)UI and Analysis

HepRep/WIRED

DAWN

OpenGL

From Introduction to Geant4 Visualization by Joseph Perl, SLAC

Page 49: Visualisation, (G)UI and Analysis

DAWN

HepRep/FRED

OpenInventor

From Introduction to Geant4 Visualization by Joseph Perl, SLAC

Page 50: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 50

Page 51: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 51

Page 52: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 52

Page 53: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 53

Page 54: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 54

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

Page 55: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 55

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

Page 56: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 56

10. Information

Geant4 User Guide (and source codes) On-line documentation on Geant4 visualisation

http://cern.ch/geant4/G4UsersDocuments/UsersGuides/ForApplicationDeveloper/html/Visualization

For commands http://geant4.web.cern.ch/geant4/G4UsersDocuments/

UsersGuides/ForApplicationDeveloper/html/Control/commands.html

SLAC tutorial http://geant4.slac.stanford.edu/SLACTutorial04/

Page 57: Visualisation, (G)UI and Analysis

PART 2

Geant4Geant4

GUIGUI

Page 58: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 58

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;

}

Page 59: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 59

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);

Page 60: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 60

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

Page 61: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 61

3. Useful GUI Tools Released by Geant4 Developers

GGE: Geometry editor based on Java GUI http://erpc1.naruto-u.ac.jp/~geant4

GPE: Physics editor based on Java GUI http://erpc1.naruto-u.ac.jp/~geant4

OpenScientist: Interactive environment http://www.lal.in2p3.fr/OpenScientist

Page 62: Visualisation, (G)UI and Analysis

PART 3

Geant4Geant4

DAVID & DTREEDAVID & DTREE

Page 63: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 63

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:• http://geant4.kek.jp/~tanaka

Page 64: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 64

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

Page 65: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 65

1. Volume-Overlapping Detection with DAVID (3)

Sample visualisationwith overlapping volumes highlighted

Page 66: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 66

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 25 .....

Page 67: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 67

1. Volume-Overlapping Dection with DAVID (5)

If no overlaps are detected, DAVID displays the following message:

------------------------------------------------------

!!! Number of intersected volumes : 0 !!!

!!! Congratulations ! \(^o^)/ !!!

------------------------------------------------------

Page 68: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 68

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

Page 69: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 69

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

Page 70: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 70

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/cm3Calculating mass(es)...Overall volume of "thePit":0, is 8000 m3 Mass of tree, ignoring daughters at depth 1 and below, is 800 kg

Page 71: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 71

2. DTREE:Visualising Detector Geometry Tree (4)

GAG Tree

Page 72: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 72

2. DTREE:Visualising Detector Geometry Tree (5-1)

XML Tree

Page 73: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 73

2. DTREE:Visualising Detector Geometry Tree (5-2)

XML Tree(find)

Page 74: Visualisation, (G)UI and Analysis

PART 4

Geant4Geant4

AIDA & analysisAIDA & analysis

Page 75: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 75

Java Analysis Studio

PI

AIDA

AIDA & Analysis Tools

1. Interface to AIDA

No dependence

Minimize coupling of components

Through abstract interfaces

Page 76: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 76

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

Page 77: Visualisation, (G)UI and Analysis

Visualisation & (G)UI - Geant4 Course 77

3. References …

AIDA http://aida.freehep.org

PI http://cern.ch/PI/

JAS (Java Analysis Studio) http://jas.freehep.org

Open Scientist Lab http://www.lal.in2p3.fr/OpenScientist