Nikhef Bfys Workshop Day One: Exploring a (m)DST Juan Palacios 22-06-2009.

Slides:



Advertisements
Similar presentations
Data Analytics and Dynamic Languages Lee E. Edlefsen, Ph.D. VP of Engineering 1.
Advertisements

Server-Side vs. Client-Side Scripting Languages
Concepts of Version Control A Technology-Independent View.
1 Programming for Engineers in Python Autumn Lecture 5: Object Oriented Programming.
Chapter 1 Introduction to C Programming. 1.1 INTRODUCTION This book is about problem solving with the use of computers and the C programming language.
Chapter 3 Planning Your Solution
Android 4: Creating Contents Kirk Scott 1. Outline 4.1 Planning Contents 4.2 GIMP and Free Sound Recorder 4.3 Using FlashCardMaker to Create an XML File.
DaVinci status Juan Palacios LHCb Software Week March, 2009.
Project Proposal: Academic Job Market and Application Tracker Website Project designed by: Cengiz Gunay Client: Cengiz Gunay Audience: PhD candidates and.
Game Programming © Wiley Publishing All Rights Reserved. The L Line The Express Line to Learning L Line L.
CLARIN tools for workflows Overview. Objective of this document  Determine which are the responsibilities of the different components of CLARIN workflows.
JAS3 + AIDA LC Simulations Workshop SLAC 19 th May 2003.
THE BIG PICTURE. How does JavaScript interact with the browser?
Jeff LandgrafSTAR Trigger Workshop: Oct 21, 2002 Trigger Accounting for 2002.
Browsing Data with GaudiPython Disclaimers: 1.I am an apprentice! 2.The porpoise: we think GaudiPython could be quite useful for a LHCb physicist… Browsing.
Using Commtap Communication Targets and Activities Project.
CERN Tutorial, September Job Options and Printing.
Job Options and Printing 1 LHCb software tutorial - September 2011.
G.Corti, P.Robbe LHCb Software Week - 19 June 2009 FSR in Gauss: Generator’s statistics - What type of object is going in the FSR ? - How are the objects.
A Short Course on Geant4 Simulation Toolkit How to learn more?
Introduction Advantages/ disadvantages Code examples Speed Summary Running on the AOD Analysis Platforms 1/11/2007 Andrew Mehta.
Introduction to Gaudi LHCb software tutorial - September
1 Control Software (CAT) Introduction USB Interface implementation Calorimeter Electronics Upgrade Meeting Frédéric Machefert Wednesday 5 th May, 2010.
Particle to MC truth association Juan Palacios (Nikhef) LHCb software week June
240-Current Research Easily Extensible Systems, Octave, Input Formats, SOA.
A Technical Validation Module for the offline Auger-Lecce, 17 September 2009  Design  The SValidStore Module  Example  Scripting  Status.
Kali Calo progress report Dasha Savrina (ITEP/Moscow), Vanya Belyaev.
Gaudi Framework Tutorial, April Algorithm Tools: what they are, how to write them, how to use them.
Jose A. Hernando Trigger Gaudies Reconstruction Tools & Algorithms Inspectors MC & Data Algorithms Template preserved container Jose A. Hernando.
Reconstruction Configuration with Python Chris Jones University of Cambridge.
Use Cases CS 6961 – Lecture 4 Nathan Dykman. Neumont UniversityCS Lecture 102 Administration Homework 1 is due –Still reviewing the proposal, but.
You Need an Interpreter!. Closing the GAP Thus far, we’ve been struggling to speak to computers in “their” language, maybe its time we spoke to them in.
LHCb-ATLAS GANGA Workshop, 21 April 2004, CERN 1 DIRAC Software distribution A.Tsaregorodtsev, CPPM, Marseille LHCb-ATLAS GANGA Workshop, 21 April 2004.
Vanya BELYAEV Vanya BELYAEV (Syracuse) Vanya BELYAEV Tutorial Gaudi/DaVinci/LoKi/Bender.
Argonne Jamboree January 2010 Esteban Fullana AOD example analysis.
Refitting Tracks from DST E. Rodrigues, NIKHEF LHCb Tracking and Alignment Workshop, Lausanne, 8-9th November 2006  Motivations  Step-by-step …  Current.
Trinity College Dublin, The University of Dublin GE3M25: Computer Programming for Biologists Python Karsten Hokamp, PhD Genetics TCD, 03/11/2015.
M1G Introduction to Programming 2 3. Creating Classes: Room and Item.
1 SICBDST and Brunel Migration status and plans. 2 Migration Step 1: SICBMC/SICBDST split  Last LHCb week: Split done but not tested  Software week.
SHERPA Simulation for High Energy Reaction of PArticles.
LHCb Software Week, 26th April /23 Tracking in LHCb E. Rodrigues, NIKHEF LHCb Software Week A Status Report.
CERN Tutorial, February Introduction to Gaudi.
CERN Tutorial, September Overview of LHCb applications and software environment.
1 G4UIRoot Isidro González ALICE ROOT /10/2002.
Software Engineering (Chap. 1) Object-Centered Design When we prepare a program, the experience can be just like composing poetry or music … My claim is.
20 October 2005 LCG Generator Services monthly meeting, CERN Validation of GENSER & News on GENSER Alexander Toropin LCG Generator Services monthly meeting.
Python -based Physics Analysis Environment for LHCb G. Barrand, M. Frank, P. Mato, E. de Oliveira, A.Tsaregorodtsev, I. Belyaev CHEP 2004, Interlaken,
9 Associators How to relate objects to each other Create relations Save relations Use relations: Associators.
Introduction to FCC Software FCC Istanbul 11 March, 2016 Alice Robson (CERN/UNIGE) on behalf of / with thanks to the FCC software group.
Today… Modularity, or Writing Functions. Winter 2016CISC101 - Prof. McLeod1.
Geant4 Training 2003 A Short Course on Geant4 Simulation Toolkit How to learn more? The full set of lecture notes of this Geant4.
BES III Software: Beta Release Plan Weidong Li 19 th October 2005.
GOOGLE TAG MANAGER. INTRODUCTION Google Tag Manager (GTM) is a free solution, introduced in October Google Tag Manager (GTM) is a free solution,
Session 7: More Module Interface Rob Kutschke art and LArSoft Course August 4, 2015.
Software Development – Topic 2 Types of Programming Language.
GaudiPython hands-on: from basic python to analysing a (m)DST Juan Palacios
Development Environment
DecayTreeTuple – an update (v2r3p1)
FCC Software Status Readiness for FCC-ee Physics
PyBAR Firmware Structure and Operation Experience
Event Data Definition in LHCb
A Short Course on Geant4 Simulation Toolkit How to learn more?
Unit# 9: Computer Program Development
Coding Concepts (Basics)
A Short Course on Geant4 Simulation Toolkit How to learn more?
A Short Course on Geant4 Simulation Toolkit How to learn more?
2 Getting Started.
2 Getting Started.
Open data in teaching and education
Presentation transcript:

