In file TrigEnv/TrigEnv.hh:

class TrigEnv

Triggered data processing base class.

Inheritance:


Public Methods

TrigEnv (int argc, const char *argv[])
Class constructor.
virtual ~TrigEnv (void)
Class destructor.
void MainLoop (void)
Loop over data epochs.
virtual void ProcessData (void)
Process one epoch (Supplied by user).
virtual bool ProcessTrigger (const trig::TrigBase& t)
Process a Trigger (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.
const Interval getEpochLength (void) const
Get the epoch length.
const Interval getEpochOffset (void) const
Get the epoch length.
const Interval getStride (void) const
Get the data stride.
const trig::TrigBase& getTrigger (void) const
Get the current trigger.
bool isTrigEnvArg (const char* arg) const
Test if string is a TrigEnv command line argument.
void setEpochLength (const Interval& t)
Set the epoch length.
void setEpochOffset (const Interval& t)
Set the epoch offset.
void setStride (const Interval& t)
Get the data stride.

Protected Fields

Dacc mIn
Frame Input object

Protected Methods

Dacc& getDacc (void)
Get the data accessor.

Documentation

Introduction
The triggered data processing base class defines the basic routines necessary for processing data selected by a trigger table. Each trigger is passed to a user method for selection and detemination of the time epoch. The data from the specified epoch are then passed to a second user method containing the data processing code. The TrigEnv class provides an environment similar to that supplied by DatEnv. The functions provided by the TrigEnv are:

Writing a TrigEnv Monitor
The strategy for writing a monitor program is to create a class (MyClass) based on TrigEnv 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))

Trigger processing (bool ProcessTrigger(const trig::TrigBase\& x))

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 TrigTemplate.hh and TrigTemplate.cc.

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.

Compiling the monitor
The monitor class can be compiled and linked using the default makefile which can be found in \$DMTHOME/\$DMTVERSION/doc/DMTBase/Makefile.default

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

-debug <lvl> Set debug level to <lvl>
-infile <file> Frame data files (names may contain '*'s).
-inlist <list> Frame data files (names may contain '*'s).
-stride Default stride time (in seconds).
-toffset Start of epoch relative to trigger time.
-tepoch Length of epoch (in seconds).
-ttable Ligo_lw table containing triggers.
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:
gROOT->LoadMacro("TrigEnv.hh");
gROOT->LoadMacro("TrigEnv.cc");
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.

TrigEnv(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.
Parameters:
argc - Number of arguments specified.
argv - Pointers to arguments.

virtual ~TrigEnv(void)
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 stride. It must be defined as part of the derived monitor class implementation.

virtual bool ProcessTrigger(const trig::TrigBase& t)
ProcessTrigger performs the monitor specific processing of the trigger used to specify an epoch. ProcessTrigger is invoked after reading and parseing the trigger from the trigger table, but before locating or reading the data from the trigger epoch. This allows the monitor designer to set the time parameters for the epoch or to bypass the processing of the trigger epoch completely. The epoch is skipped if ProcessTrigger returns false. The default ProcessTrigger method returns true for all triggers.
Returns:
true if data from trigger epoch are to be processed.
Parameters:
t - Trigger to be processed.

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.

const Interval getEpochLength(void) const
Get the length of the epoch.

const Interval getEpochOffset(void) const
Get the time offset from the specified trigger time to the start of the epoch to be processed. If the offset is negative, the spoch starts before the trigger time.
Returns:
Time offset from the trigger time to the data epoch start.

const Interval getStride(void) const
Get the data stride. The data stride is the length of data to be read for each call to ProcessData.
Returns:
The data stride interval.

const trig::TrigBase& getTrigger(void) const
Get the current trigger block.
Returns:
Reference to the current trigger.

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

void setEpochLength(const Interval& t)
Set the length of the epoch.

void setEpochOffset(const Interval& t)
Set the time offset from the specified trigger time to the start of the epoch to be processed. If the offset is negative, the epoch starts before the trigger time.
Returns:
Time offset from the trigger time to the data epoch start.

void setStride(const Interval& t)
Get the length of the epoch.

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

Dacc mIn
Frame Input object


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

alphabetic index hierarchy of classes


Please send questions and comments to zweizig_j@ligo.caltech.edu


generated by doc++