ROOT Event Recording system Katerina Opocenska, CERN PH-SFT Summer student 2008 [1/7/2008 – 12/9/2008] Supervisor: Bertrand Bellenot 26th August 2008
Project motivation & goals To record and replay events in ROOT Commandline events Commands typed by user ("new TBrowser();") GUI events Window creation, resize, movement Mouse movement, (double)click, drag&drop … Why? QA purposes (especially ROOT GUI) Presentations, tutorials To avoid performing the same operations manually again and again Create once and then just replay Like macros in Excel
How it works – overview Recorder implemented as standalone ROOT script recorder.C Only few lines of code added to ROOT sources Interface for recorder: TRecorder.h Using of signal-slot communication mechanism Recorded events stored in TFile All events from 1 recording session stored in 1 TFile Stored in TTree data structure Recorder runs both on Linux and Windows Platform-specific solutions developed for replaying of windows moving
Recording Start ROOT Run recorder: .L recorder.C+ Prefarably with no windows Run recorder: .L recorder.C+ recorder(); Push ● button to start recording In "Save As" dialog enter name for log file Work with ROOT freely Issue commandline commands Work with GUI Press stop button on recorder to stop recording Interactive demo
Replaying Run recorder: .L recorder.C+ Push ► button to start In "Open" dialog choose ROOT file with previously recorded events Watch the replaying Mouse cursor is used when replaying When replaying finishes, it is written to the console Interactive demo
Recording & replaying - notes In fact: replaying = state recreation All the objects are created again Replaying events = executing them on real (recreated) objects Same setup needed for recording and replaying Just the execution of static code is recorded, not the code itself If you record command ".x path/script.C" and you want to replay it, this script must be present in the same place also in time of replaying State capturing is part of recording If you want to replay events for some window, creation of this window must be also recorded Create window Start recording Work with window Start recording Create window Work with window
C++ (non-GUI) interface for Recorder class TEventRecorder : public TRecorder { public: // Recording void Start(const char * filename, Option_t * option="RECREATE"); void Stop(); // Replaying bool Replay(const char * filename); void Pause(); void Resume(); void ReplayStop(); // Listing void List(const char * filename); void ListGui(const char * filename); } …
Conclusion Major part of project has been already done My plan for the next 2,5 weeks: Implementing additional requests Testing and fixing minor bugs Developing better GUI for recorder Improving current code smoother cursor and windows movement optimalization of performance Code comments User and programmer documentation