talk. paul scherrer institut 5232 villigen psi rome / 20.4.2005 / matthias schneebeli rome chep 2006...

40
Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable analysis framework generator

Upload: randell-gibson

Post on 17-Jan-2016

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli

ROME

CHEP 2006

Presented by Matthias Schneebeli

a universally applicable analysis framework generator

Page 2: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli

Index

• Generating frameworks

• Introduction to the ROME Environment

o Objects inside ROME Projects

o The code generation mechanism

• Monitoring Tools

o Argus

o Roody

Page 3: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli

Generating FrameworksGenerating Frameworks

Page 4: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli

Generating Frameworks

Problem :

Writing an analysis software for an experiment

Possible Solutions :

• Writing an analysis software specifically for the experiment

Limited use, no help from other collaborations

• Writing an analysis software for all HEP experiments

Impossible

• Generating an analysis framework and adding experiment specific analysis code

Presented in this talk

Page 5: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli

Composition of an Analysis Tool

Totally experiment independent code

• Event Loop

• Support functions

Experiment dependent code which can be summarized in a description file

• Data structure

• Task structure

• Database access, DAQ access

Experiment dependent code which can not be summarized

• Analysis Code (Physics)

Code part of the distribution

Code generated by a translation program

Code implemented by the user

Page 6: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

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

o Lots of code is produced

o Easier Maintenance

o Modification are done once (in the builder)

and then available in the whole framework

Page 7: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli

Introduction to ROMEIntroduction to ROME

Page 8: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

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.

Page 9: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli

ROME Objects

Folders

•Data objects in memory

Tasks

•Calculation objects

Trees

•Data objects saved to disc

Histograms

•Graphical data objects

Steering Parameters

•Framework steering

Midas Banks

•Midas raw data objects

ROME Objects :• Only 6 different objects.• Access methods have same naming

conventions

Page 10: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli

Interconnections

Folders

TasksTasksTasksFill

Read

TreesTreesTreesFill

Flag

HistogramsHistogramsHistograms

HistogramsHistogramsHistograms

HistogramsHistogramsHistograms

Fill

Fill

Disk (Output)Write (ROOT)

Disk (Input)

Read (any Format)

Page 11: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli

ADC BankValue 1Value 2

...

DMND Bank

Value 1Value 2

...

From Banks to Folders

PMT FolderADCTDC

XXXx

PMT FolderADCTDC

XXXx

PMT FolderADCTDC

HV demandHV measured

HV currentScaler

Readout values of a sub-detectors

Sub-detector with all it’s readout values

TDC BankValue 1Value 2

...

SCLR BankValue 1Value 2

...

MSRD BankValue 1Value 2

...

CRNT BankValue 1Value 2

...

Page 12: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli

ADCcounts

counts

counts

counts

TDCheader

chn./value

chn./value

Pedestal subtractionCounts -> Charge

Decoding (chn./crate/…

-> number)Offset correction

MappingADC/TDC -> counter

Rawdata

*.root

Decodeddata

*.root

Objectdata

*.root

Optional analysis ofdecoded data

Highlevel

analysis

TaskTask Task

Banks ROME folderROME folder

Proposed Analysis Structure

ADCchargechargechargecharge

TDCtimetimetimetime

HitchargetimeHV

scaler

HitchargetimeHV

scaler

HitchargetimeHV

scaler

Page 13: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI 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.

A1

A2

B1

A3

B2

A4 Possible even during runtime

Page 14: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli

ROME is clearly separated into

• an experiment independent part of the framework

• e.g. Event loop, IO, Database access.

• 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.

• Translated into c++ code by the ROMEBuilder.

• the calculation code

• Has to be filled in by the experimenter

Universality

Part of ROME

Generated by ROMEBuilder

Written by the user

Page 15: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI 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 classesROME classesROME classes

SummarizationXML File

ROME classesROME classesExp. classes

ROMEBuilder Executable

Documentation

Project

ROME Environment

Add calculation code

Page 16: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli

Introduction to XML

• Extensible Markup Language (XML)

• Standardized ascii format

• Tree structure

• Syntax is similar to html

<Garage><Car>

<Type>Ferrari</Type><Color>Red</Color>

</Car><Car>

<Type>Fiat</Type><Color>Blue</Color>

</Car><Bicycle>

<Type>Bianchi</Type><Color>White</Color>

</Bicycle></Garage>

<xs:complexType name="VehicleDesc"><xs:sequence>

<xs:element name="Type" type="xs:string"/><xs:element name="Color" type="xs:string"/>

</xs:sequence></xs:complexType><xs:element name="Garage">

<xs:complexType><xs:sequence>

