next up previous contents
Next: Output Streams Up: Components and Concepts Previous: Paths

Module Operation States

Modules supply operations to be called when AC++ decides that the appropriate state of processing has been reached. In ANALYSIS_CONTROL these operational states were called entry-points. Below is a brief description of each of the supported states:

  1. Initialization
    The initialization operations for all linked modules are called once at the beginning of the program. Since the constructor for a module should be minimal, more involved initialization (like opening a file) should be done in the initialization operation.
  2. Run Initialization
    The run initialization operations for all active modules are called whenever a begin run or begin file record is encountered with a different run number than the previous run or when the run number changes. In addition, whenever the command BEGIN is used to start processing events, this operation is called. The run initialization operation can be used to zero run-oriented statistics, read run dependent databases or perform any other initialization that needs to be redone whenever event processing begins. This feature is not yet available. A proto-type implementation will be done by the end of May 1997 and a joint design review will occur at a meeting with BaBar in the beginning of June.
  3. Event Analysis
    The event analysis operations for all active modules are called once for each event. This operation is where most analysis is done.

  4. End Run
    The end run operations for all active modules are called when an end run record is encountered or when the run number changes. This operation is typically used to output run dependent information (as printout, as a file, or as a database entry).
  5. Program Termination
    The termination operations for all linked modules are called once at the end of the analysis program. Uses of this operation include outputting final statistics and closing appropriate files or output devices.
  6. Other Record
    The "Other record" operations for all active modules are called for all logical records that are not Event, Begin-Run or End-Run. This operation can be used to access such special records as comment and calibration. It is not yet implemented.

  7. talk_to
    The talk_to operation provides a means of accessing a user supplied subroutine on demand. This operation is called when the framework detects the command (either interactively or from a command file): module talk

    One purpose of this operation is to allow a mechanism for setting adjustable parameters within each module. See the section on writing a module. Another use of the talk_to operation is to drop the user into non-event oriented modules.

  8. Abnormal Termination
    This operation will be called for all linked modules if the analysis job terminates abnormally.



next up previous contents
Next: Output Streams Up: Components and Concepts Previous: Paths



Liz Sexton
Fri May 16 16:37:56 CDT 1997