Nikhef Bfys Workshop Day One: Exploring a (m)DST Juan Palacios

June 22, Juan Palacios –1 Plan Very brief explanation of some terminology Plan for the day References Help and hints

Terminology DST –Data file or format after the reconstruction phase (Brunel) of the LHCb software chain MicroDST –Data file containing a subset of data from the DST plus data obtained from the analysis (DaVinci) phase –Part of the event written, only for events passing a selection Vanya’s DST –Extended DST (only that name has been taken for something else now) with some analysis stuff (Particles, secondary vertices) added in –Full events written, bun only when certain particles have been selected June Exploring the (m)DST - Juan Palacios - Bfys workshop June-09 2

DST format (1) All three types have the same “format” –LHCb event model types stored in some kind of directory-like locations in something called the transient event store or TES from now on –Gaudi framework allows us to get them by querying locations like “/Event/Rec/Track/Best”, “Event/Phys/SomeSelection/Particles” June Exploring the (m)DST - Juan Palacios - Bfys workshop June-09 3

DST format (2) For our purposes, all that matters is that the framework loads these things from the DST onto memory, and we can get them by asking for them Reality can be more complicated –Framework allows to invoke some code that produces the stuff automatically when you ask for it and it isn’t there: DataOnDemandSvc We won’t be using that in this workshop June Exploring the (m)DST - Juan Palacios - Bfys workshop June-09 4

