next up previous contents index
Next: Miscellaneous Commands Up: Control Statements Previous: VALUE: Output of Expressions   Contents   Index


DOOM: Interact with the DOOM Data Base

MAD can now be interfaced to the DOOM (MAD Object-Oriented Database) data base; this allows the user to transmit most objects known by MAD to and from user-written programs. We assume that MAD-9 has been launched with:

mad9 -db data-base-name
It will then open the data base data-base-name and read all data stored therein. Whenever the user requests it, or when a STOP statement is executed, MAD will write all modified objects to the data base and (temporarily) close it. Another program can then access the data base and optionally modify it. MAD regains access to the data base by explicitely re-opening it.

Interaction with the data base is done with the command


DOOM,OPEN=logical,CLOSE=logical,SHUT=logical,NOUPDATE=logical,
     DEBUG=integer;
which has the following attributes:
CLOSE
Close the database for good. Afterwards one may continue with MAD without affecting the database contents. At the STOP; command a DOOM,CLOSE; is executed by default.
SHUT
Close the database temporarily before a launching a user program by a SYSTEM call.
OPEN
Reopen the database after DOOM,CLOSE; or DOOM,SHUT; and possible execution of a system call. The first DOOM,OPEN; is performed automatically when MAD-9 is launched with a data base name and need not be requested explicitly.
NOUPDATE
After this command, the database is not updated any more, be it at a DOOM,SHUT;, DOOM,CLOSE;, or at the STOP; command. This can come handy when you do not want to spoil the contents of the database. You can revoke the effect (i.e. enable updating) with

DOOM,NOUPDATE=false;
DEBUG
Enables debugging, if the <integer> is non-zero.
Example:

// Open the data base by default when launching MAD.
// Read some input.
...
DOOM,CLOSE; // Allow access to another program
// Do something which does not require access to the data base
...
SYSTEM,"..."; // Use the data base from outside MAD
// Do another thing which does not require access to the data base
...
DOOM,OPEN; // Re-gain access to the data base
// Modify something.
...
STOP; // Data base is closed by default.


next up previous contents index
Next: Miscellaneous Commands Up: Control Statements Previous: VALUE: Output of Expressions   Contents   Index
MAD User Guide, http://wwwslap.cern.ch/mad/