doom_close Close database doom_dyncode produce record code dynamically doom_exist Does object exist ? doom_exist_env Does env$object exist ? doom_fetch Fetch an object doom_galign Get alignment errors doom_gbase Get object basic type name doom_gcorrect Get corrector settings doom_gdirect Get directory doom_gelcode Get element ISP code (MAD-8) doom_gelement Get element parameter values doom_gfelem Get full element parameters doom_getenv Get environment variable doom_getvar Get value of internal variable doom_gfield Get field errors doom_gline Get next line from line buffer object doom_gmonitor Get monitor settings doom_gparam Get parameter doom_gparent Get object parent doom_gpos Get attribute position (starting at 1) doom_gsequ Get expanded sequence doom_gstring Get string doom_gsumm Get summary record doom_gsurv Get survey table doom_gtbody Get table (TWISS, SURVEY etc.) doom_gthead Get table master record doom_gtime Get object time of creation or mod. doom_gtime_env Get env$object time doom_gtnames Get optics table column names doom_gtrack Get track master record doom_gturn Get one turn record doom_gtype Get object type doom_open Open database doom_palign Put alignment errors doom_pcorrect Put corrector settings doom_pdirect Put directory doom_pelement Put element parameter values doom_pfelem Put full element parameters doom_pfield Put field errors doom_pline Put next line into line buffer object doom_pmonitor Put monitor settings doom_pparam Put parameter doom_pparent Put object parent doom_prtab Prepare name table from Fortran doom_psequ Put expanded sequence doom_pstring Put string doom_psumm Put summary record doom_psurv Put survey table doom_ptbody Put table (TWISS, SURVEY doom_pthead Create or replace twiss master record doom_ptrack Put track master record doom_pturn Put one turn record doom_ptype Put object type doom_recall Get (any) array collection doom_rline rewinds line buffer object doom_robj Get object (from Fortran) doom_save Put object (inverse of doom_fetch) doom_setenv Set value of environment variable doom_setvar Set value of internal variable doom_sobj Put object (from Fortran) doom_store Put (any) array collection doom_time Get current DOOM timedoom_close: Close database
doom_dyncode: produce record code dynamically
int doom_dyncode() /* returns each time a new integer code */doom_exist: Does object exist ?
int doom_exist /* checks existence in list and d.b.
returns -1 not found, 0 not mod., 1 mod. */
(char* name, /* input: (full) d.b. object name */
int* key_list) /* input: key list for composed name */
doom_exist_env: Does env$object exist ?
int doom_exist_env /* checks existence in list and d.b.
returns -1 not found, 0 not mod., 1 mod. */
(char* env, /* input: precede with environment value+_ */
char* name, /* input: (full) d.b. object name */
int* key_list) /* input: key list for composed name */
doom_fetch: Fetch an object
struct object* doom_fetch( /* fetches complete object, enters in list */
char* rec_key) /* input: full object key */
doom_galign: Get alignment errors
void doom_galign /* gets alignment errors for one element */
(char* name, /* input: element name */
int* occ, /* input: occurrence count */
int* nerr, /* input/output: max/returned number of errors,
or = -1 if element not found */
double* al_err) /* alignment errors */
doom_gbase: Get object basic type name
void doom_gbase /* returns basic type of object */
(char* name, /* input: element name */
int* key_list, /* input: key_list */
int* nitem, /* input: length of type character variable */
char* type, /* output: base type name */
int* ntype) /* output: act. number of characters,
or = -1 if element not in d.b. */
doom_gcorrect: Get corrector settings
void doom_gcorrect /* gets corrector values for one element */
(char* name, /* input: element name */
int* occ, /* input: occurrence count */
int* bits, /* output: flag bit string */
double* corr) /* output: corrector settings */
doom_gdirect: Get directory
void doom_gdirect /* gets DIRECTORY */
(char* name, /* input: name */
int* n_name, /* input/output: max/number of names */
int* nitem, /* input: no. characters/key */
char* a_char) /* output: char array for keys */
doom_gelcode: Get element ISP code (MAD-8)
int doom_gelcode /* returns element ISP code (MAD-8), or zero */
(char* name) /* input: element name */
doom_gelement: Get element parameter values
void doom_gelement /* gets parameters for one element */
(char* name, /* input: element name */
int* npar, /* input/output: max/act. number of parameters,
or = -1 if element not in d.b. */
double* el_par) /* output: element parameters */
doom_gfelem: Get full element parameters
void doom_gfelem /* gets full parameters for one element */
(char* name, /* input: element name */
int* npar, /* input/output: max/act. number of parameters,
or = -1 if element not in d.b. */
int* nchar, /* input/output: max/act. length of char array */
int* isvflg, /* output: expr. flags */
double* el_par, /* output: element parameters */
char* a_char) /* output: char array for expressions */
doom_getenv: Get environment variable
void doom_getenv( /* returns current value of environment variable */
char* variable, /* input */
char* value) /* output (\0 terminated) */
doom_getvar: Get value of internal variable
void doom_getvar( /* get DOOM internal variable (ad hoc) */
char* name, /* input */
int* value) /* output */
doom_gfield: Get field errors
void doom_gfield /* gets field errors for one element */
(char* name, /* input: element name */
int* occ, /* input: occurrence count */
int* nerr, /* input/output: max/returned number of errors,
or = -1 if element not found */
double* f_err) /* output: field errors */
doom_gline: Get next line from line buffer object
void doom_gline /* gets next line from line buffer object */
(char* name, /* input: object name */
char* line, /* output: next line if length > 0 */
int* length) /* output: last non-blank in line, or 0 for e.o.f
-1 if object does not exist */
doom_gmonitor: Get monitor settings
void doom_gmonitor /* gets monitor values for one element */
(char* name, /* input: element name */
int* occ, /* input: occurrence count */
int* bits, /* output: flag bit string */
double* corr) /* output: monitor settings */
doom_gparam: Get parameter
void doom_gparam( /* gets parameter from database */
char* name, /* input */
int* exflag, /* output: flag: 1 value, > 1 string */
double* value, /* output: value if exflag = 1 */
int* l_char, /* i/o: max/length of string in array a_char */
char* a_char) /* output: string if exflag > 1 */
doom_gparent: Get object parent
void doom_gparent /* returns parent name of object */
(char* name, /* input: element name */
int* key_list, /* input: key_list */
int* nitem, /* input: length of parent character variable */
char* parent, /* output: parent name */
int* npar) /* output: act. number of characters,
or = -1 if element not in d.b. */
doom_gpos: Get attribute position (starting at 1)
int doom_gpos /* returns attribute position in current list */
(char* name) /* input: attribute name */
doom_gsequ: Get expanded sequence
void doom_gsequ /* returns sequence table if exists */
(char* sequ_name, /* input: sequence name */
int* max_item, /* input/output: max./actual no. of elements,
or -1 if not found */
int* nitem, /* no. of characters/name */
char* names, /* element names */
int* occ, /* array occ(max_item): occ. counts */
double* pos) /* array pos(max_item): centre position */
doom_gstring: Get string
void doom_gstring /* returns string */
(char* name, /* input: key name */
int* key_list, /* input */
int* sleng, /* input/output: max. length (cut or blank filled)
or -1 if not found */
doom_gsumm: Get summary record
void doom_gsumm /* returns summary table if exists */
(char* summ_name, /* input: summary table name */
int* max_item, /* input/output: max./actual no. of elements,
or -1 if not found */
doom_gsurv: Get survey table
void doom_gsurv /* returns survey table if exists */
(char* surv_name, /* input: survey name */
int* max_item, /* input/output: max./actual no. of elements,
or -1 if not found */
int* nitem, /* no. of characters/name */
char* names, /* element names */
int* occ, /* array occ(max_item): occ. counts */
double* pos) /* array pos(max_item,7):
s, x, y, z, theta, phi, psi */
doom_gtbody: Get table (TWISS, SURVEY etc.)
void doom_gtbody /* Get table (TWISS, SURVEY etc.) */
(char* tabl_name, /* input: table name */
double* deltap, /* input: deltap value of twiss table:
the table with the nearest deltap is returned */
char* sequ_name, /* output: sequence name */
int* n_column, /* input/output: max/actual no. of columns */
int* n_row, /* input/output: max/actual no. of rows, or -1 */
int* name_l, /* input: no. of characters/name */
char* names, /* output: element names */
int* occ, /* output: occ. counts */
double* optics_t) /* output: table (see twiss_att_names) */
doom_gthead: Get table master record
(char* tabl_name, /* input: table name */
int* name_l, /* input: character length of sequ_name */
char* sequ_name, /* output: sequence name */
int* n_delta, /* output: # of delta values*/
int* n_row, /* output: Twiss table length (per delta) */
int* pos_flag, /* output: element position flag:
1 start, 2 centre, 3 end */
int* sum_leng, /* input/output: max/actual total length
of summary record */
double* sum_rec) /* output: summary record */
doom_gtime: Get object time of creation or mod.
void doom_gtime /* returns -1. if not found, else mod. time */
(char* name, /* input: (full) d.b. object name */
int* key_list, /* input: key list for composed name */
double* time) /* output */
doom_gtime_env: Get env$object time
void doom_gtime_env /* returns -1 if not found, else mod. time */
(char* env, /* input: precede with environment value+$ */
char* name, /* input: */
int* key_list, /* input: key list for composed name */
double* time) /* output */
doom_gtnames: Get optics table column names
(char* tabl_name, /* input: table name */
int* name_l, /* input: character length of sequ_name */
int* n_names, /* input/output: max/actual # names, or -1 */
char* names) /* output: column names in order of occ. */
doom_gtrack: Get track master record
void doom_gtrack /* gets track survival table */
(int* locc, /* input/output: max/number of list items,
or = -1 if not found */
int* list) /* output: list of turn numbers, and surviving particles */
doom_gturn: Get one turn record
void doom_gturn( /* return the track data of one turn */
int* turn, /* input: turn number */
int* number, /* input/output: max/number of particles,
or -1 if not found */
int* list, /* output: particle list */
double* track) /* output: track coordinates (6,...) */
doom_gtype: Get object type
void doom_gtype /* returns type of object */
(char* name, /* input: element name */
int* key_list, /* input: key_list */
int* nitem, /* input: length of parent character variable */
char* type, /* output: type */
int* ntype) /* output: act. number of characters,
or = -1 if element not in d.b. */
doom_open: Open databasedoom_palign: Put alignment errors
void doom_palign /* puts alignment errors for one element */
(char* name, /* input: element name */
int* occ, /* input: occurrence count */
int* nerr, /* input: number of errors */
double* al_err) /* input: alignment errors */
doom_pcorrect: Put corrector settings
void doom_pcorrect /* puts corrector setting for one element */
(char* name, /* input: element name */
int* occ, /* input: occurrence count */
int* bits, /* input: bit pattern */
double* corr) /* input: corrector settings */
doom_pdirect: Put directory
void doom_pdirect /* puts directory object */
(char* name, /* input: name */
int* n_name, /* input: number of names */
int* nitem, /* input: (fixed) length of names */
char* a_char) /* input: char array for names */
doom_pelement: Put element parameter values
void doom_pelement /* puts parameter values in existing element */
(char* name, /* input: element name */
int* npar, /* input: number of parameters */
double* el_par) /* input: element parameters */
doom_pfelem: Put full element parameters
void doom_pfelem /* puts full parameters for one element */
(char* name, /* input: element name */
int* isp, /* input: MAD element type (1=drift etc.) */
char* parent, /* input: parent name */
int* npar, /* input: number of parameters */
int* nchar, /* input: length of char array */
int* isvflg, /* input: expr. flags */
double* el_par, /* input: element parameters */
char* a_char) /* input: char array for expressions */
doom_pfield: Put field errors
void doom_pfield /* puts field errors for one element */
(char* name, /* input: element name */
int* occ, /* input: occurrence count */
int* nerr, /* input: number of errors */
double* f_err) /* input: field errors */
doom_pline: Put next line into line buffer object
void doom_pline /* puts next line into line buffer object */
(char* name, /* input: object name */
char* line, /* input: next line if length */
int* length) /* last non-blank in line */
doom_pmonitor: Put monitor settings
void doom_pmonitor /* puts monitor setting for one element */
(char* name, /* input: element name */
int* occ, /* input: occurrence count */
int* bits, /* input: bit pattern */
double* corr) /* input: monitor settings */
doom_pparam: Put parameter
void doom_pparam( /* puts parameter or constant in database */
char* name, /* input */
int* flag, /* input: flag mod 10: 1 value, > 1 string
flag/10: 1 = constant, 2 = variable */
double* value, /* input: value if exflag = 1 */
int* l_char, /* input: length of string in array a_char */
char* a_char) /* input: string if exflag > 1 */
doom_pparent: Put object parent
void doom_pparent /* puts parent name into object */
(char* name, /* input: object name */
int* key_list, /* input: key_list */
char* parent) /* input: parent name */
doom_prtab: Prepare name table from Fortran
(char* name_list, /* input: list of names */
int* n_names, /* input: number of names */
int* name_l, /* input: number of characters/name */
char* prep_list, /* output: list in DOOM format (ordered, \0 sep */
int* positions) /* output: positions in value table
The initial order is assumed to be 0, 1, 2, */
doom_psequ: Put expanded sequence
void doom_psequ /* stores sequence table */
(char* sequ_name, /* input: sequence name */
int* n_item, /* input: actual no. of elements */
int* name_l, /* no. of characters/name */
char* names, /* element names */
int* occ, /* array occ(max_item): occ. counts */
double* pos) /* array pos(max_item): centre pos. */
doom_pstring: Put string
void doom_pstring /* stores string */
(char* name, /* input: key name */
int* key_list, /* input */
int* sleng, /* input: string length */
char* string) /* input */
doom_psumm: Put summary record
void doom_psumm /* stores summary tables = array of double */
(char* surv_name, /* input: summary name */
int* n_item, /* input: actual no. items */
doom_psurv: Put survey table
void doom_psurv /* stores survey table */
(char* surv_name, /* input: survey name */
int* n_item, /* input: actual no. of elements */
int* name_l, /* no. of characters/name */
char* names, /* element names */
int* occ, /* array occ(max_item): occ. counts */
double* pos) /* array pos(max_item,7):
s, x, y, z, theta, phi, psi */
doom_ptbody: Put table (TWISS, SURVEY
void doom_ptbody /* stores a table (TWISS, SURVEY etc.) */
(char* tabl_name, /* input: table name */
char* sequ_name, /* input: sequence name */
int* n_column, /* input: no. of columns in table */
int* n_row, /* input: no. of rows = no. of positions */
int* name_l, /* input: no. of characters/name */
char* names, /* input: element names */
int* occ, /* input: occ. counts */
double* optics_t) /* input: table (see twiss_att_names) */
doom_pthead: Create or replace twiss master record
void doom_pthead /* creates or replaces twiss master record */
(char* tabl_name, /* input: table name */
char* sequ_name, /* input: sequence name */
int* n_delta, /* input: # of delta values*/
int* n_row, /* input: # of rows per table (per delta) */
int* sum_leng, /* input: length of summ. record (per delta) */
double* sum_rec, /* input: summary record */
int* n_col, /* input: # of columns */
int* pos_flag, /* input: element position flag:
1 start, 2 centre, 3 end */
char* col_names, /* input: column names (compressed) */
int* col_pos) /* input: column positions in table */
doom_ptrack: Put track master record
void doom_ptrack /* puts track survival table */
(int* locc, /* input: number of list items */
int* list) /* input: list address */
doom_pturn: Put one turn record
void doom_pturn( /* saves the track data of one turn */
int* turn, /* input: turn number */
int* number, /* input: number of particles */
int* list, /* input: particle list */
double* track) /* input: track coordinates (6,...) */
doom_ptype: Put object type
void doom_ptype /* puts type into object */
(char* name, /* input: object name */
int* key_list, /* input: key_list */
char* type) /* input: type */
doom_recall: Get (any) array collection
void doom_recall( /* recalls an object from memory or the d.b.
if it does not exist, all length = -1 */
char* name, /* input */
int* key_list, /* input: key token list: number + codes */
int* lint, /* input/output: max/length of integer array */
int* ldble, /* input/output: max/length of double array */
int* lchar, /* input/output: max/length of char array */
int* a_int, /* output: integer array */
double* a_dble, /* output: d.p. array */
char* a_char) /* output: string */
doom_rline: rewinds line buffer object
void doom_rline /* "rewinds" line buffer object */
(char* name) /* input: object name */
doom_robj: Get object (from Fortran)
void doom_robj /* restores object (for call from fortran) */
(char* name, /* input: name */
int* key_list, /* input: key list for composed name */
char* parent, /* output: */
char* type, /* output: */
int* n_int, /* input/output: max/act. number of integers */
int* n_dble, /* input/output: max/act. number of doubles */
int* n_name, /* input/output: max/number of names in char array */
int* ncname, /* input: (fixed)number of char.s per name */
int* a_int, /* output: integer array */
double* a_dble,/* output: double array */
char* a_char) /* output: char array for names (blank padded) */
doom_save: Put object (inverse of doom_fetch)
void doom_save( /* puts object into list to be saved at end.
If it exists, the previous object is deleted
if it has a different pointer */
struct object* psave) /* input: object to be saved */
doom_setenv: Set value of environment variable
void doom_setenv( /* sets new value of environment variable */
char* variable, /* input */
char* value) /* input */
doom_setvar: Set value of internal variablevoid doom_setvar( /* set DOOM internal variable (ad hoc) */doom_sobj: Put object (from Fortran)
void doom_sobj /* stores object (from fortran) */
(char* name, /* input: name */
int* key_list, /* input: key list for composed name */
char* parent, /* input: */
char* type, /* input: */
int* n_int, /* input: number of integers */
int* n_dble, /* input: number of doubles */
int* n_name, /* input: number of names in char array */
int* ncname, /* input: (fixed)number of char.s per name */
int* a_int, /* input: integer array */
double* a_dble,/* input: double array */
char* a_char) /* input: char array for names */
doom_store: Put (any) array collection
void doom_store( /* creates an object in memory and in the d.b.
If it exists, it is replaced. */
char* name, /* input */
int* key_list, /* input: key token list: number + codes */
int* lint, /* input: length of integer array */
int* ldble, /* input: length of double array */
int* lchar, /* input: length of char array */
int* a_int, /* input: integer array */
double* a_dble, /* input: d.p. array */
char* a_char) /* input: string */
doom_time: Get current DOOM timevoid doom_time(double* r_time) /* external time in d.p. */
Hans Grote