CEventSegment

Name

CEventSegment -- Base class for all event segments.

Synopsis


#include <CEventSegment.h>
         
 class CEventSegment {

  virtual void initialize();
  virtual void clear();
  virtual void disable();
  virtual =0 size_t read(void* pBuffer, size_t maxwords);
  virtual const bool isComposite();
}

Description

Event segments are a logical unit of an experiment readout. CEventSegment is an abstract base class that provides default implementations for most of the interface for an event segment as well as a pure virtual function as an interface placeholder for the readout of the segment itself.

Public member functions

virtual void initialize();

This is called as the runs becomes active (begin or resume). It should be overidden by concrete classes to provide code that sets up the hardware used by the segment and makes it ready for data taking. The default implementation of this method is to do nothing.

virtual void clear();

Called to clear the data taking hardware just prior to releasing the busy and enabling gates. This happens prior to the initial enable of response to triggers as well as after each event is read. Default action is to do nothing.

virtual void disable();

Called to disable the electronics. The default does nothing.

virtual =0 size_t read(void* pBuffer, size_t maxwords);

This must be suplied by concrete classes for them to be concrete classes. This method is supposed to read out the electronics associated with the event segment and put it in pBuffer. At most maxwords words of data should be read.

virtual const bool isComposite();

If the event segment contains other segments and those segments can be queried via the same interfaces supported by CCompoundEventSegment, this should return true false if not.