25th May, 1999 HTL - Histogram Template Library Pavel Binko, LHCb / CERN 1 LHCb Computing Meeting HTL - Histogram Template Library Pavel Binko LHCb / CERN.

Slides:



Advertisements
Similar presentations
Lecture Computer Science I - Martin Hardwick The Programming Process rUse an editor to create a program file (source file). l contains the text of.
Advertisements

Part IV: Memory Management
The C ++ Language BY Shery khan. The C++ Language Bjarne Stroupstrup, the language’s creator C++ was designed to provide Simula’s facilities for program.
Write a program step by step. Step 1: Problem definition. Given the coordinate of two points in 2-D space, compute and print their straight distance.
Input and Output READ WRITE OPEN. FORMAT statement Format statements allow you to control how data are read or written. Some simple examples: Int=2; real=
C++ Basics March 10th. A C++ program //if necessary include headers //#include void main() { //variable declaration //read values input from user //computation.
1 Various Methods of Populating Arrays Randomly generated integers.
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,
Chapter 10.
Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
CS31: Introduction to Computer Science I Discussion 1A 5/7/2010 Sungwon Yang
03 Data types1June Data types CE : Fundamental Programming Techniques.
1 String Library and Stream I/O Ying Wu Electrical Engineering & Computer Science Northwestern University ECE230 Lectures Series.
Introduction to Computers and Programming Lecture 15: Arrays Professor: Evan Korth New York University.
Computer Programming 1 Functions. Computer Programming 2 Objectives Take a first look at building functions Study how a function is called Investigate.
CS31: Introduction to Computer Science I Discussion 1A 4/2/2010 Sungwon Yang
C++ for Engineers and Scientists Third Edition
Arrays.
CMSC 104, Version 8/061L22Arrays1.ppt Arrays, Part 1 of 2 Topics Definition of a Data Structure Definition of an Array Array Declaration, Initialization,
C++ Functions. 2 Agenda What is a function? What is a function? Types of C++ functions: Types of C++ functions: Standard functions Standard functions.
Ping Zhang 10/08/2010.  You can get data from the user (input) and display information to the user (output).  However, you must include the library.
ROOT An object oriented HEP analysis framework.. Computing in Physics Physics = experimental science =>Experiments (e.g. at CERN) Planning phase Physics.
High-Level Programming Languages: C++
Chapter 7: Arrays. In this chapter, you will learn about: One-dimensional arrays Array initialization Declaring and processing two-dimensional arrays.
LHCb Software week November, 1999 M.Frank LHCb/CERN N-Tuples within Gaudi ã Definition ã Usage ä Run through simplified example ã The persistent.
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.
Binary Number System & Logic Operations. The focus of the last lecture was on the microprocessor During that lecture we learnt about the function of the.
Algorithm and Programming Array Dr. Ir. Riri Fitri Sari MM MSc International Class Electrical Engineering Dept University of Indonesia 15 March 2009.
Getting Started with MATLAB 1. Fundamentals of MATLAB 2. Different Windows of MATLAB 1.
Event Data History David Adams BNL Atlas Software Week December 2001.
Programming Fundamentals. Today’s Lecture Why do we need Object Oriented Language C++ and C Basics of a typical C++ Environment Basic Program Construction.
Course Title: Introduction to C++ Course Instructor: ADEEL ANJUM Chapter No: 01 1 BY ADEEL ANJUM (MCS, CCNA,WEB DEVELOPER)
Pointers OVERVIEW.
07 Apr, 2000 GAUDI Histograms Pavel Binko, LHCb / CERN 1 LHCb Software Week GAUDI Histograms Pavel Binko LHCb / CERN.
I/O and Data Formatting Introduction to Class Concepts INFSY 307 Spring 2003 Lecture 3.
Jose A. Hernando Trigger Gaudies Reconstruction Tools & Algorithms Inspectors MC & Data Algorithms Template preserved container Jose A. Hernando.
David Adams ATLAS DIAL/ADA JDL and catalogs David Adams BNL December 4, 2003 ATLAS software workshop Production session CERN.
A Level Computing#BristolMet Session ObjectivesU2#S12 MUST describe the terms modal and pretty printing in term of input and output facilities. SHOULD.
1 Lecture 14 Functions Functions with Empty Parameter Lists Empty parameter lists  void or leave parameter list empty  Indicates function takes.
Object Oriented Programming COP3330 / CGS5409.  Multiple Inheritance  Template Classes and Functions.
 2008 Pearson Education, Inc. All rights reserved. 1 Arrays and Vectors.
