July 25, 1988

PAW version 1.03/05

1- The command NTUPLE/CUTS has been modified in the following way:

* /NTUPLE/CUTS ICUT [ CHOPT FNAME ] 

ICUT I 'Cut number' R=0:100 
CHOPT C 'Options' D='P' R=' ,G,P,S,-,R,W,D' 
FNAME C 'File name' D=' ' 

Define cut number ICUT for an ntuple. This cut can then be used 
in subsequent commands NTUPLE/PLOT, PROJECT.

CHOPT='G' define a new cut ICUT using graphics input on the latest
1-DIM or 2-DIM projection of the Ntuple.
In case of a 1-DIM projection, give 2 points cutmin,cutmax. 
In case of a 2-DIM projection, give up to 20 points to 
delimit the selected area. The polygon will automatically 
be closed by PAW. 
CHOPT='P' Print definition of cut number ICUT.
'S' same as P 
'-' Reset cut ICUT 
'R' read definition of cut ICUT from file FNAME.
'W' write definition of cut ICUT on file FNAME (text file). 
'D' Draw cut contour. 
CHOPT='expression' Ex: 0.4
 
    Note that ICUT=0 means all cuts except for 'G' option.  
    When option G is selected, graphical cuts are only operational  
    for plots of the original Ntuple variables, not for expressions 
    of these variables. 
 
 

