EventBuilder

Name

EventBuilder -- Event builder utility procs

Synopsis

package require Tk package require EventBuilder

EVB::getConnections

EVB::setDisconnectCallback script

EVB::setConnectionCallback script

EVB::Start ?name?

EVB::setSourceTimeout timeout

EVB::getSourceTimeout

EVB::startRingFragmentSource url tsex id desc ?expectHeaders oneshot timeout?

EVB::startS800FragmentSource url id ?desc?

EVB::startGretinaFragmentSource url id ?desc?

DESCRIPTION

Provides a procedural interface to the event builder.

PROCs

EVB::getConnections

Returns a list of information about connected clients. Each element of the list is itself a sublist containing the following elements in order:

  • The host name of the client.

  • Description of the client as supplied by the client when it connected.

  • The connection state.

  • Either an empty string or yes if the connection has not recently sent any fragments but other source clients have. This datum is called the stalled flag. When yes it is possible that the source has failed without exiting.

EVB::setDisconnectCallback script

Sets a new script that will be called when an event source disconnects. The host and description of the connection will be appended in that order to script prior to invoking it.

EVB::setConnectionCallback script

Sets a new script that will be called when the event builder receives a new data source client connection. The host and description will be appended, in that order, to the script prior to invoking it.

EVB::Start ?name?

Starts the event builder. Naturally this must be the first thing called as without it the event builder does not yet exist. The optional name parameter supplies the event builder name. EVB::Start will pop up a Tk dialog warning you if you choose a duplicat name.

EVB::setSourceTimeout timeout

Sets the source stall timeout. If other sources are contributing data any source that is not contributing data for more than timeout seconds is considered stalled.

A source becomes un-stalled by sending a fragment.

EVB::getSourceTimeout

Returns the source stall timeout as the command result.

EVB::startRingFragmentSource url tsex id desc ?expectHeaders oneshot timeout?

Starts an event fragment source that takes data from an NSCLDAQ ring, extracts timestamps and inserts the data into the event orderer. The fragment source runs on the same system as the event builder but, of course the ring buffer could be remote.

url speceifies the source data ring. tsex specifies the shared library that extracts timestamps from event fragments. id specifies the source id that will be used for data from this ring and desc specifies the description the source will provide the event builder when it starts.

The expectHeaders optional parameter is a valid Tcl boolean. When true, the source expects the ring items will have valid body headers. If true, the tsex and id parameters will be ignored and those data will be pulled from the item body headers. the default value is false.

The oneshot and timeout parameters cooperate to enable the data source to exit after sensing the run has ended. oneshot if present and non-zero tells the fragment source to exit after oneshot end run items have been seen. oneshot can be any positive integer, allowing for hierarchical event building.

timeout, if present is the maximum number of seconds that can elapse between observing the first end run item and the last end run item (oneshot nonzero). If this time elapses, the ring fragment source times out and exits. The default value for this parameter is 10.

EVB::startS800FragmentSource url id ?desc?

This is really a call to EVB::startRingFragmentSource with the time stamp extractor set to a library that is suitable for S800 data and an exit message that indicates the S800 event source exited.

The larger implications of this are that the connection between the S800 DAQ and the producer for this ring are not setup by this command. Typically that is done in readout callouts for the ReadoutGUI.

EVB::startGretinaFragmentSource url id ?desc?

Really a call to EVB::startRingFragmentSource supplying a timestamp extractor suitable for most GRETINA event data. The exit message in this case indicates the GRETINA data source has exited.

Typically the producer for the ring is set up by a readoucallouts extension in the Readout GUI.

The actual timestamp used is the timestamp of the first fragment in the glommed data from the ring.k