<xs:element name="Car" type="VehicleDesc" maxOccurs="unbounded"/><xs:element name="Bicycle" type="VehicleDesc" maxOccurs="unbounded"/>

</xs:sequence></xs:complexType>

</xs:element>

XSD File

XML File

Page 17: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli

XML Project Definition File

<ROMEFrameworkDefinition><Folders>

Folder definitions…</Folders><Tasks>

Task definitions…</Tasks><Trees>

Tree definitions…</Trees><GeneralSteeringParameters>

Steering Parameters definitions…</GeneralSteeringParameters><MidasBanks>

Midas Bank definitions…</MidasBanks>

</ROMEFrameworkDefinition >

Folder Classes

Analyzer Class

Task Classes

Page 18: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli

Folders<Folder>

<FolderName>Folder Name</FolderName>

<Field>

<FieldName>Field Name 1<FieldName>

<FieldType>Field Type 1<FieldType>

</Field>

<Field>

<FieldName>Field Name 2<FieldName>

<FieldType>Field Type 2<FieldType>

</Field>

</Folder>

XML File

[Field Type 1] Get[Folder Name]()->Get[Field Name 1]();

void Get[Folder Name]()->Set[Field Name 1]([Field Type 1] value);

Code

Page 19: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli

<Task>

<TaskName>Task Name<TaskName>

<…>…<…>

</Task>

XML File

void [Experiment Shortcut]T[Task Name]::Init() { }

void [Experiment Shortcut]T[Task Name]::BeginOfRun() { }

void [Experiment Shortcut]T[Task Name]::Event() { }

void [Experiment Shortcut]T[Task Name]::EndOfRun() { }

void [Experiment Shortcut]T[Task Name]::Terminate() { }

Code

Tasks

Page 20: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI 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’.

Page 21: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

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

o 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

Page 22: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli

Configuration File

<RunNumbers>1001,1002-1004</RunNumbers>

<Modes>

<AnalyzingMode>offline</AnalyzingMode>

<InputDataFormat>midas</InputDataFormat>

</Modes>

<Tasks>

<Task>

<TaskName>Task 1</TaskName>

<Active>yes/no</Active>

</Task>

</Tasks>

<GeneralSteeringParameters>

<SteeringParameterField>

<SPName>Value</SPName>

<SPValue>123</SPValue>

</SteeringParameterField>

</GeneralSteeringParameters>

<…>

XML File

Page 23: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli

Program structureStart

read configuration file

BOR

EOR

Event

read database

fill treeread raw data

write tree

End of Analysis

Start ROOT interactive session

<Configuration>

<MainConfiguration>

<Run25</Runs>

<Evers></Events>

Page 24: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli

Run ProgramC:\Sample> ROMEBuilder.exe sample.xml

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 << gAnalyzer->GetPMTData()->GetADC()

Windows

Page 25: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli

Monitoring ToolsMonitoring Tools

Page 26: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

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.

Page 27: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

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

oROME

oMidas Analyzer

oSQL Database, Midas ODB

Page 28: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli

Socket Connections

Argus

Network

MIDASAnalyzer

ROME

Databas

e

Page 29: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli

ARGUS Samples

Page 30: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

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

oROME

oMidas Analyzer

Page 31: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli

ROODY Samples

Page 32: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

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

Page 33: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli

Short introduction to ROOTShort introduction to ROOT

Page 34: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

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, …

Page 35: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli

Three User Interfaces

• GUIwindows, buttons, menus

• Root Command lineCINT (C++ interpreter)

• Macros, applications, libraries (C++ compiler and interpreter)

int main()

{

TH1F *h;

h = new TH1F(“h“);

h->Fill(1);

h->Draw();

TBrowser t;

}

Page 36: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

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 OpenGL and X3D.

• Well Documented code. HTML class descriptions for every class.

Page 37: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli

Root > float x=5, y=7;

Root > x*sqrt(y)

(double)1.322875655532e+01

Root > TF1 fl(“fl”,”sin(x)/x”,0,10)

Root > fl.Draw()

Example of a ROOT interactive session

Page 38: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli

Histogram Views

All these plots can be rotated with the mouse

Page 39: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli

Data acquisition/analysis Data acquisition/analysis

Page 40: Talk. Paul Scherrer Institut 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli ROME CHEP 2006 Presented by Matthias Schneebeli a universally applicable

Paul Scherrer Institut • 5232 Villigen PSI ROME / 20.4.2005 / Matthias Schneebeli

DAQ Setup

Event buffer

Logger Analyzer

Run controlTrigger

Front-end

Histogramdisplay

VME

CAMAC

Tape

Back-end computerOffice computers

WWW

ROME

Argus, Roody