C++ Programming Lecture 13 Functions – Part V The Hashemite University Computer Engineering Department (Adapted from the textbook slides)
Arrays, Vectors, and Strings Allocation and referencing.
Structuring Data: Arrays ANSI-C. Representing multiple homogenous data Problem: Input: Desired output:
Postgraduate Computing Lectures PAW 1 PAW: Physicist Analysis Workstation What is PAW? –A tool to display and manipulate data. Learning PAW –See ref. in.
Arrays.
Functions BICSE-6A Mr. Naeem Khalid Lecturer, Dept. of Computing.
Course Title Object Oriented Programming with C++ instructor ADEEL ANJUM Chapter No: 03 Conditional statement 1 BY ADEEL ANJUM (MSc-cs, CCNA,WEB DEVELOPER)
C++ Programming Lecture 14 Arrays – Part I The Hashemite University Computer Engineering Department (Adapted from the textbook slides)
Variables in C Topics  Naming Variables  Declaring Variables  Using Variables  The Assignment Statement Reading  Sections
CMSC 104, Version 8/061L09VariablesInC.ppt Variables in C Topics Naming Variables Declaring Variables Using Variables The Assignment Statement Reading.
AIDA Abstract Interfaces for Data Analysis Massimiliano Turri, SLACCHEP, La Jolla, March “The goal of the AIDA project is to define abstract.
Proposal for extension of GaudiAlgorithm and GaudiTool classes Vanya Belyaev CERN & ITEP/Moscow.
C Programming Day 2. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/LA07/003 Version No. 1.0 Union –mechanism to create user defined data types.
Gaudi Framework Tutorial, April Histograms And N-tuples.
 What Does This Program Do? ACSL.  Frequently one must use or modify sections of another programmer’s code.  It is essential to be able to read and.
C++ Programming Lecture 13 Functions – Part V By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Gaudi Framework Tutorial, April Histograms And N-tuples.
Introduction Every program takes some data as input and generate processed data as out put . It is important to know how to provide the input data and.
Chapter 15 - C++ As A "Better C"
Examples (D. Schmidt et al)
TNSmooth: Root Multi-dimensional PDFs
APPENDIX a WRITING SUBROUTINES IN C
Data Structures and Abstract Data Types
Screen output // Definition and use of variables
CMSC 202 Lesson 22 Templates I.
Variables, Identifiers, Assignments, Input/Output
7 Arrays.
Templates I CMSC 202.
C++ Programming Basics
Presentation transcript:

25th May, 1999 HTL - Histogram Template Library Pavel Binko, LHCb / CERN 1 LHCb Computing Meeting HTL - Histogram Template Library Pavel Binko LHCb / CERN

25th May, 1999 HTL - Histogram Template Library Pavel Binko, LHCb / CERN 2 LHCb Computing Meeting What is HTL ? C++ class library –Provides powerful histogramming functionality –It only deals with histograms - binned data (not with n-tuples - unbinned data) –Exploits the template facility of C++ –Designed to be compact, extensible, modular and performant –Uses “the same” basic signature as HBOOK subroutines Histogram name, number of bins, lower and upper bounds of the histogram axis are enough to create a 1D histogram Transient and Persistent Histograms are de-coupled –Uses Objectivity/DB for persistency –Light weight Persistent Object Manager available (pre-alpha version)

25th May, 1999 HTL - Histogram Template Library Pavel Binko, LHCb / CERN 3 LHCb Computing Meeting Histogram Classes User works with these predefined types –Histo1D - 1D histogram with Gravity_Bin_1D and fixed binning –Histo1DVar - 1D histogram with Gravity_Bin_1D and variable binning –ProfileHisto - 1D histogram with Profile_Bin and fixed binning –ProfileHistoVar - 1D histogram with Profile_Bin and variable binning –Histo2D - 2D histogram with Weighted_Bin and fixed binning –Histo2DF - 2D histogram with Float_Weighted_Bin and fixed binning –Histo2DVar - 2D histogram with Weighted_Bin and variable binning Persistent version of all of them available –PHisto1D etc.

25th May, 1999 HTL - Histogram Template Library Pavel Binko, LHCb / CERN 4 LHCb Computing Meeting Partitions and Bins Partitions describe –One dimension of the problem space –How it is divided into intervals Bins contain information about –The content, the error and possibly the center of the bin –Fix and variable binning available Weighted_Bin represents bins with weighted data points –By default the gravity centers are the middle or center of the bin Gravity_Bin_1D represents bins with weighted data points –They know how to determine the gravity center of the bins Profile_Bin represents bins that can average another quantity

25th May, 1999 HTL - Histogram Template Library Pavel Binko, LHCb / CERN 5 LHCb Computing Meeting I_Histo Interface –virtual const char* name( ) –Title attached to current histogram. –virtual I_Bin& i_bin( I_Bin_Location &a_location ) –virtual I_Bin& i_extra_bin( I_Extra_Bin_Location &a_location ) –In-range and extra bin associated with extra location a_location –virtual Size bin_count( ) –virtual Size extra_bin_count( ) –Number of in-range and extra bins –virtual Size dim( ) –Dimension of the histo, i.e., of the problem space –virtual I_Partition& i_partition( Index p = 0 ) –Partition interface of this histogram –virtual I_Bin& i_bin( Index i ) –Any bin (in-range or extra) with index "i" (note that this is a linear access)

