December 9, 1992
PAW version 2.00
Introduction
The new version 2.00 of PAW will be introduced in the NEW area on
Wednesday 9 December 1992. Platforms: CERNVM,VXCERN, ASIS, Apollos
This new version will be introduced in the PRO area on January 19.
The many new features and enhancements offered by the new version are
briefly summarised in the following.
THe full description of the new options can be obtained as usual by
the HELP command. We intend to provide a complete description of
these changes and the new features in the next issue of the CNL.
Suggestions or comments should be sent to:
- A.Nathaniel (NATHANIE@CERNVM.CERN.CH) for KUIP
- N.Cremel (CREMEL@CERNVM.CERN.CH) for KUIP/MOTIF
- O.Couet (COUET@CERNVM.CERN.CH) for graphics (PAW/HPLOT/HIGZ)
- F.Rademakers (RDM@HPSALO.CERN.CH) for HBOOK new ntuples
- A.Cash (CASH@CERNVM.CERN.CH) for ntuples selection mechanisms
- C.Vandoni (VANDONI@CERNVM.CERN.CH) for SIGMA
- J.Allison (ALLISON@CERNVM.CERN.CH) for commands SMOOTH, NT/DRAW
- O.Schaile (SCHAILE@CERNVM.CERN.CH) for the ZEBRA browser of PAW++
- M.Marquina (MARQUINA@CERNVM.CERN.CH) for the installation procedures
- R.Brun (BRUN@CERNVM.CERN.CH) for any other item
PAW++
PAW++ is an extended version of PAW with a new built-in MOTIF user interface.
In addition to the conventional command line and macros types of interface,
the following dialogue modes are also available:
- Pull Down menus. They are useful to understand the structure of an
interactive program.
- Object Browser. This is in many ways similar to the well know browsers
in the PC/MAC utilities or the visual tools on some workstations.
- Direct graphics. One can click in the graphics area and identify
automatically which object has been selected. A pop-up menu appears
with a list of possible actions on this object. For example, by clicking
on a histogram, one can make directly a Gaussian fit,etc..
Pop-Up menus are available in clicking on the graphics window to
automatically produce PostScript, Encapsulated PostScript, LateX files
or print the picture on your local printer.
- The Histogram_style panel widget. Buttons are available to change
histogram attributes, colours, line styles, fonts, axes representation.
2-D histograms can be rotated interactively.
- A Ntuple viewer. Just click on the ntuple column name to histogram
the column,etc..
A first version of PAW++ is available in the NEW area(HP-UX, SUN, DEC/Ultrix,
SGI,RS6000). We still hope to have a VMS and Apollo version ready at the time
of the release in January. This new system is largely self-explanatory.
Only a subset of PAW has been converted to this new user interface, but
work is currently in progress to offer many new facilities in the coming
releases. In particular the release version of PAW++ in January will include
a major upgrade of the ntuple viewer.
PIAF (The Parallel Interactive Analysis Facility)
PIAF is a farm of 5 new HP755 workstations. Each workstation has 128 Mbytes
of memory and 8 Gbytes of RAID. This system is currently in the development
phase and it will be installed at the CERN computer center in the first quarter
of 1993 when high speed connections to the other CERN systems will be
possible. It will be available to all PAW users running the standard version
of PAW on a workstation with the TCP/IP software.
PIAF will execute in a transparent way all time consuming
commands (Ntuple/plot, project,loop,etc.). The software to stage ntuples files
from tapes, disk files, NFS, AFS files is currently under development.
The 5 HP755 can process a user query (ntuple/plot) in parallel using the
PVM system.
New HBOOK file format
The HBOOK files created by the new version of HBOOK are by default in
exchange mode. They can be transported between machines using the standard
binary FTP or they can be NFS mounted in a heterogeneous environment.
The old HBOOK files can still be processed by HBOOK and PAW.
A conversion program called HTONEW is available to convert old files to
the new format. This program also converts automatically old format ntuples
to the new ntuples described below. A complete listing of this program can
be found at the end of this note.
- To transport HBOOK files between Unix machines with FTP:
ftp remote
bin
get remote.hbook
- To transport HBOOK files from CERNVM to a Unix workstation
on CERNVM FTP workstation
BIN F 4096 ! to specify the block size in bytes
PUT file.hbook
- To transport HBOOK files from CERNVM or Unix workstations to VMS
ftp remote
bin
get remote.hbook
quit
resize -s 4096 remote.hbook;1
The resize command does not copy the file. It simply changes the
header information, from 512 bytes record to 4096 bytes.
The resize tool is available on request from the CERN Program Library.
HBOOK files naming convention
We encourage users to name their HBOOK files with the suffix .hbook
Doing so, the PAW++ browser will be able to recognise these files
automatically.
New Ntuples in HBOOK
With the new version of PAW/HBOOK the new Ntuple routines, as
described in the current HBOOK manual, become operational. Below we
give a short summary of the features of the new Ntuples. For more
details see section 3.2 of the HBOOK manual.
- Data Types.
The new Ntuples support the storage of all basic data types: floating
point numbers (REAL*4 and REAL*8), integers, bit patterns
(unsigned integers), booleans and character strings.
The PAW command UWFUNC has been modified to generate the COMIS functions
with the corresponding data types.
- Data Compression.
Floating point numbers, integers and bit patterns can be packed by
specifying a range of values or by explicitly specifying the number
of bits that should be used to store the data. Booleans are always
stored using one bit. Unused trailing array elements will not be
stored when an array depends on an index variable. In that case only
as many array elements will be stored as specified by the index
variable.
For example, the array definition NHITS(NTRACK) defines NHITS
to depend on the index variable NTRACK. When NTRACK is 16,
the elements NHITS(1..16) are stored, when NTRACK is 3 only
the elements NHITS(1..3) are stored, etc.
- User Routines.
A new Ntuple is booked and defined using the routines: HBNT,
HBNAME and HBNAMC.
They are filled using the routines: HFNT and HFNTB.
Information is retrieved using: HGNT, HGNTB, HGNTV and HGNTF.
Note that the routines HGN cannot be used to retrieve information from
a new ntuple.
Global Ntuple options (like buffer size) are set using HBSET.
The Ntuple definition can be printed using HPRNT and a user
function to access the Ntuple data can be created with HUWFUN.
- Storage Model.
To improve the data access time and to facilitate the compression
mechanism the new Ntuples are stored column wise, as opposed to row
wise for the old Ntuples. The column wise storage scheme allows
direct access to any column in the Ntuple. Histogramming
one column from a 300 column Ntuple requires the reading of
only 1/300 of the total data set. However, this storage scheme
requires one memory buffer per column as opposed to only one buffer
in total for the old Ntuples. By default the buffer length is 1024
words, in which case a 100 column Ntuple requires 409600 bytes of buffer
space. In general, the performance increases with increasing buffer size.
Therefore, one should tune the buffer size (using routine HBSET) as
function of the number of columns and the amount of available memory.
Highest efficiency is obtained when setting the buffer size equal to the
record length of the RZ HBOOK file (as specified in the call to
HROPEN). Another advantage of column wise storage is that Ntuples
can easily be extended with one or more new columns.
Columns are logically grouped into blocks (physically, however, all
columns are independent). Blocks allow users to extend
Ntuples with private columns or to group relevant columns together.
New blocks can even be defined after the Ntuple has been filled. The newly
created blocks can be filled using the routine HFNTB.
Further note that arrays are treated as a single column. So defining only
one array of NVAR elements reproduces the behaviour of the old
Ntuples (with in addition data typing and data compression). This practice,
however, is not advised since one looses the direct column access
capabilities of the new Ntuples.
- Performance.
Accessing a relatively small number of the total number of
defined columns results in huge performance increases compared to
the old Ntuples. However, reading a complete Ntuple will take
slightly longer than reading an old Ntuple due to the overhead
introduced by the type checking and compression mechanisms and
because the data is not stored sequentially on disk. The huge
performance increases will most clearly show up when analysing
the new Ntuples with PAW where one typically histograms one
column with cuts on a few other columns. The advantages of
having different data types and data compression generally
outweighs the performance penalty incurred when reading complete
Ntuples.
Ntuple variables and selection function specifications
The following operands are permitted for expressions used as
selection criteria in the Ntuple operations:
- Numerical
Real and integer numbers. Example: 123.877 123 -12.E3 0
- Character string
This is a string of characters (plus the wild characters '*' and '?'
see "Other features" below) written in the following form: 'AbCd'
(Upper and lower case, within quotes)
- Bit strings (unsigned integers)
These are numbers written in Hexadecimal, Octal or Binary form
enclosed in single quotes. The string of digits is preceded by a Z,
O, or B (upper or lower case) to identify it.
o Hexadecimal numbers, are written in the form Z'xxxx' where x is a
hexadecimal digit in the range 0 - F.
o Octal numbers, are written in the form O'oooo' where o is an octal
digit in the range 0 - 7
o Binary numbers, are written in the form B'bbbb' where b is a binary
digit in the range 0 - 1
- Logical
o Logicals are written in the form TRUE or true and FALSE or false
(Upper or lower case without quotes). This implies that the names
TRUE and FALSE are not permitted as ntuple column identifiers.
- Cuts
A cut is identified by a '$' followed by an integer (written in the
form $nn, where 030.2).AND.MSK(3)
Using a Cut
o NTUPLE/PLOT 30.A $1.OR.(B=12)
o NTUPLE/SCAN 30 $3
Example:
o NTUPLE/PLOT 30.A $4*5.3 (where 5.3 is the weight)
Masks
The Mask facility allows up to 32 selection criteria associated with
a Ntuple. One bit of a mask (which has a logical type) is identified
by the mask name followed by an index of the bit within brackets. The
index ranges from 1 to 32. Example: Assuming there exists a mask
vector MSK.
o NTUPLE/PLOT 30.X MSK(4) (bit 4)
The Mask vector has a bit string type, and is identified by the name
of the mask with no bit index and no brackets. Example:
o NTUPLE/PLOT 30.X MSK.EQ.B'101'
This would be the same using the single logical bits in the following
way
o NTUPLE/PLOT 30.X .NOT.(MSK(2)).AND.(MSK(1)).AND.(MSK(3))
We assume that the reading of bits is from right to left, i.e.
position 1 is the least significant bit.
- Operators
Table of binding powers.
This shows the order in which operations are carried out in an
expression.
Operators Meaning
** raising to a power
* multiply and divide
+ - add and subtract
NE GE GT EQ LT LE relational operations
AND OR NOT logical operations
Unless indicated otherwise by means of parentheses, the operations are
carried out in the following order :
o first the exponentiations,
o then from left to right the multiplication and division,
o then from left to right the additions and subtractions,
o then from left to right the relational operations,
o finally from left to right the logical operations.
Note: The dots '.' either side of .NE. .GE. .GT. .EQ. .LT. .LE.
.AND. .OR. .NOT. can be omitted only when the operator appears between
brackets. The following lists the allowed operators, their alias, and
the permitted combinations and the type of the result.
- Notation used
o N numerical
o C character string
o L logical
o B bit string
o Bo boolean result
operand(s): N - result: N
o **
o *
o /
o -
o +
Any numerical combination of constants and Ntuple variables. (i.e. the
type must be Real or Integer)
Example: If X is an Ntuple variable of type Real or Integer
o NTUPLE/PLOT 30.X Y weight X by Y
o NTUPLE/PLOT 30.X X**2+Y**2
operand(s): N or B or C - result: Bo
o EQ .EQ. =
o NE .NE. <>
Mixed types are not permitted, i.e. an Integer can not be compared to
a Character string. (but Integer and Real types can be compared).
Example: If X is of type Real or Integer, Y is of type Bit string and
Z is of type Character string :
o NTUPLE/PLOT 30.Y X.EQ.9
o NTUPLE/SCAN 30 Y<>Z'8FFB'
o NTUPLE/SCAN 30 Z='PAW'
operand(s): N - result: Bo
o GT .GT. >
o LT .LT. <
o GE .GE. >=
o LE .LE. <=
o CT .CT. #
Example: If W and X are of type Real or Integer:
o NTUPLE/PLOT 30.W (W*3).GT.50
o NTUPLE/SCAN 30 X>=39.5
Note: Double comparisons of the type NTUPLE/SCAN 30 Y<1010)
operand(s): Bo or L - result: Bo
o AND .AND.
o OR .OR.
These operands can be used to join expressions which have a boolean
result or compare logical values.
o NOT .NOT.
This can be used on a Boolean expression or on a Ntuple variable that
has a Logical type. Example: If W and X are of type Real or Integer, Z
is of type Character string and V is of type Logical.
o NTUPLE/SCAN 30 (W.EQ.4)AND(Z='CERN').OR.X=5
o NTUPLE/PLOT 30.X (Z.NE.'CERN').OR.(NOT(V))
o NTUPLE/SCAN 30 V.AND.T
o NTUPLE/PLOT 30.W .NOT.((Z.EQ.'CERN').OR.V)
Note: AND, OR, and NOT can no longer be represented by *, +, -.
Functions
operand(s): N - result: N
n must be of type N (Integer or Real) and can be a Ntuple variable, a
constant or an expression with a numerical result.
o SIN(n)
o COS(n)
o SQRT(n)
o EXP(n)
o LOG(n)
o ATAN(n)
o ABS(n)
o INT(n)
o LOG10(n)
o TANH(n)
o ACOS(n)
o ASIN(n)
o TAN(n)
o SINH(n)
o COSH(n)
o MOD(n,n)
o ATAN2(n,n)
o SIGN(n,n)
operand(s): B - result: B These are the routines belonging to BITPAK
(CERN Program Library M441)
m and n , of type bit string (unsigned integer), can be a Ntuple
variable, a bit string constant entered in the format shown above or
an expression with a bit string result.
- Logical operations:
o IOR(m,n) inclusive OR of bit strings m and n
o IAND(m,n) logical AND of bit strings m and n
o NOT(m) logical complement of bit string m
o IEOR(m,n) exclusive OR of bit strings m and n
Shift operations:- shift count k specifies
o a left shift for k >0
o no shift for k =0
o a right shift for k <0
the absolute value of k is the number of shifts
o ISHFT(m,k) provides the value of the argument m with the bits
shifted. Bits shifted out to the left or right are lost, and zeros
are shifted in from the opposite end.
o ISHFTC(m,k,ic) provides the value of the argument m with the
rightmost ic bits shifted and the remaining bits untouched. The shift
is circular; i.e. no bits are lost.
Bit subfields:-
o IBITS(m,i,len) provides, right justified, the value of the
len bits of the argument m , starting from position i .
o MVBITS(m,i,len,n,j) moves len bits of argument
m , starting at position i , to the argument n , starting at position
j. All other bits of n are left untouched. The arguments m and n may
refer to the same numeric storage unit.
Bit testing:-
o IBSET(n,i) has the value of the argument n with bit
i set to 1.
o IBCLR(n,i) has the value of the argument n with bit i set to 0.
Example of bit string function
o NTUPLE/SCAN 30 IAND(XTYPE,B'10101').EQ.B'00101'
Operand: B - Result: Bo (Bit testing)
o BTEST(m,i) has the value 'TRUE' if bit i of argument n is set,
and 'FALSE' otherwise.
- Other features
Wild-characters are allowed in character strings. The wild-character is
represented by '?' to replace any single character and a '*' to replace
any number of characters (including no characters). For example:
- '?A*' = 'PAW' or 'bAcK' or any string of two or more characters, with
the second character being 'A'.
- '*B' = 'B' or 'RoB' or any string that ends in 'B', with any number
of characters preceding the 'B'.
- '????' = 'ABCD' or 'abcd' or any string with exactly four characters.
More than one wild-character can be used in a string and they can be
placed in any position. A standard substring selection notation
STRING(j:k) is allowed in character strings. (where j and k are integers
and 1<=j<=k) Example: If Ntuple of type character NAME = 'BOB' then
- NAME(1:2)='BO' will be true NAME(1:)='BOB' will also be true
Mixed mode expressions are not allowed. For example, if X is of type
Integer (X*'TRUE') are not permitted. Complex expressions can be built
using the various operands and operators. The result of one operation
can be the operand for the next operator, but the data types must be
compatible.
-
KUIP
----
A large fraction of KUIP has been rewritten in C. The new version is
intended to be (mostly) backwards compatible to the old one but because
of the large amount of new code involved we cannot exclude that some
incompatibilities remain. We want to urge all users to test their KUMAC
files with the PAW version in the new area before it goes into production.
At the moment the following features are not yet fully implemented:
DEFAULTS -AUTO
MANUAL in SGML and plain TeX
STYLE GP
TRACE WAIT
system functions for STYLE GP ($KEYNUM, $KEYVAL)
Known incompatibilities:
- Alias names may contain only letters, digits, @-signs and underscores.
(If someone can make a strong case that this is too restrictive,
let us know; we can still consider going back to the old scheme.)
- The commands /KUIP/LISTHELP and /KUIP/SET_SHOW/MODE have been removed.
Improvements:
- There is no limit on the number of aliases anymore.
Since KUMAC variables are treated internally as a special kind of
alias complex macros could hit the limit of 200 aliases before.
- The HELP command recognises now abbreviations for sub-menu names.
E.g. HELP H/OP works now while before HELP HISTOGRAM/OPERATIONS had
to be spelled out.
- The HELP command does a simple text formatting. The line length is
controlled by /KUIP/SET_SHOW/COLUMNS.
- The HELP -EDIT option is now implemented for all systems.
A new command /KUIP/SET_SHOW/HOST_PAGER defines the pager used to
display the help text. E.g. on a Unix workstation define
HOST_PAGER 'xterm -e view &' to display the help text in a
separate window.
- A new command /KUIP/SET_SHOW/FILECASE allows now to select the case
sensitivity for filenames on Unix systems. Before this functionality
was hidden as STYLE '-FILECASE ON'.
- A new command /KUIP/SET_SHOW/RECALL_STYLE to define the command recall
and editing style. There is a choice between ksh/emacs-like binding
and the key definitions used by DCL command line editing on VAX/VMS.
Errors corrected
----------------
- An error in SIGMA on the ORDER command has been corrected.
HIGZ-HPLOT
----------
1) Improvements in histogram plotting:
-------------------------------------
-- Many improvements in the axis drawing routines:
a) The routine used to optimise the axis labels has been
modified in order to have better automatic labelling.
b) The second and third levels of tick marks are now optimised
like the first level.
c) In the case of logarithmic axis, intermediate divisions
are drawn if less than one decade is requested.
-- The option '+' in the command HISTO/PLOT works now on histograms
subranges.
Ex.
PAW > H/PLOT 10(1:20)
PAW > H/PLOT 20(11:30) + | Draw the channels 11 to 30 of the
| histogram 20 above the channels 1 to 20
| of the histogram 10.
This mechanism works also in LOG scale.
-- Bug fixed in the command OPTION: LINY was not correctly reset with
OPTION *.
-- The command HIST/PLOT is able to draw the Multiquadratic fits
produced by the SMOOTH command as a contour plot above the normal
scatter plot of a bi-dimensional histogram.
-- The SET command is now able to manage all the IGSET options. i.e.
if the requested option is not available under SET, it is passed to
the IGSET command for possible processing.
-- HBOOK is now able to manage histograms with alphanumeric binnings.
The HPLOT package has been changed in order to plot automatically
these new labels.
-- With OPTION ZFL1, the same picture name ('PICT00') is
used for every new picture.
-- It is now possible to specify with one SET command both
the border and the inside color for the Histogram, Box
Page, and Function (HCOL, BCOL, PCOL, FCOL).
Ex:
+---- The Histogram is filled
|+--- The border color is 2
||++- The inside color is 3
||||
VVVV
PAW > SET HCOL 1203
The same mechanism is also available for FCOL, BCOL and PCOL.
2) Graphics improvements:
--------------------------
-- In the X11 version of PAW, the graphics window is raised only if
some graphics has been produced, i.e. if the execution of a command
or a macro doesn't produce any graphics, the graphics window is not
raised. In the previous version the graphics window was raised
after each command.
3) PostScript improvements:
---------------------------
-- The PostScript text is now fully compatible with the escape characters
of the TEXT command (see the PAW manual):
+--------------------------------------------------------------------------+
| List of escape characters and their meaning |
+---+----------------------------------+---+-------------------------------+
| < | go to lower case (optional) | > | go to upper case (optional) |
+---+----------------------------------+---+-------------------------------+
| [ | go to greek (Roman = default) | ] | end of greek |
+---+----------------------------------+---+-------------------------------+
| " | go to special symbols | # | end of special symbols |
+---+----------------------------------+---+-------------------------------+
| ~ | go to ZapfDingbats | # |end of ZapfDingbats |
+---+----------------------------------+---+-------------------------------+
| ^ | go to superscript | ? | go to subscript |
+---+----------------------------------+---+-------------------------------+
| ! | go to normal level of script | & | backspace one character |
+---+----------------------------------+---+-------------------------------+
| $ | termination character (optional) |
+---+----------------------------------------------------------------------+
The control characters can be escaped with '@'.
Ex.
PAW > ITX 1. 1. '[abc]' | print (in the PS file) "abc" in Greek
| characters
PAW > ITX 1. 1. '@[abc@]' | print "[abc]" (in the PS file)
-- Bug fixed: the PostScript marker size is now correct if several
pictures are produced in the same file.
4) PAW Commands improvements:
-----------------------------
* NTUPLE/PLOT IDN [ UWFUNC NEVENT IFIRST NUPD OPTION ]
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=1000000
OPTION C 'Options' D=' '
New Possible OPTION values are:
C Draw a smooth curve.
S Superimpose plot on top of existing picture.
+ Add contents of IDN to last plotted ntuple.
B Bar chart format.
L Connect channels contents by a line.
P Draw the current polymarker at each channel or cell.
* Draw a * at each channel.
U Update channels modified since last call.
E Draw error bars with current marker.
A Axis labels and tick marks are not drawn.
' ' Draw the ntuple as an histogram.
PROF Fill a Profile histogram (mean option).
PROFS Fill a Profile histogram (spread option).
The options PROF and PROF can be used to produce a profile histogram,eg.
Ntuple/plot id.y%x ! ! ! ! PROFS
or Ntuple/plot id.sqrt(y)/x**2 option=PROF
* HISTOGRAM/FIT ID FUNC [ CHOPT NP PAR STEP PMIN PMAX ERRPAR ]
When the options 'B','L','E' are given, they do not have an effect
on the graphics output. To select the MINOS error evaluation (option E)
and the graphics option 'E' , select CHOPT=EE.
* /NTUPLE/CUTS CUTID [ OPTION FNAME ]
CUTID C 'Cut identifier'
OPTION C 'Options' D='P' R='G,P,-,R,W,D'
FNAME C 'File name' D=' '
Possible OPTION values are:
G Define a new cut CUTID using graphics input on the latest
1-Dim or 2-Dim projection of the Ntuple. For a 1-Dim projection,
give 2 points cutmin, cutmax. For a 2-Dim projection, give up to
20 points to delimit the selected area. The polygon will
automatically be closed by PAW.
P Print definition of cut CUTID.
- Reset cut CUTID.
R Read definition of cut CUTID from file FNAME.
W Write definition of cut CUTID on file FNAME (text file).
D Draw cut contour.
Define the CUTID with the format $nn, where nn is an integer
between 1 and 99. This cut can then be used in subsequent commands
NTUPLE/PLOT, PROJECT.
OPTION='expression' allows to define the cut CUTID. For example
the command:
PAW > CUTS $1 X<0.8.and.Y IGSET NCOL 8 | Define the number of colours
PAW > PALETTE 1 | The palette 1 is filled with
| 8 elements: 0,5,7,3,6,2,4,1
PAW > IGSET NCOL 4 | Define the number of colours
PAW > PALETTE 1 | The palette 1 is filled with
| 4 elements: 0,5,7,3
b) If NCOL is greater than 8, the palette is filled
with colours varying continuously from blue to red. This is
called a "geographical palette".
Examples:
PAW > IGSET NCOL 16 | Define the number of colours
PAW > PALETTE 1 | Fill palette 1 with 8 elements
| (8,9,10,11,12,13,14,15) varying
| continuously from blue to red
Note that after the command IGSET NCOL, the color indices from
8 to NCOL are set with gray levels. The command PALETTE 1
reset the same indices with a "geographical palette" varying
continuously from blue to red.
* HISTOGRAM/OPERATIONS/SMOOTH ID [ OPTION SENSIT SMOOTH ]
ID C 'Histogram or Ntuple Identifier'
OPTION C 'Options' D='2M'
SENSIT R 'Sensitivity parameter' D=1. R=0.3:3.
SMOOTH R 'Smoothness parameter' D=1. R=0.3:3.
Possible OPTION values are:
0 Replace original histogram by smoothed.
1 Replace original histogram by smoothed.
2 Store values of smoothed function and its parameters without replacing
the original histogram (but see note below) - the smoothed function
can be displayed at editing time - see HISTOGRAM/PLOT.
M Invoke multiquadric smoothing.
Q Invoke the 353QH algorithm.
S Invoke spline smoothing.
V Verbose (default for all except 1-D histogram).
N Do not plot the result of the fit.
Smooth a histogram or "simple" ntuple. ("simple" = 1, 2, or 3 variables.)
For multiquadric smoothing, SENSIT controls the sensitivity to statistical
fluctuations. SMOOTH controls the (radius of) curvature of the
multiquadric basis functions.
Note: 1) The multiquadric basis functions are SQRT(R**2+D**2), where R is
the distance from the "centre", and D is a scale parameter and
also the curvature at the "centre". "Centres" are located at
points where the 2nd differential or Laplacian of event density
is statistically significant.
2) The data must be statistically independent, i.e. events (weighted
or unweighted) drawn randomly from a parent probability
distribution or differential cross-section.
For spline smoothing, SENSIT and SMOOTH control the no. of knots (= 10 *
SENSIT) and degree of splines (= SMOOTH + 2) (thus if SENSIT and SMOOTH are
at their default values a 10-knot cubic spline is used).
Note: 1) The spline option ALWAYS replaces the contents of a 2-D histogram.
(Also chi-squared is unavailable in this case.)
2) Use the SPLINE command for more flexibility.
5, NEW PAW commands
===================
* PICTURE/PRINT [ FILE ]
FILE C 'File name' D=' '
Print the current picture. The current picture is transformed into a
printable file. The file type is defined according to the extension of
the file name i.e.
FILE = filename.ps A PostScript file is generated (-111)
FILE = filename.eps A Encapsulated PostScript file
is generated (-113)
FILE = filename.tex A LaTex file is generated (-778)
Do HELP META for details about the metafile types. Note that a new picture
is automatically created for each new plot if the OPTION ZFL1 is on.
If FILE=HIGZPRINTER or FILE=' ' the PostScript file paw.ps (-111) is
generated and the operating system command defined by the environment
variable HIGZPRINTER is executed.
The environment variable HIGZPRINTER should be defined as follow:
On UNIX systems:
setenv HIGZPRINTER 'lp -dprinter_name paw.ps'
or
export HIGZPRINTER='lp -dprinter_name paw.ps'
On VAX/VMS sytems:
HIGZPRINTER == "XPRINT paw.ps /PRINTER=printer_name"
On CERNVM:
setenv HIGZPRINTER 'XPRINT PAW PS (PR printer_name'
Note that if the environment variable HIGZPRINTER is not defined the file
paw.ps is created but not printed.
* NTUPLE/DRAW IDN [ VALUE OPTION ]
IDN C 'Ntuple Identifier'
VALUE C 'Isosurface value (for 3-D)' D='0'
OPTION C 'Options' D=' '
Draw a simple ntuple (1, 2 or 3 variables). For simple ntuples, with 1, 2
or 3 variables per event, this command will draw a histogram with HPLOT
options. If the ntuple has an associated functional representation,
as the result, e.g., of using SMOOTH, it will also draw the function.
No selections are allowed.
For 3-variable ntuples which have been SMOOTHed, give a VALUE for the
isosurface of event density. If VALUE=0, an isosurface
value half way between the minimum and maximum fitted smoothing function
values will be used.
* NTUPLE/WAVE IDN [ LUN ]
IDN C 'Ntuple Identifier'
LUN I 'Logical unit no.' D=-1
Produce a formatted file suitable for Wavefront's Data Visualiser.
Only for simple 3-variable ntuples which have been SMOOTHed.
A file with logical unit no. LUN must previously have been opened with
the FORTRAN/FILE command.
A new set of commands to produce Feynman diagrams is now available.
This is a first implementation which may be changed in the future
according to the users needs and suggestions.
* GRAPHICS/PRIMITIVES/HELIX [ X1 Y1 X2 Y2 R WI PHI ]
X1 R 'X coordinate of the begin of helix' D=0.
Y1 R 'Y coordinate of the begin of helix' D=0.
X2 R 'X coordinate of the end of helix' D=10.
Y2 R 'Y coordinate of the end of helix' D=10.
R R 'Radius of helix' D=.3
WI R 'Number of turns ' D=1.
PHI R 'Projection angle ' D=15.
Plots an helix on current page Feynman graph: gluon phi = 30,
photon phi = 0.
* GRAPHICS/PRIMITIVES/ARCHELIX [ X1 Y1 X2 Y2 R WI PHI RL ]
X1 R 'X coordinate of the begin of helix' D=0.
Y1 R 'Y coordinate of the begin of helix' D=0.
X2 R 'X coordinate of the end of helix' D=10.
Y2 R 'Y coordinate of the end of helix' D=10.
R R 'Radius of helix' D=.3
WI R 'Number of turns ' D=1.
PHI R 'Projection angle ' D=30.
RL R 'Radius of loop ' D=15.
Plots an helix on current page Feynman graph: gluon phi = 30,
photon phi = 0.
* GRAPHICS/PRIMITIVES/ARLINE [ X1 Y1 X2 Y2 H ]
X1 R 'X coordinate of the begin' D=0.
Y1 R 'Y coordinate of the begin' D=0.
X2 R 'X coordinate of the end' D=10.
Y2 R 'Y coordinate of the end' D=10.
H R 'arrow size' D=.5
Line with arrow (fermion line)
* GRAPHICS/PRIMITIVES/FPOINT [ X Y R ]
X R 'X ' D=0.
Y R 'Y ' D=0.
R R 'Radius ' D=.5
Draw filled point (vertex)
Example:
Macro EXAMPLE
next
* c-c system
Arline 13 8 10 8 .3
Arline 10 10 13 10 .3
Arline 10 8 10 10 .3
* proton
Arline 4 5 8.5 5 .3
Arline 4 5.5 8.5 5.5 .3
Arline 4 6 8.5 6 .3
Line 8.5 6 13 4.5
Line 8.5 5 13 5
Line 8.5 5.5 13 5.5
* gluon
Helix 10 8 8.5 6 .3 7 30
*lepton
Arline 4 13 8 12 .3
Arline 8 12 13 13 .3
* photon
Helix 8 12 10 10 .1 4 0
* vertex
Fpoint 8 12 .1
Fpoint 10 10 .1
Fpoint 10 8 .1
Fpoint 8.5 6 .1
Itx 12.5 10.1 'c'
Line 12.55 8.45 12.7 8.45
Itx 12.5 8.1 'c'
Itx 12.5 13.1 'e^-!'
Itx 4.5 13.1 'e^-!'
Itx 4.5 6.2 'P'
Itx 9.3 11.1 '[g]'
Itx 9.5 6.8 'g'
*
Return
6, Restrictions for the use of new ntuples
==========================================
The following commands cannot yet process the new style ntuples:
Ntuple/Create
Ntuple/Read
Ntuple/Merge
Ntuple/Lintra
When structures are defined within a ntuple, the only way to access
these structures is via a COMIS function. In this case, however,
the skeleton function may be generated via the command UWFUNC.
7, New HBOOK routines
=====================
The following routine HQUAD is part of the HBOOK system.
HQUAD (implemented by J.Allison OPAL/Manchester) is automatically called
in PAW by the existing command SMOOTH (see above).
***************************************************************
* CALL HQUAD (ID,CHOPT,MODE,SENSIT,SMOOTH,NSIG*,CHISQ*,NDF*, *
* FMIN*,FMAX*,IERR*) *
***************************************************************
Action: fit multiquadric radial basis functions to the bin contents of a
histogram or the event density of an ntuple.
(For ntuples this is currently limited to ``simple'' ones, i.e., with 1, 2 or 3
variables; all events are used - no selection mechanism is implemented. Thus
the recommended practice at the moment is to create a ``simple'' ntuple and
fill it from your ``master'' ntuple with the NTUPLE/LOOP command and an
appropriate SELECT.FOR function.)
Input parameters:
ID histogram or ntuple ID.
CHOPTQ character variable containing option characters:
0 or 1: replace original histogram by smoothed.
2: do not replace original histogram but store values of smoothed
function and its parameters. (The fitted function is regenerated
from the values or the parameters with the FUNC option in
HISTOGRAM/PLOT for histograms or with NTUPLE/DRAW for ntuples.)
V: verbose.
MODE mode of operation
3, find significant points and perform unconstrained fit. If
the histogram or ntuple is unweighted perform a Poisson likelihood
fit, otherwise a least squares fit (see MODE = 4).
4, force an unconstrained least squares fit in all cases.
(This is a linear least squares problem and therefore the most
efficient possible since it allows a single step calculation of the
best fit and covariances. But note it assumes Gaussian errors,
even for low statistics, including the error on zero being 1.)
MODE = 0 is equivalent to MODE = 3.
SENSIT a sensitivity parameter. It controls the sensitivity to statistical
fluctuations (see Remarks).
SENSIT = 0. is equivalent to SENSIT = 1.
SMOOTH a smoothness parameter. It controls the (radius of) curvature of the
multiquadric basis functions.
SMOOTH = 0. is equivalent to SMOOTH = 1.
Output parameters:
NSIG no. of significant points or centres found, i.e., no. of basis
functions used.
CHISQ chi-squared (see Remarks).
NDF no. of degrees of freedom.
FMIN minimum function value.
FMAX maximum function value.
IERR error flag, 0 if all's OK. (Hopefully helpful error messages are
printed where possible.)
Remark:
o Empty bins are taken into account. (Poisson statistics are used for the
unweighted case.)
o The multiquadric basis functions are $\sqrt{r^2+\Delta^2}$, where $r$ is
the radial distance from its ``centre'', and $\Delta$ is a scale
parameter and also the curvature at the ``centre''. ``Centres'', also
referred to as ``significant points'', are located at points where the
2nd differential or Laplacian of event density is statistically
significant.
o The data must be statistically independent, i.e., events (weighted or
unweighted) drawn randomly from a parent probability distribution or
differential cross-section, e.g., you cannot further smooth a previously
smoothed distribution.
o For histograms, the chi-squared (CHISQ) is that of the fit to the
original histogram assuming Gaussian errors on the original histogram
even for low statistics, including the error on zero being 1. It is
calculated like this even for a Poisson likelihood fit; in that case the
maximum likelihood may not correspond to the minimum chi-squared, but
CHISQ can still be used, with NDF (the no. of degrees of freedom), as a
goodness-of-fit estimator. For ntuples, an internally generated and
temporary histogram is used to calculate CHISQ in the same way.
The following routine HDIFFB (from the D0 group) is part of HBOOK.
******************************************************
* CALL HDIFFB(ID1,ID2,TOL,NBINS,CHOPT,NBAD*,DIFFS*) *
******************************************************
Authors:R. J. Genik II, J. McKinley, J. McCampbell, J. Linnemann,
D. Gilliland
Compare two histograms, bin by bin
ID1 the first histogram to be compared. The "reference" histogram
in options A and C.
ID2 the second histogram to be compared. The "data" histogram in
options A and C.
ID1, ID2 are a pair of 1, 2-dim, or profile histograms booked with
the same number of bins.
TOL is the tolerance for a passing the test.
Under options S and C, TOL is a number between 0 and 1 which
represents the smallest probability considered as an acceptable
match. Thus TOL is the fraction of bins expected to fail by
chance if ID1 and ID2 are drawn from the same distribution.
Under option A, TOL is the degree of precision of match
required for the test to be considered as passed, e.g. TOL=2.0
would mean that the value from the data bin had to be within 2
times the reference error of the reference mean to be considered
as compatible.
NBINS is the number of bins in the comparison (the size of the 1d
histogram, plus 0, 1 or 2, depending on whether the overflow and
underflow channels are included). For a 2-dim histogram, this
will have the total bins (X * Y) plus room for overflow bins
along any of the axes.
The input value is the dimension of the user-supplied DIFFS
array.
CHOPT is a string allowing specification of the following options:
The default (no options selected) is for option S (statistical
comparison), ignoring all underflow and overflow bins, and
automatically correcting for the difference in events between ID1
and ID2. No such correction is done for profile histograms.
N Use the absolute contents of each histogram, thus including the
normalisation of the histogram as well as its shape in the
comparison.
D Debug printout, dumps the critical variables in the comparisons,
along with indicators of its weight, etc.
O Overflow, requests that overflow bins be taken into account.
U Underflow, requests that underflow bins be taken into account.
R Right overflow bin. For a 2-D histogram, it includes the X-Axis
overflow bin in the comparisons. If the O option is used, this
is automatic.
L Left underflow bin. Same as above, but the X-Axis underflow is
used. The U option uses this automatically.
T Top overflow bin. Same as R but for the Y-Axis
B Bottom underflow bin. Option L for the Y-Axis
S Statistical comparison. For standard 1-D histograms, calculates
the probability that both bins were produced from
a Poisson distribution with the same mean. For large statistics,
R and D greater than 25, the mean for each bin is the average of
the bin contents of ID1, ID2, adjusted for scaling (not adjusted
for scaling if option 'N' is selected). For small statistics, the
unbiased ultimately most powerful comparison is made. This
returns the confidence level that the two bins came from a
Poisson distribution with the same mean. For a profile
histogram, calculates t test probability that both bin means
were produced from a population with the same mean.
This probability is referred to in TOL and DIFFS.
The S option should be used when comparing two sets of data.
Using the S option when comparing data to a function or known
reference yields poor results. In this case, the C option should
be selected.
C Compatibility test. Calculates the probability that the data
(from ID2) was produced from a distribution with the mean and
error in the bin of the reference histogram (ID1). The test
is for Poisson statistics for 1-D histogram, Gaussian
statistics for profile histograms. The C option should be used
when comparing data to either a function, or a known reference or
calibration distribution.
A Absolute test. Here the test is on the number of standard
deviations by which the data from ID2 deviates from the
reference histogram (ID1) mean. The standard deviation is
taken from ID1. TOL is the number of standard deviations, rather
than a probability.
An arbitrary tolerance interval may be formed by using HPAK
and HPAKE to fill the reference histogram; asymmetric intervals
may be implemented by setting TOL to 1.0 and choosing the error
and "mean" so that the allowed interval corresponds to +/- 1.0
standard deviations.
Z Ignore in the comparison any bins with zero contents in ID1.
The default action is to consider all bins as significant.
NBAD* is the number of bins failing the compatibility test according
to the criteria defined by TOL and CHOPT.
DIFFS* is an array of length the number of bins being compared, which
gives the results of the test bin by bin (probabilities for
options S and C, deviations for A). The results are passed back
in the form:
1-D: DIFFS(NX) for no over or under flow or DIFFS(0:NX+1), for
for overflow and/or underflow.
2-D: DIFFS(NX,NY) or DIFFS(0:NX+1, 0:NY+1).
Errors reported by HDiffB:
Warning: Zero tolerance.
The passed value TOL is equal to 0.
Warning: Only one comparison at a time, please.
More than one type of comparison was selected. Only one of options S, C,
and A may be used at a time. This is only a warning and the test defaults
to the S mode.
Warning: Different binning.
The XMin values for a 1-dim histogram or the XMin and/or YMin values on a
2-dim histogram are different. This may give inaccurate results.
Warning: Weighted or saturated events in 2-dimensions.
HBook does not compute error bars for two dimensional histograms, thus
weighted event are not allowed, and HDIFFB can not compute the correct
statistics. An answer is still given, but it is probably not right.
Integral is zero!
The sum of the content bins is zero.
Both histograms must be the same dimension.
A 1-dim and a 2-dim histogram have been specified. In order for the
routine to work, both must be the same dimension.
Both histograms must be the same type.
Two different types of histograms have been specified. Both must be
profile or non-profile, you can not have a mix.
Not enough bins DIFF to hold result.
The parameter NBINS is less that the number of bins in the histograms.
Number of channels is different.
The number of channels in the two histograms to compare are different. They
must be the same before the routine will process the data.
U/O/L/R/T/B Option with weighted events.
HBook does not compute an error bar for over-/under-flow bins, thus it may
not be used with weighted events.
Weighted options and no HBarX.
The user had not told HBook to figure the error bars for the histograms.
Therefore, the operations will not be valid.
Both histograms must be the same, weighted or unweighted.
As it states, the histograms must be of the same type.
Statistical comments:
The methods used for the S and C mode are correct for unweighted events and
Poisson statistics for 1 or 2 dimensional histograms. For weighted events,
a Gaussian approximation is used, which results in DIFFS values which are
too low when there are fewer than 25 or so "equivalent events" (defined
under HSTATI.) per bin. This is caused by either few entries or by wide
fluctuation in weights. The result is that HDIFFB rejects to many bins in
this case.
Comparisons for profile histograms assume Gaussian statistics
for the S and C mode comparisons of the channel mean. Fewer that 25 or so
events will result in DIFFS values which are too large. The result is
that HDIFFB rejects too many event in these low statistic cases.
The HTONEW conversion program
==============================
PROGRAM HTONEW
*
* Program to convert old format HBOOK files into new format
* New files are by default in RZ Exchange mode
* Old format ntuples are converted into new format
*
* Note that executable modules of this program are already
* available on the CERN machines.
*
*
PARAMETER (MXBOOK=1000000)
COMMON/PAWC/ PAW(MXBOOK)
COMMON/QUEST/ IQUEST(100)
COMMON/HINFO/LRECL
*
CHARACTER*80 FILE, FILOUT,FILIN
*
EXTERNAL CONVERT
*
*===========================================================
*
CALL HLIMIT(MXBOOK)
*
* Get input file name
WRITE(6,10000)
10000 FORMAT(' Give input file name ==>')
FILE = ' '
READ(5,'(A)')FILIN
NCH=LENOCC(FILIN)
IF (NCH.EQ.0) THEN
WRITE (6,'('' No INPUT file. Job aborted'')')
GO TO 20
ENDIF
* Get output file name
FILOUT = ' '
WRITE(6,10100)
10100 FORMAT(' Give output file name ===>')
READ(5,'(A)')FILOUT
IF(LENOCC(FILOUT).LE.0) THEN
WRITE (6,'('' No OUTPUT file. Job aborted'')')
GO TO 20
END IF
*
*
10 CONTINUE
*
*-* Create directory //PAWC/OLDF to store old ntuples
CALL HMDIR('OLDF',' ')
*-* Open old file and get record length
LRECL=1024
CALL HROPEN(1,'OLDF',FILIN,' ',LRECL,ISTAT)
LRECL=IQUEST(10)
IF(ISTAT.NE.0) THEN
WRITE (6,'('' FILE : '',A80,'' CANNOT BE OPENED'')') FILIN(1:
+ LENOCC(FILIN))
GO TO 20
END IF
*
*-* Create new file
IQUEST(10) = 64000
print *,' Creating new file with LRECL=',lrecl,' words'
CALL HROPEN(2,'NEWF',FILOUT(1:LENOCC(FILOUT)),'QN',LRECL,ISTAT)
IF(ISTAT.NE.0) THEN
WRITE (6, '('' FILE : '',A80, '' CANNOT BE CREATED'')')
+ FILOUT(1:LENOCC(FILOUT))
GOTO 20
END IF
*
*
*-* Convert
CALL HCDIR('//OLDF',' ')
CALL RZSCAN (' ', CONVERT)
CALL HREND ('NEWF')
CLOSE (2)
CALL HREND ('OLDF')
CLOSE (1)
*
WRITE (6,'('' Conversion completed'')')
*
* Abnormal end
20 CONTINUE
*
END
SUBROUTINE CONVERT (CDIR)
*
CHARACTER*(*) CDIR
*
*KEEP,HCBOOK.
INTEGER NWPAW,IXPAWC,IHDIV,IXHIGZ,IXKU, LMAIN
REAL FENC , HCV
COMMON/PAWC/NWPAW,IXPAWC,IHDIV,IXHIGZ,IXKU,FENC(5),LMAIN,HCV(9989)
INTEGER IQ ,LQ
REAL Q
DIMENSION IQ(2),Q(2),LQ(8000)
EQUIVALENCE (LQ(1),LMAIN),(IQ(1),LQ(9)),(Q(1),IQ(1))
INTEGER HVERSN,IHWORK,LHBOOK,LHPLOT,LGTIT,LHWORK,
+LCDIR,LSDIR,LIDS,LTAB,LCID,LCONT,LSCAT,LPROX,LPROY,LSLIX,
+LSLIY,LBANX,LBANY,LPRX,LPRY,LFIX,LLID,LR1,LR2,LNAME,LCHAR,LINT,
+LREAL,LBLOK,LLBLK,LBUFM,LBUF,LTMPM,LTMP,LTMP1,LHDUM ,LCIDN
COMMON/HCBOOK/HVERSN,IHWORK,LHBOOK,LHPLOT,LGTIT,LHWORK,
+LCDIR,LSDIR,LIDS,LTAB,LCID,LCONT,LSCAT,LPROX,LPROY,LSLIX,
+LSLIY,LBANX,LBANY,LPRX,LPRY,LFIX,LLID,LR1,LR2,LNAME,LCHAR,LINT,
+LREAL,LBLOK,LLBLK,LBUFM,LBUF,LTMPM,LTMP,LTMP1,LHDUM(10),LCIDN
*
INTEGER KNCX ,KXMIN ,KXMAX ,KBWIDX ,KMIN ,KMAX ,KNORM ,
+ KTIT1 ,KNCY ,KYMIN ,KYMAX ,KBWIDY ,KSCAL2 ,
+ KTIT2 ,KNBIT ,KNOENT ,KSTAT1 ,KNSDIR ,KNRH ,
+ KCON1 ,KCON2 ,KBITS ,KNTOT
PARAMETER(KNCX=3,KXMIN=4,KXMAX=5,KBWIDX=6,KMIN=7,KMAX=8,KNORM=9,
+ KTIT1=10,KNCY=7,KYMIN=8,KYMAX=9,KBWIDY=10,KSCAL2=11,
+ KTIT2=12,KNBIT=1,KNOENT=2,KSTAT1=3,KNSDIR=5,KNRH=6,
+ KCON1=9,KCON2=3,KBITS=1,KNTOT=2)
parameter (kip1=20)
*
*KEND.
*
COMMON/QUEST/ IQUEST(100)
*
COMMON/HINFO/LRECL
*
CHARACTER*80 TITLE, RDIR
*
parameter (nev=1000)
parameter (nmax=500)
parameter (nbvmax=40)
parameter (ntotmax=500000)
dimension x(nmax,nev)
common/event/y(nmax)
dimension iy(nmax)
equivalence (y(1),iy(1))
character*8 tags(nmax),tag1,bname
character*1300 chform
character*1 type
dimension rlow(nmax),rhigh(nmax)
*
*
*
WRITE (6, '('' Processing directory: '',A)')
+ CDIR(1:LENOCC(CDIR))
*
RDIR = CDIR
RDIR(3:6) = 'NEWF'
JLS = ICFILA ('/', CDIR, 1, LENOCC(CDIR))
IF (JLS .GT. 2) THEN
CALL HMDIR (RDIR, ' ')
END IF
*
*-* Loop on all keys in file (order of creation)
NKEY = 50000
DO 80 M = 1, NKEY
CALL HCDIR (CDIR, ' ')
CALL RZINK (M, 0, 'S')
IF (IQUEST(1) .NE. 0) GO TO 999
IF (JBIT (IQUEST(14),4) .NE. 0) GO TO 80
IDN = IQUEST(21)
CALL HRIN(IDN,999,0)
IF(IQUEST(1).NE.0) THEN
WRITE (6,'('' NTUPLE OR HISTO '',I10,'' CANNOT BE READ'')')
+ IDN
GO TO 90
END IF
IF (JBIT (IQ(LCID+KBITS),4) .NE. 0) THEN
*-* ntuple
*-* First read the specs of old ntuple
NVAR = NMAX
CALL HGIVEN(IDN,TITLE,NVAR,TAGS,RLOW,RHIGH)
call hnoent(idn,noent)
ntotal=min(ntotmax,noent)
CALL HDELET(IDN)
*-* Change directory to new file. Create new ntuple
*-* Put a maximum of NBVMAX variable per block (hbname)
*-* Blocks are labelled Block1,Block2,etc.
*-* Buffer size per column is set to (nwpaw-100000)/nvar or lrecl-15 words
nwbuf1=(nwpaw-100000)/nvar
nwbuf=nwbuf1
if(nwbuf1.gt.lrecl-15)nwbuf=lrecl-15
if(nwbuf1.gt.2*lrecl-15)nwbuf=2*lrecl-15
call hbset('BSIZE',nwbuf,ierr)
print *,' Converting ntuple:',idn,' Bsize =',nwbuf,' words'
call hcdir(rdir,' ')
*-* We want to force new ntuple record to start at word 1 of a new record
lrzcdir=iquest(11)
iq(lrzcdir+kip1)=lrecl+1
call rzmods('CONVER',ierr)
call rzsave
CALL HBNT(IDN,TITLE,' ')
chform=' '
icold=1
nbn=0
type='R'
do 10 i=1,nvar
tag1=tags(i)
if(tag1.eq.' ')then
write(tag1,30000)i
30000 format('VAR',I3)
if(tag1(4:4).eq.' ')tag1(4:4)='0'
if(tag1(5:5).eq.' ')tag1(5:5)='0'
endif
nch=lenocc(tag1)
icnew=icold+nch+2
chform(icold:icnew)=tag1(1:nch)//':'//type//','
if(mod(i,nbvmax).eq.0.or.i.eq.nvar)then
nbn=nbn+1
write(bname,10000)nbn
10000 format('Block',i1)
ibl=(nbn-1)*nbvmax +1
call hbname(idn,bname,y(ibl),chform(1:icnew-1))
icnew=0
chform=' '
endif
icold=icnew+1
10 continue
*
*
*-* Now loop to fill new ntuple.
*-* To avoid changing directory too frequently, buffer NEV events in memory
do 60 i=1,ntotal,nev
call hcdir('//PAWC/OLDF',' ')
call hcdir(cdir,' ')
do 20 j=1,nev
k=i+j-1
if(k.gt.ntotal)go to 30
call hgn(idn,nidn,k,x(1,j),ierror)
20 continue
30 continue
call hcdir('//PAWC',' ')
call hcdir(rdir,' ')
do 50 j=1,nev
k=i+j-1
if(k.gt.ntotal)go to 70
do 40 l=1,nvar
y(l)=x(l,j)
40 continue
call hfnt(idn)
50 continue
60 continue
70 continue
*-* save new ntuple header onto file
call hrout(idn,icycle,' ')
call hdelet(idn)
call hcdir('//PAWC/OLDF',' ')
call hdelet(0)
call hcdir('//PAWC',' ')
ELSE
*-* Histogram
call hcdir(rdir,' ')
call hrout(idn,icycle,' ')
CALL HDELET(IDN)
END IF
80 CONTINUE
90 CONTINUE
*
999 END
Paw.Support@cern.ch