DMT Interactive Environment
Quick Start Guide

Daniel Sigg, May 2001


  1. Overview
  2. Setup
  3. Command line
  4. A sample session


Overview

The interactive DMT environment is based on ROOT/CINT. ROOT is a scientific software package developed for high energy physics. CINT is a C++ interpreter which is distributed as part of ROOT. The interactive DMT environment uses the ROOT command line and loads the standard DMT libraries during initialization. A good place to start is the ROOT User's Guide which explains all major features of ROOT.

The most important features of the DMT libraries are:

  • Data containers for time series, frequency series and power spectra,
  • Classes for handling GPS time,
  • Signal processing,
  • Data access to frame data (both online and off-line),
  • Standard input/output routines to support LIGO data type (XSIL, trend, monitor data, html, etc.),
  • A framework to implement monitor programs.

  • Generally, a user will use the classes and routines of the DMT library for computations and IO, (s)he will use the ROOT graphics to display plots and histograms and (s)he will use the ROOT command line for interactive program development and data analysis.

    Since the ROOT command line is a C++ interpreter, macros developed in the interactive shell can easily compiled into a library module or program to gain efficiency.



    Setup

    Before starting make sure you have the DMT software installed on your machine and you are running a compatible version of ROOT. To setup the DMT run

    root-setup
    from the UNIX prompt (root-setup is located in the bin directory of the DMT distribution). This script will perform the following:
  • Set your ROOTSYS and DMTHOME environment variables (if not set),
  • Add root and the DMT distribution to your binary and libraries paths,
  • Link your ~/.rootrc file the one which loads the DMT libraries at startup.

  • It is probably best to add root-setup to your shell login script, i.e., for (t)csh add the line
    source /export/home/dmt/pro/bin/root-setup
    to your ~/.cshrc file. Change the path to reflect the DMT setup on your machine. Working on a system which gets live data through the frame broadcast network also requires to setup a shared memory partition; specify it with
    setenv DMTINPUT /online/LHO_Online
    and correspondingly for LLO. For off-line use this variable can be pointed to a set of frame files:
    setenv DMTINPUT "/export/raid3/E3/*/*.F"
    This will read all frame files from all directories in /export/raid3/E3 (Note the use of quotes to avoid expanding the wild card by the shell).



    Command line

    Now the DMT command line can be invoked by simply typing:

    root
    This should launch the ROOT command line with the DMT libraries preloaded. You can type normal C++ statements to test if it works. There are a few special commands one has to know. They all start with a period:
    .q : Quit
    .? : Help
    .x mymacro.cc : Execute the script mymacro.cc
    .L mystuff.cc : Load the file mystuff.cc
    .! ls : Executes a shell command (ls in this example)


    A sample session

    First declare a new time series object pointer:

    TSeries* ts = 0;
    Now add it to the online data access class:
    In.addChannel ("H0:PEM-MX_SEISZ", 1, &ts);
    where the first parameter must correspond to a valid channel name and the second parameter denotes an optional decimation rate. Now we can fill the time series object with some data from the default input
    In.fillData (8);
    This will load eight seconds worth of data into ts. Let us now compute the power spectrum
    FSeries fs (*ts);
    FSpectrum ps (fs);
    and display it with
    Spectrum (ps);
    We can now automate this so that data is loaded every eight seconds, the power spectrum calculated and the plot updated. Here is the macro
     
    {
       for (;;) {
          In.fillData (8, true);
          fs = FSeries (*ts);
          ps = FSpectrum (fs);
          Spectrum (ps);
       }
    }
    Note the additional brackets around the for loop. This tells the ROOT command line interpreter to expect multiple lines of statements. Break out of the loop with
    Ctrl-c
    Now get some more data and compute the minimum and maximum of the data points
     
    In.fillData (8);
    int min = ts->getMinimum();
    int max = ts->getMaximum();
    Now print the values
    cout << "Minimum = " << min << endl;
    cout << "Maximum = " << max << endl;
    Let's build a histogram of the sampled values. First define the histogram with
    TH1F* h1 = new TH1F ("h1", "Sampled Values", 30, min, max);
    Get the number of samples and load the data into an array:
    int N = ts->getNSample();
    float f [N];
    ts->getData (N), f);
    Now fill the histogram and display it:
    for (int i = 0; i < N; i++) h1->Fill(f[i]);
    h1->Draw();
    This should display the distribution of the sampled values together with a small statistics window on the right top corner.

    The script of this session can be found here.