Waveform Visualization Program


1. Introduction

Here, we show a simple example for the waveform visualization based on Root ntuple. If you are looking for a way to draw the waveform from TWR system, this can be a good starting point.

This example consists two parts, one is “waventuple” which is a c++ program to produce a Root ntuple from F2K file(s) and the other is “draw.C” which is a Root macro to draw waveform.

Waveform visualization scheme

The “waventuple” is using the rdmc library to read F2K format, so you should have it on your computer before your install “waventuple”.

For your understanding, we just provide a simplest version. So we recommend you to modify the program for your own task.


2. Source code down road..click here

3. Installation

    a. Preparation

       You have to have Root and rdmc on your system

    b. Copy the source code tarball above 2.

    c. Untar the talball, it creates a directory wavevisual which has following files.

        waventuple.c : waventuple source code

        Makefile : Makefile for the waventuple.

        Draw.C : Root macro to draw waveform.

    d. Modify the Makefile for your system configuration

        You need to modify CXXFLAGS and GLIBS variables to indicate the paths for rdmc.h and librdmc.a

    c. Just try “make”

    d. If it's successfully done. An executable “waventuple” is created on the same directory.


4. Example usage

The usage of waventuple is very simple. You can specify the file list and number of events that you wish to analyze.

yourshell>waventuple [file1] [file2] [file3] …. [number of event]

Here the number of event is useful when we want to process only a part of the file. If you want to analyze all events in the file list, just give very large number like 10000000.

The output of waventuple is “wave.root” which is stored in the same directory where you run the program. Once you get the wave.root output, you can draw the waveform by running the script draw.C on root prompt.

yoursell> root

root [0] draw.C

example waveform output


Then you may see a waveform on the root canvas.

Where the x-axis is time in ns and the y-axis is corresponding waveform in mV.

There are few lines inside the draw.C. You can select one specific event number and OM number by changing the cut variables “nom”, “nevent” in the draw function. For example, wf->Draw("mv:t","nom==662 && nevt==9") draws the waveform for the om number 662 in the 9th event.


5. Further question.

If you have more question about installation of usage, please send email to me “jwnam @hep.ps.uci.edu”


Feb 22 2004 Jiwoo Nam