Plan for the day (1) We will just open some files, look at what is there, and make some plots and calculations We will use GaudiPython –No C++ programming Do not have the seven years necessary to teach that –Good at scripting –Full access to Gaudi framework tools, algorithms and services –Access for non-LHCb SW components MathLibs, STL stuff, RooFit Any python library that is installed June Exploring the (m)DST - Juan Palacios - Bfys workshop June-09 5

Plan for the day (2) Set the Bender v12r1 environment go to the GaudiPython tutorial package –~/cmtuser/Bender_v12r1/Tutorial/GaudiPy thonTutor – This is installed on all the accounts on the workshop server and if you followed the CernVM instructions you should have it installed too Simple event loop example in ~cmtuser/Bender_v12r1/Tutorial/ GaudiPythonTutor/scripts/EventL oop.py – Have a look at it and run it June Exploring the (m)DST - Juan Palacios - Bfys workshop June-09 6

Plan for the day (3) Plain text descriptions of problems in $GAUDIPYTHONROOT/exercises – We will try to do exercises/pvs0.txt exercises/tracks0.txt exercises/particles0.txt exercises/particles1.txt – If quick with previous one. Might requires some slightly complicated python exercises/particles2.txt exercises/particles3.txt – if we have time. If we’ve done particles1 then it should be trivial June Exploring the (m)DST - Juan Palacios - Bfys workshop June-09 7

About the exercises They are designed to give you a feeling of what can be quickly achieved –From basic plots of pT, eta, PV multiplicity, to more complicated things like proper time resolution Some require more complicated python –This is just for simplicity and to avoid code duplication. We could achieve the same with many more lines similar to the simpler examples They gradually build up towards the functionality of Ex/MicroDSTExample/scripts/MicroDSTReadingE xample.py There are example partial solutions in the GaudiPythonTutor package – No prizes for guessing where to find them June Exploring the (m)DST - Juan Palacios - Bfys workshop June-09 8

About the exercises (2) There are example partial solutions in the GaudiPythonTutor package – No prizes for guessing where to find them But don’t just copy-and-paste them, if something is not clear, just ask – We should avoid relying blindly on black magic Don’t hesitate to ask questions about Python – It isn’t the topic of the tutorial but it will make your like much, mich easier June Exploring the (m)DST - Juan Palacios - Bfys workshop June-09 9

References (1) doxygen is your best friend –Class and function documentation – release- area/DOC/davinci/releases/latest/doxygen/clas ses.htmlhttp://lhcb-release-area.web.cern.ch/LHCb- release- area/DOC/davinci/releases/latest/doxygen/clas ses.html –Many problems users have could be solved by them if they’d looked at the doxygen for a few classes –Documentation for some algorithms and tools not great Complain to the authors! June Exploring the (m)DST - Juan Palacios - Bfys workshop June-09 10

References (2) Wiki pages are your other best friends –DaVinci –GaudiPython FAQ –Loki (the engine behind Bender and many other things) –MicroDST –Particle -> MC association –Particle -> PV relating –Other links - Reference_Wiki_pages_and_noteshttps://twiki.cern.ch/twiki/bin/view/LHCb/DaVinci - Reference_Wiki_pages_and_notes June Exploring the (m)DST - Juan Palacios - Bfys workshop June-09 11

