Download presentation
Presentation is loading. Please wait.
Published byJoella Bond Modified over 8 years ago
2
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli ROME Root based Object oriented Midas Extension Presented by Matthias Schneebeli
3
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli Index Introduction to the ROME Environment o Objects inside ROME Projects o ROMEBuilder o Data Base o Installation Sample of a ROME generated framework
4
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli Introduction to ROME
5
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli Features Tool for Event based Data Analysis Fully Object Oriented Root based Full connection to the Midas Environment Online and Offline Based on Tasks and Folders for an easy Data and Program Structure Experiment independent Base Classes Experiment dependent Classes are generated out of simple XML-Files The Users write only experiment specific code (physics) Administrative code is implemented in the generated code Self Documenting Code Self Linking Project
6
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli Objects Folders Objects, where data is stored in Stores the data of one detector (or sub detector) component Hierarchically arranged Data inside of Folders is structured Tasks Tasks are objects, which provides actions They make calculations Store and read data in folders Fill trees and histograms Hierarchically arranged. Task also own histograms Trees Data Objects : only written, never read Used to write data on files Histograms Graphical Data Objects : only written Belong to one Task Steering Parameters Task steering Framework steering
7
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli Interconnections Folders Tasks Fill Read Trees Read Flag Histograms Fill Disk (Output) Write (ROOT) Disk (Input) Read (any Format)
8
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli ADC Bank Value 1 Value 2... DMND Bank Value 1 Value 2... From Banks to Objects PMT Folder ADC TDC X x PMT Folder ADC TDC X x PMT Folder ADC TDC HV demand HV measured HV current Scaler Readout values of a sub-detectors Sub-detector with all it’s readout values TDC Bank Value 1 Value 2... SCLR Bank Value 1 Value 2... MSRD Bank Value 1 Value 2... CRNT Bank Value 1 Value 2...
9
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli ADC counts TDC header chn./value Pedestal subtraction Counts -> Charge Decoding (chn./crate/… -> number) Offset correction Mapping ADC/TDC -> counter Raw data *.root Decoded data *.root Object data *.root Optional analysis of decoded data High level analysis Task Banks ROME folder Proposed Analysis Structure ADC charge TDC time Hit charge time HV scaler Hit charge time HV scaler Hit charge time HV scaler
10
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli Advantages of Proposed Analysis Structure High level analysis accesses data in objects –no knowledge of cable mapping or ADC/TDC decoding necessary ADC/TDC decoding is decoupled from mapping and high level analysis –If ADC/TDC module is changed, only decoding task needs to be changed –If counter is reconnected to different ADC/TDC, only mapping task needs to be changed Data can be stored/retrieved between different tasks in ROOT format –Analyze raw data –Analyze decoded data –Analyze object data
11
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli The ROME Environment Experiment independent ‘ROME’-Classes o Base classes for the generated, experiment dependent classes. ROMEBuilder o Builds all experiment dependent classes out of simple XML Files. o XML files describe Tasks, Folders, Trees, Histos, Steering Parameters and Midas Banks. o Links the generated project. o Documents the generated project. ROME classes XML File ROME classes Exp. classes ROMEBuilder Executable Documentation Project ROME Environment
12
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli ROME classes Tasks Classes in the Generated Project The generated classes are : Task classes o Implement 5 user methods : Init(), BeginOfRun(), Event(), EndOfRun(), Terminate(). Folder classes o Define how the data is stored. Analyzer class o Main class. The Analyzer provides all user-methods. IO class o The IO handles all input and output. Folders ROMEEventLoop Analyzer Folders Steering fAnalyzer IO Trees Data base
13
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli XML Project Definition File Folder definitions … Task definitions … Tree definitions … Steering Parameters definitions … Midas Bank definitions … Folder Classes Analyzer Class Task Classes
14
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli Object Arrays [Field Type 1] Get[Folder Name]At(int index)->Get[Field 1](); void Get[Folder Name]At(int index)->Set[Field 1]([Field Type 1] value); Single Objects [Field Type 1] Get[Folder Name]Object()->Get[Field 1](); void Get[Folder Name]Object()->Set[Field 1]([Field Type 1] value); Folders XML File Code
15
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli 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() { } Fill[Histo Name](double value,double weight) Draw[Histo Name]() Get[Histo Name]Handle() Fill[Histo Name]At(int index,double value,double weight) Draw[Histo Name]At(int index) Get[Histo Name]HandleAt(int index) Code Tasks Histogram Arrays Single Histograms
16
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli Trees XML File
17
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli General Steering Parameters XML File [Type 1] GetGSP()->Get[Field 1]() [Type 2] GetGSP()->Get[SubClass]()->Get[Field 2]() Code XML File
18
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli Midas Banks XML File [Type 1] Get[Bank 1]BankAt(int index) Int Get[Bank 1]BankEntries() [Structure Name]* Get[Bank 2]BankAt(int index) Int Get[Bank 2]BankEntries() e.g. : [Type 2] Get[Bank 2]BankAt(int index)->[Field 2] Code Simple BanksStructured Banks
19
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli Comparing to Midas ASUM - Sum - Average In the Online Data Base : In the XML-File : Midas Library is not used for offline analysis
20
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli XML Editors XMLSpy -Table Format -Commercial Software (50 Euro) -Only for Windows EditiX -Nice Tree Format -Commercial Software (30 Euro) -Windows, Linux, Mac ROME works with any Editor
21
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / 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
22
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli class [Experiment Shortcut][Folder Name] : public TObject { protected: [Field Type 1] f[Field Name 1]; // [Comment 1] public: [Experiment Shortcut][Folder Name]([Field Type 1] value1=[Init Value 1] ) { f[Field Name 1] = value1; }; [Field Type 1] Get[Field Name 1]() { return f[Field Name 1]; }; void Set[Field Name 1]([Field Type 1] value1) { f[Field Name 1] = value1; }; ClassDef([Experiment Shortcut][Folder Name],[Version Number]) }; Code Generated Code XML File
23
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli Data base SQL Data base see Ryu’s presentation XML data base If no network connection available
24
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli Read and Write Data Input Data o Root files o Midas files o Online buffer o Data base Output Data o Root files o Database Read by the Framework. Data accessed via Midas Bank access methods. Read and filled to the Folder by the Framework Written by the Framework, can be flagged Written with : fAnalyzer->Write[Folder]DataBase(this);
25
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli Installation Installation of ROOT Installation of LIBXML2 (only Linux) Installation of MIDAS (only online, Linux) [~]$ setenv ROMESYS ~/ROME [~]$ setenv PATH $ROMESYS/bin:$PATH [~]$ cvs checkout ROME [~/ROME]$ make [../MyExp]$ romebuilder myExp.xml –v [-o Output Path] [~/MyExp]$ progname Linux CVS checkout of ROME Define environment variable ROMESYS Define environment variable ‘Path’ C:\> set ROMESYS=C:/ROME C:\> set Path=%Path%;%ROMESYS%/bin C:\> cvs checkout ROME C:\ROME> nmake –f Makefile.win C:\MyExp> ROMEBuilder.exe myExp.xml –v [–o Output Path] C:\MyExp> progname Windows
26
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli Configuration File XML-File for steering the program 100 XML File
27
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli Summary Structure of the framework is defined in XML-files All code is generated, except the physical calculations The framework provides access functions for the user SQL Data base XML Configuration file
28
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli Sample Experiment
29
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli Sample Overview 3 Folders o PMTData o Calib(Data base) o PMTInfo(Data base) 2 Tasks o ReadMidas o ADCCalib 1 Midas Bank o ADC0
30
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli XML Configuration File I sample.xml
31
Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli XML Configuration File II sample.xml
32
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli Read Midas Task void XYZTReadMidas::Event() { for (int i=0;i<257;i++) { int iadc = fAnalyzer->GetPMTInfoAt(i)->GetADCID(); Float_t adcValue = fAnalyzer->GetADC0BankAt(iadc); fAnalyzer->GetPMTDataAt(i)->SetADC(adcValue); } XYZTReadMidas.cpp
33
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli ADC Calibration Task void XYZTADCCalib::Event() { for (int i=0;i<257;i++) { float pmtData = fAnalyzer->GetPMTDataAt(i)->GetADC(); float pedestal = fAnalyzer->GetCalibAt(i)->GetADCPedestal(); FillADCHistoAt(i,pmtData - pedestal); } void XYZTADCCalib::EndOfRun() { for (int i=0;i<257;i++) { DrawADCHistoAt(i); } XYZTADCCalib.cpp
34
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli Run Program C:\Sample> ROMEBuilder.exe sample.xml –v link messages C:\Sample> XYZSample 12005 events processed Task 'ReadMidas' : run time = 00:00:00 Task 'ADCCalib' : run time = 00:00:02 Windows
36
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli The MEG Experiment
37
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli MEG Experiment CMDCTC CMScaler Scaler CMHV HV Environment Env Trigger MEG CMHit Hit Hit Tree CMRefCMPMTData Ref PMT Data Tree PMT Data CMPMTInfo Info Data base CMCalib Calib Data base
38
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli Referencies CMHit Hit CMPMTInfo Info CMCalib Calib CMScaler Scaler CMHV HV Environment Env Trigger MEG PMT Data CMPMTData ADC0 ADC1 TDC Info CMRef Scaler HV Env Trigger
39
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli Detailed Introduction to ROME
40
Paul Scherrer Institut 5232 Villigen PSI ROME / 30.6.2004 / Matthias Schneebeli ROME Classes ROMEAnalyzer o Main Class o Provides general steering methods ROMEEventLoop o Implements the event loop ROMETask ROMETree ROMERunTable
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.