MONTE CARLO EVENT GENERATION IN A MULTILANGUAGE, MULTIPLATFORM ENVIRONMENT Norman Graf Tony Johnson Stanford Linear Accelerator Center Abstract: We discuss.

Slides:



Advertisements
Similar presentations
MicroKernel Pattern Presented by Sahibzada Sami ud din Kashif Khurshid.
Advertisements

EvtGen in ATLAS/LHC Roger W.L. Jones James R. Catmore Maria Smizanska Lancaster University, UK.
Programming Paradigms and languages
RunJob in CMS Greg Graham Discussion Slides. RunJob in CMS RunJob is an Application Configuration and Job Creation Tool –RunJob uses metadata to abstract.
Why ROOT?. ROOT ROOT: is an object_oriented frame work aimed at solving the data analysis challenges of high energy physics Object _oriented: by encapsulation,
ECHO: NASA’s E os C learing HO use Integrating Access to Data Services Michael Burnett Blueprint Technologies, 7799 Leesburg.
George Blank University Lecturer. CS 602 Java and the Web Object Oriented Software Development Using Java Chapter 4.
1 Introducing Collaboration to Single User Applications A Survey and Analysis of Recent Work by Brian Cornell For Collaborative Systems Fall 2006.
Event Generators Norman Graf (SLAC) May 20, 2003 May 20, 2003.
25/03/2003Simulation Application for the LHCb Experiment CHEP March 2003 Presented by: W. Pokorski / CERN Authors: I. Belyaev, Ph. Charpentier,
MC-tester as tool for transition from F77 HEPEVT to C++ HepMC Nadia Davidson.
Victor Serbo, SLAC30 September 2004, Interlaken, Switzerland JASSimApp plugin for JAS3: Interactive Geant4 GUI Serbo, Victor (SLAC) - presenter Donszelmann,
C++ fundamentals.
Introduction 01_intro.ppt
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Robert Fourer, Jun Ma, Kipp Martin Optimization Services Instance Language (OSiL), Solvers, and Modeling Languages Kipp Martin University of Chicago
LCIO A persistency framework for LC detector simulation studies Frank Gaede, DESY, IT 4 th ECFA/DESY LC Workshop Amsterdam April 1 st -4 th 2003.
SiD Software Status. Framework Overview Pythia, WHIZARD, etc. Pythia, WHIZARD, etc. SLIC Tracking, PFA, etc. LCSim StdHep LCIO Events JAS3 (or any AIDA.
Adapting Legacy Computational Software for XMSF 1 © 2003 White & Pullen, GMU03F-SIW-112 Adapting Legacy Computational Software for XMSF Elizabeth L. White.
Monte Carlo Particle ID Numbers Computer Readable Files Palm Particle Data Book Tom Trippe PDG Collaboration Meeting November 13, 2004.
Shuei MEG review meeting, 2 July MEG Software Status MEG Software Group Framework Large Prototype software updates Database ROME Monte Carlo.
REVIEW OF NA61 SOFTWRE UPGRADE PROPOSAL. Mandate The NA61 experiment is contemplating to rewrite its fortran software in modern technology and are requesting.
Java Analysis Studio Status Update 12 May 2000 Altas Software Week Tony Johnson
Introductory Software Engineering with a Focus on Dependency Management Christine Hofmeister.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
Java Introduction to JNI Prepared by Humaira Siddiqui.
By Noorez Kassam Welcome to JNI. Why use JNI ? 1. You already have significantly large and tricky code written in another language and you would rather.
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett A Lightweight Histogram Interface Layer CHEP 2000 Session F (F320) Thursday.
HERA/LHC Workshop, MC Tools working group, HzTool, JetWeb and CEDAR Tools for validating and tuning MC models Ben Waugh, UCL Workshop on.
Chapter 1 Introduction to Computers and C++ Programming Goals: To introduce the fundamental hardware and software components of a computer system To introduce.
CSE 425: Object-Oriented Programming I Object-Oriented Programming A design method as well as a programming paradigm –For example, CRC cards, noun-verb.
Vector Application : A UML Example © Dr. David A. Workman School of EE and CS University of Central Florida Feb. 8, 2001.
FLUKA GUI Status FLUKA Meeting CERN, 10/7/2006.
V. Serbo, SLAC ACAT03, 1-5 December 2003 Interactive GUI for Geant4 by Victor Serbo, SLAC.
The european ITM Task Force data structure F. Imbeaux.
SCIRun and SPA integration status Steven G. Parker Ayla Khan Oscar Barney.
ALICE Simulation Framework Ivana Hrivnacova 1 and Andreas Morsch 2 1 NPI ASCR, Rez, Czech Republic 2 CERN, Geneva, Switzerland For the ALICE Collaboration.
BeamCal Simulations with Mokka Madalina Stanescu-Bellu West University Timisoara, Romania Desy, Zeuthen 30 Jun 2009 – FCAL Meeting.
Fabiola Gianotti, 31/8/’99 PHYSICS and SOFTWARE ATLAS Software Week 31/8/’99 Fabiola Gianotti Software requirements of physics groups What should Detector.
Andreas Morsch, CERN EP/AIP CHEP 2003 Simulation in ALICE Andreas Morsch For the ALICE Offline Project 2003 Conference for Computing in High Energy and.
9 Systems Analysis and Design in a Changing World, Fourth Edition.
Scott Kohn with Tammy Dahlgren, Tom Epperly, and Gary Kumfert Center for Applied Scientific Computing Lawrence Livermore National Laboratory October 2,
Ties Behnke: Simulation and Tools 1 Simulation and Tools Ties Behnke, DESY Summary of the simulation sessions At this conference: 4 sessions (one combined.
1 Software tools for GLC studies Akiya Miyamoto KEK 20 April, 2004 Representing ACFA-Sim Group
LC Software Workshop, May 2009, CERN P. Mato /CERN.
Java Physics Generator and Analysis Modules Mike Ronan LBNL (presented by Tony Johnson)
ISBN Chapter 11 Abstract Data Types and Encapsulation Concepts.
Visualization of Geant4 Data: Exploiting Component Architecture through AIDA, HepRep, JAS and WIRED Geant4 Workshop, CERN - 2 October 2002 Joseph Perl.
Introduction What is detector simulation? A detector simulation program must provide the possibility of describing accurately an experimental setup (both.
HIGUCHI Takeo Department of Physics, Faulty of Science, University of Tokyo Representing dBASF Development Team BELLE/CHEP20001 Distributed BELLE Analysis.
Testing OO software. State Based Testing State machine: implementation-independent specification (model) of the dynamic behaviour of the system State:
GLAST LAT Offline SoftwareCore review, Jan. 17, 2001 Review of the “Core” software: Introduction Environment: THB, Thomas, Ian, Heather Geometry: Joanne.
LCIO A persistency framework and data model for the linear collider CHEP 04, Interlaken Core Software, Wednesday Frank Gaede, DESY -IT-
STAR STAR MC Filter V. Perevoztchikov Brookhaven National Laboratory,USA.
Claudio Grandi INFN-Bologna CHEP 2000Abstract B 029 Object Oriented simulation of the Level 1 Trigger system of a CMS muon chamber Claudio Grandi INFN-Bologna.
Classes, Interfaces and Packages
ALICE Offline Week October 4 th 2006 Silvia Arcelli & Chiara Zampolli TOF Online Calibration - Strategy - TOF Detector Algorithm - TOF Preprocessor.
Author: DoanNX Time: 45’.  OOP concepts  OOP in Java.
STAR Simulation. Status and plans V. Perevoztchikov Brookhaven National Laboratory,USA.
Java to C++: What would be needed ? Norman Graf (SLAC) ILC-CLIC Software, CERN May 28, 2009.
Conservation Laws Monte Carlo Particle ID Numbers Computer Readable Files Palm Particle Data Book Tom Trippe PDG Advisory Committee Meeting November 14,
Data Model: LCIO to LCIO2.0 Norman Graf (SLAC) ILC-CLIC Software, CERN May 28, 2009.
Fundamental of Java Programming (630002) Unit – 1 Introduction to Java.
GEANT4 for Future Linear Colliders
INF230 Basics in C# Programming
StdHepC++ L. Garren Presented by M. Fischler
Compiler Construction
JLEIC Detector Simulation Forward Ion Detection
Linear Collider Simulation Tools
Linear Collider Simulation Tools
Presentation transcript:

MONTE CARLO EVENT GENERATION IN A MULTILANGUAGE, MULTIPLATFORM ENVIRONMENT Norman Graf Tony Johnson Stanford Linear Accelerator Center Abstract: We discuss techniques used to access legacy event generators from modern simulation environments. Coding to a standard interface and use of shared object libraries enables runtime selection of generators, and allows for extension of the suite of available generators without having to rewrite core code. Problem Statement  Physics and detector simulations for the International Linear Collider are being conducted by an amorphous and heterogeneous group of high energy physicists, working mostly part-time on this project.  Simulation software needs to be lightweight, yet flexible and performant over a wide variety of development platforms.  HEP community has mostly completed it transition to modern, object-oriented programming languages such as C++ and Java e.g. GEANT4, ROOT, JAS, … One exception is event generators. Most event generators producing unweighted events with stable final state particles appropriate for detector response simulations are either written in FIRTRAN or depend on FORTRAN-based libraries for fragmentation, e.g PYTHIA, ISAJET, HERWIG pandora-pythia 406 International Linear Collider (ILC) Designed to exploit the physics discovery potential of e + e - collisions at  s ~ 1TeV. Will perform precision measurements of complex final states and require:  Exceptional momentum resolution  Excellent vertexing capabilities  “Particle Flow” calorimetry  Hermeticity Require access to many different event generators to fully investigate interplay of machine, physics and detectors. A pure Java Solution  Providing a simulation and reconstruction framework written in Java has proven to be well matched to this environment. Object Oriented and easy to use. Many support libraries. Platform independent.  Few event generators are written in Java! Do have a “diagnostic” generator for simple events. Interfacing Legacy Event Generators Most generators can target the HEPEVT common block. stdhep provides a binary persistence binding  stdhep not well supported on all platforms, somewhat tricky to implement for casual users.  Could interface with generators simply through persistent output: FORTRAN program  stdhep file  user app.  Disk storage can be prohibitive in large statistics fast-simulation physics analyses.  End users need to know idiosyncrasies of each package, i.e. no standard main programs or runtime input commands.  Alternative is to abstract out a common generation interface and provide standard implementations. A Multilanguage Solution  Use Java to provide a consistent platform- independent interface.  Use Java Native Interface (JNI) to call FORTRAN event generators via C++.  Use shared-object (.so) or dynamic link library to delay binding and provide runtime felxibility.

406 Encapsulation Philosophy is to push as much as possible onto the native event generators. Control is through ASCII files which are parsed by FORTRAN routines. These communicate with the COMMON blocks in the event generator code to set parameters. Can select processes, beamstrahlung, decay channels, etc. at run-time by editing text file. Output is stdhep files Runtime Control Interact natively with event generators ISAJET has well-defined set of control “cards” Input file same as for FORTRAN job. PYTHIA has command-parsing capability Simply pass these commands to PYGIVE HERWIG has neither abstract out a “reasonable” set of parameters. Similarly for other generators  Needs input from an “expert” in the generator. Interaction from Java/C++ is only through initialize() method. All.dll or.so libraries respect same interface, so can dynamically select and load at runtime >java EvtGen libToLoad Catalog of available generators can be expanded in the future, without users having to modify any of their existing code. Simply distribute new.so or.dll! Summary  Use of Java as the user interface and JNI to connect to legacy code has proven to be a useful solution.  Definition of a minimal interface allows generators to be selected at runtime without code modification and allows smooth future upgrades. Java calls C++ class through JNI with minimal interface: public native void initialize(); public native void nextEvent( int[] nev, int[] isthep, int[] idhep, int[] jmohep, int[] jdahep, double[] phep, double[] vhep); public native void finish(); C++ communicates with FORTRAN: extern "C" void initialize_(); extern "C" void nextevent_(); extern "C" void finish_(); typedef struct // HEPEVT common block { int nevhep; // event number int nhep; // number of entries int isthep[4000]; // status code int idhep[4000]; // PDG particle id int jmohep[4000][2]; // pos’n of 1st, 2nd mother int jdahep[4000][2]; // pos’n of 1st, last daughter double phep[4000][5]; // 4-mom, mass double vhep[4000][4]; // vertex position & time } hepevtcommon; FORTRAN code simply fills HEPEVT common block for each event.  This code has to be written by someone with expertise in the generator, but then can be used by anyone. Control is through initialize_ call, and is generator- specific. import hep.analysis.EventGenerator; import hep.analysis.EventData; import hep.analysis.EndOfDataException; import hep.io.stdhep.adapter.StdhepAdapter; /** * LCD interface to stdhep event generators. Norman Graf */ public class StdhepEventGenerator extends EventGenerator { StdhepAdapter _stdadapter; private EvtGen _eventgen; /** * Constructor loads native library */ public StdhepEventGenerator(String generatorName) { _stdadapter = new StdhepAdapter(); System.loadLibrary(generatorName+"evtgen"); _eventgen = new EvtGen(); // Constructor calls initialize() } /** * Generate a single event */ public EventData generateEvent() throws EndOfDataException { _eventgen.nextEvent(); return _stdadapter.convert(_eventgen.genStdhepEvent()); } /** * Finish up */ public void afterLastEvent() { _eventgen.finish(); } }