Presentation is loading. Please wait.

Presentation is loading. Please wait.

Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli ROME Root based Object oriented Midas Extension Presented by Matthias.

Similar presentations


Presentation on theme: "Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli ROME Root based Object oriented Midas Extension Presented by Matthias."— Presentation transcript:

1

2 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli ROME Root based Object oriented Midas Extension Presented by Matthias Schneebeli

3 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli Index Introduction to the ROME Environment o Objects inside ROME Projects o ROMEBuilder o Data Stream o Installation Sample Application within the ROME Environment o Project Sample o MEG Experiment

4 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli Introduction to ROME

5 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.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 a good 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 / 11.5.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

7 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.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 / 11.5.2004 / Matthias Schneebeli The ROME Environment 5 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 and the Database. o Links the generated project o Documents the generated project ROME classes XML File ROME classes Exp. classes ROMEBuilder Executable Documentation Project ROME Environment

9 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli ROME classes Tasks Classes in the Generated Project The generated project consists of Task classes o Implement 5 user methods : Init(), BeginOfRun(), Event(), EndOfRun(), Terminate(). Folder classes o Define the data structure of the folders. Analyzer class o Main class. Contains the folders, the trees and the data base. EventLoop class o Implements the event loop. The event loop calls the user methods of the tasks. ROME classes Folders EventLoop Analyzer Folder Handles Trees Data base fAnalyzer

10 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli XML Project Definition File Folder definitions … Task definitions … Tree definitions … Folder Classes Analyzer and EventLoop Class Task Classes

11 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli Folders XML File [Experiment Shortcut][Folder Name]* Get[Folder Name]At(int index) TClonesArray* Get[Folder Name]Objects() Void Set[Folder Name]Object(int index,[Variable Type 1] [Field 1],…) [Experiment Shortcut][Folder Name]* Get[Folder Name]Object() Void Set[Folder Name]Object([Variable Type 1] [Field 1],…) Code

12 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli Tasks 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) Get[Histo Name]Handle() Fill[Histo Name]At(int index,double value,double weight) Get[Histo Name]HandleAt(int index) Histogram ArraysSingle Histograms XML File Code

13 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli Trees Bool_t is[Tree Name]FillEvent() void Set[Tree Name]FillEvent(true/false) XML File Code

14 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli Data base XML Data base Run table contains the history of the experiment XML Files contain one data base entry of one folder <Entry TimeStamp=“Time” RunNumber=“Run” RunDescription=“Desc.” [Folder Name 1]File=“File 1” [Folder Name 2]File=“File 2” …> Run Table Value 1 Data Base

15 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.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

16 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.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 : (void*) fAnalyzer->GetMidasEvent(); Read and filled to the Folder by the Framework Written by the Framework, can be flagged Written with : fAnalyzer->Write[Folder]DataBase(this);

17 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli Installation Installation of Cygwin (only Windows) 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

18 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli Sample Experiment

19 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli Sample Overview 2 Tasks o ReadMidas o ADCCalib 4 Folders o CMPMTData o CMCalib(Data base) o CMPMTInfo(Data base) o Trigger 1 Tree o Data

20 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli XML Configuration File I ; ; ; (see CMCalib) sample.xml

21 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli XML Configuration File II sample.xml

22 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli Read Midas Task void XXXTReadMidas::Event() { EVENT_HEADER *pevent = (EVENT_HEADER*)fAnalyzer->GetMidasEvent(); fAnalyzer->SetTriggerObject(pevent->event_id,pevent->serial_number); if (pevent->event_id== EVENTID_EOR) fAnalyzer->EndOfRun(); if (pevent->event_id event_id== EVENTID_EOR) { fAnalyzer->SetDataFillEvent(false); return; } pevent++; float fADC[gNumberOfPMT],*pADC; if (ROMEStatic::bk_locate(pevent, "ADC0", &pADC)) { for (int i=0;i<gNumberOfPMT;i++) fADC[i] = (Float_t)pADC[i]; } else { fAnalyzer->SetDataFillEvent(false); return; } for (int i=0;i<gNumberOfPMT;i++) { int iadc = fAnalyzer->GetCMPMTInfoAt(i)->GetADCID(); fAnalyzer->SetCMPMTDataObject(i,fADC[iadc]); } XXXTReadMidas.cpp

23 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli ADC Calibration Task void XXXTADCCalib::Event() { if (fAnalyzer->GetTriggerObject()->GetID()!=1) return; for (int i=0;i<gNumberOfPMT;i++) { float pmtData = fAnalyzer->GetCMPMTDataAt(i)->GetADC0Data(); float pedestal = fAnalyzer->GetCMCalibAt(i)->GetADCPedestal(); int ipmt = fAnalyzer->GetCMPMTInfoAt(i)->GetADCID(); FillADC0HistoAt(ipmt,pmtData - pedestal); } XXXTADCCalib.cpp

24 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli Run Program C:\Sample> ROMEBuilder.exe sample.xml –v link messages C:\Sample> XXXSample –r 06625 –db …/database/ -i …/data/ –o …/out/ –ta 1,1 –tr 0,1,1,0 12005 events processed Task 'ReadMidas' : run time = 00:00:00 Task 'ADCPedestal' : run time = 00:00:02 Windows

25 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli The MEG Experiment

26 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.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

27 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.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

28

29 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli Detailed Introduction to ROME

30 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli ROME Classes ROMEAnalyzer o Main Class o Provides general steering methods ROMEEventLoop o Implements the event loop ROMETask ROMETree ROMERunTable


Download ppt "Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli ROME Root based Object oriented Midas Extension Presented by Matthias."

Similar presentations


Ads by Google