M.Frank LHCb/CERN Random Numbers in GAUDI ã Requirements ã Interface ã Usage.

Slides:



Advertisements
Similar presentations
Review What is a virtual function? What can be achieved with virtual functions? How to define a pure virtual function? What is an abstract class? Can a.
Advertisements

Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 1.1 of…
25/03/2003Simulation Application for the LHCb Experiment CHEP March 2003 Presented by: W. Pokorski / CERN Authors: I. Belyaev, Ph. Charpentier,
Collaborative Picture Gallery Project Presentation Amos Hersch Aviad Barzilai Supervisor Maxim Gurevitch Lab Chief Eng. Ilana David.
Matnet – Matlab Network Simulator for TinyOS Alec WooTerence Tong July 31 st, 2002.
 2007 Pearson Education, Inc. All rights reserved C Functions.
The Event as an Object-Relational Database: Avoiding the Dependency Nightmare Christopher D. Jones Cornell University, USA.
The Atlas Software Distribution Christian ArnaultAlessandro De SalvoSimon GeorgeGrigori Rybkine
Hank Childs, University of Oregon June 3 rd, 2015 CIS 330: _ _ _ _ ______ _ _____ / / / /___ (_) __ ____ _____ ____/ / / ____/ _/_/ ____/__ __ / / / /
© 2004 The MathWorks, Inc. 1 MATLAB for C/C++ Programmers Support your C/C++ development using MATLAB’s prebuilt graphics functions and trusted numerics.
The Metadata System1. 2 Introduction Metadata is data that describes data. Traditionally, metadata has been found in language- specific files (e.g. C/C++
Presented by: Katie Milanowski. 2  Formed in 1982  Bruce Barrington (HBO & Company)  Apply RAD technology to IBM PC  1986: Clarion Version 1.0, Atlanta,
Gaudi Framework Tutorial, April Introduction.
Data Structures Using C++ 2E
LHCb Software week November, 1999 M.Frank LHCb/CERN N-Tuples within Gaudi ã Definition ã Usage ä Run through simplified example ã The persistent.
Data File Access API : Under the Hood Simon Horwith CTO Etrilogy Ltd.
Introduction to GSL CS 3414 From GNU Scientific Library Reference Manual at
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
© ABB Inc. - USETI All Rights Reserved 10/17/2015 Insert image here An Economic Analysis Development Framework for Distributed Resources Aaron F. Snyder.
SE: CHAPTER 7 Writing The Program
The Client/Server Database Environment Ployphan Sornsuwit KPRU Ref.
PVSSProxy The first piece of the MACS procedure framework (ProShell) Angela Brett.
Chapter 18 Java Collections Framework
SCIRun and SPA integration status Steven G. Parker Ayla Khan Oscar Barney.
MotoHawk™ Components Scalable, Secure, Model-Based Design of Embedded Systems.
Introduction to Gaudi LHCb software tutorial - September
Topic 2d High-Level languages and Systems Software
M.Frank LHCb/CERN Using Shared Libraries ã The traditional way ã How to build shared images? ã Benefits ã Process configuration ã Fortran.
9 Associators How to relate objects to each other Create relations Save relations Use relations: Associators.
CS/CoE 536 : Lockwood 1 Project Integration : In order to ensure that projects can be integrated at the end of the semester, a few rules have been developed.
Use of Gaudi in Reconstruction Weidong Li 23/06/2004.
Structural Design Patterns
Gaudi Framework Tutorial, April Algorithm Tools: what they are, how to write them, how to use them.
CHEP /21/03 Detector Description Framework in LHCb Sébastien Ponce CERN.
Gaudi Framework Tutorial, April Job Options and Printing.
9-13/9/03 Atlas Overview WeekPeter Sherwood 1 Atlfast, Artemis and Atlantis What, Where and How.
PROGRAMMING IN VISUAL BASIC.NET VISUAL BASIC PROGRAMMING FUNDAMENTALS Bilal Munir Mughal 1 Chapter-8.
1 MotoHawk Components Scalable, Secure, Model-Based Design of Embedded Systems MotoHawk Training.
JSP BASICS AND ARCHITECTURE. Goals of JSP Simplify Creation of dynamic pages. Separate Dynamic and Static content.
Modularity Computer Science 3. What is Modularity? Computer systems are organized into components called modules. The extent to which this is done is.
CHEP /21/03 Detector Description Framework in LHCb Sébastien Ponce CERN.
1 Becoming More Effective with C++ … Day Two Stanley B. Lippman
Unit 13 –JQuery Basics Instructor: Brent Presley.
Bologna Tutorial, April Job Options and Printing.
General requirements for BES III offline & EF selection software Weidong Li.
CINT & Reflex – The Future CINT’s Future Layout Reflex API Work In Progress: Use Reflex to store dictionary data Smaller memory footprint First step to.
Software Week 25. Nov GAUDI
Parallel IO for Cluster Computing Tran, Van Hoai.
More on Variables and Subroutines. Introduction Discussion so far has dealt with self- contained subs. Subs can call other subs or functions. A module.
1 Chapter 1 C++ Templates Readings: Sections 1.6 and 1.7.
Chapter 17 – Templates. Function Templates u Express general form for a function u Example: template for adding two numbers Lesson 17.1 template Type.
Chapter 7 - Functions. Functions u Code group that performs single task u Specification refers to what goes into and out of function u Design refers to.
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett Prototype GEANT4 Service for ATHENA framework ATLAS Software Workshop Dec 3.
Bologna Tutorial, June Overview of LHCb applications and software environment.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Function Templates 16.2.
9 Associators How to relate objects to each other Create relations Save relations Use relations: Associators.
The Web Wizard’s Guide To JavaScript Chapter 4 Image Swapping.
Evaluation of the C++ binding to the Oracle Database System Dirk Geppert and Krzysztof Nienartowicz, IT/DB CERN IT Fellow Seminar November 20, 2002.
Pyragen A PYTHON WRAPPER GENERATOR TO APPLICATION CORE LIBRARIES Fernando PEREIRA, Christian THEIS - HSE/RP EDMS tech note:
Elements of LCG Architecture Application Architecture Blueprint RTAG 8 th June 2002 P. Mato / CERN.
Use of CMT in LHCb CMT Workshop, LAL (Orsay) 28 th February - 1 st March 2002 P. Mato / CERN.
Windows Programming Environments
Using Shared Libraries
GLAST Gaudi Review T. Burnett H.Kelly 10 Sept 02 Gaudi code review
The Client/Server Database Environment
Page Replacement.
MXNet Internals Cyrus M. Vahid, Principal Solutions Architect,
The Web Wizard’s Guide To JavaScript
6 Functions.
SPL – PS1 Introduction to C++.
Presentation transcript:

M.Frank LHCb/CERN Random Numbers in GAUDI ã Requirements ã Interface ã Usage

M.Frank LHCb/CERNGAUDI Requirements ã Distinguish between generator and distribution ã Flexibility ä Change the random number generator if necessary ä No need to change user code ä Generate any distribution using a single generator ã Reproducibility ä Start simulation at any point ä Initialization at each event ä Set the seed necessary to restart

M.Frank LHCb/CERNGAUDI Architecture RndmGenSvc RndmGen RndmEngine Distribution: Gauss owns & initializes uses owns

M.Frank LHCb/CERNGAUDI Interface /// Single shot returning single random number virtual double shoot() const = 0; /// Multiple shots returning vector with random number virtual StatusCode shootArray( std::vector & array, long howmany, long start = 0) const = 0; ã Generator Interface ã Service Interface ã There is a wrapper to simplify the code /// Retrieve a valid generator from the service. virtual StatusCode generator( const IRndmGen::Param& par, IRndmGen*& refpGen) = 0;

M.Frank LHCb/CERNGAUDI IRndmGen::Param ???!!! ã Defines the shape of the generated distribution ä Rndm::Bit() ä Rndm::Flat(double mi, double ma) ä Rndm::Gauss(double mean, double sigma) ä Rndm::Poisson(double mean) ä Rndm::Binomial(long n, double p) ä Rndm::Exponential(double mean) ä Rndm::Chi2(long n_dof) ä Rndm::BreitWigner(double mean, double gamma) ä Rndm::BreitWignerCutOff (mean, gamma, cut-off) ä Rndm::Landau(double mean, double sigma) ä Rndm::DefinedPdf(const std::vector & pdf, long intpol) See Gaudi/RandmGenSvc/RndmGenerators.h

M.Frank LHCb/CERNGAUDI ã I just need a number how do I get it quickly ? ä Needs to be initialized for every event ä There are some useful examples, but not always! #include “Gaudi/RandmGenSvc/RndmGenerators.h” Rndm::Numbers gauss(randSvc(), Rndm::Gauss(0.5,0.2)); if ( gauss ) { IHistogram1D* his = histoSvc()->book(); for ( long i = 0; i < 5000; i++ ) his->fill(gauss(), 1.0); } Local Usage

M.Frank LHCb/CERNGAUDI ã Get the generator once, then keep it! ä In the header file or your algorithm: ã In myAlgorithm::initialize ã In myAlgorithm::execute: use it! StatusCode sc = m_gaussDist.initialize( randSvc(), Rndm::Gauss(0.5,0.2)); Global Usage #include “Gaudi/RandmGenSvc/RndmGenerators.h” class myAlgorithm : public Algorithm { Rndm::Numbers m_gaussDist; his->fill(m_gaussDist(), 1.0);

M.Frank LHCb/CERNGAUDI Dos and Don’ts ã The interface allows to retrieve a bunch of random numbers ä Do not keep numbers across events: Reproducibility! ä Often caching does more harm than it helps ä If there is a performance penalty, better find another solution ã Use the wrapper ä it’s easier ã Do not access the RndmEngine directly ä Do not manipulate the engine: Reproducability

M.Frank LHCb/CERNGAUDI Summary ã Random generator is flexible ä Many distributions possible ã Easy to use ä Wrapper is straight forward ä Wrapper can be used with STL: operator() ã Allows to be initialized by the framework in a way to ensure reproducability ä As long as everyone sticks to the rules

M.Frank LHCb/CERNGAUDI GAUDI: Shared Libraries  LD_LIBRARY_PATH : It’s a mess! ä String becomes too long for some shells ä Load Shared libraries by environment ä requirements: set GaudiSvcShr "${GAUDISVCROOT}/${BINDIR}/libGaudiSvc” ä jobOptions: ApplicationMgr.DLLs += {“GaudiSvc”};  LD_LIBRARY_PATH becomes much shorter ä Contains only path to images needed to start the program ã Better control over usage of modules

M.Frank LHCb/CERNGAUDI GAUDI: CMT requirements ã Include path ä Instead of include_dirs $(GAUDISVCROOT)  Do the following for component libraries include_path none ä Or for public libraries: include_path $(GAUDISVCROOT)  This shortens the compile statement(s) dramatically