Gaudi Framework Tutorial, April 2006 6 Creating Objects and Writing Data.

Slides:



Advertisements
Similar presentations
Athena/POOL integration
Advertisements

Access Lesson 2 Creating a Database
Persistent State of Package Variables. 2 home back first prev next last What Will I Learn? Identify persistent states of package variables Control the.
Gaudi Framework Tutorial, April Accessing Event Data.
Creating a Blank Database 1. Open up Microsoft Access 2. Click on Blank document button 3. On the right panel, Specify the location for saving your database.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 4: Implementing and Managing Group and Computer Accounts.
Click to proceed iProcurement requirement for Account Generator was….  To auto-populate maximum possible segments in Accounting flexfield for iProcurement.
Guide to Using Message Maker Robert Snelick National Institute of Standards & Technology (NIST) December 2005
Guide to MCSE , Enhanced 1 Activity 4-1: Creating and Adding Members to Global Groups Objective: Use Active Directory Users and Computers to create.
Module 14: Configuring Print Resources and Printing Pools.
Web Application Development. Define ER model in QSEE Generate SQL Create Database mySQL Write Script to use TableEditor class Process to create A simple.
M.Frank LHCb/CERN - In behalf of the LHCb GAUDI team Data Persistency Solution for LHCb ã Motivation ã Data access ã Generic model ã Experience & Conclusions.
SYST Web Technologies SYST Web Technologies Lesson 6 – Intro to JavaScript.
Overview of LHCb applications and software environment LHCb software tutorial - March
The report on the current situation of the BESIII framework zhangxiaomei maqiumei 10/3/2004.
Event Data History David Adams BNL Atlas Software Week December 2001.
The Glance Project ATLAS Management January 2012.
CHEP 2003 March 22-28, 2003 POOL Data Storage, Cache and Conversion Mechanism Motivation Data access Generic model Experience & Conclusions D.Düllmann,
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.
LHCb Simulation Tutorial CERN, 21 st -22 nd February B 00 l e Event Model, XML, GaudiObjDesc Original.
Use of Gaudi in Reconstruction Weidong Li 23/06/2004.
Gaudi Framework Tutorial, April Algorithm Tools: what they are, how to write them, how to use them.
Gaudi Framework Tutorial, April Job Options and Printing.
Status of Florida Tier2 Center A mini tutorial on ROCKS appliances Jorge L. Rodriguez February 2003.
CHEP ‘06 David Lawrence JLab C++ Introspection and Object Persistency through JIL David Lawrence Ph. D. Jefferson Lab, Newport News VA.
C++ Introspection and Object persistency Through JIL David Lawrence Ph. D. Jefferson Lab, Newport News VA.
STAR Event data storage and management in STAR V. Perevoztchikov Brookhaven National Laboratory,USA.
Apr. 8, 2002Calibration Database Browser Workshop1 Database Access Using D0OM H. Greenlee Calibration Database Browser Workshop Apr. 8, 2002.
Argonne Jamboree January 2010 Esteban Fullana AOD example analysis.
Marco Cattaneo, 15-Sep OO software plans  Major milestone (presented last June) Fully functional SICB replacement by mid-2000  How to get there?
- Early Adopters (09mar00) May 2000 Prototype Framework Early Adopters Craig E. Tull HCG/NERSC/LBNL ATLAS Arch CERN March 9, 2000.
STAR Schema Evolution Implementation in ROOT I/O V. Perevoztchikov Brookhaven National Laboratory,USA.
23/2/2000Status of GAUDI 1 P. Mato / CERN Computing meeting, LHCb Week 23 February 2000.
Tutorial: Examples (09may00 - ATLAS Software LBNL) May 2000 Prototype Framework Tutorial: Examples Paolo Calafiura, Charles Leggett HCG/NERSC/LBNL.
Valeri Fine Athena/POOL integration.
D. Duellmann - IT/DB LCG - POOL Project1 The LCG Dictionary and POOL Dirk Duellmann.
Module 7: Auditing Active Directory Domain Services Changes.
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.
Advanced Athena Tutorial ADL/StoreGate ADL Exercises CERN, May/Mai 5, 2002.
CERN Tutorial, September Overview of LHCb applications and software environment.
Athena Tutorial: Liquid Argon Example ATHENA The ATLAS Control Framework Tutorial: Liquid Argon Example Based on original by S. Rajagopalan BNL.
ATLAS Data Dictionary A. Bazan, T. Bouedo, P. Ghez, T. Le Flour, S. Lieunard M. Marino, C. Tull.
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,
Gaudi Framework Tutorial, Algorithm Tools: what they are and how to use them.
Bologna Tutorial, June Overview of LHCb applications and software environment.
Gaudi Framework Tutorial, April Histograms And N-tuples.
9 Associators How to relate objects to each other Create relations Save relations Use relations: Associators.
Athena StoreGate Tutorial: May 30, Objectives Learn how to access data objects using StoreGate How to record/retrieve by TYPE Optionally using keys.
Gaudi Framework Tutorial, April Histograms And N-tuples.
POOL Based CMS Framework Bill Tanenbaum US-CMS/Fermilab 04/June/2003.
David Adams ATLAS Hybrid Event Store Integration with Athena/StoreGate David Adams BNL March 5, 2002 ATLAS Software Week Event Data Model and Detector.
Re Write POGO using openArchitectureWare Technology ● Pogo History ● OpenArchitectureWare technology ● Generated code ● Project status.
AOD example analysis Argonne Jamboree January 2010
Root I/O and the Gaudi Framework
Review What is an object? What is a class?
Configuration and Build System
Event Data Definition in LHCb
LHCb Software Tutorial
ISC440: Web Programming 2 Server-side Scripting PHP 3
Data Persistency Solution for LHCb
Various News From Detector Description
Converting ATLAS Events Into XML Files Janice Drohan (UCL)
2 Getting Started.
2 Getting Started.
Use Of GAUDI framework in Online Environment
Planning next release of GAUDI
Accessing Event Data Schedule: Timing Topic 20 minutes Lecture
Calibration Infrastructure Design
Presentation transcript:

