org.lcsim Recon XML Framework

Slides:



Advertisements
Similar presentations
AP Computer Science Anthony Keen. Computer 101 What happens when you turn a computer on? –BIOS tries to start a system loader –A system loader tries to.
Advertisements

Introduction to Java 2 Programming Lecture 4 Writing Java Applications, Java Development Tools.
3 Copyright © 2005, Oracle. All rights reserved. Basic Java Syntax and Coding Conventions.
The map and reduce functions in MapReduce are easy to test in isolation, which is a consequence of their functional style. For known inputs, they produce.
INHERITANCE BASICS Reusability is achieved by INHERITANCE
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the structure of a C-language program. ❏ To write your first C.
Using Ant to build J2EE Applications Kumar
Classes and Objects. Topics The Class Definition Declaring Instance Member Variables Writing Instance Member Methods Creating Objects Sending Messages.
Introduction to Engineering MATLAB – 6 Script Files - 1 Agenda Script files.
TUTORIAL 10: PROGRAMMING WITH JAVASCRIPT Session 2: What is JavaScript?
Java Quiz Bowl A fun review of the Java you should know from CMPT 201 If you don’t know the answers - this week is for you to study up!
ALCPG Software Framework Overview & Updates Jeremy McCormick, SLAC SiD Group ALCPG 2009.
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
The Log4E logging plug-in David Gallardo. What is logging good for? Tracing program execution during development Debugging Providing an audit trail for.
JUnit A framework which provides hooks for easy testing of your Java code, as it's built Note: The examples from these slides can be found in ~kschmidt/public_html/CS265/Labs/Java/Junit.
Methods. Methods also known as functions or procedures. Methods are a way of capturing a sequence of computational steps into a reusable unit. Methods.
Java methods Methods break down large problems into smaller ones Your program may call the same method many times saves writing and maintaining same code.
4. Javascript M. Udin Harun Al Rasyid, S.Kom, Ph.D Lab Jaringan Komputer (C-307) Desain.
® IBM Software Group © 2006 IBM Corporation Rational Asset Manager v7.2 Using Scripting Tutorial for using command line and scripting using Ant Tasks Carlos.
CPSC 233 Tutorial 5 February 9 th /10 th, Java Classes Each Java class contains a set of instance variables and methods Instance Variables: Type.
CHAPTER 8 Scope, Lifetime, and More on Functions.
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,
AdaptJ Sookmyung Women’s Univ. PSLAB. 1. 목차 1. Overview 2. Collecting Trace Data using the AdaptJ Agent 2.1 Recording a Trace 3. Analyzing Trace Data.
LCSim Tutorial for Muon Collider Detector Studies Jeremy McCormick, Norman Graf SLAC Hans Wenzel FNAL.
Programming in Java Transitioning from Alice. Becomes not myFirstMethod but …. public static void main (String[] arg) { // code for testing classes goes.
Java 5 Class Anatomy. User Defined Classes To this point we’ve been using classes that have been defined in the Java standard class library. Creating.
Methods. Methods are groups of statements placed together under a single name. All Java applications have a class which includes a main method class MyClass.
1 Project 12: Cars from File. This is an extension of Project 11, Car Class You may use the posted solution for Project 11 as a starting point for this.
SWE 434 SOFTWARE TESTING AND VALIDATION LAB2 – INTRODUCTION TO JUNIT 1 SWE 434 Lab.
Andrew(amwallis) Classes!
Test 2 Review Outline.
Classes and Objects.
Content Programming Overview The JVM A brief look at Structure
USING ECLIPSE TO CREATE HELLO WORLD
A Lecture for the c++ Course
Coding Defensively Coding Defensively
Functions CIS 40 – Introduction to Programming in Python
4. Javascript Pemrograman Web I Program Studi Teknik Informatika
INF3110: Exercises Part 3 Comments and Solutions
Engineering Innovation Center
User Defined Functions
CSC 253 Lecture 8.
Subroutines Idea: useful code can be saved and re-used, with different data values Example: Our function to find the largest element of an array might.
Introduction to the C Language
Some Tips for Using Eclipse
CSC 253 Lecture 8.
How to Run a Java Program
Ruby Testing 2, 11/9/2004.
Introduction to SAS A SAS program is a list of SAS statements executed in order Every SAS statement ends with a semicolon! SAS statements can be in caps.
Beans and object editor
PHP.
Defining methods and more arrays
Parameter Passing in Java
Chap 1 Chap 2 Chap 3 Chap 5 Surprise Me
Programs and Classes A program is made up from classes
Tonga Institute of Higher Education
Python 19 Mr. Husch.
Introduction to Java Brief history of Java Sample Java Program
Functions continued.
Classes, Objects and Methods
Java Looking at our first console application in Eclipse
Sookmyung Women’s Univ. PSLAB
Java: Variables, Input and Arrays
Python 19 Mr. Husch.
CS 1054: Lecture 2, Chapter 1 Objects and Classes.
Methods/Functions.
Review for Midterm 3.
ENERGY 211 / CME 211 Lecture 29 December 3, 2008.
SEEM 4540 Tutorial 4 Basic PHP based on w3Schools
SPL – PS1 Introduction to C++.
Presentation transcript:

org.lcsim Recon XML Framework Jeremy McCormick, SLAC

Purpose provide XML frontend to org.lcsim that is Marlin-like replace various ways of feeding reconstruction/analysis parameters to Drivers (.ini files, xml files, etc.) run control or steering of org.lcsim jobs

Non-working Example <lcsim> <inputFiles> <file>/path/to/local/event.slcio</file> <fileUrl>ftp://www.example.org/myLcioFile.slcio</fileUrl> </inputFiles> <control> <logFile>/path/to/my/output.log</logFile> <numberOfEvents>1000</numberOfEvents> <verbose>true</verbose> <fileCache>/my/local/cache/dir</fileCache> </control> <execute> <driver name=“MyDriver” type=“org.lcsim.MyDriver”/> </execute> <drivers> <driver name=“MyDriver” type=“org.lcsim.MyDriver”> <specialSecretCodeWord>frobnoz</specialSecretCodeWord> <specialSecretNumber>42</specialSecretNumber> </driver> </drivers> </lcsim>

Defining a Driver must have class extending Driver in org.lcsim code (or some other project) if defined in another project, must use <classpath> (see “Class Path” section) name can be anything as long as it is unique type is a fully qualified class extending Driver class MyDriver extends Driver {…} <execute> <driver name=“MyDriver”/> </execute> <drivers> <driver name=“MyDriver” type=“org.lcsim.MyDriver”/> </drivers>

Parameters Support defined within <driver> in the <drivers> section Java primitives int, double, long, boolean String 2d arrays some basic types Hep3Vector requires a set method with a single parameter (see next slide) todo: add global parameters not associated to single Driver

Defining Parameters define a setter method in your Driver: class MyDriver extends { public void setMyVariable(int mv); } automatically creates a variable myVariable in the xml <driver …> <myVariable>1234</myVariable> </driver> naming: setMyVariable -> MyVariable -> myVariable first letter is always lower case! (javabeans)

Running from the Command Line new org.lcsim command line script build with maven 2: mvn install ./bin/lcsim mySteeringFile.xml this script is just: java -cp [very long classpath] org.lcsim.job.JobControlManager $@

Running from within Java JobControlManager mgr = new JobControlManager(); mgr.setup(“/path/to/my/steering.xml”); mgr.run();

Job Execution Order defind in <execute> section references the <drivers> section so nothing is defined here ordering is respected! (obviously) make sure that you don’t accidently comment out a driver here and then forget to put it back <execute> <driver name=“MyDriver”/> </execute> <drivers> <driver name=“MyDriver” type=“org.lcsim.ExampleDriver”/>

Input Files defined in <inputFiles> block file on local file system <file>/path/to/myEvents.slcio</file> file at URL <fileUrl>http://www.example.org/events.slcio</fileUrl> unlimited number of files can be run in same job currently accepts only total number of events to be run (LCSim.loop(numberOfEvents))

All Job Control Parameters <logFile>./seedtrackerStrategyBuilder.log</logFile> <cacheDirectory>.</cacheDirectory> <numberOfEvents>-1</numberOfEvents> <verbose>true</verbose> <printDriverStatistics>true</printDriverStatistics> <printSystemProperties>true</printSystemProperties> <printUserClassPath>true</printUserClassPath> <printDriversDetailed>true</printDriversDetailed> </control>

Job Control Parameters defined in <control> section parameters that control job execution numberOfEvents - passed to LCSimLoop logFile - log file on local file system verbose - turn on verbose job control output printDetailedDriverInformation - prints name/type of driver and parameter values as they are processed printSystemProperties - prints all properties defined in System.getProperties() printInputFiles - prints input file locations/URLs as they are processed

Modifying the Class Path use to add dependencies external to lcsim that contain Drivers <classpath> <jar>/path/to/local/mylib.jar</jar> <jarUrl>http://www.example.org/mylib.jar</jarUrl> </classpath> </drivers>

Actual Example <lcsim> <inputFiles> <file>./muons10_Theta4-176_1-10GeV_SLIC-v2r3p10_geant4-v9r0p1_LCPhys_sid01.slcio</file> </inputFiles> <control> <logFile>./seedtrackerStrategyBuilder.log</logFile> <cacheDirectory>.</cacheDirectory> <numberOfEvents>-1</numberOfEvents> <verbose>true</verbose> </control> <execute> <driver name="StrategyBuilder"/> </execute> <drivers> <driver name="StrategyBuilder" type="org.lcsim.recon.tracking.seedtracker.strategybuilder.StrategyBuilder"> <output>./seedtrackerStrategyBuilderTest.xml</output> </driver> </drivers> </lcsim>