25th May, 1999 HTL - Histogram Template Library Pavel Binko, LHCb / CERN 6 LHCb Computing Meeting I_Partition Interface –virtual double i_bin_width( Index i ) –Width of in-range bin "i". –virtual double i_lower_point( ) –Leftmost point of the partition. –virtual double i_lower_point( Index i ) –Leftmost point of bin indexed by "i". –virtual double i_upper_point( ) –Rightmost point of the partition. –virtual double i_upper_point( Index i ) –Rightmost point of bin indexed by "i".

25th May, 1999 HTL - Histogram Template Library Pavel Binko, LHCb / CERN 7 LHCb Computing Meeting I_Bin Interface –virtual double value( Index i = 0) and virtual double error( Index i = 0) –Value and error associated with this bin –virtual Size count( ) –Count associated with this bin = Number of entries –virtual void set_value( double other, Index i = 0 ) –Set the value associated with this bin to "other" –virtual void set_error( double other, Index i = 0 ) –Change/set the error of the bin to "other" –virtual void set_count( Size other ) –Change/set the count of the bin to "other" –virtual double center( Index i = 0) –Absolute or relative center of this bin on axis "i" –virtual int offset( Index i = 0) –Relative or absolute position for the center of the bin

25th May, 1999 HTL - Histogram Template Library Pavel Binko, LHCb / CERN 8 LHCb Computing Meeting Create and fill a histogram #include "HTL/Histograms.h" // Transient histograms Histo1D *histo = new Histo1D( "Transient Histo_1D", 20, 0.0, 20.0 ); // Let's fill the histogram with points long i; double x, w; for( i=0; i<50000; i++ ) { x = (i % 22) - 1; w = (x-9.5)*(x-9.5)/100; histo->fill(x,w); } delete histo;

25th May, 1999 HTL - Histogram Template Library Pavel Binko, LHCb / CERN 9 LHCb Computing Meeting Helper Classes I_Histo, I_Partition and I_Bin interfaces not sufficient –Helper classes introduced do add missing functionality H_2D_Helper ( make slices, 2D projections ) H_Bin_Helper ( mins, maxs, in_range_error( ), bin_center() ) H_HistoTable1D and 2D ( write( ) - ASCII table output ) H_Printout ( print( ) - line printer output ) H_Statistics ( mean( ), rms( ), entries counts ) –Shortcuts for mean( ) and rms( ) provided Syntax: histo->mean( )

25th May, 1999 HTL - Histogram Template Library Pavel Binko, LHCb / CERN 10 LHCb Computing Meeting Output of a histogram #include "HTL/Histograms.h" // Transient histograms #include "HTL/PHistograms.h" // Persistent histograms Histo1D *histoT = new Histo1D("Transient Histo_1D", 20, 0.0, 20.0 ); HepRef(PHisto2D) histoP = new PHisto2D("Persistent Histo_2D", 20, 0.0, 20.0, 20, 0.0, 20.0 ); // Line printer representation of a histogram HPrinter hp( cout ); // Into any output stream hp.print( *histoT ); // ASCII table with a histogram contents HistoTable1D ht1( "histo.txt” ); // Only into a text file ht1.write( *histoP ); delete histoT; delete histoP;

25th May, 1999 HTL - Histogram Template Library Pavel Binko, LHCb / CERN 11 LHCb Computing Meeting What is missing Fill( ) is not part of any interface –Implemented as non-virtual inline functions Output the histogram contents as an array (not ASCII) Open for any input...

25th May, 1999 HTL - Histogram Template Library Pavel Binko, LHCb / CERN 12 LHCb Computing Meeting Interface to PAW (1) Provide set of new (similar to old) PAW commands To access HTL histograms the same way as the HBOOK histograms are accessed now Two new menus created –OODB - interface to the Objectivity/DB OPEN - Open a data base and a container HTLIN - Put in memory the HTL histogram indexed by ID LIST - List the HTL histograms in the currently opened data base –T_HTL - to manipulate HTL transient histograms 1DHISTO - Create an HTL histogram PRINT - Print a HTL histogram LIST - List HTL histograms DELETE - Delete HTL histograms identified by ID PLOT - Plot a HTL histogram FRHBOOK - Convert the HBOOK histogram ID into an HTL histogram

25th May, 1999 HTL - Histogram Template Library Pavel Binko, LHCb / CERN 13 LHCb Computing Meeting Interface to PAW (2) Proof of concept done –Integration of C++ in a FORTRAN application possible –Integration of HTL in well known PAW framework possible Missing –1D histograms with non-equidistant binning –Profile histograms –2D histograms –Interface to KUIP vectors (PUT/CONTENT, GET/CONTENT etc...) –HTL histograms filling –Fitting –etc.

25th May, 1999 HTL - Histogram Template Library Pavel Binko, LHCb / CERN 14 LHCb Computing Meeting Integration in GAUDI Neither HTL code, nor HTL libraries compatible with our strategy –Changes done by Dino Ferrero Merlino and me –Library compiled in our environment with new created project file Integration started last week - not part of this GAUDI release Required changes –Slight modifications into HistogramSvc –Decisive changes in IHistogram interface Merging of HTL interfaces into single consistent IHistogram interface