Gaudi Framework Tutorial, April Creating Objects and Writing Data

6-2 Gaudi Framework Tutorial, April 2006 Objectives After completing this lesson, you should be able to: Design data store objects. Implement standard persistency. Read and write your own mini-DSTs. After completing this lesson, you should be able to: Design data store objects. Implement standard persistency. Read and write your own mini-DSTs.

6-3 Gaudi Framework Tutorial, April 2006 Two Types Of Objects Identifiable objects –Access by name: “/Event/MC/Particles” or LHCb::MCParticleLocation::Default –Typically: a KeyedContainer (e.g. of MCParticles) a DataObject (e.g. “/Event/MC/Header”) Non-identifiable objects –5th. MCParticle in MCParticles –MCParticle with key = 25 Identifiable objects –Access by name: “/Event/MC/Particles” or LHCb::MCParticleLocation::Default –Typically: a KeyedContainer (e.g. of MCParticles) a DataObject (e.g. “/Event/MC/Header”) Non-identifiable objects –5th. MCParticle in MCParticles –MCParticle with key = 25

6-4 Gaudi Framework Tutorial, April 2006 Inherit from DataObject Data store objects must implement a basic functionality Class understood by the data store Have a unique CLID Inherit from DataObject Data store objects must implement a basic functionality Class understood by the data store Have a unique CLID Design of Identifiable Objects MyObjClass DataObject Data members Member functions

6-5 Gaudi Framework Tutorial, April 2006 Non-Identifiable Objects Same rules Replace DataObject with KeyedObject Same rules Replace DataObject with KeyedObject MyContdClass KeyedObject Data members Member functions

6-6 Gaudi Framework Tutorial, April 2006 Gaudi Object Description Set of tools to describe event data classes – Description in XML – Generates.h plus dictionaries –Including all setters and getters –Including all infrastructure needed for persistency Set of tools to describe event data classes – Description in XML – Generates.h plus dictionaries –Including all setters and getters –Including all infrastructure needed for persistency

6-7 Gaudi Framework Tutorial, April 2006 G.O.D. Xml file <gdd> <class author="Marco Cattaneo" <class author="Marco Cattaneo" desc="Example of a simple keyedObject" desc="Example of a simple keyedObject" name="VertexInfo" name="VertexInfo" location="MC/PrimaryVertices" location="MC/PrimaryVertices" id="12345" id="12345" > &KeyedObject; &KeyedObject; <attribute <attribute desc="Vertex multiplicity" desc="Vertex multiplicity" name="multiplicity“ type="long" init="0" name="multiplicity“ type="long" init="0" /> /> </gdd> <gdd> <class author="Marco Cattaneo" <class author="Marco Cattaneo" desc="Example of a simple keyedObject" desc="Example of a simple keyedObject" name="VertexInfo" name="VertexInfo" location="MC/PrimaryVertices" location="MC/PrimaryVertices" id="12345" id="12345" > &KeyedObject; &KeyedObject; <attribute <attribute desc="Vertex multiplicity" desc="Vertex multiplicity" name="multiplicity“ type="long" init="0" name="multiplicity“ type="long" init="0" /> /> </gdd>

