ROME a universally applicable analysis framework generator Wednesday
ROME a universally applicable analysis framework generator Wednesday Seminar Presented by Matthias Schneebeli Paul Scherrer Institut • 5232 Villigen PSI ROME / 20. 4. 2005 / Matthias Schneebeli
Index • Short introduction to ROOT • Data acquisition/analysis • Introduction to the ROME Environment o Objects inside ROME Projects o The code generation mechanism • Monitoring Tools o Argus o Roody Paul Scherrer Institut • 5232 Villigen PSI ROME / 20. 4. 2005 / Matthias Schneebeli
Short introduction to ROOT Paul Scherrer Institut • 5232 Villigen PSI ROME / 20. 4. 2005 / Matthias Schneebeli
What’s ROOT ? • ROOT is an object oriented HEP analysis framework • It provides class libraries for o handling and analyzing large amount of data o data visualization o Monte Carlo, parallel processing, … Paul Scherrer Institut • 5232 Villigen PSI ROME / 20. 4. 2005 / Matthias Schneebeli
Three User Interfaces int main() { TH 1 F *h; h = new TH 1 F(“h“); h->Fill(1); h->Draw(); • GUI windows, buttons, menus • Root Command line CINT (C++ interpreter) TBrowser t; } • Macros, applications, libraries (C++ compiler and interpreter) Paul Scherrer Institut • 5232 Villigen PSI ROME / 20. 4. 2005 / Matthias Schneebeli
ROOT vs. PAW • Regular grammar (C++) on command line • Single language (compiled and interpreted) • Object Oriented (use your class in the interpreter) • Advanced Interactive User Interface • Object I/O including Schema Evolution • 3 -d interfaces with Open. GL and X 3 D. • Well Documented code. HTML class descriptions for every class. Paul Scherrer Institut • 5232 Villigen PSI ROME / 20. 4. 2005 / Matthias Schneebeli
Example of a ROOT interactive session Root > float x=5, y=7; Root > x*sqrt(y) (double)1. 322875655532 e+01 Root > TF 1 fl(“fl”, ”sin(x)/x”, 0, 10) Root > fl. Draw() Paul Scherrer Institut • 5232 Villigen PSI ROME / 20. 4. 2005 / Matthias Schneebeli
Histogram Views All these plots can be rotated with the mouse Paul Scherrer Institut • 5232 Villigen PSI ROME / 20. 4. 2005 / Matthias Schneebeli
Data acquisition/analysis Paul Scherrer Institut • 5232 Villigen PSI ROME / 20. 4. 2005 / Matthias Schneebeli
DAQ Setup VME Run control Trigger Front-end CAMAC Event buffer Tape Logger Analyzer Back-end computer ROME Paul Scherrer Institut • 5232 Villigen PSI WWW Histogram display Office computers Argus, Roody ROME / 20. 4. 2005 / Matthias Schneebeli
Introduction to ROME Paul Scherrer Institut • 5232 Villigen PSI ROME / 20. 4. 2005 / Matthias Schneebeli
Framework Requirements • Object oriented • Program should deal with objects, not with single values. • Modular • Possibility to easy exchange calculation modules. • Universal • The framework should be usable by as many experiments as possible. • Easy to use • The user should write as less and as simple code as possible. Paul Scherrer Institut • 5232 Villigen PSI ROME / 20. 4. 2005 / Matthias Schneebeli
ROME Objects Folders Tasks • Data objects in memory • Calculation objects Trees Histograms • Data objects saved to disc • Graphical data objects Steering Parameters Midas Banks • Framework steering • Midas raw data objects ROME Objects : • Only 6 different objects. • Access methods have same naming conventions Paul Scherrer Institut • 5232 Villigen PSI ROME / 20. 4. 2005 / Matthias Schneebeli
Interconnections Disk Read (any Format) (Input) Read Histograms Fill Tasks Fill Folders Histograms Fill Histograms Flag Fill Trees Write (ROOT) Paul Scherrer Institut • 5232 Villigen PSI Disk (Output) ROME / 20. 4. 2005 / Matthias Schneebeli
From Banks to Folders Readout values of a sub-detectors ADC Bank SCLR Bank TDC Bank Value 1 Value 2. . . DMND Bank Value 1 Value 2. . . CRNT Bank MSRD Bank Value 1 Value 2. . . Paul Scherrer Institut • 5232 Villigen PSI Value 1 Value 2. . . Sub-detector with all it’s readout values PMTFolder PMT Folder ADC ADC TDC TDC XX HV demand XX HV measured XX HV current xx Scaler ROME / 20. 4. 2005 / Matthias Schneebeli
Proposed Analysis Structure Banks ROME folder Task ADC counts charge Pedestal subtraction Counts -> Charge counts header chn. /value Raw data ROME folder Task ADC counts TDC Task Decoding (chn. /crate/… -> number) Offset correction TDC time Decoded data *. root Paul Scherrer Institut • 5232 Villigen PSI Mapping ADC/TDC -> counter Optional analysis of decoded data Hit Hit charge time HV HV HV scaler High level analysis Object data *. root ROME / 20. 4. 2005 / Matthias Schneebeli
Modularity ROME is based on Tasks and Folders. • Tasks are independent calculation modules. • The interface to the tasks are folders. • Tasks can be combined or exchanged arbitrarily, as long as the interface matches. • E. g. one can execute different calibration tasks without re-linking. A 1 B 1 A 2 B 2 A 3 A 4 Ø Possible even during runtime Paul Scherrer Institut • 5232 Villigen PSI ROME / 20. 4. 2005 / Matthias Schneebeli
Universality ROME is clearly separated into • an experiment independent part of the framework • e. g. Event loop, IO, Database access. Part of ROME • Works for all event based experiments • an experiment dependent part of the framework • e. g. Data structure, program structure • Summarized in a framework definition file. Generated by ROMEBuilder • Translated into c++ code by the ROMEBuilder. • the calculation code • Has to be filled in by the experimenter Paul Scherrer Institut • 5232 Villigen PSI Written by the user ROME / 20. 4. 2005 / Matthias Schneebeli
The framework generation • ROMEBuilder o Translation program. o Reads in a XML framework definition file and translates this information into c++ code. o Links the generated project. o Documents the generated project. o Like the MAKE command in ODBEdit ROME classes Exp. classes ROME Environment ROMEclasses ROME Project ROMEBuilder Executable Documentation Summarization XML File Paul Scherrer Institut • 5232 Villigen PSI Add calculation code ROME / 20. 4. 2005 / Matthias Schneebeli
XML File <Garage> <Car> <Type>Ferrari</Type> <Color>Red</Color> </Car> <Type>Fiat</Type> <Color>Blue</Color> </Car> <Bicycle> <Type>Bianchi</Type> <Color>White</Color> </Bicycle> </Garage> Introduction to XML • Extensible Markup Language (XML) • Standardized ascii format • Tree structure • Syntax is similar to html XSD File <xs: complex. Type name="Vehicle. Desc"> <xs: sequence> <xs: element name="Type" type="xs: string"/> <xs: element name="Color" type="xs: string"/> </xs: sequence> </xs: complex. Type> <xs: element name="Garage"> <xs: complex. Type> <xs: sequence> <xs: element name="Car" type="Vehicle. Desc" max. Occurs="unbounded"/> <xs: element name="Bicycle" type="Vehicle. Desc" max. Occurs="unbounded"/> </xs: sequence> </xs: complex. Type> </xs: element> Paul Scherrer Institut • 5232 Villigen PSI ROME / 20. 4. 2005 / Matthias Schneebeli
XML Project Definition File <ROMEFramework. Definition> <Folders> Folder definitions… </Folders> <Tasks> Task definitions… </Tasks> <Trees> Tree definitions… </Trees> <General. Steering. Parameters> Steering Parameters definitions… </General. Steering. Parameters> <Midas. Banks> Midas Bank definitions… </Midas. Banks> </ROMEFramework. Definition > Paul Scherrer Institut • 5232 Villigen PSI Folder Classes Task Classes Analyzer Class ROME / 20. 4. 2005 / Matthias Schneebeli
Folders XML File <Folder> <Folder. Name>Folder Name</Folder. Name> <Field. Name>Field Name 1<Field. Name> <Field. Type>Field Type 1<Field. Type> </Field> <Field. Name>Field Name 2<Field. Name> <Field. Type>Field Type 2<Field. Type> </Field> </Folder> Code [Field Type 1] Get[Folder Name]()->Get[Field Name 1](); void Get[Folder Name]()->Set[Field Name 1]([Field Type 1] value); Paul Scherrer Institut • 5232 Villigen PSI ROME / 20. 4. 2005 / Matthias Schneebeli
Tasks <Task> <Task. Name>Task Name<Task. Name> <…>…<…> </Task> XML File Code void void [Experiment [Experiment Shortcut]T[Task Shortcut]T[Task Paul Scherrer Institut • 5232 Villigen PSI Name]: : Init() { } Name]: : Begin. Of. Run() { } Name]: : Event() { } Name]: : End. Of. Run() { } Name]: : Terminate() { } ROME / 20. 4. 2005 / Matthias Schneebeli
Easy to use • User can summarize the experiment dependent part of the framework in a XML file. • The XML file is then translated by the romebuilder into c++ code. • The user adds only calculation code to predefined event methods of the tasks. • Calculation code is ‘c-code’. Paul Scherrer Institut • 5232 Villigen PSI ROME / 20. 4. 2005 / Matthias Schneebeli
Benefit of a generated Framework • Consistent Program Structure o All classes look the same o Better readability • Less Handwritten Code of a class is written once (in the builder) and reproduced many times • Easier Maintenance o Modification are done once (in the builder) and then available in the whole framework Paul Scherrer Institut • 5232 Villigen PSI ROME / 20. 4. 2005 / Matthias Schneebeli
Configuration File <Run. Numbers>1001, 1002 -1004</Run. Numbers> <Modes> <Analyzing. Mode>offline</Analyzing. Mode> <Input. Data. Format>midas</Input. Data. Format> </Modes> <Task> <Task. Name>Task 1</Task. Name> <Active>yes/no</Active> </Tasks> <General. Steering. Parameters> <Steering. Parameter. Field> <SPName>Value</SPName> <SPValue>123</SPValue> </Steering. Parameter. Field> </General. Steering. Parameters> <…> Paul Scherrer Institut • 5232 Villigen PSI XML File ROME / 20. 4. 2005 / Matthias Schneebeli
Program structure Start read configuration file <Configuration> <Main. Configuration> <Run 25</Runs> <Evers></Events> read database BOR read raw data fill tree Event EOR write tree End of Analysis Start ROOT interactive session Paul Scherrer Institut • 5232 Villigen PSI ROME / 20. 4. 2005 / Matthias Schneebeli
Run Program C: Sample> ROMEBuilder. exe sample. xml Windows link messages C: Sample> XYZ q : Terminates the program e : Ends the program s : Stops the program r : Restarts the program c : Continuous Analysis o : Step by step Analysis g : Run until event # i : Root interpreter root [0] TBrowser t root [1] cout << g. Analyzer->Get. PMTData()->Get. ADC() Paul Scherrer Institut • 5232 Villigen PSI ROME / 20. 4. 2005 / Matthias Schneebeli
Monitoring Tools Paul Scherrer Institut • 5232 Villigen PSI ROME / 20. 4. 2005 / Matthias Schneebeli
Monitoring ROME Objects ROME can distribute objects over a socket interface. Ø Any third party application can access and even modify ROME objects. Ø The distribution of the objects goes over the network. Ø Used for monitoring/displaying ROME objects Ø Users can display online histograms. E. g. at home. Paul Scherrer Institut • 5232 Villigen PSI ROME / 20. 4. 2005 / Matthias Schneebeli
ARGUS • Written by Ryu Sawada • Experiment independent GUI framework • Helps to write an full experiment dependent event display • Provides connection to o ROME o Midas Analyzer o SQL Database, Midas ODB Paul Scherrer Institut • 5232 Villigen PSI ROME / 20. 4. 2005 / Matthias Schneebeli
Socket Connections Network MIDAS Analyzer ROME Database Argus Paul Scherrer Institut • 5232 Villigen PSI ROME / 20. 4. 2005 / Matthias Schneebeli
ARGUS Samples Paul Scherrer Institut • 5232 Villigen PSI ROME / 20. 4. 2005 / Matthias Schneebeli
ROODY • Written at the Triumf, Vancouver • Histogram Display • Final application (unlike ARGUS) but only for histograms • Provides connection to o ROME o Midas Analyzer Paul Scherrer Institut • 5232 Villigen PSI ROME / 20. 4. 2005 / Matthias Schneebeli
ROODY Samples Paul Scherrer Institut • 5232 Villigen PSI ROME / 20. 4. 2005 / Matthias Schneebeli
Summary • ROME is a framework generator. • Only 6 different objects with up to 6 access methods. • All classes are generated, only event methods have to be written. • No knowledge about object oriented programming is needed. • Folders and Tasks support a very clear program structure. • Modularity : tasks can be easily exchanged even at runtime. • Socket connection to third party applications Paul Scherrer Institut • 5232 Villigen PSI ROME / 20. 4. 2005 / Matthias Schneebeli
- Slides: 36