2- The command NTUPLE/PLOT has been modified in the following way:

 
  * /NTUPLE/PLOT  IDN [ UWFUNC NEVENT IFIRST NUPD CHOPT ] 
 
    IDN        C 'Ntuple identifier'  
    UWFUNC     C 'Selection function' D='0'  
    NEVENT     I 'Number of events' D=999999  
    IFIRST     I 'First event' D=1  
    NUPD       I 'Frequency to update histogram' D=30000  
    CHOPT      C 'option' D=' ' R=' ,C,S,+,B,L,P,*' 
 
    Project and plot an ntuple as a (1D or 2D) histogram
    with automatic binning(ID=1000000), 
    possibly using a selection algorithm.   
    CHOPT is the option string given to HPLOT.  
 
     IDN may be given as IDN
                      or IDN.X  
                      or IDN.Y%X
                      or IDN.1  
                      or IDN.2%1
                      or IDN.expression1
                      or IDN.expression1%expression2
 
    Y%X means a scatter-plot Y(I) versus X(I) where I is the event number.  
    2%1 means a scatter-plot variable 2 versus variable 1.  
    In this particular case, X and Y are the names of the variables 1 and 2 
    respectively.   
    Expression1 is any numerical expression of the Ntuple variables.
 
     UWFUNC may have the following forms:   
     1- UWFUNC='0' or missing (only IDN given). No selection is applied.
     2- UWFUNC is a CUT or combination of valid CUTS created by the 
        command NTUPLE/CUTS. Ex:
               UWFUNC=1            means use cut number 1   
               UWFUNC=1.AND.2   
               UWFUNC=.NOT.(1.AND.2)
               UWFUNC=(1.OR.2).AND.3
     3- UWFUNC is a FORTRAN expression  
        Ex:    X>3.14.AND.(Y>Mname(4)
means mark bit 4 in mask Mname for all events satisfying the condition Z<0.4

A MASK may also be given as input to a selection expression. Ex: NT/PLOT 30.X Mname(4).and.Z<0.4

means all events satisfying bit 4 of Mname AND Z<0.4

It is possible to plot expressions of the original variables. Ex: NT/PLOT 30.SIN(X)%SQRT(Y**2+Z**2) Z<0.4

plots a scatter-plot of variable U versus V for all events satisfying the condition Z<0.4. U and V are U=SIN(X) and V=SQRT(X**2+Y**2)

The default identifier of the histogram being filled is IDF=1000000. At the next invocation of this command, it will be overwritten. If either NEVENT or IFIRST or NUPD are negative, then the identifier of the histogram being filled will be taken as IDF=-NEVENT or IDF=-IFIRST or IDF=-NUPD. IDF may have been created with H/CREATE. Before filling IDF, the contents of IDF are reset if IDF already exists. Use NTUPLE/PROJECT to cumulate several passes into IDF. Note that IDF.NE.1000000 is a convenient way to force user binning, in case the automatic binning algorithm used within PAW/HBOOK does not give acceptable results (this can be the case when the variable to be histogrammed always increases or decreases). This option must be used when options '+', 'U', 'S' are specified in CHOPT. Every NUPD events, the current status of the histogram is displayed.

3- A new command NTUPLE/UWFUNC is available.

* /NTUPLE/UWFUNC IDN FNAME [ CHOPT ] 

IDN I 'Ntuple identifier' 
FNAME C 'File name' 
CHOPT C 'Options' D=' ' R=' ,E,P,T' 

Generates automatically the Fortran skeleton of a selection 
function. Example 

If Ntuple ID=30 has variable names [X,Y,Z,ETOT,EMISS,etc] then 
NTUPLE/UWFUNC 30 SELECT.FOR will generate the file SELECT.FOR with: 
FUNCTION SELECT(XDUMMY) 
COMMON/PAWIDN/IDNEVT,X,Y,Z,ETOT,EMISS,etc 
SELECT=1. 
END 

Then using the command EDIT one can modify this file which could then 
look something like: IDNEVT is the event number.

FUNCTION SELECT(XDUMMY) 
COMMON/PAWIDN/IDNEVT,X,Y,Z,ETOT,EMISS,etc 
IF(X**2+Y**2.GT.Z**2.OR.ETOT.GT.20.)THEN 
SELECT=1. 
ELSE 
SELECT=0. 
ENDIF 
END 

If CHOPT='E' then the local editor is invoked on FNAME. 

='P' code to print events is generated. 
='T' Tags for variables are generated in DATA. 

4- A new command NTUPLE/SCAN is available (from T. Wildish ALEPH).

*/NTUPLE/SCAN IDN [CHFUNC NEVENT IFIRST NVARS CH1 CH2 CH3 CH4 CH5 CH6 CH7
CH8] 

IDN C 'Ntuple identifier' 
CHFUNC C 'User cut function' D='0' 
NEVENT I 'Number of events' D=999999 
IFIRST I 'First event' D=1 
NVARS I 'Number of variables to scan' D=8 R=0:8 
CH1 C 'Name of 1st variable' D='1' 
CH2 C 'Name of 2nd variable' D='2' 
CH3 C 'Name of 3rd variable' D='3' 
CH4 C 'Name of 4th variable' D='4' 
CH5 C 'Name of 5th variable' D='5' 
CH6 C 'Name of 6th variable' D='6' 
CH7 C 'Name of 7th variable' D='7' 
CH8 C 'Name of 8th variable' D='8' 

Scan the entries of an Ntuple subject to user cuts. 
Scan the variables for NEVENT events starting at IFIRST, requiring that

the events satisfy cut CHFUNC. Up to 8 variables may be scanned,
the default is to scan the first 8 variables. 

5- A new command NTUPLE/MASK is available.

* /NTUPLE/MASK MNAME [ CHOPT NUMBER ] 

MNAME C 'Mask name' 
CHOPT C 'Options' D=' ' R=' ,U,N,R,C,P' 
NUMBER I 'Bit number' D=0 

Operations with masks. 
A mask is in fact a direct-access file with the name MNAME.MASK.
A mask must contains as many 32 bit words as there are events 
in the associated Ntuple(s).
Masks are interesting when only a few events of a Ntuple are selected 
with a time consuming selection algorithm. For example if the command 

NT/PLOT 30.X Z<0.4.and.SELECT.FTN>>Mname(6) 

then for all events in Ntuple 30 satisfying the above condition 
the bit 6 in the corresponding mask words will be set. One can then use

the mask as selection mechanism. Example: 

NT/PLOT 30.X Mname(6)

will produce the same results than the first NT/PLOT command but
will be much faster if only a small fraction of all the events 
is selected.
MASKS are automatically saved across PAW sessions. 

CHOPT=' ' existing mask on file MNAME.MASK is attached for READ only. 
CHOPT='U' existing mask on file MNAME.MASK is attached for UPDATE. 
CHOPT='N' a new mask on file MNAME.MASK is created for NUMBER events. 
CHOPT='P' the comments for all active bits is printed. 
CHOPT='C' mask is closed. 
CHOPT='R' Reset bit number NUMBER.If NUMBER=99, resets all bits. 

Example:

MASK Test N 10000 
creates a new mask on file Test.mask with enough words to 
process a Ntuple with 10000 events
MASK Test UP
opens an existing mask for update 
+prints the active selection bits with explanation 

6- A new command NTUPLE/CSELECT is available.

* /NTUPLE/CSELECT [ CHOPT CSIZE ] 

CHOPT C 'OPTIONS' D='N' R=' N,R,B,M,C' 
CSIZE R 'Comment size' D=0.28 

The selection mechanism will be written as a comment on the picture.
If option N is given, then all subsequent NTUPLE/PLOT commands 
will print the selection mechanism with the options specified in CHOPT.

By default, the comment is drawn Left justified Above the top zone line.
The options are : 

'R' comment is right adjusted to the current zone 
'C' comment is centred to the current zone 
'B' comment is drawn below the top zone line 

Ex: 

CSEL All coming NT/PLOT commands will draw a comment 
of size CSIZE=0.28cm Left justified. 
CSEL NRB 0.4 All coming NT/PLOT commands will draw a comment 
of size 0.4 cm Right justified Below the top line. 
CSEL CB Draw previous selection mechanism Centred Below 
the top zone line. 

7- Multi-Dimensional vectors are now implemented.

Ex: VECTOR/CREATE X(3,10000).
Using the file VECTOR.DAT described in the documentation try:
VECTOR/READ X VECTOR.DAT
VECTOR/PLOT X(1)
VECTOR/PLOT X(1)%X(3)
(type "HELP VECTOR")

8- Changes in the commands TEXT and ITX

The two commands accept now X and Y coordinates given in the current Normalisation transformation units. The text size is always given in centimetres.

9- Several enhancements in the KUIP,HBOOK,HPLOT and HIGZ packages.

Logic of commands HELP and STYLE A revised (type "HELP" or "STYLE AN" and follow the questions)

Single quote inside character string can be escaped by @' (type "HELP KUIP/SYNTAX")

The character "!" stands now for the default value of a parameter (type "HELP GETTING_HELP")

Added the possibility of concatenating strings using "//" (type "HELP CONCATENATING")

New system functions (usable like aliases) $DATE and $TIME (type "HELP FUNCTIONS")

The character "*" stands now for the repetition factor in VECTOR/INPUT (type "HELP VECTOR/INPUT")

New macro statements: "assignment statement" and "IF expr GOTO label" (type "HELP MACRO/SYNTAX")

Added option TPU for command HOST_EDITOR (T.Wenaus, CERN EP/L3)

10- The array manipulation language SIGMA is available.

SIGMA (System for Interactive Graphical Mathematical Applications)
is a programming language for scientific computing whose major
characteristics are the following:


1. The basic data units are scalars, one-dimensional arrays, and
multi-dimensional rectangular arrays; SIGMA provides automatic handling
of these arrays.

2. The computational operators of SIGMA closely resembles the
operations of numerical mathematics; procedural operators are often
analogous to those of FORTRAN.


For an introduction to SIGMA, consult the tutorial SIGMA WITHOUT
EFFORT, and for details see the CERN SIGMA User's Manual, available
from C.E. Vandoni, DD, ext. 3355 or 13+5567.

Notation

In the following, we use the words "array" and "vector"
as synonyms.
In both cases, we refer to PAW vectors, in the sense that
SIGMA-generated arrays are stored as PAW vectors and therefore are
accessible to PAW commands, and PAW vectors are accessible to SIGMA.

Operating procedure

SIGMA is implemented on VAX-VMS, IBM/VM and APOLLO. SIGMA can be
invoked by just typing the command APPL SIGMA, when under PAW.

Lines starting with a $ are considered comment lines.

The last 20 SIGMA commands typed can be shown by typing a character
@ alone followed by carriage return.

The command EXIT will revert control to PAW.

SIGMA commands are not case sensitive.

Data storage and manipulation is based on a conventional assignment
statement:

= 

where the result of the expression is assigned to the name. The
expression may include arithmetical, relational or logical operators
because Boolean truth values are represented by zero for FALSE and one
for TRUE. The expression may also include any prefix operator provided
by SIGMA.

Since the basic data type of SIGMA is an n-dimensional rectangular
array, the result of any expression will be an array without any
explicit loop structures to process individual components.

Names FORTRAN conventions, max. 7 characters.

Numbers and ranges

Real, integers and Boolean. Note that SIGMA distinguishes only
between real or complex numbers and strings; integers and Boolean
values (0,1) have no special status. Numbers can be typed in using a
completely free (FORTRAN rules!) format.

Ranges has the structure: A#B, where A, B are numbers, names of
scalars or scalars expressions. Main usage of ranges is in arrays
definition and in graphics command.

Expressions and assignment statements

As in FORTRAN, while basic items may be scalars or full arrays.

Scalars and arrays definition


Note that scalars are implemented as one-dimensional arrays of
length one. A=ARRAY (arg1,arg2)

arg1 defines the array structure, i.e. the NCO (Number of
COmponents) of the array

arg2 provides the numerical values filling the array row-wise. If
arg2 is absent (or does not provide enough values) the array is filled
with 1.

Examples

A=ARRAY (6,1#6) 1 2 3 4 5 6

A=ARRAY (4) 1 1 1 1

A=ARRAY (5,5&7&-1&2&1.2) 5 7 -1 2 1.2

A=ARRAY (3)*PI 3.1415927 3.1415927 3.1415927

A=ARRAY (1,123E4) 1230000.0

Debugging commands

!PRINT Automatic printing of scalars and arrays after
(re)definition.

!NOPRINT Suppress !PRINT

Basic operators

+ Add

- Subtract

* Multiply

/ Divide

** Exponentiation

& Concatenation

Logical operators

Logical operators act on entities that have Boolean values 1 (true)
or 0 (false). The result is Boolean.

ANY The result is a Boolean scalar of value 1 (true) if at least one
component of the argument is true and 0 (false) otherwise.

AND Logical operation AND

NOT Logical operation NOT

OR Logical operation OR

EQ EQual to

GE Greater or Equal to

GT Greater Than

LE Less or Equal to

LT Less Than

NE Not Equal


Array functions (operators)

DEL DELta Function

DIFF Forward DIFFerence

LS R=LS(A,N) shifts index of A to the left by N steps (cyclic)

MAX A=MAX(A) replaces each element in a row of A by the MAXimum
element in that row

MIN A=MIN(A) replaces each element in a row of A by the MINimum
element in that row

NCO R=NCO(A) Number of COmponent vector of A

ORDER R=ORDER(A,P) finds a permutation that brings P in a
non-descending order and applies it to A to generate R.

PROD Generates the running product

SMAX Largest element of A (scalar)

SMIN Smallest element of A (scalar)

SUM Generates the running sum

Workspace commands

EXIT SIGMA is stopped, and control is returned to PAW.

!WAIT The execution is suspended until the user types a carriage
return.

!NAMES Obtain a full listing of presently defined names, specifying
their NCO.

!CLEAR Deletes all defined names.


Available functions


ABS ABSolute value

ACOS ArCOSine

ASIN ArcSINe

ATAN ArcTANgent

ATAN2 ArcTANgent2 (2 arguments)

COS COSine

COSH Hyperbolic COSine

COSINT COSine INTegral

EXP EXPonential

INT takes INTegral part of decimal number

LOG Natural LOGarithm

LOG10 Common LOGarithm

MOD Remaindering

RNDM Random Number Generator - generates random numbers between 0
and 1. R=RNDM(X), where NCO(R)=NCO(X)

SIGN Transfer of SIGN R=SIGN(X,Y), R=|X|*Y/|Y|

SIN SINe Function

SINH Hyperbolic SINe

SININT SINe INTegral

TAN TANgent

TANH Hyperbolic Tangent

SQRT SQuare RooT


Note that ill defined functions (e.g. SQRT(-2)) will give 0. as
result.

Input/output statements and control


PRINT list Argument list can consist of scalars, arrays and
expressions.

!DIGITS n Specifies the number of digits in output (PRINT)

!LENGTH n Sets output line length


Release NotesKnown bugsFAQsContributionsTutorialReference manualDown loadMiscellaneous

Paw.Support@cern.ch