Download presentation
Presentation is loading. Please wait.
Published byAmber Paul Modified over 9 years ago
1
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 data with GaudiPython H. Dijkstra, JA. Hernando, T. Ruf,
2
GaudiPython: a gate… LHCb code is in Python GaudiPython: (most) Gaudi framework accessible via Python (GaudiPython v*) + the Event Model classes (Data) “Bender”: Extra Gaudi-classes + DaVinci Tools + ‘LoKi’ for analysis Why Python?: It is a simple, intuitive, powerful OO language Ads: ie.: no pointers, dynamically typed, heterogeneous containers, dictionaries It supports interactivity and introspection It is one for all: use for scripting, for programming, for interactive data-analysis GaudiPython (we have used for… but we can do more…): XXX?Enviroment: we use PanoramixEnv Creating a simple Application Browsing Data Quick way to develop monitoring algorithms (histograms)… > source PanoramixEnv vXrY > cd ~/cmtuser/Vis/Panoramix/vXrY/cmt > source setup.csh
3
An illuminating example (T.Ruf): anaSpillOver.py Import Gaudi Create a Gaudi Application Select a Data file Get the Event/Histo Svc Book histos
4
An example: anaSpillOver.py, histogram monitoring algo Create your Algorithm Execution per event Get the clusters And fill the Histos Add your algorithm to the Application Run!!! Final Print out
5
An example: anaSpillOver.py: 1,2,3, how to run? ~>python anaSpillOver.py ~>python Python 2.3.4 (#1, Jun 7 2004, 11:39:13) >> import gaudimodule >> gaudi = gaudimodule.AppMgr(outputLevel = 2, jobptions = ‘spillOverDicts.opts) 1 2 3 As an script! (console) At the prompt: (console) From the Emacs menu: # get the prompt: (menu) Python->start interpreter # Execute a region (fraction) or buffer (all): (menu) Python->execute region/buffer # define a fucntion, execute region and use it in the promt! > source PanoramixEnv vXrY > cd ~/cmtuser/Vis/Panoramix/vXrY/cmt > source setup.csh
6
The option files and the result, an Hbook file Dictionaries Algo and options Note: You can see histos and analyze ntuple from Python!! PyROOT (HIPYS)
7
GaudyPython extension in Bender: Vanya’s similar example From Bender import Gaudi Creating the ‘GaudiHisto’Algorithm Getting the data plot = (book + fill) histogram Configuring Gaudoi Creating my algorithm NOTE: Vanya’s will exports GaudiAlgorithms from Bender to GaudiPython
8
Interactivity and Introspection: ginspector.py But… What data is there?, What methods has my data? What are the options? … Exploring the data What methods? Module inspection What functions? What classes? >> evh = evt[‘Header’] >> dir(evh) >> print evh.evtNum() >> import ginspector >> help(ginspector)
9
ginspector.py: What is in the DST & TES? Inspecting Data: PATH “Header” TYPE “EventHeader” Methods: evtNum() runNum() >>ginspector.inspectData(evt,”dst_data.txt”) NOTE: in the next version: we can have also the arguments of the methods (gracias Pere)
10
Ginspector: What properties? Inspecting Properties Name and Type AppMgr iAlgorithm List of properties >> ginspector.inspectProperties(gaudi,’dst_properties.txt’)
11
A repository of scripts and catalog, and tests Different uses of Python: (one for all..) Scripting: 1.create joboptions Hugo’s stripping 2.stage data in castor 3.send jobs Programming: 1.Physics Analysis: Vanya’s Bender Interactive Analysis: Monitoring: spillOver (T.Ruf,H.D.) With Panoramix Reconstruction: (plans) debug: event by event Histos/Ntuple Analysis: PyROOT (HIPYS) it is time to replace your “kumacs” In the repository : A repository of packages python modules /python directory in the packages CMT will take care of PYTHONPATH I catalog in the web: Python script name, author, description, comment Test before a release (Brunel, DaVinci) Some problems (linux): i.e RTTC a simple script did not (almost solved now)! A set of meaningful GaudiPython test scripts before a release?
12
Other uses of GaudiPython Visualization: Steer Panoramix from a Python script What to draw and how: T. Ruf examples Testing/debugin: Click in a object in Panoramric and get it in the Python prompt (i.e track) Operate it in Python: i.e remove measurements and refit Tracking Debuging/Prototyping the reconstruction event by event In the Python prompt: tracks, extrapolator, fitter Geometry Debugin/testing detector geometries/aligment From Bender we can import to and update DetectorDescription classes Debug/test Volumes, DetectorElements…
13
Enlarging the community LHCb code is in Python GaudiPython + Event Model classes (Data) + “Bender” Making it more powerful (Pere, Vanya): exposing to GaudiPython more features of Gaudi: NTuples importing fron Bender common modules: GaudiAlgorithm extending to DetDescription classes We think it is useful for the Physicist: Simple, intuitive, powerful, interactive language: scripts, programming, analysis Allows easy browse of the data: create histograms, ntuples convenient for: prototyping, debugging, analysis event per event Enlarging the community: a repository with pythons scripts and a catalog on the web (TR, JAH) standard meaningful test with some GaudiPython scripts before a release? (check of data size, spill over…etc)
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.