Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


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

1 Talk

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

3 Paul Scherrer Institut 5232 Villigen PSI ROME / 16.9.2004 / Matthias Schneebeli Index Introduction to the ROME Environment o Requirements to a Framework o Objects inside ROME Projects o Structure of Analysis with ROME o ROMEBuilder o Installation Sample of a ROME generated framework

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

5 Paul Scherrer Institut 5232 Villigen PSI ROME / 16.9.2004 / Matthias Schneebeli Framework Requirements Universal The framework should be usable by as many experiments as possible. Modular Possibility to exchange calculation modules without changing the program. Object oriented Program should deal with objects, not with single values. Easy to use The user should write as less and as simple code as possible (only physics).

6 Paul Scherrer Institut 5232 Villigen PSI ROME / 16.9.2004 / Matthias Schneebeli Universality ROME is clearly separated into an experiment independent part of the framework Works for all event based experiments e.g. Event loop, IO, base classes. an experiment dependent part of the framework Summarized in a framework definition file. e.g. Data structure, program structure the calculation code Has to be written by the experimenter

7 Paul Scherrer Institut 5232 Villigen PSI ROME / 16.9.2004 / Matthias Schneebeli Modularity ROME is based on Tasks and Folders. Tasks are root objects, which are executed by the framework. 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. A1A2B1A3B2 A2’  Possible even during runtime

8 Paul Scherrer Institut 5232 Villigen PSI ROME / 16.9.2004 / Matthias Schneebeli Object Oriented ROME is based on Objects. Values, which belong together, are stored in the same object Objects should preferably reflect real objects, like a sub-detector (e.g. a PMT) Objects are easier to use Objects support the modularity

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

10 Paul Scherrer Institut 5232 Villigen PSI ROME / 16.9.2004 / 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 are : Composite items built out of classes. Only access methods are visible to the user Access methods have same naming conventions

11 Paul Scherrer Institut 5232 Villigen PSI ROME / 16.9.2004 / Matthias Schneebeli Interconnections Folders Tasks Fill Read Trees Fill Flag Histograms Fill Disk (Output) Write (ROOT) Disk (Input) Read (any Format)

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

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

14 Paul Scherrer Institut 5232 Villigen PSI ROME / 16.9.2004 / Matthias Schneebeli Easy to use Experiment dependent part of the framework can be summarized 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.

15 Paul Scherrer Institut 5232 Villigen PSI ROME / 16.9.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. o Like the MAKE command in ODBEdit ROME classes XML File ROME classes Exp. classes ROMEBuilder Executable Documentation Project ROME Environment

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

17 Paul Scherrer Institut 5232 Villigen PSI ROME / 16.9.2004 / Matthias Schneebeli Object Arrays [Field Type 1] Get[Folder Name]At(int index)->Get[Field Name 1](); void Get[Folder Name]At(int index)->Set[Field Name 1]([Field Type 1] value); Single Objects [Field Type 1] Get[Folder Name]Object()->Get[Field Name 1](); void Get[Folder Name]Object()->Set[Field Name 1]([Field Type 1] value); Folders Folder Name Array Size yes/no Field Name 1 Field Type 1 Field Name 2 Field Type 2 XML File Code

18 Paul Scherrer Institut 5232 Villigen PSI ROME / 16.9.2004 / Matthias Schneebeli Task Name Histo Name 1 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 1](double value,double weight) Draw[Histo Name 1]() Get[Histo Name 1]Handle() Fill[Histo Name 1]At(int index,double value,double weight) Draw[Histo Name 1]At(int index) Get[Histo Name 1]HandleAt(int index) Code Tasks Histogram Arrays Single Histograms

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

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

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

22 Paul Scherrer Institut 5232 Villigen PSI ROME / 16.9.2004 / Matthias Schneebeli Configuration File 1001,1002-1004 offline midas Task 1 yes/no Tree1 yes/no Value 123 XML File

23 Paul Scherrer Institut 5232 Villigen PSI ROME / 16.9.2004 / Matthias Schneebeli ROME vs. Midas Analyzer ROMEMidas Analyzer Banks -> Arrays or structures Folders -> Objects (Classes) odbedit> make -> experim.h containing data structure romebuilder -> classes containing data structure and access methods Midas required for online and offlineMidas not needed for offline Calibration and configuration data in ODBCalibration and configuration data in mySQL, XML,... User code added to BOR,EVENT,EOR functions User code added to BeginOfRun, Event, EndOfRun functions Input format : midasInput format : midas, root Output format : midas, rootOutput format : root

24 Paul Scherrer Institut 5232 Villigen PSI ROME / 16.9.2004 / 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. Modularity : tasks can be exchanged even at runtime.

