In file DatEnv/DatEnv.hh:

class DatEnv

Data processing monitor base class.


Public Methods

DatEnv (int argc, const char *argv[])
Class constructor.
virtual ~DatEnv ()
Class destructor.
void MainLoop (void)
Loop over data epochs.
virtual void ProcessData (void)
Process one epoch (Supplied by user).
virtual void Attention (void)
Attention interrupt handler (Supplied by user).
void finish (void)
Stop data processing and go away cleanly.
int Debug (void) const
Get the debug level.
const Dacc& getDacc (void) const
Get the data accessor.
bool isDatEnvArg (const char* arg) const
Test if string is a DatEnv command line argument.
void setStrideAlignment (unsigned long mult, double off)
set stride alignment.
bool testAttnSignal (int sig) const
Test for a specified signal.

Protected Fields

Dacc mIn
Frame Input object
trig::TrigRaw mRawID
Raw trigger data identifier for current epoch.

Protected Methods

Dacc& getDacc (void)
Get the data accessor.


The data processing base class defines the basic routines necessary for a data processing application. The DatEnv class is designed to provide a similar environment whether running in the foreground ( i.e. under root) or in the background. The functions provided by the environment are:

Writing a DatEnv Monitor
The strategy for writing a monitor program is to create a class (MyClass) based on DatEnv including a constructor, destructor and ProcessData method. An attention handler may also be provided if desired. The operations to be performed by each of these methods are:

Constructor (MyClass(int argc, const char* argv[]))

Destructor (~MyClass(void))

Epoch processing (void ProcessData(void))

Interrupt handler (void Attention(void))

The EXECDAT(myclass) macro is used to generate the main function. Definition and implementation templates are available from DatTemplate.hh and

The EXEROOT(myclass) macro is used to generate a main function with root graphics. Note that the "TROOT.h" and "TApplication.h" header files must be included in your monitor implementation file if EXEROOT is used.

Running the Monitor
The base class constructor recognizes the following command line arguments:

-debug <lvl> Set debug level to <lvl>
-infile <file> Read frames from <file>
-inlist <list> Read frames from files listed in <list>
-maxframes <nFr> Stop after reading <nFr> frames
-partition <part> Read from shared memory partition <part>.
If no input option is specified, the frames are read from the partition specified by the LIGOSMPART environment variable or, if this is not defined, from "LIGO_Online".

When running under ROOT, the base class definition and implementation files must be loaded before the monitor can be run. If these files aren't provided automatically by the start-up script, they may be loaded with:
The monitor is run with the .x command or by loading it and calling it as a function. See the note entitled "Online monitoring of LIGO Data Using ROOT" for more details.

DatEnv(int argc, const char *argv[])
The class constructor gets all the command line arguments in the usual Unix/C argument list format. It sets up the environment for processing and opens the frame input stream as directed by the command line arguments.
argc - Number of arguments specified.
argv - Pointers to arguments.

virtual ~DatEnv()
Close the input stream and go away.

void MainLoop(void)
MainLoop reads in data and invokes ProcessData for each data epoch successfully read in. MainLoop exits when a SIGINT or SIGTERM signal is caught, or when finish is called by a subsidiary function (usually by ProcessData).This function is provided by the base class.

virtual void ProcessData(void)
ProcessData performs the monitor specific processing data from a single epoch. It must be defined as part of the derived monitor class implementation.

virtual void Attention(void)
Attention performs the monitor specific attention interrupt processing. Its implementation is optional. Execution of the attention handler is deferred until the processing of the current epoch has completed. This means that there may be a significant delay between the delivery of the SIGUSR1 signal and the invocation of the handler. The ROOT version uses the ROOT event handler as a source of When used with ROOT, the default action is to terminate the monitor. When used in the background, it defaults to no action. The execution of the attention handler is synchronized to the

void finish(void)
finish stops processing by setting a flag that breaks the main loop. Note that finish returns to the calling function (generally the user's ProcessData) which must exit normally for the process to terminate.

int Debug(void) const
Debug returns the debug level as specified by the "-debug nnn" argument. If "-debug" isn't specified in the command line the debug level defaults to 0.

const Dacc& getDacc(void) const
Return a constant reference to the data accessor.

bool isDatEnvArg(const char* arg) const
Test for a DatEnv command line argument. All DatEnv command line arguments take a value in the following argument position.
true if the specified string is a DatEnv argument.

void setStrideAlignment(unsigned long mult, double off)
Align the time stride to an integer multiple of seconds.
mult - boundary alignment.
off - boundary offset

bool testAttnSignal(int sig) const
Test whether the specified signal has been caught.
true if the specified signal was caught.

Dacc& getDacc(void)
Return a reference to the data accessor.

Dacc mIn
Frame Input object

trig::TrigRaw mRawID
A raw trigger data identifier is encoded for each data epoch read. This field is omitted in the ROOT version.

This class has no child classes.
John G. Zweizig
1.4; Last Modified March 4, 2003

alphabetic index hierarchy of classes

Please send questions and comments to

generated by doc++