6-8 Gaudi Framework Tutorial, April 2006 Adding objects to the Transient Event Store In order to write out an object, you first have to add it to the T.E.S: // Create a container for the VertexInfo objects LHCb::VertexInfos* infoCont = new LHCb::VertexInfos(); LHCb::VertexInfos* infoCont = new LHCb::VertexInfos(); // Declare the VertexInfo to the transient store put( infoCont, LHCb::VertexInfoLocation::Default ); put( infoCont, LHCb::VertexInfoLocation::Default ); // Loop over vertices to identify primary vertices {... // Make new VertexInfo object, insert in container // Make new VertexInfo object, insert in container LHCb::VertexInfo* newInfo = new LHcb::VertexInfo(); LHCb::VertexInfo* newInfo = new LHcb::VertexInfo(); newInfo->setMultiplicity( daughters.size() ); newInfo->setMultiplicity( daughters.size() ); infoCont->insert( newInfo ); infoCont->insert( newInfo );} In order to write out an object, you first have to add it to the T.E.S: // Create a container for the VertexInfo objects LHCb::VertexInfos* infoCont = new LHCb::VertexInfos(); LHCb::VertexInfos* infoCont = new LHCb::VertexInfos(); // Declare the VertexInfo to the transient store put( infoCont, LHCb::VertexInfoLocation::Default ); put( infoCont, LHCb::VertexInfoLocation::Default ); // Loop over vertices to identify primary vertices {... // Make new VertexInfo object, insert in container // Make new VertexInfo object, insert in container LHCb::VertexInfo* newInfo = new LHcb::VertexInfo(); LHCb::VertexInfo* newInfo = new LHcb::VertexInfo(); newInfo->setMultiplicity( daughters.size() ); newInfo->setMultiplicity( daughters.size() ); infoCont->insert( newInfo ); infoCont->insert( newInfo );}

6-9 Gaudi Framework Tutorial, April 2006 Data Persistency Data conversion mechanism –Transient -> Persistent … Persistent -> Transient Data conversion mechanism –Transient -> Persistent … Persistent -> Transient Generic converters –Object serialization by Root –Converters come for free. They use information from the dictionaries that are automatically generated by G.O.D. Generic converters –Object serialization by Root –Converters come for free. They use information from the dictionaries that are automatically generated by G.O.D. Specific converters –Possible, but well beyond the scope of this tutorial –Allow optimization in transient and/or persistent world Specific converters –Possible, but well beyond the scope of this tutorial –Allow optimization in transient and/or persistent world

6-10 Gaudi Framework Tutorial, April 2006 The Remaining Machinery Setup in the job options // Services and dictionaries for reading/writing event data #include "$STDOPTS/simDicts.opts" // Additional dictionary for user defined classes PoolDbCacheSvc.Dlls += {“TutKernelDict" }; // Define the data to write out and the output file ApplicationMgr.OutStream = { "RootDst" }; RootDst.ItemList = { "/Event#1", "/Event/MC#1", "/Event/MC/Header#1", "/Event/MC/PrimaryVertices#1“ }; RootDst.Output = "DATAFILE='RootDst.root' TYP='POOL_ROOTTREE' OPT='REC'"; // Services and dictionaries for reading/writing event data #include "$STDOPTS/simDicts.opts" // Additional dictionary for user defined classes PoolDbCacheSvc.Dlls += {“TutKernelDict" }; // Define the data to write out and the output file ApplicationMgr.OutStream = { "RootDst" }; RootDst.ItemList = { "/Event#1", "/Event/MC#1", "/Event/MC/Header#1", "/Event/MC/PrimaryVertices#1“ }; RootDst.Output = "DATAFILE='RootDst.root' TYP='POOL_ROOTTREE' OPT='REC'";

6-11 Gaudi Framework Tutorial, April 2006 Hands on: VertexInfo.xml Look at the file in xml directoryLook at the file in xml directory – Understand it and adapt it to your needs Look at the cmt/requirements fileLook at the cmt/requirements file – Understand it – Use it to create the VertexInfo.h header file – Look at the generated header file Look at the file in xml directoryLook at the file in xml directory – Understand it and adapt it to your needs Look at the cmt/requirements fileLook at the cmt/requirements file – Understand it – Use it to create the VertexInfo.h header file – Look at the generated header file cd ~/cmtuser getpack Tutorial/TutKernel cd Tutorial/TutKernel/v1r0

6-12 Gaudi Framework Tutorial, April 2006 Hands On: write persistent data Modify VisibleEnergy.cpp to: – create VertexInfo objects – Add them to a VertexInfos KeyedContainer – Register the VertexInfos on the transient event store at the default location –See slide 6-8 Write the object to a ROOT file –See slide 6-10 Browse the output file with the Root browser Modify VisibleEnergy.cpp to: – create VertexInfo objects – Add them to a VertexInfos KeyedContainer – Register the VertexInfos on the transient event store at the default location –See slide 6-8 Write the object to a ROOT file –See slide 6-10 Browse the output file with the Root browser cd ~/cmtuser/Tutorial/Components/v7r0/src

6-13 Gaudi Framework Tutorial, April 2006 Solution In src.data directory of Tutorial/Components package To try this solution and start next exercise from it: In src.data directory of Tutorial/Components package To try this solution and start next exercise from it: Uncomment Tutorial 3 options in $MAINROOT/options/jobOptions.opts cd ~/cmtuser/Tutorial/Component/v7r0/src Move your modified files if you want to keep them cp../src.data/*.*. cd../cmt Uncomment use TutKernel directive in requirements cmt broadcast gmake source setup.csh $MAINROOT/$CMTCONFIG/Main.exe $MAINROOT/options/jobOptions.opts