Geant4 v9.2p02 User Interface I Makoto Asai (SLAC) Geant4 Tutorial Course.

Slides:



Advertisements
Similar presentations
CSE 105 Structured Programming Language (C)
Advertisements

JavaScript I. JavaScript is an object oriented programming language used to add interactivity to web pages. Different from Java, even though bears some.
First Step on User Commands Makoto Asai (SLAC) Geant4 Users CERN Nov. 11th, 2002.
User Interface The full set of lecture notes of this Geant4 Course is available at
CSCI 1730 April 1 st, Materials Class notes slides & some “plain old” html & source code examples linked from course calendar board notes & diagrams.
User Interface I Makoto Asai (SLAC) Geant4 Tutorial Course Geant4 v8.3.
NETW-240 Shells Last Update Copyright Kenneth M. Chipps Ph.D. 1.
FILE TRANSFER PROTOCOL Short for File Transfer Protocol, the protocol for exchanging files over the Internet. FTP works in the same way as HTTP for transferring.
Git/Unix Lab March Version Control ●Keep track of changes to a project ●Serves as a backup ●Revert to previous version ●Work on the same files concurrently.
CS Lecture 03 Outline Sed and awk from previous lecture Writing simple bash script Assignment 1 discussion 1CS 311 Operating SystemsLecture 03.
Geant4 User Interface Overview Geant4 Mini-Tutorial Hebden Bridge 15 September 2007 Joseph Perl, SLAC (mostly stolen from a talk by Makoto Asai)
Linux+ Guide to Linux Certification, Second Edition
Geant4 v9.4 User Interface I Makoto Asai (SLAC) Geant4 Tutorial Course.
23-Jun-15Advanced Programming Spring 2002 bash Henning Schulzrinne Department of Computer Science Columbia University.
More Shell Basics CS465 - Unix. Unix shells User’s default shell - specified in /etc/passwd file To show which shell you are currently using: $ echo $SHELL.
User Commands Makoto Asai (SLAC) Geant4 Users SLAC Feb. 19th, 2002.
Guide To UNIX Using Linux Third Edition
Guide to Linux Installation and Administration, 2e1 Chapter 6 Using the Shell and Text Files.
Introduction to Unix (CA263) Introduction to Shell Script Programming By Tariq Ibn Aziz.
Using Linux Commands 2 Lab#5
Introduction to Linux and Shell Scripting Jacob Chan.
Linux Shell. 2 Linux Command-Line Interface ■ Linux shells: A shell is a command interpreter that allows you to type commands from the keyboard to interact.
Using Linux Commands 2 Lab#5. Sort command Sort the lines of text files. $ sort fileName by default it will sort in normal order(alphabetical 0-9 A-Z.
IEEE Nuclear Science Symposium and Medical Imaging Conference Short Course The Geant4 Simulation Toolkit Sunanda Banerjee (Saha Inst. Nucl. Phys., Kolkata,
Chapter 9 Part II Linux Command Line Access to Linux Authenticated login using a Linux account is required to access a Linux system. The Linux prompt will.
Introduction to Shell Script Programming
Ch 21 Command Syntax Using the DIR Command with Parameters and Wildcards.
Week 7 Working with the BASH Shell. Objectives  Redirect the input and output of a command  Identify and manipulate common shell environment variables.
– Introduction to the Shell 10/1/2015 Introduction to the Shell – Session Introduction to the Shell – Session 2 · Permissions · Users.
An Introduction to Unix Shell Scripting
®® Microsoft Windows 7 for Power Users Tutorial 13 Using the Command-Line Environment.
Unix Tutorial for FreeSurfer Users. Helpful To Know FreeSurfer Tutorial Wiki:
1 UNIX essentials (hands-on) the directory tree running programs the shell → command line processing → special characters → command types → shell variables.
S9-1 ADM , Section 9, August 2005 Copyright  2005 MSC.Software Corporation SECTION 9 COMMAND LANGUAGE.
Unix Tutorial for FreeSurfer Users. Helpful To Know FreeSurfer Tutorial Wiki:
Lecture 4  C Shell Scripts(Chapter 10). Shell script/program  Shell script: a series of shell commands placed in an ASCII text file  Commands include.
Introduction to Bash Programming Ellen Zhang. Previous three classes What have we learnt so far ?
Linux+ Guide to Linux Certification, Third Edition
1 Homework / Exam HW7 is due next class Starting Glass chapter 4 and parts of 7 Exam 3 – Class 26 –Open Book / Open Notes –Up through End of K&R Chapter.
1 Operating Systems Lecture 2 UNIX and Shell Scripts.
Introduction to Geant4 User Interface J. Perl1 6 June 2005 Introduction to Geant4 User Interface Joseph Perl Stanford Linear Accelerator Center.
UI command Makoto Asai (SLAC) Geant4 Tutorial CERN May 25-27, 2005 May 2005, Geant4 v7.0p01.
Lesson 2-Touring Essential Programs. Overview Development of UNIX and Linux. Commands to execute utilities. Communicating instructions to the shell. Navigating.
Shell Advanced Features. Module 8 Shell Advanced Features ♦ Introduction In Linux systems, the shells are often referred to as command line interfaces.
Unix Environment Input Output 2  List Content (ls) ◦ ls (list current directory) ◦ ls –all (include hidden files/folders)  Make directory (mkdir) ◦
Using UNIX Shell Scripts Michael Griffiths Corporate Information and Computing Services The University of Sheffield
©Colin Jamison 2004 Shell scripting in Linux Colin Jamison.
CSCI 330 UNIX and Network Programming Unit III Shell, Part 1.
1 © 2001 John Urrutia. All rights reserved. Chapter 2 Getting Started.
Linux+ Guide to Linux Certification, Second Edition
Linux Tutorial Lesson Two *Getting Help in Linux *Data movement and manipulation *Relative and Absolute path *Processes Note: see chapter 1,2,3 from Linux.
PHP Tutorial. What is PHP PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
Unix Lab Fall Shell Scripting ●Through the shell (LXTerminal) you can: ●Run programs. ●Interact with the file system. ●Change settings. ●Send/receive.
Linux Administration Working with the BASH Shell.
INTRODUCTION TO SHELL SCRIPTING By Byamukama Frank
Bash Scripting CIRC Summer School 2016 Baowei Liu CIRC Summer School 2016 Baowei Liu.
PHP using MySQL Database for Web Development (part II)
UNIX To do work for the class, you will be using the Unix operating system. Once connected to the system, you will be presented with a login screen. Once.
CIRC Winter Boot Camp 2017 Baowei Liu
Linux Commands Help HANDS ON TRAINING Author: Muhammad Laique
The full set of lecture notes of this Geant4 Course is available at
UI & Interfaces : latest updates
John Carelli, Instructor Kutztown University
CSCI The UNIX System Shell Startup and Variables
Makoto Asai (SLAC) Geant4 Tutorial Course
CSE 303 Concepts and Tools for Software Development
Module 4 Command Line Skills
PHP an introduction.
Makoto Asai (SLAC) Geant4 Users CERN Nov. 13th, 2002
Introduction to Bash Programming, part 3
Presentation transcript:

Geant4 v9.2p02 User Interface I Makoto Asai (SLAC) Geant4 Tutorial Course

Contents Command syntax Macro file G4UIterminal User Interface I - M. Asai (SLAC)2

Geant4 UI command 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 User Interface I - M. Asai (SLAC)3 /run/verbose 1 /vis/viewer/flush

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. User Interface I - M. Asai (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 User Interface I - M. Asai (SLAC)5

Macro file 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"); User Interface I - M. Asai (SLAC)6

Available Commands 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. User Interface I - M. Asai (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}} User Interface I - M. Asai (SLAC)8

Loop /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 User Interface I - M. Asai (SLAC)9

G4UIterminal G4UIterminal is a concrete implementation derived from G4UIsession abstract base class. It provides character-base interactive terminal functionality to issue Geant4 UI commands. –C-shell or TC-shell (Linux only) new G4UIterminal(new G4UItcsh); –For Windows new G4UIWin32(); int main(int argc,char** argv) { … G4UImanager* UImanager = G4UImanager::GetUIpointer(); if(argc==1) { // interactive mode G4UIsession* session = new G4UIterminal(new G4UItcsh); session->SessionStart(); delete session; } else { // batch mode G4String command = "/control/execute " + argv[1]; UImanager->ApplyCommand(command); } User Interface I - M. Asai (SLAC)10

G4UIterminal It supports some Unix-like commands for directory. –cd, pwd - change and display current command directory By setting the current command directory, you may omit (part of) directory string. –ls - list available UI commands and sub-directories It also supports some other commands. –history - show previous commands –!historyID - re-issue previous command –arrow keys and tab (TC-shell only) –?UIcommand - show current parameter values of the command –help [UIcommand] - help –exit - job termination Above commands are interpreted in G4UIterminal and are not passed to Geant4 kernel. You cannot use them in a macro file. User Interface I - M. Asai (SLAC)11