25 Paul Scherrer Institut 5232 Villigen PSI ROME / 16.9.2004 / Matthias Schneebeli Sample Experiment

26 Paul Scherrer Institut 5232 Villigen PSI ROME / 16.9.2004 / Matthias Schneebeli Sample Overview 2 Folders o PMTData o Calib(Data base) 2 Tasks o ReadMidas o ADCCalib 1 Midas Bank o ADC0

27 Paul Scherrer Institut 5232 Villigen PSI ROME / 16.9.2004 / Matthias Schneebeli XML Definition File I PMTData 228 ADC Float_t PMTCalib 228 true ADCPedestal Float_t /RunCatalog(id=#)/LPCalib[0,227]/pedestal sample.xml

28 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli XML Definition File II ReadMidas ADCCalib ADCHisto TH1F 228 500 0 500 ADC0 unsigned short sample.xml

29 Paul Scherrer Institut 5232 Villigen PSI ROME / 16.9.2004 / Matthias Schneebeli Read Midas Task void XYZTReadMidas::Event() { for (int i=0;i<228;i++) { Float_t adcValue = gAnalyzer->GetADC0BankAt(i); gAnalyzer->GetPMTDataAt(i)->SetADC(adcValue); } XYZTReadMidas.cpp

30 Paul Scherrer Institut 5232 Villigen PSI ROME / 16.9.2004 / Matthias Schneebeli ADC Calibration Task void XYZTADCCalib::Event() { for (int i=0;i<228;i++) { float pmtData = gAnalyzer->GetPMTDataAt(i)->GetADC(); float pedestal = gAnalyzer->GetCalibAt(i)->GetADCPedestal(); FillADCHistoAt(i,pmtData - pedestal); } void XYZTADCCalib::EndOfRun() { for (int i=0;i<228;i++) { DrawADCHistoAt(i); } XYZTADCCalib.cpp

31 Paul Scherrer Institut 5232 Villigen PSI ROME / 16.9.2004 / Matthias Schneebeli Run Program C:\Sample> ROMEBuilder.exe sample.xml link messages C:\Sample> XYZ program messages root [0] TBrowser t root [1] cout GetPMTData()->GetADC() Windows

32 ROME vs. AliROOT

33 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli Comparison of AliROOT and ROME

34 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli Differences between ROME and AliROOT ROMEAliROOT Objects are classes containing calculations and data. Objects are complex items. Calculations and data are strictly separated. C D AB A1A2B1A3B2 A’ A2’  Has to be relinked  Possible even during runtime

35 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli ROME vs. AliROOT ROMEAliROOT Usable for MEG ?Used by the ALICE collaboration. (Maybe also others) Used for the LP. Midas Analyzer used for PiBeta. Needed modifications ?Classes have to be modified to match the data structure. Calculation code has to be rewritten. Classes holding data structure have to be generated. Calculation code has to be written. Requirements on the userGood knowledge of C++Knowledge of C Question

36 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli Modifications AliROOTFeatures Control ClassesLittle to medium modifications. None Detector Classes (Geometry, clustering, reconstruction, …) Have to be rewritten completely. Classes can only be used as templates. Data structure will be generated. Calculations have to be written. Virtual Monte CarloLittle changes (ROOT feature) Can be added easily (ROOT feature) MonitorNeeds modificationsLP monitor. ROME’s online monitor can be used offline! ROME  Info about AliROOT form Federico Carminati (AliROOT Offline Project Leader)

37 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli Monitors AliROOT LPMonitor

38 Paul Scherrer Institut 5232 Villigen PSI ROME / 11.5.2004 / Matthias Schneebeli Comments form the ALICE Collaboration From a mail of Federico Carminati (Offline Project Leader) :  “AliRoot was not meant to be a ‘framework’ for experiments” Out of 51 modules: ElectroMagnetic calorimeter code. To be discarded  AliRoot main program, probably to be modified Methods for the production of raw data. To be modified  Analysis classes, to be modified, possibly lightly Online monitoring code. May be interesting, to be modified  Main steering classes, needs modification Display Code. Has to be modified Interface with the FLUKA MC. Can be reused Event generator interfaces. To be modified

39 Additional Slides

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

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

42 Paul Scherrer Institut 5232 Villigen PSI ROME / 16.9.2004 / Matthias Schneebeli Trees XML File

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

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

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

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

47 Paul Scherrer Institut 5232 Villigen PSI ROME / 16.9.2004 / Matthias Schneebeli Data base SQL Data base see Ryu’s presentation XML data base If no network connection available

48 Paul Scherrer Institut 5232 Villigen PSI ROME / 16.9.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);

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


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

Similar presentations


Ads by Google