Geant4 User Interface Overview Geant4 Mini-Tutorial Hebden Bridge 15 September 2007 Joseph Perl, SLAC (mostly stolen from a talk by Makoto Asai)

Slides:



Advertisements
Similar presentations
Question Bank. Explain the syntax of if else statement? Define Union Define global and local variables with example Concept of recursion with example.
Advertisements

First Step on User Commands Makoto Asai (SLAC) Geant4 Users CERN Nov. 11th, 2002.
Geant4 v9.2p02 User Interface I Makoto Asai (SLAC) Geant4 Tutorial Course.
CSCI 1730 April 1 st, Materials Class notes slides & some “plain old” html & source code examples linked from course calendar board notes & diagrams.
Stata and logit recap. Topics Introduction to Stata – Files / directories – Stata syntax – Useful commands / functions Logistic regression analysis with.
Classes  All code in a Java program is part of a class  A class has two purposes  Provide functions to do work for the programmer  Represent data.
User Interface I Makoto Asai (SLAC) Geant4 Tutorial Course Geant4 v8.3.
Geant4 v9.2p02 Particle Gun Makoto Asai (SLAC) Geant4 Tutorial Course.
Linux+ Guide to Linux Certification, Second Edition
Geant4 v9.4 User Interface I Makoto Asai (SLAC) Geant4 Tutorial Course.
CS-341 Dick Steflik Introduction. C++ General purpose programming language A superset of C (except for minor details) provides new flexible ways for defining.
User Commands Makoto Asai (SLAC) Geant4 Users SLAC Feb. 19th, 2002.
Guide To UNIX Using Linux Third Edition
Guide To UNIX Using Linux Third Edition
Guide To UNIX Using Linux Third Edition
Introduction to Unix (CA263) Introduction to Shell Script Programming By Tariq Ibn Aziz.
PHP Server-side Programming. PHP  PHP stands for PHP: Hypertext Preprocessor  PHP is interpreted  PHP code is embedded into HTML code  interpreter.
C How to Program, 6/e © by Pearson Education, Inc. All Rights Reserved.
Improvements in Interface, Intercoms and environments Koichi Murakami (KEK/CRC) Koichi Murakami Geant4 Collaboration Workshop (18/Sep/2007) 1.
IEEE Nuclear Science Symposium and Medical Imaging Conference Short Course The Geant4 Simulation Toolkit Sunanda Banerjee (Saha Inst. Nucl. Phys., Kolkata,
AIT 616 Fall 2002 PHP. AIT 616 Fall 2002 PHP  Special scripting language used to dynamically generate web documents  Open source – Free!!!  Performs.
Introduction to Shell Script Programming
Week 7 Working with the BASH Shell. Objectives  Redirect the input and output of a command  Identify and manipulate common shell environment variables.
CISC474 - JavaScript 03/02/2011. Some Background… Great JavaScript Guides: –
Linux+ Guide to Linux Certification, Third Edition
Website Development with PHP and MySQL Saving Data.
Agenda Regular Expressions (Appendix A in Text) –Definition / Purpose –Commands that Use Regular Expressions –Using Regular Expressions –Using the Replacement.
Introduction to Geant4 User Interface J. Perl1 6 June 2005 Introduction to Geant4 User Interface Joseph Perl Stanford Linear Accelerator Center.
Fundamentals of GUI Programming. Objectives: At the end of the session, you should be able to: describe the guidelines that are used for creating user-friendly.
Variables and ConstantstMyn1 Variables and Constants PHP stands for: ”PHP: Hypertext Preprocessor”, and it is a server-side programming language. Special.
Primary particle Giovanni Santin ESA / ESTEC and RheaTech Ltd On behalf of the Geant4 collaboration Ecole Geant4 Annecy, and Nov 2008 With.
FIRST JAVA PROGRAM. JAVA PROGRAMS Every program may consist of 1 or more classes. Syntax of a class: Each class can contain 1 or more methods. public.
UI command Makoto Asai (SLAC) Geant4 Tutorial CERN May 25-27, 2005 May 2005, Geant4 v7.0p01.
Chapter 10: BASH Shell Scripting Fun with fi. In this chapter … Control structures File descriptors Variables.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
Data TypestMyn1 Data Types The type of a variable is not set by the programmer; rather, it is decided at runtime by PHP depending on the context in which.
Introducing Python CS 4320, SPRING Resources We will be following the Python tutorialPython tutorial These notes will cover the following sections.
Chapter 3 Functions, Events, and Control Structures JavaScript, Third Edition.
Counter-Controlled Loops CSIS 1595: Fundamentals of Programming and Problem Solving 1.
Introducing Python CS 4320, SPRING Lexical Structure Two aspects of Python syntax may be challenging to Java programmers Indenting ◦Indenting is.
Chapter 2: Introduction to HyperMesh Process Auomation
CS 330 Programming Languages 10 / 02 / 2007 Instructor: Michael Eckmann.
©Colin Jamison 2004 Shell scripting in Linux Colin Jamison.
S11-1 ADM , Section 11, August 2005 Copyright  2005 MSC.Software Corporation SECTION 11 MACROS: OVERVIEW.
Geant4 examples Sébastien Incerti On behalf of the Geant4 collaboration with special thanks to Luciano Pandola, INFN.
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
LING 408/508: Programming for Linguists Online Lecture 6 September 14 th.
Linux+ Guide to Linux Certification, Second Edition
BY: JAKE TENBERG & CHELSEA SHIPP PROJECT REVIEW: JGIBBERISH.
1 G4UIRoot Isidro González ALICE ROOT /10/2002.
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
PHP Overview. What is PHP Widely available scripting language Free Alternative to Microsoft’s ASP Runs on the Web Server; not in the browser Example:
CS 330 Programming Languages 09 / 30 / 2008 Instructor: Michael Eckmann.
Presentation By :- Nikhil R. Anande ( ) Electronic & Communication Engineering. 3 nd Year / 5 th Semester FACULTY GUIDE : RAHIUL PATEL SIR MICROCONTROLLER.
Linux Administration Working with the BASH Shell.
Updates on Intercoms / Interfaces
DBW - PHP DBW2017.
The full set of lecture notes of this Geant4 Course is available at
SECTION 3 MACROS: OVERVIEW.
CHAPTER 8 (skip , ) CHAPTER 10
User Interface
Makoto Asai (SLAC) Geant4 Tutorial Course
CSE 303 Concepts and Tools for Software Development
Geant4 course - exercices
Module 4 Command Line Skills
Makoto Asai (SLAC) Geant4 Users CERN Nov. 13th, 2002
Introduction to Bash Programming, part 3
Introduction to Programming - 1
Visualisation and (G)UI
Presentation transcript:

Geant4 User Interface Overview Geant4 Mini-Tutorial Hebden Bridge 15 September 2007 Joseph Perl, SLAC (mostly stolen from a talk by Makoto Asai)

Geant4 User Interface Overview - J. Perl (SLAC)2 Command Syntax  A command consists of  Command directory  Command  Parameter(s)  A parameter can be a type of string, boolean, integer or double.  Space is a delimiter.  Use double-quotes (“”) for string with space(s).  A parameter may be “omittable”. If it is the case, a default value will be taken if you omit the parameter.  Default value is either predefined default value or current value according to its definition.  If you want to use the default value for your first parameter while you want to set your second parameter, use “!” as a place holder. /dir/command ! second /run/verbose 1 /vis/viewer/flush

Geant4 User Interface Overview - J. Perl (SLAC)3 Command submission  Geant4 UI command can be issued by  (G)UI interactive command submission  Macro file  Hard-coded implementation  Slow but no need for the targeting class pointer  Should not be used inside an event loop G4UImanager* UI = G4UImanager::GetUIpointer(); UI->ApplyCommand("/run/verbose 1");  The availability of individual command, the ranges of parameters, the available candidates on individual command parameter may vary according to the implementation of your application and may even vary dynamically during the execution of your job.  some commands are available only for limited Geant4 application state(s).  E.g. /run/beamOn is available only for Idle states.

Geant4 User Interface Overview - J. Perl (SLAC)4 Command refusal  Command will be refused in case of  Wrong application state  Wrong type of parameter  Insufficient number of parameters  Parameter out of its range  For integer or double type parameter  Parameter out of its candidate list  For string type parameter  Command not found

Geant4 User Interface Overview - J. Perl (SLAC)5 Available Commands  You can define your own commands.  See talk on this topic at: (and pdf)  You can get a list of available commands including your custom ones by /control/manual [directory]  Plain text format to standard output /control/createHTML [directory]  HTML file(s) - one file per one (sub-)directory  List of built-in commands is also available in section 7.1 of User's Guide For Application Developers.

Geant4 User Interface Overview - J. Perl (SLAC)6 Macro  Macro file is an ASCII file contains UI commands.  All commands must be given with their full-path directories.  Use “#” for comment line.  First “#” to the end of the line will be ignored.  Comment lines will be echoed if /control/verbose is set to 2.  Macro file can be executed  interactively or in (other) macro file /control/execute file_name  hard-coded G4UImanager* UI = G4UImanager::GetUIpointer(); UI->ApplyCommand("/control/execute file_name");

Geant4 User Interface Overview - J. Perl (SLAC)7 Alias  Alias can be defined by /control/alias [name] [value]  It is also set with /control/loop and /control/foreach commands  Aliased value is always treated as a string even if it contains numbers only.  Alias is to be used with other UI command (and macro files).  Use curly brackets, { and }.  For example, frequently used lengthy command can be shortened by aliasing. /control/alias tv "/tracking/verbose" {tv} 1  Aliases can be used recursively. /control/alias file1 /diskA/dirX/fileXX.dat /control/alias file2 /diskB/dirY/fileYY.dat /control/alias run 1 /myCmd/getFile {file{run}}

Geant4 User Interface Overview - J. Perl (SLAC)8Loop   /control/loop and /control/foreach commands execute a macro file more than once. Aliased variable name can be used inside the macro file.   /control/loop [macroFile] [counterName] [initialValue] [finalValue] [stepSize]   counterName is aliased to the number as a loop counter   /control/foreach [macroFile] [counterName] [valueList]   counterName is aliased to a value in valueList   valueList must be enclosed by double quotes (" ")   on UI terminal or other macro file /control/loop myRun.mac Ekin   in myRun.mac /control/foreach mySingleRun.mac pname “p pi- mu-”   in mySingleRun.mac /gun/particle {pname} /gun/energy {Ekin} GeV /run/beamOn 100

Geant4 User Interface Overview - J. Perl (SLAC)9 Choice of User Interface  In keeping with its nature as a Toolkit rather than an Application, Geant4 allows you to select one of several different user interfaces.  Most of the examples used by novices rely on the terminal interface:  G4UIsession* session = new G4UIterminal(new G4UItcsh);  But other interfaces can be used instead, such as:  Motif: G4UIXm  GAG: G4UIGAG  Pyton  Qt (coming soon)  It’s beyond the scope of this talk to explain much more about this  But the point is that you have great flexibility