LHCb Software week 24-26 November, 1999 M.Frank LHCb/CERN N-Tuples within Gaudi ã Definition ã Usage ä Run through simplified example ã The persistent.

Slides:



Advertisements
Similar presentations
C Language.
Advertisements

Chapter 7: User-Defined Functions II
Chapter 10: File-System Interface
1 Chapter 11: File-System Interface  File Concept  Access Methods  Directory Structure  File System Mounting  File Sharing  Protection  Chapter.
File Management. Persistent storage Shared device Why Programmers Need Files HTML Editor HTML Editor … … Web Browser Web Browser Structured information.
Chapter 10: File-System Interface
File System Interface CSCI 444/544 Operating Systems Fall 2008.
Dr. Kalpakis CMSC 421, Operating Systems. Fall File-System Interface.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition File-System Interface.
Main Index Contents 11 Main Index Contents Pointer Illustration Pointer Illustration Vertical / Horizontal View. Vertical / Horizontal View. Data Addresses.
8 November Forms and JavaScript. Types of Inputs Radio Buttons (select one of a list) Checkbox (select as many as wanted) Text inputs (user types text)
6/24/2015B.RamamurthyPage 1 File System B. Ramamurthy.
Main Index Contents 11 Main Index Contents Pointer Illustration Pointer Illustration Vertical / Horizontal View. Vertical / Horizontal View. Data Addresses.
CS-341 Dick Steflik Introduction. C++ General purpose programming language A superset of C (except for minor details) provides new flexible ways for defining.
File Concept l Contiguous logical address space l Types: Data: numeric, character, binary Program: source, object (load image) Documents.
Os111 Chapter 11 File-System Interface. os112 Outline File Concept Access Methods Directory Structure File System Mounting File Sharing Protection.
7/15/2015B.RamamurthyPage 1 File System B. Ramamurthy.
Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access memory.
From C++ to C#. Web programming The course is on web programming using ASP.Net and C# The course is on web programming using ASP.Net and C# ASP.Net is.
LSP 121 Week 1 Intro to Databases. Welcome to LSP 121 Quantitative Reasoning and Technological Literacy II Continuation of quantitative data concepts.
A Level Computing#BristolMet Session Objectives U2#S6 MUST identify different data types used in programming aka variable types SHOULD describe each data.
ITEC 502 컴퓨터 시스템 및 실습 Chapter 10-1: File Systems Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
M.Frank LHCb/CERN - In behalf of the LHCb GAUDI team Data Persistency Solution for LHCb ã Motivation ã Data access ã Generic model ã Experience & Conclusions.
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA 1 CST 221 OBJECT ORIENTED PROGRAMMING(OOP) ( 2 CREDITS.
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.
Chapter 10: File-System Interface Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 Chapter 10: File-System.
Hello.java Program Output 1 public class Hello { 2 public static void main( String [] args ) 3 { 4 System.out.println( “Hello!" ); 5 } // end method main.
Summary of what we learned yesterday Basics of C++ Format of a program Syntax of literals, keywords, symbols, variables Simple data types and arithmetic.
ECE 353 Lab 1: Cache Simulation. Purpose Introduce C programming by means of a simple example Reinforce your knowledge of set associative caches.
Copyright © Curt Hill Generic Classes Template Classes or Container Classes.
AIDA Tuple Service Manuel Domenech Wednesday
Iterators CS Chakrabarti What is an iterator?  Thus far, the only data structure over which we have iterated was the array for (int ix = 0;
Gaudi Framework Tutorial, April Job Options and Printing.
Jose A. Hernando Trigger Gaudies Reconstruction Tools & Algorithms Inspectors MC & Data Algorithms Template preserved container Jose A. Hernando.
1 Chapter 2 C++ Syntax and Semantics, and the Program Development Process.
STAR Event data storage and management in STAR V. Perevoztchikov Brookhaven National Laboratory,USA.
Homework due Test the random number generator Create a 1D array of n ints Fill the array with random numbers between 0 and 100 Compute and report the average.
David Adams ATLAS DIAL: Distributed Interactive Analysis of Large datasets David Adams BNL August 5, 2002 BNL OMEGA talk.
File Systems cs550 Operating Systems David Monismith.
Object Oriented Software Development 4. C# data types, objects and references.
23/2/2000Status of GAUDI 1 P. Mato / CERN Computing meeting, LHCb Week 23 February 2000.
Bologna Tutorial, April Job Options and Printing.
Postgraduate Computing Lectures PAW 1 PAW: Physicist Analysis Workstation What is PAW? –A tool to display and manipulate data. Learning PAW –See ref. in.
CSCI 156: Lab 11 Paging. Our Simple Architecture Logical memory space for a process consists of 16 pages of 4k bytes each. Your program thinks it has.
Arrays in MIPS Assembly Computer Organization and Assembly Language: Module 6.
ROOT Workshop M.Frank LHCb/CERN Improvements in the I/O Area (*)  General I/O related improvements  Tree related issues  Plans (*) I present.
25th Nov, 1999 LHCb Event Data Model Pavel Binko, LHCb / CERN 1 LHCb Software Week LHCb Event Data Model Pavel Binko LHCb / CERN.
Operating Systems Files, Directory and File Systems Operating Systems Files, Directory and File Systems.
CS 31 Discussion, Week 7 Faisal Alquaddoomi, Office Hours: BH 2432, W 4:30-6:30pm, F 12:30-1:30pm.
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.
Instructor: Umar KalimNUST Institute of Information Technology Operating Systems File System Interface.
Gaudi Framework Tutorial, April Histograms And N-tuples.
David Adams ATLAS Hybrid Event Store Integration with Athena/StoreGate David Adams BNL March 5, 2002 ATLAS Software Week Event Data Model and Detector.
Root I/O and the Gaudi Framework
File System Implementation
Variables In programming, we often need to have places to store data. These receptacles are called variables. They are called that because they can change.
Can store many of the same kind of data together
File System B. Ramamurthy B.Ramamurthy 11/27/2018.
LHCb Detector Description Framework Radovan Chytracek CERN Switzerland
Data Persistency Solution for LHCb
Can store many of the same kind of data together
Chapter 10: File-System Interface
Can store many of the same kind of data together
Raw Event Conversion Service in BOSS framework
Introduction to Data Structure
Event Storage GAUDI - Data access/storage Framework related issues
Use Of GAUDI framework in Online Environment
Lecture 4: File-System Interface
LHCb Detector Description Framework Radovan Chytracek CERN Switzerland
Presentation transcript:

LHCb Software week November, 1999 M.Frank LHCb/CERN N-Tuples within Gaudi ã Definition ã Usage ä Run through simplified example ã The persistent back-end

M.Frank LHCb/CERNGaudi N-Tuples PersistencySvc PObj Converter TObj Obj2 TObj TObjContainer ObjContainer EventDataSvc Transient Event Store TObj Obj1 N-tuple Service EventSelectorMessageSvc JobOptionsSvcAnotherPercySvc PObj What are we talking about? AppManager TObj1 Obj1PObject PDetElem DetDataSrv TDetElem1 T Detector Store T Histogram Store HistogramSvc Hist1 Algorithm1 DetPerstySvc Converter Alg Properties AlgFactory uses creates navigability HistPerstySvcPHist Converter PHist PNTup Converter ConversionSvc T N-Tuple Store NTupleSvc NTup NTup1

M.Frank LHCb/CERNGaudi N-Tuples What was an N-Tuple in CERNLIB ã Collection of identifiable n-dim. primitive items ä LOGICAL*4, INTEGER*4, REAL*4, REAL*8 ã See HBOOK ä Row wise N-Tuples ä REAL*4 array(SOME_DIMENSION) ä Items are single numbers identified by tags ä Column wise N-Tuples ä Structure mapped to a common block ä Items (number, array, …) are identified by tags ä Allow for variable size arrays

M.Frank LHCb/CERNGaudi N-Tuples What is an N-Tuple in Gaudi ã Collection of N-tuple Items ä Items represent primitives: bool, long, float, double ã N-tuples reside in a data store ä Can be accessed like any other DataObject ã Data management (e.g. writing records) is done by the N-tuple service Things did not change dramatically

M.Frank LHCb/CERNGaudi N-Tuples What’s the job: Wishes ã Stick to architecture ä We want to independent from the “back-end” storage mechanism (HBOOK, ROOT, OBJY...) Cernlib will die ä Encapsulate implementation: Interfaces or ABC ã Easy to use Items must behave like ordinary numbers Must support basic arithmetic operations and type conversions ã N-tuples should not go all into one single file possibly, but not always Connect several streams to the data store

M.Frank LHCb/CERNGaudi N-Tuples The N-Tuple Data Store ã Top Entry point /NTUPLES ä Logical file names User defined First useable directory /MC /REC /USER ä Directory structure ä N-tuples 1,2,3,4

M.Frank LHCb/CERNGaudi N-Tuples The Example ã Simplified version of GaudiExample/Ntuples ã Explain how to write and read a column wise N-tuple ã Differences to row wise N-tuples are minor ä Only record structure differs ã N-tuples should be easy to use ä Tell me if you think stuff is overcomplicated ä I do not use them daily

M.Frank LHCb/CERNGaudi N-Tuples Easy to Use… (Hopefully) ã Define data items e.g. as members of filling Algorithm ä Items are based on primitives bool, long, float, double // Items for n-tuple // _________________ // // 0 dimensional item (=number) NTuple::Item m_ntrk; // 1 dimensional items (Arrays) NTuple::Array m_px, m_py, m_pz; // 2 dimensional items (Matrices) NTuple::Matrix m_hits;

M.Frank LHCb/CERNGaudi N-Tuples NTuplePtr nt(ntupleService(),"/NTUPLES/MC/1"); if ( !nt ) { nt = ntupleService()->book("/NTUPLES/MC/1”, CLID_ColumnWiseTuple, "Hello World"); } NTuplePtr nt(ntupleService(),"/NTUPLES/MC/1"); if ( !nt ) { nt = ntupleService()->book("/NTUPLES/MC/1”, CLID_ColumnWiseTuple, "Hello World"); if ( nt ) { status = nt->addItem ("Ntrack", m_ntrk, 0, 5000 ); status = nt->addItem ("px", m_ntrk, m_px); // m_hits[0:m_ntrk][0:5]; numbers within [0,8] status = nt->addItem ("hit", m_ntrk, m_hits, 5, 0, 8 ); } Easy to Use… (Hopefully) ã Book and add the items you later want to fill Book the N-tuple Add items

M.Frank LHCb/CERNGaudi N-Tuples for(m_ntrk=0; m_ntrk < numTracks; m_ntrk++) { if ( m_ntrk >= m_ntrk->range().distance() ) break; } for(m_ntrk=0; m_ntrk < numTracks; m_ntrk++) { if ( m_ntrk >= m_ntrk->range().distance() ) break; m_px[m_ntrk] = track[m_ntrk]->px(); m_hits[m_ntrk][0] = track[m_ntrk]->adcValue(0);... m_hits[m_ntrk][4] = track[m_ntrk]->adcValue(4); } for(m_ntrk=0; m_ntrk < numTracks; m_ntrk++) { if ( m_ntrk >= m_ntrk->range().distance() ) break; m_px[m_ntrk] = track[m_ntrk]->px(); m_hits[m_ntrk][0] = track[m_ntrk]->adcValue(0);... m_hits[m_ntrk][4] = track[m_ntrk]->adcValue(4); } // Commit record (here of a column wise N-tuple) status = ntupleService()->writeRecord("/NTUPLES/MC/1"); Easy to Use… (Hopefully) ã Fill all items and commit record ä Simple calculations can be done directly using the items Fill items Commit record Do not overrun dimensions Reset values to defaults: Is this good?

M.Frank LHCb/CERNGaudi N-Tuples Easy to Use… (Hopefully) ã At the end of the job ä All N-tuples will automatically be closed ã The directory structure of the data store is reflected by RZ directories ä Access N-tuple for reading in the same way as for writing ä Don’t forget to “cd // / ” in PAW

M.Frank LHCb/CERNGaudi N-Tuples NTuple::Item ntrk; NTuple::Array px, py, pz; NTupleDirPtr nt(ntupleService(), "/NTUPLES/MC/1"); if ( nt ) { } NTuple::Item ntrk; NTuple::Array px, py, pz; NTupleDirPtr nt(ntupleService(), "/NTUPLES/MC/1"); if ( nt ) { status = nt1->item ("Ntrack", ntrk ); status = nt1->item ("px", px);... } NTuple::Item ntrk; NTuple::Array px, py, pz; NTupleDirPtr nt(ntupleService(), "/NTUPLES/MC/1"); if ( nt ) { status = nt1->item ("Ntrack", ntrk ); status = nt1->item ("px", px);... do { float sumPx = 0; if(ntupleService()->readRecord(nt.ptr()).isSuccess()){ for ( long j = 0; j < ntrk; j++ ) sumPx += px[j]; } } while ( status.isSuccess() ); } Easy to Use… (Hopefully) ã Reading back (…or with PAW) Will open the corresponding logical file Search for the directory Load the N-tuple Assign the entries to the N tuple Loop over records

M.Frank LHCb/CERNGaudi N-Tuples Easy to Use… (Hopefully) ã Configuration (using job options file) ä Reading N-tuples NTupleSvc.Input = { ”MC#tuple1.hbook", ”USER#tuple2.hbook" }; // Persistency type of the N-tuple service: 6=HBOOK NTupleSvc.Type = 6; NTupleSvc.Output = { ”MC#tuple1.hbook", ”USER#tuple2.hbook" }; // Persistency type of the N-tuple service: 6=HBOOK NTupleSvc.Type = 6; ä Writing N-tuples

M.Frank LHCb/CERNGaudi N-Tuples Back-End: HBOOK Limitations ã Limited type information ä Cannot define all “C” data types ä Therefor only: bool, long, unsigned long, float and double ä NOT: char, short, int (+unsigned) ä Does not affect disk space: HBOOK compresses internally ã N-tuple name is an “integer” ä “integer” translates later to HBOOK ID ä Must be constant independent of booking time for kumacs ã Do not mix up N-tuple IDs and Histogram Ids ä There is only one PAWC common block!

M.Frank LHCb/CERNGaudi N-Tuples Back-End: HBOOK Limitations ã Only one index variable per item ã RZ directory names are CHARACTER*8 ä … and upper case ONLY ã double/REAL*8 data ä PAW has trouble: better don’t use ä REAL*8 must be quadword aligned (64 bits) ä Padding must be done by user ä Not more than 1000 REAL*8 entries per N tuple ã Row wise N-tuples ä Type information is stored as first “event” ä Start reading at the second...

M.Frank LHCb/CERNGaudi N-Tuples Other Back-Ends ã The Present: HBOOK ä PAW is the most widely used viewer ä N-tuples don’t help if they can’t be analyzed interactively ã The Future (?): ROOT I/O ä Will give ROOT a try as back-end ä Implementation with trees/branches is straight forward ä Would solve probably all the limitations of HBOOK

M.Frank LHCb/CERNGaudi N-Tuples Conclusions ã It is possible to define dynamic structures (N-tuples) with Gaudi ã If you think the usage is too complicated, please say so! ä Otherwise it will never change ã Depending on the back-end, limitations invade transient side

M.Frank LHCb/CERNGaudi N-Tuples The Back-End: HBOOK (At least for the time beeing) ã Items must be contigous in memory ä Array of reals ä Common block ä Must be exported in detail where ever a variable has to be filled PARAMETER (MAXTRK = 100, MAXHIT = 300) COMMON /CMTRK/ NTRACK, PX(MAXTRK), PY(MAXTRK), + PZ(MAXTRK), HITS(MAXHIT,MAXTRK) CALL HBNAME(ID,'VARBLOK2',NTRACK, + 'NTRACK[0,100], '// + 'PX(NTRACK), PY(NTRACK), PZ(NTRACK), HITS(300,NTRACK)’)

M.Frank LHCb/CERNGaudi N-Tuples Expected Functionality ? ã Like a library ä Store objects for later use by clients ä Retrieve objects when needed ã Traverse the content (using “Agents”) ä Retrieve collections Make only selected objects persistent ã Ownership ä Responsibility for cleanup

M.Frank LHCb/CERNGaudi N-Tuples Structure of the data store ã Tree - similar to file system MCEvent DataObject ã Store item= directory + attributes ã Browse capability ã Identification by logical addresses: ”/Event/Mc/MCEcalHits”