Hints and Help June Exploring the (m)DST - Juan Palacios - Bfys workshop June-09 12

Using python help Get information about stuff –>>help(ClassName) –>>help(InstanceName) We got book from a python module. Look at the top of EventLoop.py : –from MicroDSTExample.HistoUtils import book, fill Can call help directly: –help(book) –help(fill) Make a 2D histo, name fred, then –help(fred) June Exploring the (m)DST - Juan Palacios - Bfys workshop June-09 13

Obtaining Gaudi Tools Needed for proper-time fitter, MC association, partilce->PV association –myTool = toolSvc.create(“ImplementationName”, interface=“InterFaceName) –propTimrFitter = toolSvc.create(“ProperTimeFitter”,interface=“ILifeTim eFitter” Getting references –GaudiPython equivalent of foo(double& x) is a bit complicated: –from ROOT import Double –x = Double(0.) –foo(x) June Exploring the (m)DST - Juan Palacios - Bfys workshop June-09 14

Gaudi Units Can get definitions of units from module –from GaudiKernel import SystemOfUnits as units –help(units)# see what units are available –x = someTool.getX() –x_inGeV = x/units.GeV June Exploring the (m)DST - Juan Palacios - Bfys workshop June-09 15

Getting c++ classes All C++ namespaces in special module –from GaudiPython.Bindings import gbl –# get some short cuts to avoid typing –LHCb = gbl.LHCb –std = gbl.std –myParticle = LHCb.Particle() –# get an std::vector –DoubleVector = std.vector(“double”) –# make a size 100 vector full of 0.5 –v0 = DoubleVector(100, 0.5) June Exploring the (m)DST - Juan Palacios - Bfys workshop June-09 16

Histogram help Saving histograms –Need Ex/MicroDSTExample v2r6 One version higher than that used for workshop –from MicroDSTExample.HistoUtils import HistoFile –hFile = HistoFile(“fileName.txt”) –help(hFile) –hFile.save(histo1, histo2, histo3, …) –hFile.close() Histogram service –histSvc = appMgr.histSvc() –histSvc.dump() # print all histos booked so far –Help(histSvc) June Exploring the (m)DST - Juan Palacios - Bfys workshop June-09 17

EventLoop.py Check that the data location is OK –Server: /data/bfys/lhcb/workshop –CernVM (Mac): /data/lhcb python –i gives you interactive prompt after running script so you can plot Look at the script to see what plots have been made –appMgr.histSvc().dump() –plotName.plot() June Exploring the (m)DST - Juan Palacios - Bfys workshop June-09 18

tracks0.py Use a DST –Not enough tracks on MicroDST Track location: –‘/Event/Rec/Track/Best’ What is the meaning of this? –from GaudiKernel import SystemOfUnits as units –help(units) # of things in a container –ContainerName.size() June Exploring the (m)DST - Juan Palacios - Bfys workshop June-09 19

tracks0.py (2) Checking Track type tType = myTrack.type() if tType == gbl.LHCb.Track.Long : fill(longTrackPlot, ….) gbl.LHCb.Track.Long is the GaudiPython equivalent of LHCb::Track::Long June Exploring the (m)DST - Juan Palacios - Bfys workshop June-09 20

particlesN.txt Use the MicroDST –Has a Bs->J/Psi(mm)Phi(KK) selection –B0s particles in ‘Event/microDST/Phys/DC06selBs2JpsiPhi_inbiased/Particles’ Try using the SystemOfUnits stuff to plot momenta and masses in GeV and proper times in ps –from GaudiKernel import SystemOfUnits as units –help(units) June Exploring the (m)DST - Juan Palacios - Bfys workshop June-09 21

ParticlesN.txt (2) fitter = toolSvc(…) time = Double( ) error = … propTime = fitter.fit(vertex, particle, time, error, chi2 June Exploring the (m)DST - Juan Palacios - Bfys workshop June-09 22