CDigitizerModule

Name

CDigitizerModule -- Scripted readout base class for module support.

Synopsis


            CDigitizerModule : public CReadableObject
           
  CDigitizerModule(const std::string&  rName, CTCLInterpreter& rInterp);
        

            CReadableObject : public SConfigurableObject
           
  CReadableObject(const std::string&  rName, CTCLInterpreter& rInterp);
           
  virtual   = 0 void Initialize();
             virtual  = 0 void Prepare();
             virtual  = 0 int Read(void* pBuffer);
             virtual  = 0 void Clear();
               void Link(CReadOrder* pReader)
          throws ;
               void Unlink()
          throws ;
               bool isLinked()
          throws ;
              const = 0 std::string getType()
          throws ;
             virtual  void OnDelete()
          throws ;
  
        

DESCRIPTION

The CDigitizerModule and its base class CReadableObject together provide the infrastructure for something that can be read out. See as well SConfigurableObject which provides the command dispatching to support the subcommands that all readable objects also support.

This class is an abstract base class. Specifically, Initialize, Prepare Read and Clear are method which must be supplied by subclasses and are used during the process of data taking. getType is also pure virtual and is expected to return a string that describes the module type.

While OnDelete is also virtual, it is a life-cycle method that has a reasonable default implementation and, in most cases, will not need to be overidden.

METHODS

CReadableObject(const std::string& rName, CTCLInterpreter& rInterp);

Constructs a CReadableObject rName is the name of the object. Normally this is the name provided to the module create command.

virtual = 0 void Initialize();

This virtual method must be implemented by derived classes. it is expected to perform one-time initialization at the start of a run or resume of a run. Normaly, this method determines the current module configuration and sets up the module it is controlling from the information in that configuration.

virtual = 0 void Prepare();

This virtual method must be implemented by derived classes (even if the method does nothing). It is called just prior to awaiting the next trigger. If any per-event preparation is required, this method is expected to perform it on the device.

virtual = 0 int Read(void* pBuffer);

This method must be implemented by derived classes. It is called in response to a trigger. It is expected to read the data from an event into the buffer pointed to by pBuffer. The return value should be the number of uint16_t words placed in pBuffer

virtual = 0 void Clear();

Pure virtual method that must be implemented in derived classes. The method is expected to clear any data that is latched in the module. This is called after each call to Read as well as at the beginning of the run.

void Link(CReadOrder* pReader) throws ;

When a device is placed in a packet or the top level readout object, it is said to have an owner. The owner is the readout object in whose list it immediately lives. If the software attempts to place a CReadableObject in more than one readout object, an exception is raised indicating the object is already linked.

void Unlink() throws ;

Reverses the effect of Link. On return the object is not owned by any readout object.

bool isLinked() throws ;

Returns true if the object has an owner (was Linked).

const = 0 std::string getType() throws ;

Returns a string that describes the module type.

virtual void OnDelete() throws ;

Called if the module is deleted. The base class makes this object not owned, and removes the object from the current owner's readout list.