% Reference Card for EUROGAM Event Builder Compiler. %**start of header \newcount\columnsperpage % This file can be printed with 1, 2, or 3 columns per page (see below). % Specify how many you want here. Nothing else needs to be changed. \columnsperpage=3 % This file is intended to be processed by plain TeX (TeX82). % % The final reference card has six columns, three on each side. % This file can be used to produce it in any of three ways: % 1 column per page % produces six separate pages, each of which needs to be reduced to 80%. % This gives the best resolution. % 2 columns per page % produces three already-reduced pages. % You will still need to cut and paste. % 3 columns per page % produces two pages which must be printed sideways to make a % ready-to-use 8.5 x 11 inch reference card. % For this you need a dvi device driver that can print sideways. % Which mode to use is controlled by setting \columnsperpage above. % \def\versionnumber{1.0} \def\year{1991} \def\version{April \year\ v\versionnumber} \def\shortcopyrightnotice{\vskip 1ex plus 2 fill \centerline{\small \copyright\ \year\ Liverpool Nuclear Structure Group v\versionnumber}} \def\copyrightnotice{ \vskip 1ex plus 2 fill\begingroup\small \centerline{Produced by Linda Pratt and John Cresswell, \version} \centerline{Contact PRATT or CRESSWELL @ UK.AC.LIV.PH.GB} Permission is granted to make and distribute copies of this card as long as its contents are not altered. \centerline{For copies of the EUROGAM Event Builder Compiler User Manual ...} \centerline{extract document EDOCxxx from the NSF document server.} \endgroup} % make \bye not \outer so that the \def\bye in the \else clause below % can be scanned without complaint. \def\bye{\par\vfill\supereject\end} \newdimen\intercolumnskip \newbox\columna \newbox\columnb \def\ncolumns{\the\columnsperpage} \message{[\ncolumns\space column\if 1\ncolumns\else s\fi\space per page]} \def\scaledmag#1{ scaled \magstep #1} % This multi-way format was designed by Stephen Gildea % October 1986. \if 1\ncolumns \hsize 4in \vsize 10in \voffset -.7in \font\titlefont=\fontname\tenbf \scaledmag3 \font\headingfont=\fontname\tenbf \scaledmag2 \font\smallfont=\fontname\sevenrm \font\smallsy=\fontname\sevensy \footline{\hss\folio} \def\makefootline{\baselineskip10pt\hsize6.5in\line{\the\footline}} \else \hsize 3.2in \vsize 7.70in \hoffset -.75in \voffset -.745in \font\titlefont=cmbx10 \scaledmag2 \font\headingfont=cmbx10 \scaledmag1 \font\smallfont=cmr6 \font\smallsy=cmsy6 \font\eightrm=cmr8 \font\eightbf=cmbx8 \font\eightit=cmti8 \font\eighttt=cmtt8 \font\eightsy=cmsy8 \textfont0=\eightrm \textfont2=\eightsy \def\rm{\eightrm} \def\bf{\eightbf} \def\it{\eightit} \def\tt{\eighttt} \normalbaselineskip=.8\normalbaselineskip \normallineskip=.8\normallineskip \normallineskiplimit=.8\normallineskiplimit \normalbaselines\rm %make definitions take effect \if 2\ncolumns \let\maxcolumn=b \footline{\hss\rm\folio\hss} \def\makefootline{\vskip 2in \hsize=6.86in\line{\the\footline}} \else \if 3\ncolumns \let\maxcolumn=c \nopagenumbers \else \errhelp{You must set \columnsperpage equal to 1, 2, or 3.} \errmessage{Illegal number of columns per page} \fi\fi \intercolumnskip=.46in \def\abc{a} \output={% % This next line is useful when designing the layout. %\immediate\write16{Column \folio\abc\space starts with \firstmark} \if \maxcolumn\abc \multicolumnformat \global\def\abc{a} \else\if a\abc \global\setbox\columna\columnbox \global\def\abc{b} %% in case we never use \columnb (two-column mode) \global\setbox\columnb\hbox to -\intercolumnskip{} \else \global\setbox\columnb\columnbox \global\def\abc{c}\fi\fi} \def\multicolumnformat{\shipout\vbox{\makeheadline \hbox{\box\columna\hskip\intercolumnskip \box\columnb\hskip\intercolumnskip\columnbox} \makefootline}\advancepageno} \def\columnbox{\leftline{\pagebody}} \def\bye{\par\vfill\supereject \if a\abc \else\null\vfill\eject\fi \if a\abc \else\null\vfill\eject\fi \end} \fi % we won't be using math mode much, so redefine some of the characters % we might want to talk about \catcode`\^=12 \catcode`\_=12 \chardef\\=`\\ \chardef\{=`\{ \chardef\}=`\} \hyphenation{mini-buf-fer} \parindent 0pt \parskip 1ex plus .5ex minus .5ex \def\small{\smallfont\textfont2=\smallsy\baselineskip=.8\baselineskip} \outer\def\newcolumn{\vfill\eject} \outer\def\title#1{{\titlefont\centerline{#1}}\vskip 1ex plus .5ex} \outer\def\section#1{\par\filbreak \vskip 3ex plus 2ex minus 2ex {\headingfont #1}\mark{#1}% \vskip 2ex plus 1ex minus 1.5ex} \newdimen\keyindent \def\beginindentedkeys{\keyindent=1em} \def\endindentedkeys{\keyindent=0em} \endindentedkeys \def\paralign{\vskip\parskip\halign} \def\<#1>{$\langle${\rm #1}$\rangle$} \def\cop#1{$\lbrack\!\lbrack${\rm #1}$\rbrack\!\rbrack$} \def\kbd#1{{\rm#1}\null} %\null so not an abbrev even if period follows \def\beginexample{\par\leavevmode\begingroup \obeylines\obeyspaces\parskip0pt\tt} {\obeyspaces\global\let =\ } \def\endexample{\endgroup} \def\key#1#2{\leavevmode\hbox to \hsize{\vtop {\hsize=.215\hsize\rightskip=1em \hskip\keyindent\relax#1}\kbd{#2}\hfil}} \def\kkj#1#2{\leavevmode\hbox to \hsize{\vtop {\hsize=.30\hsize\rightskip=0em \hskip 0em\relax#1}\kbd{#2}\hfil}} \def\kkk#1#2{\leavevmode\hbox to \hsize{\vtop {\hsize=.35\hsize\rightskip=0em \hskip 0em\relax#1}\kbd{#2}\hfil}} \def\kk#1#2{\leavevmode\hbox to \hsize{\vtop {\hsize=.15\hsize\rightskip=0em \hskip 0em\relax#1}\kbd{#2}\hfil}} \def\k#1{\leavevmode\hbox to \hsize{\vtop {\rightskip=0em \hskip 0em\relax#1}\hfil}} \newbox\metaxbox \setbox\metaxbox\hbox{\kbd{M-x }} \newdimen\metaxwidth \metaxwidth=\wd\metaxbox \def\metax#1#2{\leavevmode\hbox to \hsize{\hbox to .75\hsize {\hskip\keyindent\relax#1\hfil}% \hskip -\metaxwidth minus 1fil \kbd{#2}\hfil}} \def\threecol#1#2#3{\hskip\keyindent\relax#1\hfil&\kbd{#2}\quad &\kbd{#3}\quad\cr} %**end of header \title{EUROGAM Ebc Reference Card} \centerline{(for version \versionnumber)} \section{Setting up} There are 2 steps involved in producing an event builder customised to individual experimental requirements. A data file of EUROGAM event builder source language should be created using any text editor. The data file has to contain sections as described in File Sections below. Secondly, the complete description file must be passed through the Event Builder Compiler, see elsewhere. \section{Statement Definitions} The compiler is not case sensitive. Blank lines between statements are ignored. There are restrictions on line breaks in the middle of statements. Each statement should start on a new line. Unnecessary white space is ignored. Comment lines and trailing comments should be indicated with an exclamation mark ({\bf !}). \k{} \k{$<$...-name$>$ ... upto 8 characters (alphanumeric plus \_)} \k{} \section{File Sections} \kkk{{\bf input formats}}{... see Input Definitions} \k{$<$input-definition-statements$>$} \kkk{\bf output formats}{... see Output Definitions} \k{$<$output-definition-statements$>$} \kkk{\bf commands}{... see Command Definitions} \k{$<$command-statements$>$} \kkk{\bf finish}{... File terminator} \k{ } \section{Input Definitions} This is the first section of information required. It defines the maximum set of data items to be expected in each event to be processed. Each parameter is labelled by an ``address''. \key{ }{ } \k{$<$item-name$>$ $<$address$>$} \k{$<$group-name$>$ {\bf [}$<$group-range$>${\bf ]} ($<$item-list$>$)} \k{ } \key{where}{ } \kkk{$<$group-range$>$ =}{\ one or more group ranges of the form} \kkk{ }{$<$integer$>$} \kkk{\hfill or}{ $<$integer$>$ {\bf :} $<$integer$>$} \kkk{ }{\ separated by commas} \kkk{$<$item-list$>$=}{\ one or more $<$item-name$>$s separated} \kkk{ }{\ by commas} \k{ } \newcolumn \section{Output Definitions} Definition of the maximum set of data items to be output from each event processed. There are restrictions on the use of names to ensure consistency with the {\bf input format} definitions. \key{ }{ } \k{$<$item-name$>$ $<$address$>$} \k{$<$group-name$>$ [$<$group-range$>$] ($<$item-list$>$)} \k{ } \key{where}{$<$group-range$>$ and $<$item-list$>$ are explained} \key{ }{in the input definitions section} \section{Command Definitions} Commands all start on a new line except where indicated. For example, a simple command following an {\bf if} statement. \k{ } \k{$<$expression$>$ ... see Arithmetic Commands} \k{$<$value$>$ is one of $<$integer$>$, $<$item-name$>$ or} \key{ }{$<$local-variable$>$} \k{$<$variable$>$ is $<$item-name$>$ or $<$local-variable$>$} \k{ } A $<$local-variable$>$ is any name used in {\bf commands} section not defined in {\bf input} or {\bf output formats} section. Qualification bits may be accessed wherever $<$item-name$>$ appears as follows: \k{ } \k{$<$item-name$>${\bf.q0} or } \k{$<$item-name$>$\bf.q1} \k{ } \section{The IF Command} The {\bf if} command allows a statement or block of statements to be executed or not depending on the outcome of some test. Various conditions may be applied to data parameters. Upto 6 nested {\bf if} blocks are allowed. \k{ } \k{{\bf if} $<$condition$>$ {\bf then} $<$statements$>$} \k{ } \key{where}{ } \kkj{$<$condition$>$ =}{$<$variable$>$ $<$test$>$ $<$value$>$} \kkj{\hfill or }{$<$variable$>$ {\bf passes} [$<$value$>${\bf ,} $<$value$>$]} \kkj{\hfill or }{$<$variable$>$ {\bf fails} [$<$value$>${\bf ,} $<$value$>$]} \kkj{$<$statements$>$ =}{$<$single-command$>$} \kkj{\hfill or }{\ $\lbrace$} \kkj{ }{$<$one-or-more-commands$>$} \kkj{ }{\ $\rbrace$} \kkj{$<$test$>$ =}{one of {\bf lt le eq ge gt ne}} \k{ } \newcolumn \section{The WHENEVER Command} This allows the processing of the same statement or block of statements on many groupnumbers. The statement(s) are executed for every group belonging to $<$group-name$>$ that is present in the event. {\bf Whenever} blocks may not be nested, but they may be combined with {\bf if} blocks. \k{ } \k{{\bf whenever} $<$condition$>$ {\bf then} $<$statements$>$} \key{where}{ } \kkk{$<$condition$>$ =}{\ {\bf group =} $<$group-number$>$} \kkk{\hfill or}{\ {\bf group =} $<$group-name$>$} \kkk{\hfill or}{\ {\bf word =} $<$sitem-name$>$} \kkk{$<$statements$>$}{\ are as given above for the IF command} \kkk{$<$sitem-name$>$}{\ is an itemname defined with the single} \kkk{ }{\ item format in the {\bf input formats}} \kkk{ }{\ section.} \k{ } \section{Arithmetic} \k{ } \k{$<$variable$>$ = $<$expression$>$} \k{{\bf increment} $<$variable$>$} \k{{\bf decrement} $<$variable$>$} \k{ } \key{where}{ } \kkk{$<$expression$>$ =}{an expression involving $<$value$>$s as} \kkk{ }{operands and the following operators} \kkk{Arithmetic operators:}{\bf$+, -, *, /$} \kkk{Bitwise operators:}{\bf $\&$, ior, xor, not, $<, >$} Only integer arithmetic is possible. Upto 6 levels of parenthesis are allowed. C operator precedence and associativity rules are followed. \section{REJECT Command} Discards the event or the specified part of the event. \k{ } \k{{\bf reject event}} \k{{\bf reject group}} \k{{\bf reject} $<$group-name$>$} \k{{\bf reject} $<$sitem-name$>$} \k{ } The {\bf event} keyword rejects the whole of the current event. The {\bf group} keyword is only valid in a {\bf whenever} block and discards the current groupnumber. The third form rejects all groups belonging to $<$group-name$>$. The last form rejects the single item named. \section{SUPPRESS Command} \k{{\bf suppress scheme} $<$integer$>$ {\bf file} $<$file-name$>$} \k{ } Does shared suppression according to the instructions laid out in $<$file-name$>$ for scheme $<$integer$>$. \section{The STREAM Command} Allows the user to output all or part of an event onto different streams. \k{ } \k{{\bf stream} $<$stream-number$>$ {\bf event} {\sl nosort}} \k{{\bf stream} $<$stream-number$>$ $<$output-list$>$ {\sl nosort}} \k{ } \key{where}{} \kkk{$<$output-list$>$ =}{one or more $<$group-name$>$s and/or} \kkk{ }{$<$sitem-name$>$s defined in the output} \kkk{ }{definitions section separated by commas} \kkk{\sl nosort =}{optional keyword for output not to be} \kkk{ }{included in the sort} \newcolumn \section{Writing Event Builder Files} An example: \beginexample% ! Brief example event builder language source file. INPUT FORMATS trigger [255] (type,mraw) germ [1:32,34,71] (e1,e2,t,tbd,ebgo,tbgo,hit) OUTPUT FORMATS trigger [255] (type,mraw,nge) germ [1:32,34,71] (e1,t) COMMANDS whenever group = trigger then { if Mraw lt 8 reject event if type ne 1 reject event } a=2000 b=15000 c=300 d=10000 e=8000 f=30000 whenever group = germ then { sumenergy = sumenergy + e2 + ebgo if E1 fails [a,b] then reject event suppress scheme 1 file /eb/shared-suppr increment nge if T1 passes [c,d] then increment FT1 } if SUMENER fails [e,f] then reject event if FT1 lt 1 then reject event stream 0 event finish \endexample \vfill \copyrightnotice \bye % End: