+TITLE. * MN_UTIL 1.12/34 17/09/2003 10.56.05 +PATCH,CDES. +DECK,mn_logic. +KEEP,MN_LOG1,IF=VMS. $! Define Logicals and set up default names $! +KEEP,MN_LOGIC,IF=VMS,IF=L3,IF=@DEV. +SEQ,MN_LOG1. $ @usr0:[brock]mn_fit_logical +KEEP,MN_LOGIC,IF=VMS,IF=L3,IF=-@DEV. +SEQ,MN_LOG1. $ @l3daq$gra:mn_fit_logical +KEEP,MN_LOGIC,IF=VMS,IF=BONN. +SEQ,MN_LOG1. $ @axpib$disk1:[brock]mn_fit_logical +KEEP,MN_LOGIC,IF=VMS,IF=ZEUS. +SEQ,MN_LOG1. $ @disk$zof:[brock]mn_fit_logical +KEEP,MN_LOGIC,IF=VMS,IF=CLEO. +SEQ,MN_LOG1. $ do mn_fit_logical +KEEP,MN_LOGIC,IF=VMS,IF=ALEPH,IF=@DEV. +SEQ,MN_LOG1. $ @util$root:[mn_fit.arrivals]mn_fit_logical +KEEP,MN_LOGIC,IF=VMS,IF=ALEPH,IF=-@DEV. +SEQ,MN_LOG1. $ @util$root:[mn_fit]mn_fit_logical +KEEP,MN_LOGIC,IF=VMS,IF=FNAL. +SEQ,MN_LOG1. $ if f$trnlnm("MN_FIT_DIR").eqs."" $ then $ write sys$output "You must do SETUP MN_FIT first" $ exit $ endif +KEEP,MN_LOGIC,IF=VMS,IF=-@SITE. +SEQ,MN_LOG1. $ @mn_fit_com:mn_fit_logical +KEEP,MN_LOG1,IF=UNIX. test -z "$CERN" && CERN=/cern if [ -z "$TVCERN" ]; then CERN_ROOT=$CERN/pro else CERN_ROOT=$CERN/$TVCERN fi export CERN export CERN_ROOT +KEEP,MN_LOG2,IF=UNIX,IF=APOLLO. test -z "$GKS_ROOT" && GKS_ROOT=$CERN/gks/pro export GKS_ROOT +KEEP,MN_LOGMN,IF=UNIX,IF=APOLLO,IF=L3,IF=@DEV. test -z "$MN_FIT" && MN_FIT=/user/brock/mn_fit export MN_FIT CERN=//sys2/cern.v.10.$ISP +KEEP,MN_LOGMN,IF=UNIX,IF=APOLLO,IF=L3,IF=-@DEV. test -z "$MN_FIT" && MN_FIT=/user/brock/mn_fit export MN_FIT CERN=/cern$ISP +KEEP,MN_LOGMN,IF=UNIX,IF=CERNAFS,IF=@DEV. test -z "$MN_FIT" && MN_FIT=/afs/cern.ch/user/b/brock/public/mn_new/`uname -s` export MN_FIT +KEEP,MN_LOGMN,IF=UNIX,IF=CERNAFS,IF=-@DEV. test -z "$MN_FIT" && MN_FIT=/afs/cern.ch/user/b/brock/public/mn_fit/`uname -s` export MN_FIT +KEEP,MN_LOGMN,IF=UNIX,IF=DESYAFS,IF=@DEV. test -z "$MN_FIT" && MN_FIT=/afs/desy.de/user/b/brock/public/mn_new/`uname -s` export MN_FIT +KEEP,MN_LOGMN,IF=UNIX,IF=DESYAFS,IF=-@DEV. test -z "$MN_FIT" && MN_FIT=/afs/desy.de/user/b/brock/public/mn_fit/`uname -s` export MN_FIT +KEEP,MN_LOGMN,IF=UNIX,IF=L3. test -z "$MN_FIT" && MN_FIT=/l3/repository/mn_fit/`uname -s` export MN_FIT +KEEP,MN_LOGMN,IF=UNIX,IF=BONNCIP,IF=@DEV. test -z "$MN_FIT" && MN_FIT=/home/brock/mn_fit/`uname -s` export MN_FIT CERN=/usr/local/Cern +KEEP,MN_LOGMN,IF=UNIX,IF=BONNCIP,IF=-@DEV. test -z "$MN_FIT" && MN_FIT=/usr/local/mn_fit export MN_FIT CERN=/usr/local/Cern +KEEP,MN_LOGMN,IF=UNIX,IF=BONN,IF=@DEV. test -z "$MN_FIT" && MN_FIT=/home/brock/mn_fit/`uname -s` export MN_FIT +KEEP,MN_LOGMN,IF=UNIX,IF=BONN,IF=-@DEV. test -z "$MN_FIT" && MN_FIT=/usr/local/share/mn_fit/`uname -s` export MN_FIT +KEEP,MN_LOGMN,IF=UNIX,IF=ZEUS. test -z "$MN_FIT" && MN_FIT=/home/brock/mn_fit/`uname -s` export MN_FIT +KEEP,MN_LOGMN,IF=UNIX,IF=DECS,IF=CMU. test -z "$MN_FIT" && MN_FIT=/usr/brock/mn_fit export MN_FIT CERN=/CERN +KEEP,MN_LOGMN,IF=UNIX,IF=SGI,IF=CMU. test -z "$MN_FIT" && MN_FIT=/usr0/brock/mn_fit export MN_FIT CERN=/usr0/products/cern +KEEP,MN_LOGMN,IF=UNIX,IF=CLEO,IF=@DEV. test -z "$MN_FIT" && MN_FIT=/cdat/tem/mnfit export MN_FIT +KEEP,MN_LOGMN,IF=UNIX,IF=CLEO,IF=-@DEV. test -z "$MN_FIT" && MN_FIT=/home/mnfit/mn_fit/`uname -s` export MN_FIT +KEEP,MN_LOGMN,IF=UNIX,IF=-@SITE. test -z "$MN_FIT" && MN_FIT=/usr/local/lib/mn_fit export MN_FIT +KEEP,MN_LOGIC,IF=UNIX,IF=APOLLO. +SEQ,MN_LOGMN. +SEQ,MN_LOG1. +SEQ,MN_LOG2. +KEEP,MN_LOGIC,IF=UNIX,IF=-APOLLO. +SEQ,MN_LOGMN. +SEQ,MN_LOG1. +DECK,GRAFPACK. +KEEP,GRAFPACK,IF=VMS. $ tgks = "x" +KEEP,GRAFPACK,IF=UNIX. tgks='x' +DECK,CERNLIB. +KEEP,CERNLIB1,IF=VMS. $! Standard CERN libraries $! +KEEP,CERNLIB,IF=VMS,IF=@CERNLIB. +SEQ,CERNLIB1. $ cernlib $ tcernlib = lib$ +KEEP,CERNLIB,IF=VMS,IF=@CERNNEW. +SEQ,CERNLIB1. $ cernlib/new $ tcernlib = lib$ +KEEP,CERNLIB,IF=VMS,IF=@CERNOLD. +SEQ,CERNLIB1. $ cernlib/old $ tcernlib = lib$ +KEEP,CERNLIB,IF=VMS,IF=@FNAL. +SEQ,CERNLIB1. $ tcernlib = "NPACKLIB_OLB/LIB,KERNLIB_OLB/LIB" +KEEP,CERNLIB,IF=VMS,IF=-@FNAL,IF=-@CERNLIB,IF=-@CERNNEW,IF=-@CERNOLD. +SEQ,CERNLIB1. $ tcernlib = "CERN$LIBRARY:PACKLIB/LIB,KERNLIB/LIB,SYS$LIBRARY:VAXCRTL/LIB" +KEEP,CERNLIB,IF=UNIX. # Standard CERN libraries tcernlib="-L$CERN_ROOT/lib -lpacklib -lkernlib" echo "Cernlib: $tcernlib" +DECK,GRAFLIB. +KEEP,GRAFLIB1,IF=VMS,IF=NAGLIB. $ tcextra = tcextra + ",naglib" +KEEP,GRAFLIB1,IF=VMS,IF=-NAGLIB. +KEEP,GRAFLIBG,IF=VMS,IF=@CERNLIB. $ cernlib pawlib,packlib,mathlib,graflib/noshare,packlib'tcextra' +KEEP,GRAFLIBG,IF=VMS,IF=@CERNNEW. $ cernlib/new pawlib,packlib,mathlib,graflib/noshare,packlib'tcextra' +KEEP,GRAFLIBG,IF=VMS,IF=@CERNOLD. $ cernlib/old pawlib,packlib,mathlib,graflib/noshare,packlib'tcextra' +KEEP,GRAFLIBD,IF=VMS,IF=@CERNLIB. $ cernlib pawlib,packlib,mathlib,graflib/dgks,packlib'tcextra' +KEEP,GRAFLIBD,IF=VMS,IF=@CERNNEW. $ cernlib/new pawlib,packlib,mathlib,graflib/dgks,packlib'tcextra' +KEEP,GRAFLIBD,IF=VMS,IF=@CERNOLD. $ cernlib/old pawlib,packlib,mathlib,graflib/dgks,packlib'tcextra' +KEEP,GRAFLIBX,IF=VMS,IF=@CERNLIB. $ cernlib pawlib,packlib,mathlib,graflib/x11,packlib'tcextra' +KEEP,GRAFLIBX,IF=VMS,IF=@CERNNEW. $ cernlib/new pawlib,packlib,mathlib,graflib/x11,packlib'tcextra' +KEEP,GRAFLIBX,IF=VMS,IF=@CERNOLD. $ cernlib/old pawlib,packlib,mathlib,graflib/x11,packlib'tcextra' +KEEP,GRAFLIB2,IF=VMS,IF=@CERNLIB,@CERNNEW,@CERNOLD. $ if tgks.eqs."g" $ then +SEQ,GRAFLIBG. $ tcernlib = lib$ $ endif $ if tgks.eqs."v" .or. tgks.eqs."d" $ then +SEQ,GRAFLIBD. $ tcernlib = lib$ + ",GKS_ROOT:[LIB]GKSPACK_DEC/LIB" $ endif $ if tgks.eqs."x" $ then +SEQ,GRAFLIBX. $ tcernlib = lib$ $ endif $ if tgks.eqs."p" $ then $ tcernlib = "CERN$LIBRARY:PAWLIB/LIB,packlib/lib," + - "GRAFLIB/LIB,GRAFGKS/LIB,GKS/LIB," + - "CERN$LIBRARY:MATHLIB/LIB,PACKLIB/LIB,KERNLIB/LIB" $ endif +KEEP,GRAFLIB2,IF=VMS,IF=@FNAL. $ tcernlib = "PAWLIB_OLB/LIB," + - "HPLOT_OLB/LIB,HIGZ_OLB/LIB," + - "GENLIB_OLB/LIB,NPACKLIB_OLB/LIB,KERNLIB_OLB/LIB" +KEEP,GRAFLIB2,IF=VMS,IF=@CMU. $ if tgks.eqs."v" .or. tgks.eqs."p" $ then $ tcernlib = "CERN$LIBRARY:PAWLIB/LIB,GRAFLIB/LIB,GRAFLIB_DECGKS/LIB," + - "GENLIB/LIB,PACKLIB/LIB,KERNLIB/LIB" $ endif $ if tgks.eqs."3" $ then $ tcernlib = "CERN$LIBRARY:PAWLIB/LIB,GRAFLIB/LIB,GRAFLIB_DI3000/LIB," + - "MATHLIB/LIB,PACKLIB/LIB,KERNLIB/LIB" $ endif $ if tgks.eqs."x" $ then $ tcernlib = "CERN$LIBRARY:PAWLIB/LIB,GRAFLIB/LIB,GRAFLIB_X11/LIB," + - "MATHLIB/LIB,PACKLIB/LIB,KERNLIB/LIB" $ endif +KEEP,GRAFLIB2,IF=VMS,IF=-@CERNLIB,IF=-@CERNNEW,IF=-@CERNOLD,IF=-@FNAL,IF=-@CMU. $ if tgks.eqs."g" $ then $ tcernlib = "CERN$LIBRARY:PAWLIB/LIB,packlib/lib," + - "GRAFLIB/LIB,GRAFGKS/LIB,GKS/LIB," + - "CERN$LIBRARY:MATHLIB/LIB,PACKLIB/LIB,KERNLIB/LIB" $ endif $ if tgks.eqs."v" .or. tgks.eqs."d" $ then $ tcernlib = "CERN$LIBRARY:PAWLIB/LIB,packlib/lib," + - "GRAFLIB/LIB,GRAFDGKS/LIB," + - "MATHLIB/LIB,PACKLIB/LIB,KERNLIB/LIB" $ endif $ if tgks.eqs."x" $ then $ tcernlib = "CERN$LIBRARY:PAWLIB/LIB,packlib/lib," + - "GRAFLIB/LIB,GRAFX11/LIB,GRAFX11/OPT," + - "CERN$LIBRARY:MATHLIB/LIB,PACKLIB/LIB,KERNLIB/LIB" $ endif $ if tgks.eqs."p" $ then $ tcernlib = "CERN$LIBRARY:PAWLIB/LIB,packlib/lib," + - "GRAFLIB/LIB,GRAFDGKS/LIB," + - "MATHLIB/LIB,PACKLIB/LIB,KERNLIB/LIB" $ endif +KEEP,GRAFLIB3,IF=VMS. $ if architecture.eqs."ALPHA" $ then $ tsyslib = "sys$library:decc$shr/share" $ else $ tsyslib = "sys$library:vaxcrtl/share" $ endif +KEEP,GRAFLIB,IF=VMS. $! $! CERN Libraries for graphics $ tcextra = "" +SEQ,GRAFLIB1. +SEQ,GRAFLIB2. +SEQ,GRAFLIB3. $! $ tcernlib = f$edit(tcernlib,"lowercase") $! $! Check that CERN$LIBRARY is defined $! $ if f$locate("cern$library",tcernlib).lt.f$length(tcernlib) $ then $ if f$trnlnm("cern$library").eqs."" $ then $ inquire answer "Give definition for cern$library" $ if answer.eqs."" $ then $ 'ww' "***" $ 'ww' "*** cern$library is not defined - link will not work" $ 'ww' "***" $ goto exit $ else $ define/log cern$library 'answer' $ endif $ endif $ endif $! $ tgraflib = "" $ if tgks.eqs."v" then $tgraflib = "SYS$LIBRARY:GKSFORBND/LIB" $ if tgks.eqs."d" then $tgraflib = "SYS$LIBRARY:GKS3D$FORBND/LIB" $! $ if tgks.eqs."p" $ then $ if f$search("sys:[graphics.pltsub]pltsub.olb").nes."" $ then $ tgraflib = "SYS:[GRAPHICS.PLTSUB]PLTSUB/LIB" $ else $ if f$search("sys$library:pltsub.olb").nes."" $ then $ tgraflib = "SYS$LIBRARY:PLTSUB/LIB" $ else $ tgraflib = "cllib:pltsub/lib" $ endif $ endif $ endif $ if tgks.eqs."x" $ then $ n1 = f$locate("sys$library",tcernlib) $ n2 = f$length(tcernlib) $ if n1.lt.n2 $ then $ tcernlib = f$extract(0,n1,tcernlib) + "gethostname," + - f$extract(n1,n2-n1,tcernlib) $ else $ tcernlib = f$extract(0,n1,tcernlib) + ",gethostname" $ endif $ endif $ tgraflib = f$edit(tgraflib,"lowercase") +KEEP,GRAFLIBX,IF=UNIX,IF=@CERNLIB. tcernlib=`$CERN/$TVCERN/bin/cernlib -v $TVCERN pawlib graflib packlib \ mathlib kernlib` +KEEP,GRAFLIBX,IF=UNIX,IF=-@CERNLIB. tcernlib="-L$CERN_ROOT/lib \ -lpawlib -lgraflib -lgrafX11 -lpacklib -lmathlib -lkernlib \ +KEEP,GRAFLIBY,IF=UNIX,IF=@CERNLIB. +KEEP,GRAFLIBY,IF=UNIX,IF=HPUX,IF=-@CERNLIB. -lU77 -ldld -L/usr/X11R5/lib -lX11 -lm" +KEEP,GRAFLIBY,IF=UNIX,IF=SUN,IF=-@CERNLIB. -L$OPENWINHOME/lib -lX11" +KEEP,GRAFLIBY,IF=UNIX,IF=SOLARIS,IF=-@CERNLIB. -L/usr/openwin/lib -lX11 -lsocket -lnsl -ldl" +KEEP,GRAFLIBY,IF=UNIX,IF=ALPHA,IF=-@CERNLIB. -lX11 -ldnet_stub" +KEEP,GRAFLIBY,IF=UNIX,IF=-HPUX,IF=-SUN,IF=-SOLARIS,IF=-ALPHA,IF=-@CERNLIB. -lX11" +KEEP,GRAFLIBN,IF=UNIX,IF=HPUX,IF=NAGLIB. tcernlib="$tcernlib $MN_FIT/lib/nagfix.o -L$NAG_LIBDIR -l$NAG_LIB" +KEEP,GRAFLIBN,IF=UNIX,IF=APOLLO,IF=NAGLIB. if [ $ISP != "a88k" ]; then tcernlib="$tcernlib -L$NAG_LIBDIR -l$NAG_LIB" fi +KEEP,GRAFLIBN,IF=UNIX,IF=-HPUX,IF=-APOLLO,IF=NAGLIB. tcernlib="$tcernlib -L$NAG_LIBDIR -l$NAG_LIB" +KEEP,GRAFLIBN,IF=UNIX,IF=-NAGLIB. +KEEP,GRAFLIB,IF=UNIX. case $tgks in g*) tcernlib="-L$CERN_ROOT/lib \ -lpawlib -lgraflib -lgrafGKS -lpacklib -lmathlib -lkernlib" # -L$GKS_ROOT/lib -lGKS -lGKSdriv) ;; x*) +SEQ,GRAFLIBX. +SEQ,GRAFLIBY. ;; d*) tcernlib="-L$CERN_ROOT/lib \ -lpawlib -lgraflib -lgrafDGKS -lpacklib -lmathlib -lkernlib \ -lGKS3Dforbnd -lGKS3D -ldwt -lcursesX -lX11" ;; *) echo "Allowed graphics packages are g, x, and d" echo "i.e. GKSGRAL, X Windows, DEC GKS3D." exit ;; esac +SEQ,GRAFLIBN. echo "Cernlib: $tcernlib" +DECK,EXPNAM. +KEEP,EXPNAM,IF=VMS,IF=VAX,IF=L3. $ Mn_Boss = UserID.eqs."BROCK" $ txnam = "VMS VAX L3 @SITE" +KEEP,EXPNAM,IF=VMS,IF=ALPHA,IF=L3. $ Mn_Boss = UserID.eqs."BROCK" $ txnam = "VMS ALPHA L3 @SITE" +KEEP,EXPNAM,IF=VMS,IF=ALPHA,IF=BONN. $ Mn_Boss = UserID.eqs."BROCK" $ txnam = "VMS ALPHA BONN @SITE" +KEEP,EXPNAM,IF=VMS,IF=ALPHA,IF=ZEUS. $ Mn_Boss = UserID.eqs."BROCK" $ txnam = "VMS ALPHA ZEUS @SITE" +KEEP,EXPNAM,IF=VMS,IF=VAX,IF=CLEO. $ Mn_Boss = UserID.eqs."MN_FIT" .or. UserID.eqs."CLIB" $ txnam = "VMS VAX CLEO @SITE" +KEEP,EXPNAM,IF=VMS,IF=ALPHA,IF=CLEO. $ Mn_Boss = UserID.eqs."MN_FIT" .or. UserID.eqs."CLIB" $ txnam = "VMS ALPHA CLEO @SITE" +KEEP,EXPNAM,IF=VMS,IF=VAX,IF=ALEPH. $ Mn_Boss = UserID.eqs."MN_FIT" .or. UserID.eqs."UTILITY" .or. - UserID.eqs."SYSTEM" $ txnam = "VMS VAX ALEPH @SITE" +KEEP,EXPNAM,IF=VMS,IF=ALPHA,IF=ALEPH. $ Mn_Boss = UserID.eqs."MN_FIT" .or. UserID.eqs."UTILITY" .or. - UserID.eqs."SYSTEM" $ txnam = "VMS ALPHA ALEPH @SITE" +KEEP,EXPNAM,IF=VMS,IF=VAX,IF=FNAL. $ Mn_Boss = UserID.eqs."MN_FIT" .or. UserID.eqs."JDL" .or. UserID.eqs."BROCK" $ txnam = "VMS VAX FNAL @SITE" +KEEP,EXPNAM,IF=VMS,IF=ALPHA,IF=FNAL. $ Mn_Boss = UserID.eqs."MN_FIT" .or. UserID.eqs."JDL" .or. UserID.eqs."BROCK" $ txnam = "VMS ALPHA FNAL @SITE" +KEEP,EXPNAM,IF=VMS,IF=VAX,IF=-@SITE. $ Mn_Boss = 1 $ txnam = "VMS VAX" +KEEP,EXPNAM,IF=VMS,IF=ALPHA,IF=-@SITE. $ Mn_Boss = 1 $ txnam = "VMS ALPHA" +KEEP,EXPNAM,IF=UNIX,IF=ALPHA,IF=BONNCIP. txnam='UNIX ALPHA BONNCIP @SITE' +KEEP,EXPNAM,IF=UNIX,IF=ALPHA,IF=BONN. txnam='UNIX ALPHA BONN @SITE' +KEEP,EXPNAM,IF=UNIX,IF=ALPHA,IF=CLEO. txnam='UNIX ALPHA CLEO @SITE' +KEEP,EXPNAM,IF=UNIX,IF=ALPHA,IF=-@SITE. txnam='UNIX ALPHA' +KEEP,EXPNAM,IF=APOLLO,IF=L3. txnam='UNIX APOLLO L3 @SITE' +KEEP,EXPNAM,IF=APOLLO,IF=-L3. txnam='UNIX APOLLO' +KEEP,EXPNAM,IF=DECS,IF=L3. txnam='UNIX DECS L3 @SITE' +KEEP,EXPNAM,IF=DECS,IF=ALEPH. txnam='UNIX DECS ALEPH @SITE' +KEEP,EXPNAM,IF=DECS,IF=BONN. txnam='UNIX DECS BONN @SITE' +KEEP,EXPNAM,IF=DECS,IF=CLEO. txnam='UNIX DECS CLEO @SITE' +KEEP,EXPNAM,IF=DECS,IF=CMU. txnam='UNIX DECS CMU @SITE' +KEEP,EXPNAM,IF=DECS,IF=DESYAFS. txnam='UNIX DECS DESYAFS @SITE' +KEEP,EXPNAM,IF=DECS,IF=-@SITE. txnam='UNIX DECS' +KEEP,EXPNAM,IF=HPUX,IF=CERNAFS. txnam='UNIX HPUX CERNAFS @SITE' +KEEP,EXPNAM,IF=HPUX,IF=L3. txnam='UNIX HPUX L3 @SITE' +KEEP,EXPNAM,IF=HPUX,IF=-@SITE. txnam='UNIX HPUX' +KEEP,EXPNAM,IF=IBMAIX,IF=CERNAFS. txnam='UNIX IBMAIX CERNAFS @SITE' +KEEP,EXPNAM,IF=IBMAIX,IF=-@SITE. txnam='UNIX IBMAIX' +KEEP,EXPNAM,IF=IBMRT,IF=CERNAFS. txnam='UNIX IBMRT CERNAFS @SITE' +KEEP,EXPNAM,IF=IBMRT,IF=-@SITE. txnam='UNIX IBMRT' +KEEP,EXPNAM,IF=SGI,IF=CLEO. txnam='UNIX SGI CLEO @SITE' +KEEP,EXPNAM,IF=SGI,IF=CMU. txnam='UNIX SGI CMU @SITE' +KEEP,EXPNAM,IF=SGI,IF=DESYAFS. txnam='UNIX SGI DESYAFS @SITE' +KEEP,EXPNAM,IF=SGI,IF=-@SITE. txnam='UNIX SGI' +KEEP,EXPNAM,IF=SUN. txnam='UNIX SUN' +KEEP,EXPNAM,IF=SOLARIS,IF=DESYAFS. txnam='UNIX SOLARIS DESYAFS @SITE' +KEEP,EXPNAM,IF=SOLARIS,IF=CLEO. txnam='UNIX SOLARIS CLEO @SITE' +KEEP,EXPNAM,IF=SOLARIS,IF=-@SITE. txnam='UNIX SOLARIS' +KEEP,EXPNAM,IF=LINUX,IF=BONN. txnam='UNIX LINUX BONN @SITE' +KEEP,EXPNAM,IF=LINUX,IF=ZEUS. txnam='UNIX LINUX ZEUS @SITE' +KEEP,EXPNAM,IF=LINUX,IF=-BONN. txnam='UNIX LINUX' +DECK,PAWLIB. +KEEP,PAWLIB1,IF=VMS,IF=@CERNLIB. $ cernlib pawlib,mathlib $ tcernlib = lib$ +KEEP,PAWLIB1,IF=VMS,IF=@CERNNEW. $ cernlib/new pawlib,mathlib $ tcernlib = lib$ +KEEP,PAWLIB1,IF=VMS,IF=@CERNOLD. $ cernlib/old pawlib,mathlib $ tcernlib = lib$ +KEEP,PAWLIB1,IF=VMS,IF=@FNAL. $ tcernlib = "PAWLIB_OLB/LIB,GENLIB_OLB/LIB,NPACKLIB_OLB/LIB,KERNLIB_OLB/LIB" +KEEP,PAWLIB1,IF=VMS,IF=-@CERNLIB,IF=-@CERNNEW,IF=-@CERNOLD,IF=-@FNAL. $ tcernlib = "CERN$LIBRARY:PAWLIB/LIB,MATHLIB/LIB,PACKLIB/LIB,KERNLIB/LIB" +KEEP,PAWLIB3,IF=VMS. $ if architecture.eqs."ALPHA" $ then $ tsyslib = "sys$library:decc$shr/share" $ else $ tsyslib = "sys$library:vaxcrtl/share" $ endif +KEEP,PAWLIB,IF=VMS. $! Standard CERN libraries including PAW +SEQ,PAWLIB1. +SEQ,PAWLIB3. +KEEP,PAWLIB,IF=UNIX. # Standard CERN libraries tcernlib="-L$CERN_ROOT/lib -lpawlib -lpacklib -lmathlib -lkernlib" echo "Cernlib: $tcernlib" +PATCH,DOC,T=TEXT. +DECK,intro. General Mn_Fit Documentation: _____________________________ All documentation is in the cmz directory //mn_util/doc: intro What you are reading. install Preliminary instructions on files needed to install CMZ. code Mn_Fit code, where it is and how to link and run it. new_system Soem hints on how to install Mn_Fit on a new system. manual How to produce a Mn_Fit manual. testing Testing a Mn_Fit executable. fixes Proposals for new features and bugs to fix. Also contains list of features added and bugs fixed. You can get up-to-date documentation if you already have the Mn_Fit kumac's by starting up CMZ in the Mn_Fit cmz directory and giving the command: exec mn_macro#makedoc For each major release of Mn_Fit I send some release notes to my list of Mn_Fit "tsars". If you want to be included on that list please let me know. The release notes can be found in //mn_util/news/rel_vnmm where n is the major version number and m the sub-version number (e.g. rel_v301 for the 3.01 release). There is also a list of which routines have been changed for bug fixes within a particular release, bug_vnmm. Mn_Fit is currently supported on VAX/VMS machines, Alpha, Apollo, HP, Decstations, SGI, IBM RS6000 running AIX, and SUN. It should be easy to get it to run on any other type of Unix machine. I just need to know what options are needed for compiling and linking. Mn_Fit can use either PLTSUB or HIGZ as the underlying graphics package. To make it more user friendly device names rather than numbers can usually be used for the graphical output. This necessitates some dependence on the lower level package. At present various GKS flavours (GKSGRAL, DECGKS, DEC GKS-3D) are built in. DI3000 is available thanks to Jon Lewis at Fermilab. There is also an X windows interface which is available on all supported machines. I hope to reduce explicit GKS (or DI3000) calls to a couple of subroutines making is easy to include any other lower level graphics packages. I use GKS segments which are not built into HIGZ. Therefore any other package has to either simulate or have dummy versions of the segments routines. +DECK,install. Options and Files Needed for Installing Mn_Fit ______________________________________________ There are 3 options for installing Mn_Fit: Everything, Libraries, Executable only. Provided you have CMZ or PATCHY "everything" is by far the simplest and it is easiest to update. Both other options require you to copy all the files again, or for you to check which ones have changed. There is a command procedure available for most machines in the standard distribution areas. Copy it to the top-level Mn_Fit directory and run it. On Unix machines you can install Mn_Fit using either cmz or patchy. If you use patchy then you need to have cernlib version 94b or later in order to get the test and demonstration files. Mn_Fit uses a number of logicals (VMS) or an environment variable MN_FIT (Unix). These logicals/variables are defined in the installation file if they do not already exist. In the filenames below x is the graphics package you want (g for GKSGRAL, v for VAXGKS/DECGKS, d for DEC GKS-3D, p for PLTSUB, 3 for DI3000, x for X Windows). 1) Complete installation including all code: _________________________________________ In order to install Mn_Fit on your computer you need to copy the following car files: mn_fit.car mn_util.car cgr_minuit.car typscn.car install.xxx xxx = vms,unix mn_readline-1.2.tar.gz copy with binary ftp mn_fit.doc For alpha machines running vms use install.vms. The list of machines which have the latest Mn_Fit release are given above. For example to copy from freehep do: ftp freehep.scri.fsu.edu anonymous your e-mail address cd freehep/analysis/mn_fit bin get mn_fit.tar.gz get mn_fit.ps.tar.gz quit gzip -cd mn_fit.tar.gz | tar xvf - gzip -cd mn_fit.ps.tar.gz | tar xvf - You should have CMZ version 1.44/20 or greater and I assume that the command "cmz" exists. 2) Copying Libraries: __________________ If you just want to copy the libraries code you need the following files. $MN_FIT or mn_fit_com: install.xxx $MN_FIT/mgr or mn_fit_dir: mn_fit.lnk mn_user.lnk $MN_FIT/lib or mn_fit_lib: Unix VMS mn_main_k.o mn_main_k.obj mn_main_n.o mn_main_n.obj mn_util_cc.o mn_util_cc.obj tvbgn_x.o tvbgn_x.obj math.o math.obj mn_dummy.o mn_dummy.o libmn_fit.a mn_fit.olb libtypscn.a typscn.olb libtypscn_read.a If readline is not installed on your system you also need: readline/libreadline.a readline/libtermcap.a In addition you will need all the files, except the executable, that are listed below for the case of copying just the executable. Note that if you have the libraries, you can also make user versions. To make user versions you have to also copy: Further documentation, including this file, can be found in: mn_fit_dir:mn_fit.doc This file is updated everytime a new version of Mn_Fit is released. 3) Copying executables: ____________________ If you just wish to copy the executable and other files necessary for running you should copy the following files. Note that copying executables means that you should have the same system version as I used for linking. I will use logical names below. $MN_FIT/exe or mn_fit_exe: mn_fit_x.exe The executable $MN_FIT/help or mn_fit_help: Unix VMS mn_hdir.fil mn_fit.hlb Help files mn_help.fil mn_news.fil mn_news.fil News demo00.mnf demo00.mnf demo01.mnf demo01.mnf demo02.mnf demo02.mnf demo03.mnf demo03.mnf demo04.mnf demo04.mnf demo05.mnf demo05.mnf demo06.mnf demo06.mnf demo07.mnf demo07.mnf demohard.mnf demohard.mnf symbol.mnf symbol.mnf font.mnf font.mnf hatch.mnf hatch.mnf pattern.mnf pattern.mnf key.mnf key.mnf $MN_FIT/help/tutorial: All files can be copied. $MN_FIT/bin or mn_fit_com: mn_fit mn_fit.com Script to run Mn_Fit mn_fit_logical.com VMS - define logicals $MN_FIT/mgr or mn_fit_dir: window.dat Vaxstation window definition Note that if you just copy the executable it is not possible for you to link a user version of Mn_Fit. Please contact me if you have any problems with installation, or if the instructions are incomplete, unclear or wrong! +DECK,code. Mn_Fit Code and Installation Instructions _________________________________________ Below I describe how and where the Mn_Fit code is stored and how to set up Mn_Fit for your instititute. You should also have enough information so that you can compile and link any version of Mn_Fit and make changes and test them out if you wish. I assume that you have CMZ installed at your institute and I recommend that you have version 1.44/20 or later. With the release of Mn_Fit version 4.01 I provide an installation script for all machines, which means that I can shorten the documentation considerably. You should be able to copy the installation script to the top-level Mn_Fit directory and run it. Please let me know of any corrections, improvements etc. to the installation system. On both VMS and Unix machines the fortran code is split into many files. I therefore think that it is not practicable to distribute the fortran code anymore. Instead I will make the libraries available and then you can link with them. Below I describe in a bit more detail how and where the Mn_Fit code is stored and what flags are used. All the code, files etc. needed to run Mn_Fit are stored in 4 CMZ files. You make the kumac's and other files you need to link and run Mn_Fit from the CMZ file mn_util.cmz. There are 3 types of flags that control the making of the kumac's etc.: Operating system: VMS, UNIX Computer: VAX, ALPHA, APOLLO, DECS, HPUX, IBMAIX, IBMRT, SGI, SUN, SOLARIS, LINUX Site/Experiment: L3, BONN, BONNCIP, ZEUS, CLEO, ALEPH, FNAL, CMU, CERNAFS, DESYAFS Extra options: @GCC, @CERNLIB, @CERNNEW, @CERNOLD, NAG, IMSL L3_DSP, ZEUS_DSP Development: @DEV, @DBG Before making any kumac's or other files from the mn_util.cmz you must ensure that these flags are set as you need them. Once you have done this once and made a cmzlogon.kumac, then each time you start CMZ up in the future they should be set properly. e.g. For VXL3J0 I do: SEL VMS VAX L3 @DEV for my test versions For CLEO librarian do: SEL VMS VAX CLEO For L3 HP's I do: SEL UNIX HPUX CERNAFS The @CERNLIB option assumes that you have the cernlib command available for defining the CERN libraries. @CERNNEW assumes the same, but the new version of the libraries will be used, @CERNOLD for the old versions. You should always start CMZ from the directory containing the CMZ files and the kumac's. In addition, except when starting completely from scratch as in 1) below, you should always make sure the Mn_Fit logicals or links are defined before you start up CMZ. You should normally only have to modify the mn_fit_logical.com (VMS) or the environment variable MN_FIT (Unix) file and perhaps the SEQuence //mn_util/cdes/mn_logic for your system. In addition you should check that the other sequences, such as the default graphics package and the experiment name are defined correctly in //mn_util/cdes. All other files and code should be installation independent. If you find that you have to change anything, please let me know and I will try to incorporate it automatically. 1) Starting from scratch: Set your default directory to the Mn_Fit top-level directory. Copy the relevant install script and run it. If the necessary sub-directories do not exist they will be created. a) The cmz files are made if they do not exist. make mn_fit make mn_util make typscn b) Select your options and make the kumac's: You are asked for your experiment name. If you give one this fixes the directories for mn_fit.com, mn_fit_logical.com etc. If you do not give an experiment name on VMS machines then the logical mn_fit_com must be defined before running Mn_Fit. On unix machines the environment varibale Mn_Fit must be defined (unless it is /usr/local/bin). 2) Setting up Mn_Fit when you have the CMZ files: Make sure the Mn_Fit logicals or links are defined properly for you e.g.: DO MN_FIT_LOGICAL (CLEO Vax) source mn_fit_logical (logged in as brock on L3 Apollos) Note that these files look to see if a logical mn_fit_dir or the environment variable MN_FIT exist. If so they do nothing. Therefore if you have changed anything you MUST deass mn_fit_dir (VMS) or unset MN_FIT (Unix) before running them. If you want to use a test area for example, then you should do setenv MN_FIT test_area instead of mn_fit_logical. You can also set MN_FIT in .cshrc for example to point to the correct area. Set your default directory to the mn_fit_cmz area and startup cmz. Note that cmzlogon.kumac (mn_macro#mn_alias) defines various aliases for the standard directories (a_mn_fit_dir etc.). The cmzlogon executes an alias/list which list the defined aliases for you. a) Remake the kumac's if necessary: exec mn_macro#makekumac b) Check the mn_logic SEQuence to see that it is correct for your selections: cd //mn_util/cdes read mn_logic To look at the SEQuences/CDE's with your selections you can do: seq . seq //mn_util/cdes seq -e exec mn_macro#mn_seq (to get back the standard cde's) Check that you have the graphics package selected that you want: sel (Usually HIGZ X11 on all machines or HIGZ GKS GKSGRAL on L3 Vaxes) Check whether the IMSL flag is turned on (IMSL routines are available on CLEO Vaxes) if you have IMSL and whether the NAGLIB flag is turned on if you have Naglib. If you change //mn_util/cdes/mn_logic you should either exit and restart CMZ or give the command: exec mn_macro#mn_seq before proceeding. c) Make/remake any of the other files needed: This can be done by giving the command: exec mn_macro#makefiles You will then be asked if you want to make the files to link Mn_fit, run Mn_Fit, help files, test files and test histograms. You can make the help, demonstration, test and histogram files separately as indicated in iii), iv), v) and vi) below. Note that you should not make the help files or the test histograms until an up-to-date Mn_Fit library has been made. i) Make the files to link Mn_Fit: exec mn_macro#makelink Note that the link files now have the default graphics package and the way to access CERN libraries built in. These are steered by the select options in CMZ. I probably to not have all institutes and options properly built into here yet. Please let me know of any corrections or additions. ii) Make/remake the file to run Mn_Fit if necessary: exec mn_macro#makerun Provided SEQuence mn_logic is correct for your institute you should not have to modify this file. It should also not change very often, so once you have made it once, it should only need to be updated rarely. iii) Make the help files: exec mn_macro#makehelp If you are in VMS, both simulated VMS Help and real VMS Help libraries are made. On other machines only simulated VMS Help is made. This macro needs the typscn library which is made when you link Mn_Fit. iv) Make the demonstration files: exec mn_macro#makedemo v) Make the test files: exec mn_macro#maketest vi) Make the histograms used for testing: exec mn_macro#makehist Note that you should not run this until an up-to-date Mn_Fit library has been made. 3) Where and how the Mn_Fit code is stored: All code is pointed to by the logical name MN_FIT_CMZ or link $MN_FIT/cmz. a) Mn_Fit code proper is in the file MN_FIT.CMZ b) C. Rippich MINUIT code is in the file CGR_MINUIT.CMZ c) TYPSCN code is in the file TYPSCN.CMZ d) Utilties, kumac's, help file, ... MN_UTIL.CMZ e) L3 online displays' code is in the file L3_DSP.CMZ f) Interface to L3 database is in the file DBASE.CMZ There is a main kumac file mn_macro.kumac and the startup kumac, cmzlogon.kumac. There are also kumac's, typscn.kumac and cgr_minuit.kumac for making typscn and cgr_minuit libraries etc. There are a number of flags that are used to decide which version of the code is obtained: VMS - VMS version of the code UNIX - Unix version of the code IBM - IBM version of the code (not yet implemented) ALPHA - Special ALPHA stuff in addition to Unix or VMS APOLLO - Special Apollo stuff in addition to UNIX DECS - Special DECstation stuff in addition to UNIX HPUX - Special HP stuff in addition to UNIX IBMAIX - Special IBM/370 AIX stuff in addition to UNIX IBMRT - Special IBM AIX RS6000 stuff in addition to UNIX SGI - Special SGI stuff in addition to Unix SUN - Special SUN stuff in addition to UNIX SOLARIS - Special SUN SOLARIS stuff in addition to UNIX LINUX - Special Linux stuff in addition to UNIX HIGZ - HIGZ version of the graphics GKS - GKS version of HIGZ GKSGRAL - GKSGRAL implementation of GKS DECGKS - DECGKS/VAXGKS implementation of GKS DGKS3D - DEC GKS3D implementation of GKS DI3000 - DI3000 graphics interface X11 - X11 interface for X windows PLTSUB - PLTSUB graphics interface MN_HLP - Use Mn_Fit VMS Help simulation IMSL - Use IMSL spline fitting and smoothing routines NAGLIB - Use NAGLIB spline fitting routines L3DSP - Include L3 online detector displays $L3_DB - Include interface to L3 database $L3_CPC - Make the menu driven version for L3 online ZEUSDSP - Include ZEUS detector displays To help cope with different experiments there are additional flags for making help files, kumac's etc. @CERNLIB - Assumes you have the cernlib command @CERNNEW - Assumes you have the cernlib command, new version @CERNOLD - Assumes you have the cernlib command, old version CERNAFS - AFS at CERN DESYAFS - AFS at DESY L3 - L3 experiment - only for L3 repository BONN - Bonn University BONNCIP - CIP Pool at Bonn ZEUS - ZEUS experiment - only for non-AFS machines CLEO - CLEO experiment ALEPH - ALEPH experiment FNAL - Fermilab CMU - CMU 4) Linking Mn_Fit: The file usually used to link is in the directory mn_fit_dir: (VMS) or $MN_FIT/mgr (Unix) and is called mn_fit.lnk. To link a user version you should use mn_user.lnk. This executes mn_fit.lnk with the appropriate parameters set. There are also files mn_fit_cgr.lnk to link the version of Mn_Fit using C. Rippich's version of MINUIT, and mn_dsp.lnk to link the L3 display version of Mn_Fit which includes detector displays and an interface to showing quantities in the L3 database, and mn_user.lnk to link a user version of Mn_Fit. mn_fit.lnk can be run with various options which are preceded by - signs: -f Final version - by default all the code will be compiled -t Test version - by default the code will not be compiled -u exename filename Make a user version with executable name "exename" and including compiled file(s) "filename" -c Compile all the code - must follow -f,-t or -u -nc Do not compile all the code -r Use GNU readline (only on Unix) -rc Use GNU readline with ncurses library (only on Unix) -rl Use GNU readline from /usr/local/lib -rcl Use GNU readline with ncurses from /usr/local/lib -ncmz CMZ is not available -l libname Include extra libraries "libname" in the link -d Link in debug -nd Link in NODEB. User versions get linked in debug by default -m68k Use m68k compiler on the Apollo (Motorola nodes) -a88k Use a88k compiler on the Apollo (DN10000 nodes) e.g. @mn_fit.lnk -t -c to link a test version on VMS and recompile everything mn_fit.lnk -f to link a final version on a Unix machine Final version gets the executable name mn_fit_exe:mn_fit_x.exe (VMS) and $MN_FIT/exe/mn_fit_x.exe (Unix). Test versions get the names mn_test_x.exe in the same directories. The C. Rippich version gets the name mn_fit_cgr.exe and the display version gets the name mn_dsp_x.exe. x is a single letter indicating the graphics package (g, v, d, 3, x, p). Normally if you remake the Mn_Fit libraries they will be compiled with optimization on. If for any reason you want to recompile all the code in DEBUG the way I usually do it is to modify the macro mn_macro#fort_opt to compile everything in DEBUG or change the line in mn_macro#makelib from fort_opt to fort_deb. If you link a final version all the CMZ code and the kumac's are copied to the MN_FIT_LIB area. Therefore I recommend that this area is a scratch area unless you have lots of disk quota (>20K blocks on VMS). 5) Running Mn_Fit: The file to run Mn_Fit is mn_fit.com on VMS and mn_fit on the Unix machines. You can add many qualifiers to the command to select which exe file is run. No qualifier will run mn_fit_exe:mn_fit_x where x is a letter indicating the graphics package used. -? Help -h Help List the qualifiers available -t Test MN_TEST -dis Display MN_DSP -o Old MN_OLD -u User Run a user version of Mn_Fit. You must give the executable name if it is not mn_user.exe -cgr Mn_Fit with C. Rippich version of MINUIT -g GKSGRAL MN_FIT_G, MN_TEST_G or MN_OLD_G -v DECGKS MN_FIT_V etc. -de DECGKS MN_FIT_V etc. -dg DGKS3D MN_FIT_D etc. -di3 DI3000 MN_FIT_3 etc. -x X11 MN_FIT_X etc. -n Node Nodename for the graphics window (X windows version) -t Transport Transport for DISPLAY - Decnet or TCPIP (VMS only) -p PLTSUB MN_FIT_P etc. -dbg Run Mn_Fit in debug -cpc Run CPC version of Mn_Fit (L3 Online Menu Display Version) e.g. @USER$DISK:[MN_FIT]MN_FIT -T -P to run the PLTSUB test version To run using a file you can use the form `do mn_fit filename [options]'. The first line of the file must be blank or contain a graphical output device name or number. 6) Help for Mn_Fit: There are 2 Ascii files in the mn_fit_help: (VMS) or $MN_FIT/help (Unix) directory which contain all the help: mn_fit_help.fil and minuit_help.fil. You make the help libraries by running the kumac: exec mn_macro#makehelp. On VMS this makes a VMS Help library and simulated VMS Help files. On Unix machines only simulated VMS Help files are made. To get the simulated help the select option VMS should be off or MN_HLP should be on. 7) Demonstration and test files for Mn_Fit: The demonstration files are in the directory mn_fit_help:. The test files for Mn_Fit sit in the directory mn_fit_test: These files need a set of test histograms. To make these you need to do the following: $ DO MN_FIT_LOGICAL (or the equivalent on your machine) $ CMZ exec mn_macro#makedemo to make the demonstration files exec mn_macro#maketest to make the test files exec mn_macro#makehist to make the test histograms 8) Making and Linking a Version with a Non-standard Graphics Package: Each computer and institute has a default graphics package defined and the normal mn_fit.lnk has this built in. You can use the option -g when you run mn_fit.lnk to specify another package: -g decgks -g pltsub etc. +DECK,manual. Making a Mn_Fit Manual ______________________ The Mn_Fit manual is made from an introductory LaTeX file plus the Mn_Fit help files converted to LaTeX. I have written a facility which takes the Mn_Fit help files and makes a LATEX document out of them. The macros described below enable you to run this procedure and to make the figures. However, as Postscript is becoming a de facto standard I do not support this method of making the manual for general users anymore. A Postscript version is available via anonymous ftp, so that should be easier for most users than making the manual themselves. See the README in the directory with the car or the tar files for details on what manual files exist and how to get them. You should be able to make a manual with the kumac: exec manual#text to produce the LaTeX file exec manual#pictures to make the pictures for the appendices. The FORTRAN program that is used to do this is mn_fit_dir:mn_latex.for (VMS) or $MN_FIT/mgr/mn_latex.f (Unix). (with .run to link and run it). It makes a TeX file mn_fit.tex which you can then run through LaTeX and print in the usual way. You are asked which of the steps you want to do when you execute the TEXT macro. I have a script for a Unix machine that does all the necessary steps. The pictures for the appendices are usually made in Encapsulated Postscript format. The demo05 picture covers 2 pages. In Encapsulated Postscript form this is automatically put into 2 files. I no longer support any other formats. The default syntax for including pictures use \includegraphics. All picture sizes are 16x18cm in the pictures macro. In the demonstration macros the pictures are 20x20cm, except for the fits which are 20x25cm. If you do not have CMZ you should set your directory to mn_fit_help: and run igtext_exam.run, and from Mn_Fit exec pictures.mnf and demo00.mnf. Note that you have to give a capture command to get back to a screen device after executing pictures.mnf. If you run the demonstration macros and want to include your log in the cmz file follow these steps: Copy the complete transcript of demo_man into a file. Split this file from "exec demo0n" to "end of demo0n" and put in $MN_FIT/help/demo0n.log. Check these files and edit any line that is longer than 80 charcters. Import the files into mn_util cd //mn_util/demo_log ttoc -a ../help/demo01.log ttoc -a ../help/demo02.log ttoc -a ../help/demo03.log ttoc -a ../help/demo04.log ttoc -a ../help/demo05.log ttoc -a ../help/demo06.log ttoc -a ../help/demo07.log +DECK,testing. How to Run the Mn_Fit Test Files and What the Results Should Be --------------------------------------------------------------- I assume that you have made the demonstration and test files: exec mn_macro#makedemo and exec mn_macro#maketest, and the test histograms: exec mn_macro#makehist. To run the demonstration files start up Mn_Fit and after giving the graphics device give the command: exec mn_fit_help:demo00 (VMS) or exec $MN_FIT/help/demo00 (Unix) You should also run the other macros which are used to make the figures for the manual: exec symbol exec font exec hatch exec pattern exec key exec sizes exec ps_char To run the test files start up Mn_Fit and after giving the graphics device give the command exec mn_fit_test:all_test (VMS) or exec $MN_FIT/test/all_test (Unix). I normally set the directory to the mn_fit_test directory before starting Mn_Fit, though this should not be necessary. However, I have not completely tested whether it is possible to run all the tests from another directory. As these are test macros they have some built-in errors that you should ignore and not abort the execution of the macros. Errors that will not happen in some later version of Mn_Fit when I introduce new features are indicated with a *. Below I will list the files that are run and indicate any errors: 0) init_test: Should be run before you run any of the test macros. Defines aliases etc. that are used in the test macros. 1) Fetch and store: A) fetch_test: a) mn_fetch b) mnfet_test: c) datfet_test: d) sctfet_test (Vax only) e) avefet_test: (Vax only) f) hb3fet_test: (Vax only) g) hb4fet_test: B) store_test: a) mnstore_test: b) hbstore_test: c) datstore_test: dat_store ... 1 2 3 fails for Ntuple 3 2) Plotting A) plot_test: a) plot1_test: b) plot2_test: c) plot3_test: c) label_test: Tries out different label alignments d) lego_test: Test out lego and surface plotting e) plot4_test: Tests out igtable and 2dim f) log_test: g Tests out log scales h) pi_test: Tests out scales that are multiples or fractions of pi i) slice_test: j) time_test: Plotting vs date or time and date/time functions with Ntuples. 3) Fitting A) fit_test: If you want to run a particular fit_test, give the command sequence exec fit_test return exec fitn_test a) fit0_test: b) fit1_test: c) fit2_test: d) fit3_test: e) fit4_test: f) fit5_test: g) fit7_test: h) conv_test: i) fithist_test: Test fitting with histograms fun add smooth No more space j) fit6_test: constr 8 p2-1 Parameter 8 is already constrained 4) Functions: A) fun_check: B) frag_test: C) dipi_test: 5) Parsing and macros: A) char_test: Tests out continuation lines and also different comment and continuation characters Should give a few errors B) do_test: C) if_test: plot 8 non-existent histogram D) define_test: define junk1 error trying to define it again enddef error as define failed E) alias_test: show alias more (translated to show alias what more) command more not defined junk command not known as alias what undefined 6) COMIS A) comis_test: Tests out COMIS functions and makes a file comis_test.tmp for you to edit. Unless you give a set edit command edit/tpu will be used on VMS. First pass at file comis_test.tmp make: XMNCMI = DPAR(1) + DPAR(2)*DBLE(XX)**2 Second pass: XMNCMI = DPAR(1) + 2*DPAR(2)*DBLE(XX)**3 Third pass: XMNCMI = DPAR(1) + 0.6*DPAR(2)*DBLE(XX)**4 13) squeeze_test: book n Should run out of space sometime fill n Histogram will not exist 14) ntuple_test: a) ntpfet_test: b) prof_test: 15) cut_test: a) cut1_test: b) cut2_test: c) cut3_test: Just exit when you get into the editor with cut2_temp.for 16) merge_test: 17) scan_test: 18) call_test: Add a line TYPE XVAL to the skeleton function call_temp.for 19) oper_test: 20) calc_test: dep x5&1(1) = 1000 cannot change x bin of a histogram 21) var_test: 22) spline_test: Tests HBOOK/NAGLIB and IMSL spline fitting and smoothing. 23) Demos that should go in the manual: a) symbol: b) font: c) font_gksgral: Only run with the GKSGRAL version d) hatch: e) hatch_gksgral: Only run with the GKSGRAL version f) pattern g) key h) sizes i) ps_char 24) draw_test: 25) symb_test: 26) hatch_test: 27) pattern_test: 28) font_test: +DECK,new_syst. Installing Mn_Fit on a New System _________________________________ The following is a list of (probably imcomplete) instructions on what to look for and what you probably have to change if you want to install Mn_Fit on a new system. The list currently applies to installing Mn_Fit on a new Unix machine. If you want it on another system, e.g. IBM VM, then most of the scripts in //mn_util/jobs and //mn_util/exec have to be rewritten. In addition I use logical names on VMS machines and environment variables on Unix machines, so some sort of replacement for them has to be found. 1) mn_util: a) Patch cdes: EXPNAM: Add the new computer. CMZLOGON: Add new computer e.g. SUN in all relevant places to specify the options used and the default editor etc. MN_MACRO: Specify the options for f77 etc. in fort_opt and fort_deb. On the SUN you may find that compiling from inside cmz does not work. Try to do exec mn_macro#graphics. If (when) that fails look at the cmexec.exec file and see what the PATH if defined as. Outside cmz try `which f77'. If it responds with `/usr/lang/f77' and /usr/lang is not in the PATH defined in cmexec.exec, then change fort_opt and fort_deb to set `/usr/lang/f77 ...' b) Patch jobs: MN_FIT: Add the necessary f77 or ld commands HISTMKE: Ditto helpmke: Ditto c) Patch exec: 2) mn_fit: a) Patch util: MN_FIL: Make sure the options in opening files are correct. Put in any special options, such as SHARED, READONLY, ... if they are available. 3) Extra chages to be made if installing on a completely new type of operating system: a) mn_util/exec: MN_FIT: Write it in REXX or whatever. MN_LOGIC: Defines logicals for VMS and not needed for Unix as environment variables are used. b) mn_util/jobs MN_FIT: Write it in REXX or whatever. HISTMKE: Ditto HELPMKE: Ditto c) mn_util/$kumacs: mn_macro: MN_ALIAS: Make aliases for a_computer and a_mn_fit_dir etc. MN_SET: Default library and fortran files MAKELIB: Compile full Mn_Fit in most suitable way d) mn_fit/util MN_SPW: Does things like spawning for editing, shelling out of Mn_Fit etc. Needs to have the new machine type added MN_FIL: Extra calls to VMCMS etc. for IBM e) mn_fit/handler These are the break and condition handling routines. Basically copied from KUIP with a few changes. Probably can be copied again from KUIP for a new machine. +DECK,fixes,if=fixes. This file is supposed to be a list of new features requested or bug fixes for Mn_Fit. D 03.03.94 plot 0 was nto honouring the symbol number properly if the 1st plot was not drawn. 21.09.93 Lego plots get lines drawn wrong for the frame sometimes. D 21.09.93 Some strange lines are drawn for included regions. D 06.01.93 Mean and sigma are stored in registers - not documented. D 06.01.93 Bug in limits for making profile plot from Ntuple. D 05.01.93 Default format for messages etc. did not work. 20.12.92 Add the option to display the cuts used in ntuple plot. One suggestion is to put them on a separate page - I am not sure I like this. D 20.12.92 Arrows are not translated properly for font -2013 03.11.92 plot 1:10 plots all secondary id's and not just the default. D 03.11.92 If the scale offset changes because of windowing and then you switch back to no windowing, it is not updated. D 18.08.92 Check on use of fonts -2000 in mn_pli and m_head. In mn_pli do not do more checks than necessary. 18.08.92 Editing of drawn items does not allow = and expressions properly. D 10.01.92 In DRAW ARROW add a mode 0 = as is, 1 = filled, 2 = 2 ends, 3 = 2 filled ends. D 10.01.92 Add easy history - already in here somewhere: !: list !! last command !n command n !str command containing string str Add command number to the prompt. (This must be checked properly in EFMONCO!!). 15.11.91 Allow expressions when doing sizes in MN_ENM. First look for =, then for +,-,*,/,^ and if that is the case parse it as an expression, saving the rest of the line. Almost identical procedure as in NTUPLE PROJECT. D 14.11.91 Add SET PWD command. Sets the directory to use for a filename if it is not given. If directory not given in the filename (/ or : or []) look first in current directory. If the file is not there use PWD. D 13.11.91 Add FIT/GAUSS and maybe some other simple fitting. 25.10.91 Add display of underflows and overflows - maybe at the relevant edges of the plot. 25.10.91 Check that I can use the =/2 etc. format for all sizes. It does not work for SSIZE at the moment. 24.10.91 Add STACK a la GEP. This involves a metafile format as the first step. Do it in ZEBRA as a linear chain of banks. Then is is "easy" to change delete etc. 23.10.91 NTUPLE MERGE can only write 1 Ntuple per file. This should be fixed. Either change call to MN_FIL from M_NTPMRG or add an extra option to MN_FIL. 22.10.91 HARD -111 etc. does not work properly with GKSGRAL. HIGZ problem and I have sent mail to O. Couet. IGQWK calls GQDSP instead of Postscript routine. 25.08.91 Think about doing unbinned likelihood fitting. Do a proper likelihood fit and then bin the plot to show the results. Could then be extended to at least 2-D fits. 16.08.91 Add SET FUNCTION STEP command. 16.08.91 Masks in Ntuples. 16.08.91 At end of file give filename/macro and not just unit. D? 16.08.91 Character variables in COMMON blocks for COMIS. 16.08.91 Merging of histograms with different limits?? HIST MERGE. Need to check limits, calculate new low and high limits, calculate new number of bins/points, book the new plot and fill it from the other 2. Do a proper error calculation. 16.08.91 Add access to titles and variable names in MESSAGE, COMMENT, TITLE etc. {TITLE(id&idb),format} {VAR(id&idb),number} D 15.08.91 Colour coding for contour plots! 14.08.91 Add a Mn_Fit metafile format to output and read back in plots. 14.08.91 Put plot underflows and overflows into registers. 30.01.91 Add CAPTURE/REPLACE, CAPTURE/ADD, CAPTURE/HARD commands. CAPTURE/HARD will treat even unknown as a hardcopy device and open a file for it. For GKSGRAL CONID will have 100 added to it. 23.01.91 SQUEEZE still does not work properly sometimes. Maybe connected with plots with 0 points read in with DAT_FETCH or booked with BOOK. Check the code. D 21.12.90 Use RZ calls to find out the histograms in a directory and only fetch the ones requested, even in a range. D 18.12.90 Surface and lego plots should honour x and y limits. At the same time allow phi angle to be <0 or >90 degrees. 12.12.90 COMIS Function does not get user function number passed properly sometimes. This works fine in the test! Did not work when doing fits to BGO geometry. 03.12.90 Protection removed for projecting onto more than 2 variables, but not tested. 03.12.90 Add same mechanism for fitting Ntuples as plotting them. For 2-d plots store x,y,z and not just z?? Think through the consequences of this. 16.11.90 Make SET NORMALIZE, SET RATIO into SET FIT ... to group all parameters associated with fitting together. D 16.11.90 Make a box really a box and add a quadrilateral to DRAW. Also add CIRCLE, ARC, SINE. Add arrow options, 1st end, 2nd end, both, middle, hollow, filled. With this lot should be sufficient for Feynman diagrams. 16.11.90 Add {...} into inquire statement/parameter interpretation 16.11.90 Improve KEY command to 1000000 + nhatch*1000 + nsymb so can make a proper key of a hatched histogram. 15.11.90 Add COMMENT DEL 0 and KEY DEL 0. If in file do not give an error if no keys exist. 15.11.90 Add SET COMMENT command to specify the comment character. 15.11.90 Catch comments much earlier and do not do any alias translation etc. If comment character inside '' or "" then do not treat as a comment. 21.09.90 Allow COMIS function for constraints. 15.11.90 Add standard aliases for histogram registers?? Add a command SET ALIAS DEFAULT to get back to standard aliases. D 30.05.90 Hidden line for surface should look for min values as well 30.05.90 Add message level command (1 normal, 0 echo off, -1 no normal messages, -2 no MESSAGE either, -3 no errors). 30.05.90 For device unknown check whether I really do know it and only look at #'s < 512 for VAXGKS, DGKS3D 06.02.90 Make a proper writeup of M_BOOK, M_FILL etc. 06.02.90 Add HPRINT command to directly print an HBOOK histogram D 06.02.90 Add storage of Ntuples to DAT_STORE. 06.02.90 Add storage of plots vs time to DAT_STORE. D 06.02.90 Add other smoothing or spline fitting if IMSL is not available. Add spline testing at the same time. 30.01.90 Add commands FUNCTION LEGO and FUNCTION SURFACE. 29.01.90 Add code for HIST DUMP page by page? Option in MN_MES? Then I can use it in HELP also? Make it a SET TYPE PAGE/NOPAGE option. Check how to make Vax help page by page. - see code from Jon Lewis on how to get page size. 26.01.90 Add SET PSIZE, SIZE, MARGIN commands which do both axes Alternatively make a SET SIZE command with sub-options PICTURE, PLOT, TITLE, SYMBOL, SCALE, TICKS, COMMENT, LABEL. Make a SET SIZE TEXT to change the all text sizes. 26.01.90 Get rid of 980 limit for IDB. Must change I7,I4 everywhere 981->999 still reserved for Mn_Fit? Or make them bigger? 19.01.90 Add a routine M_PLOT to do a simple MN_FIT plot - so it can be called from a COMIS function. Also add M_SET where the argument is the SET command without SET ... ENDSET. 19.01.90 Add MOD, MIN and MAX to DEPOSIT. 18.01.90 Use HBOOK storage for output and internally defined Ntuples also. 05.01.90 Check x limits in OVERLAY - use same routine to check for limits in FIT with histograms, and MN_OPR - routine M_HCHK. Routine exists - just has to be called. 05.12.89 Add OVERLAY/SCALE command to scale by the ratio of areas for the right-hand scale. 09.11.89 Add DATE and TIME plotting modes. 09.11.89 Send out a message on the form for the efficiency calculation that should be used - Frank, Paul?? 07.11.89 Adding, subtracting etc of multiple histograms MADD ido id1 id2 id3 ... (no scale factor). D 07.11.89 Check specs of histograms being fitted and fit with are the same 06.11.89 Add GOTO statements to macros 06.11.89 Multiple macros in 1 file. MACRO, ENDMACRO commands. Add defaults to MACRO command. Syntax: inquire 1 'Give parameter' default?? D 06.11.89 Contour plotting of 2-d histograms - see HPLOT code ------------------------------------------------------------------------------ Below this line, implemented in 21.12.92 release. Version 3.03/04 D 02.11.92 valtyp and vl2typ left the typscn pointer before the delimiter, when using user variables. D 10.01.92 Add storing of Ntuples in HBOOK files. D 10.01.92 Bug in PLOT 1:n nsym - symbol is only used in the first plot. If symbol number is given, but you are asked if keys should be kept, the symbol is ignored. D 10.01.92 ntuple plot id relec #eff #deff ... does not make the errors. Plot can be found in ~/tem/anal/lx/lxanal_relec.mnd. D 10.01.92 DRAW CHANGE always gives the last item to change. Also the name of the item is wrong in DRAW LIST. D 23.10.91 Add possibility to store Ntuples and scatter plots in HB_STORE. D 23.10.91 Check whether temporary directory exists in memory when doing MERGE. Also check that input and output files are open properly and directories are OK before starting MERGE. D 22.10.91 If font is not 0 in DISPLAY to not convert chi^2 and do not put @ before &. D 16.08.91 DRAW POLY in DRAW_TEST. D 16.08.91 Check out new KUIP code for shell of any sort. D? 15.08.91 Fancy fonts + superscripts/subscripts etc.??? Big problem because I do not know the character size! Jon Lewis gave me the names of subroutines in GKS and DI3000. At least if you use POstscript fonts with the X-windows version you can use fonts -2000 and bigger and you get superscripts/subscripts/greek etc. D 15.01.91 Something sometimes does not give axes names. It was functions made into histograms. D 18.12.90 Make sure I have at least 1 tick, even if limits are less than 1 bin width. D 15.01.91 If compilation error in COMIS function, new function still gets added. D 14.12.90 In simulated help, list help for all commands which are ambiguous. This leads easily to being able to give * also. Also HELP SET SCALE and then TICKS does not work and goes onto SHOW. Simulated help on a topic with a / does not work, e.g. HELP HIST PLOT /NEXT. If a topic is ambiguous then list all the topics and stay at the same level. Do not prompt for sub-topics. D 16.11.90 Add HCLOSE command to close all open histogram files. Useful if using a DN10000 to calculate and DN2500 to plot. Routine there, command not I think. D 02.10.90 Ensure that at least 3 big ticks are drawn even when windowing. D 07.09.90 Add normalization of fragmentation functions. Check into variable bin width and fitting multiple plots. D 07.09.90 Improve INTEGRATE so that it does Simpson integration. Check out the handling of the bin width. D 12.07.90 Renaming of HBOOK plots when using Ntuples screws up because Ntuple gets copied! Add directory name to plot info, and then only rename HBOOK plot if Mn_Fit plot has an associated Ntuple. Also means I can make sure directory is set properly for reading an Ntuple in PROJECT D 06.02.90 Check out dot size scaling. D 06.11.89 Add IF statements to macros ------------------------------------------------------------------------------ Below this line, implemented in 19.11.91 release. Version 3.02/15 D 11.11.91 Added IGSG, IGSA for Falco within DECGKS, DEC GKS-3D. D 11.11.91 WAIT was defined as a command twice. D 11.11.91 QUIT now does an emergency exit out of Mn_Fit instead of begin an alias for EXIT. D 11.11.91 Almost all turning on and off of breaks commented out. D 23.10.91 Use the mouse for getting the position of COMMENTS, KEYS and DRAW. D 23.10.91 Add ability to set symbol number, hatch, pattern etc. directly in the plot command. Only applies to that plot command. Use same syntax as OVERLAY. D 23.10.91 Add commands PLOT/NEXT, OVERLAY/NEXT to plot/overlay the next plots in memory. D 23.10.91 Bug in MN_PRJ if projecting onto a binned histogram and a value was too far outside limits. D 23.10.91 Default plotting mode changed to INTEGER. D 23.10.91 New command DIRECTORY = INDEX. D 23.10.91 When fetching several HBOOK plots from a subdirectory a new directory was created in memory every time. D 23.10.91 After an MN_STORE 0 all stores afterwards were treated as 0. D 23.10.91 Expressions of the type exp(4-2) could give errors or wrong answers. D 22.10.91 If you change the windowing parameters the next window is set to 1,1. To change it use SET NEXT. D 22.10.91 OVERLAY now has a default symbol number. D 21.10.91 Delimeters were not reset properly after aborting a macro. D 21.10.91 Condition handler switched to standard KUIP condition handler. Implemented on VAX, APOLLO, DECS, UNIX. D 21.10.91 New routine M_HOME to get home directory and MN_FIT_DIR etc. D 01.10.91 Limits when projecting expressions were done wrong by Dave Brown. Switched back to old method. D 01.10.91 Check in M_VGET to see if anything is typed. D 01.10.91 ADD, SUBTRACT still proceed even if 0 entries. Same done for MULTIPLY, DIVIDE and SCALE. D 01.10.91 Help added for SET NTUPLE. D 30.09.91 No check on raising a negative number to a real power. D 29.09.91 New command NTUPLE FILTER D 29.09.91 X windows interface D 04.09.91 DAT_STORE can now take a range of plots. D 21.08.91 Added condition handling for undefined exponentiation, log of 0 or -ve numbers and square root of negative numbers. D 25.08.91 Added code to speed up running and displaying on a local mode given by Jon Lewis. D 19.08.91 Added a SET FIT DEFAULT command. D 16.08.91 Condition handler for Apollo/Decstation. D 16.08.91 Add testing of event numbers to SCAN_TEST. Change test from a SUBROUTINE to a FUNCTION. D 15.08.91 CUT y.lt.1.0 does not work - JDL. ICB claims it is OK. Bug in parsing string if it was in lower case. D 14.08.91 Fixed bug to stop Mn_Fit crashing if plot limits set equal. D 14.08.91 Added new function - power law. D 14.08.91 Add option to turn off the use of bin width for functions. Make this the default, if the plot has 0 bin width. Check that this works OK with functions which have some points missing. D 01.08.91 Added number of events as a limit to SCAN. Changed SCAN to a function D 02.03.91 exam y1&5(3) only prints out y1&5 and then the value. D 22.02.91 Add command SET NTUPLE EVENT or something similar to limit the number of events scanned. Added as optional arguments to PROJECT, PLOT, FILTER, SCAN. D 31.01.91 Implement DI3000 interface. D 30.01.91 Move capture stuff to a new routine M_CAPT which will be put in the graphics patch. D 15.01.91 DRAW ARROW etc. does not exit as it should. D 16.11.90 After CLEAR get a GCLRWK error if I go straight into DRAW. D 21.09.90 In FUN FET use function name not number and correct the number if necessary so that I can renumber functions and still fetch them. D 07.09.90 Add ability to turn off condition handler. D 26.01.90 Add autoscaling for log scale?? Go to nearest decade above and below the plot limit (but not 0)! D 06.11.89 Ntuple operations: D Merging D Making a small one from a big one (FILTER) D SCAN command with COMIS to do fancy cuts and histogram filling ------------------------------------------------------------------------------ Below this line, implemented in 20.02.91 release. Version 3.01/00 D 04.02.91 Added new line modes 5,6,7,8 corresponding to HIGZ line modes 12,13,14,15. Add these mode to symbol.mnf. D 01.02.91 Add device 'None' everywhere as the first device. Mn_Fit should do everything except actually draw. Also should not switch to/from graphics D 01.02.91 Echoing of empty command lines was wrong. D 30.01.91 Typo in TVCAP meant that wrong conid was used if there was an error opening the hardcopy file. D 30.01.91 New routine to list the screen and hardcopy devices, TVHLP. Modify HELP SCREEN and HARD_DEV to make a single list of the devices available and say current list can always be founnd with capt ? or when starting up Mn_Fit. D 30.01.91 Tektronix for hardcopy renamed to Tekfile so that it does not conflict with the screen device D 30.01.91 EDIT/TPU and EDFOR now use callable TPU which should speed up their initialization. D 30.01.91 Add SET COLOUR REPRESENTATION index red green blue command so that you can specifiy your own colours. Must capture the device for it to work. D 15.01.91 FET filename id; cdir dirname; fetch id did not work. Modified M_SDIR so that it always uses input directory. D 15.01.91 Modified news scheme, so that news is in //mn_util/news/news and MN_VRS reads this file. The file gets written by mn_fit.lnk when a final version is made. D 15.01.91 Error return in SET NTUPLE was not implemented properly. D 21.09.90 Registers, parameters etc. did not work for getting secondary identifiers, in PROJECT etc. D 18.12.90 Number of plots fetched was not counted properly in DAT_FETCH, if same primary id's, but different secondary id's were used. D 18.12.90 SET X|Y|Z OPT_ZERO also changed whether exclusions were shown in a DISPLAY! D 17.12.90 Better protection of record length on Apollo. Now use RZFILE to check that it is OK. D 17.12.90 WKID is now fixed to be 1 for screen devices and 2 for hardcopies. Previously it kept on increasing and eventually caused GKS errors for Postscript files. D 12.12.90 Landscape Postscript added (Lpost) for GKSGRAL. Hardcopy number will add 100 to conid. D 12.12.90 CAPTURE does not give an error message if the device name is wrong. D 12.12.90 PARTITION only worked properly for monotonically increasing x values. Now they can go in either direction. Warning message printed if they don't. D 10.12.90 Overlay symbol, hatch and pattern numbers can now be registers, parameters, etc. Also for lego/surface plot angles. D 05.12.90 Add debug printout level and SET DEBUG command. Check still! D 05.12.90 Background subtraction does not work for variable sized bin plots. Have to use the data to get the x. D 03.12.90 M_SDIR improved. Now works properly in output also?? Check. D 03.12.90 New command MDIR to make a directory in memory. Used with STORE to store in other than top level directories. D 03.12.90 Offset of lego and surface plots from bottom left corner reduced from 1cm to 0cm. Scale now goes in margin as for all other types of plot. D 03.12.90 Y axis label was at wrong angle for lego/surface plots. D 03.12.90 It was not allowed to give the command SET Z OPT_ZERO. D 03.12.90 Can now specify variables which are weights/errors when projecting Ntuples. D 03.12.90 Bug in cut expression if value was a number (register etc.) If variable is an expression, value is always taken to be an expression. D 03.12.90 Bug in reading in of Ntuples with DAT_FETCH. D 03.12.90 Add possibility to plot Ntuples directly, using SET NTUPLE command to specify variables LIKE set order: SET NTUPLE id var1 X var2 Y var2 Z etc. D 26.11.90 ACONT (underflows, overflows etc.) was not being filled when reading in M_BOOK plots. Error was in MN_ERC. D 20.11.90 Add STORE/NEW or STORE/UPDATE as options to HBOOK4 storing. D 06.02.90 SET FONT only changes the header and comments. Make it more like SET COLOUR and THICKNESS. D 07.09.90 Tektronix does not work with DECGKS. D 07.09.90 Check out colour definitions. D 07.11.89 Add some example plots to show what Mn_Fit can do - can go with the manual. These are in DEMO directory. ------------------------------------------------------------------------------ Below this line, implemented in 15.11.90 release. Version 3.00/03 D 02.10.90 2-D functions were not declared DOUBLE PRECISION in XMNDFUN. This blew up on the Apollo. D 02.10.90 Allow access to overall normalization as in P0(1) etc. D 21.09.90 Fix occasional problem with _. Problem was that M_PRSE did not restore the list of characters allowed in a command. D 21.09.90 You must now type at least EXI to exit otherwise the command gets passed on to standard handler without a question. D 07.09.90 Add ability to parse cuts abs(x).le.3 etc. D 07.09.90 Add more math errors to condition handler. D 07.09.90 Make HBOOK means and sigmas available on request. D 07.09.90 Make a graphics mode of CONTOUR. - default in new MINUIT D 12.07.90 In MN_FTI set up a cross table of MINUIT <-> Mn_Fit numbering and use a subroutine to go back and forth D 12.06.90 Add integrating a function over a bin as an option D 12.06.90 Add autologging of commands as an option D 14.05.90 Add constraints to fitting. Use syntax: CONSTRAIN nfun npar comis_file To avoid COMIS could also use the parser in Mn_Fit. This would probably be a lot faster. CONSTRAIN nfun npar expression?? D 06.02.90 Add the COMIS template directly to the code. D 19.01.90 Add command CALL to call a COMIS routine. Must also put all the Mn_Fit routines and HBOOK routines into the list of routines known by COMIS D 19.01.90 Add an Ntuple test file. Put in check of ambiguous variable names. D 05.12.89 Add a 2-d Gaussian to standard list and check it out properly in tests. D 04.12.89 plot id&idb variables?? directly - automatic binning?? from Ntuples D 04.12.89 Ability to DEPOSIT into 2-d histograms Xid&idb(nbinx,nbiny) and Yid&idb(nbinx,nbiny), and Ntuples Xid&idb(npnt,var). Also add ability to get information out in the same way. D 07.11.89 Add aliases D? 07.11.89 Make L3 help stuff conditional??? - have to put help file into CMZ? Add a CSN-245A header for Cornell - put in MN_INTRO D 06.11.89 Add INCLUDE command D 06.11.89 Add new version of MINUIT. First step is to get rid of MINCOM and use subroutine calls for old minuit which have same names as new minuit calls. ------------------------------------------------------------------------------ Below this line, implemented in 10.09.90 release. Version 2.05/13 D 07.09.90 CUT should always expect a command D 07.09.90 MINUIT routine FTIME renamed to MFTIME D 07.09.90 Add ability to change Decwindow size to PLTSUB in TVRNG. D 06.09.90 Decwindows added to PLTSUB D 06.09.90 CUT keeps delimiters correct D 06.09.90 MIGRAD typeout of error definition fixed D 06.09.90 TYPSCN works on Decstations D 06.09.90 MESSAGE types to LUNDMP and can also output registers etc. D 06.09.90 CB line shape function fixed D 04.09.90 Grid on big ticks only does not work. Default grid symbol now set to 3 if grid turned on. D 03.08.90 Overlay with 1 point with x errors does not draw the errors right D 03.08.90 dep dx was wrong - fixed D 12.07.90 Add DRAW POLYGON D 12.07.90 New option SET RATIO for fitting many plots D 12.07.90 Plot units in DRAW now works in windowing D 26.06.90 Depositing of x values into a series of points is wrong D 26.06.90 Registers etc. did not work for histogram id's D 26.06.90 You will not be asked if you want to keep comments when reading commands from a file D 13.06.90 SET TIME only sets the date and not the time D 12.06.90 Improve aborting of plotting (particularly displays) D 12.06.90 Protect MIGRAD against overflows D 12.06.90 Fix random fixing of parameters D 12.06.90 Remove separate condition handler from MINOS D 12.06.90 Modify ARGUS function D 05.06.90 SHOW PLOT does not list the plots D 05.06.90 PART on 2-d plot does not put new bin definitions in new plot D 14.05.90 Add space for time to histogram header D 14.05.90 Add TIME card and SET TIME for DAT_FETCH DOK 14.05.90 Database interface for L3 DOK 14.05.90 FUN OVER/HIST did not scale area properly in command mode D 14.05.90 PROJECT of -1 dim plot to a histogram not correct D 14.05.90 STORE 0&IDB did STORE 0 D 14.05.90 Peterson/Bowler frag functions wrong D 14.05.90 Argus function wrong DOK 14.05.90 DO loops sometimes wrong - wait for example D 14.05.90 MINUIT sometimes fixes parameters forever DOK 06.01.90 Add option for lower limit not to be automatically zero New option SET X|Y|Z OPT_ZERO for want of a better name D 23.04.90 Most sizes you can SET can now be registers, parameters etc. D 03.04.90 DEFINE protected against overwriting DOK 03.04.90 LEGO and SURFACE z ticks are sometimes off scale D 06.02.90 Leave space for the symbol in the lego header. D 06.02.90 Improve the calculation of the number of lines in M_HEAD. D 06.02.90 Check out that parameters can be passed in single or double quotes to macros. DOK 19.01.90 Add setable flag for turning off requests for next plot DOK 05.12.89 In FUN PLOT must set orthogonality limits if they haven't already been set. D 08.11.89 Add message facility to dump what is going on if ECHO is off D 08.11.89 If no bin width given, but requested by ORDER, lower limits are not correct ------------------------------------------------------------------------------ Below this line, implemented in 15.02.90 release. Version V2_05. DOK 14.02.90 Slices, projections and bands now work again DOK 14.02.90 Text format modified in IQSTYP. Now if no quotes, rest of the line is taken. New function ISLTYP to get a single word without chaning the case. DOK 14.02.90 Changed HBOOK numbering, so Ntuples are OK. HBOOK number is now the same as the Mn_Fit primary id. DOK 09.02.90 Add segments for comments, keys etc. Add new command SHOW SEGMENTS. DOK 09.02.90 Add command SHOW DEFINITION as alias for SHOW COMMANDS DOK 09.02.90 Bug in segment numbers when doing FUN PLOT in second window DOK 09.02.90 Check the AREA calulation for FUN PLOT not after a display. Check that IBINNM, XMINNM and XMAXNM are correct. DOK 30.01.90 Check whether ( is OK as first character in DEPOSIT D 05.01.90 Add registers 201+ for plot limits and coordinates D 05.12.89 Catch files that cannot be opened in HARDCOPY DOK 07.11.89 FUNCTION OVER does not scale properly when plotting in 2 or more windows for a peaked signal type function (i.e. Gaussian) which use the bin width! FUN PLOT and then OVERLAY the hist things are OK ------------------------------------------------------------------------------ Below this line, implemented in 06.02.90 release. Version V2_04. DOK 30.01.90 Add FORTRAN error codes when problems opening a file D 30.01.90 Clean up user routines in MNFILL etc. Now have MNFILL, MNFIL1, MNFIL2, MNFILN, MNFILF. DOK 29.01.90 Add 2-d histograms as possibility for histogram fitting D 29.01.90 Add CB line shape DOK 26.01.90 Check that SET PLOT id DEFAULT is the same as SET HIST D 26.01.90 Abort option when asking for in plotting a range must be implemented properly. D 26.01.90 Check device type unknown in GTSGRAL 7878 did not work D 26.01.90 Add NTUPLE DUMP command - same as HIST DUMP DOK 26.01.90 Add a bit of blurb in HELP SET about top, bottom, left right etc. and the priority of frame etc. D 22.01.90 Add grid - set GRID ON|OFF [option symbol] D 19.01.90 Add new TYPSCN routine IQSTYP to cope with quoted strings DOK 19.01.90 Add list of functions available to HELP in DEPOSIT D 18.01.90 Check out ambiguous variable names when using numbers in the name for PROJECT DOK 18.01.90 Add dumping of Ntuples to MN_DMP DOK 18.01.90 Add routine to set HBOOK directories on file and in memory to the same subdirectory DOK 18.01.90 Fixed bug in listing ambiguous commands DOK 15.01.90 Add command ZDIR to do RZDIR and let LDIR to HLDIR D 05.01.90 Check that I can fill histograms with weights D 05.01.90 Remove flexible number of arguments as an option in MNFILL D 20.12.89 Make sure I can read filenames with / properly D 04.12.89 FORTRAN functions in deposit (INT, ABS, NINT, MOD) DOK 04.12.89 Recall of previous commands - added to TYPSCN DOK 04.12.89 More help on HESSE and MODIFY DOK 04.11.89 Bug with multiple parentheses at end of CUT USE line DOK 09.11.89 Add WAIT command D 09.11.89 Add z scale for lego plots DOK 09.11.89 Check out use of colour and line thickness - duplication between SET COLOUR etc and SET SCAL, LABEL etc. DOK 09.11.89 Add feature =+2.0 etc. to modify a value by a certain amount DOK 09.11.89 MN_ERR calls MN_ABO if in a defined command or a file DOK 08.11.89 Mean and sigma not done properly for series of points and scatter plots DOK 08.11.89 ENDDO card cannot be abbreviated - check in MN_CMD removed DOK 08.11.89 Handle asymmetric x errors properly when fitting D 08.11.89 Log scale in display if function goes negative bombs Would always bomb for any negative entries - add a check in the test routines DOK 08.11.89 Change y-offset of x scale to -0.6 DOK 07.11.89 Delimit text strings with ' ' - put in MN_ETX first DOK 07.11.89 Add GSDS to TVCAP to speed up hardcopies DOK 07.11.89 Fix number of bins when fitting from DAT_FETCH DOK 07.11.89 Check getting titles and date in LDIR DOK 07.11.89 Check out index with long filenames DOK 07.11.89 Get hardcopy segment fixes from Cornell - M_CRSG, M_CLSG MN_PLT and MN_DRW DOK 07.11.89 Get updated include form TVDEV at Cornell - not used DOK 07.11.89 Get help working from SET then HELP DOK 07.11.89 Get TeX file fixes from Cornell DOK 07.11.89 Update MINUIT help MENU to include all commands DOK 07.11.89 Rebin should not allow 0 as first bin! DOK 07.11.89 Tidy up efficiency calculation - Frank, Paul?? DOK 06.11.89 No help (or debug) for ITERATION, NO_ITERATION DOK 06.11.89 Grinell picture is offset 5.5/25 cm in x 4.3/19 cm in y DOK 06.11.89 GKS segment errors in hardcopy DOK 06.11.89 1 or 2 column format for MN_ENM - check number of variables? DOK 06.11.89 Funny state if CTRL_C to stop a plot - check DOK 06.11.89 Plotting window moving from MN_CMD to MINUIT - only Decwindows ask Jon to check in TVRNG - check whether same window position on page is used DOK 06.11.89 Polynomial * Exponential function - check it out and write it up properly DOK 06.11.89 Add HBOOK storage for Ntuples in input DOK 06.11.89 In DEFINE @@1 etc. means don't translate the @1 DOK 06.11.89 Check out HATCH_TEST and try to make it work everywhere D 06.11.89 Check out CUT DEL 0 if there are no cuts +PATCH,NEWS,T=TEXT. +DECK,NEWS. ! ! This is the news that Mn_Fit prints out when it starts up. ! Comment lines must have an ! in column 1 or 2. ! This file should be updated every time a new version is released. ! It goes to mn_fit_dir:mn_news.fil or $MN_FIT/mgr/mn_news.fil. ! The file is automatically made if a final version of Mn_Fit is linked. ! A line !END signals the end of the file, to stop continued scanning. ! *** Version 4.07/35 17/09/2003 *** +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ WARNING Serious bug when combining simple cuts with more + +++ complicated expressions fixed - see HELP CUT + +++ Bug with comment lines inside DEFINEd command fixed + +++ NOTE Length of Ntuple variable names increased to 32 characters + +++ NOTE You must change the length of TAGS in COMIS functions + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ *** Improvements in colour handling. Background colour can now be set. *** Function DATE_TIME now called DATE_TIM - see HELP EXPRESSION. *** RZ files can be merged using the HMERGE command. *** *** Version 4.06/14 06/04/2000 *** *** New symbols added with lines on end of error bars - see HELP SYMBOL. *** Labels can now be aligned with edge of plot - see HELP SET LABEL. *** *** Version 4.06/10 04/04/2000 *** *** Fixes to cope with Y2K. Years from 2000 onwards can be given as *** 2 digits or adding 100, e.g. 12-FEB-2001 can be given as either *** 010212 or 1010212. See HELP TIME or HELP Y2K. *** L3 database interface requires the second form. *** *** Default font is now -1004, i.e. Helvetica in Postscript files, but *** default IGTEXT font as before on the screen. *** *** Version 4.05/34 16/06/99 *** +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ NOTE All Mn_Fit functions now include the bin width. + +++ NOTE This affects normalisation constant for some functions + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ *** !END *** CWN variables can be accessed in expressions. *** Cuts can now be named. *** Histograms and Ntuples can be accessed directly from their RZ file. *** Improvements in lego, surface and contour plots. *** Simplified syntax for German characters with umlauts. *** ELIF allowed in IF blocks, default parameter values can be given. *** Directories can be added to the PATH. *** Linux version is available. *** *** Version 4.04/15 12/06/96 *** *** Directory PATH for filename search added - see HELP SET PATH. *** Expanded plotting options for 2-D histograms - see HELP 2DIM. *** Lego and surface plots with log scale for z-axis added. *** Plotting vs date and time now supported. *** New functions added for expressions and Ntuple projections. *** *** Version 4.03/49 15/09/95 *** *** ColumnWise Ntuple support added. *** Plots in terms of pi are possible. More header information available. *** Drawing improved. *** Continuation lines are possible. Command lines can be parsed before *** being executed meaning numbers can be translated into characters. *** WARNING - the syntax of SET NTUPLE command has changed. *** *** Version 4.02/19 25/07/94 *** *** New fitting options and qualifiers added, including quick fits. *** Smoothing and spline fitting improved and new options added. *** A histogram can also be drawn as a smooth curve. *** The working directory for files can be specified. *** Colour can be turned on and off. Global title added. *** *** Version 4.01/21 20/12/93 *** *** NOTE that the STORE command stores histograms in RZ Exchange format. *** This means that the histograms cannot be read by old versions of *** Mn_Fit or PAW. *** *** Command recall and history available using GNU readline. *** As ! is used for command line history you must use \! if you want an *** ! interactively. *** Default font is now -1013 for L3 - see HELP TEXT. *** *** CDIR command has changed - use SET DIR before a FETCH. *** MIN,MAX allowed in expressions. *** Chebyshev and Legendre polynomials changed - threshold function added. *** DRAW much improved with fetching and storing of pictures and new items. *** Colours can now be given by their names. *** Preliminary interface to IGTABL added for contour plots etc. *** Version 3.03/05 22/12/92 *** New commands for shifting and scaling axes, XSHIFT, XSCALE etc. !*** New function CHEBYSHEV, NLEGENDRE, FERMI !*** Bug fixes - see HELP CHANGES !END *** Version 3.03/02 22/09/92 *** Fit functions can be convoluted with a Gaussian. !*** IF statements are allowed in macros. *** Profile plots can be made from Ntuples. *** Ntuples are automatically refetched if needed. *** Improved comment and key positioning with the mouse. !*** New commands for shifting and scaling axes of plots. !*** Mn_Fit works fully on most Unix platforms. !END !*** Version 3.02/16 19/11/91 !*** You can specify the number of events to scan in Ntuples. ! New command NTUPLE FILTER. Number of Ntuple dimensions increased (256). !*** New plotting options: PLOT/NEXT and including symbol in PLOT command. !*** Comments and keys can be positioned using the mouse. !*** Preliminary version of automatic log scaling introduced. !*** X Windows and Decstation versions available. ! !*** Version 3.02/00 21/08/91 !*** NTUPLE SCAN uses a function rather than a subroutine. !*** New options for fitting and functions - SET FIT and FUNCTION. !*** Power law function added. Extra condition handling added. !END !*** Version 3.01/03 25/03/91 ! WARNING - This is a substantial update with new CERN Minuit. ! WARNING - New CERN Minuit introduced. ! WARNING - Many changes and additions, particularly to fitting and ! Ntuple manipulation. See HELP CHANGES V3_01_03 for details. !*** This is the first official Apollo release. !*** A new manual is available including demonstration macros. +DECK,rel_v401. Mn_Fit version 4.01/21 is hereby released. This has small bug fixes with respect to 4.01/16: `Set colour' with a colour number was not right, circular symbols had the wrong colour for the rim sometimes, `Show tick' and 'Show label' had small bugs and `Display' or `Fit_info' of 1000 bin histograms caused a divide by 0. HBOOK histograms are now all fetched with hunpak and hunpke. This should be faster than using hi and hie. In addition commands like set x label '(GeV/c^2!)' do not work interactively with readline verisons, because ! is used for history. You must give the command set x label '(GeV/c^2\!)'. This meant a fix to typscn also to substitute `\!' with `!'. Version 4.01/16 has command recall and history for all Unix machines using GNU readline routines. It is adapted to the new kuip condition handling routines. This means that the main routines are written in C. In addition I have included the necessary kuip include files in the Mn_Fit cmz file. This means that the version of the CERN library that is being used must be given. This version also runs on Alpha machines. I assume that the symbol ARCHITECTURE="ALPHA" exists on Alpha machines. There are now install scripts for Vax, Alpha, Apollo, HP, Decstations and SGI. The scripts have been used on Vax, Alpha, Apollo, HP and Decstations. Scripts for other Unix machines can be generated trivially. I just need to know if the machine has bsd or sys5 flavour of unix. These scripts are also included in the standard directories. Note that this version of Mn_Fit is only compatible with version 93d of the CERN libraries. This is because there are some changes in the syntax of a few CMZ commands that I use. For Unix machines I have a compressed tar file of the Mn_Fit code and the hp executable. This can be obtained from the directory /user/brock/mn_fit/tar. The following files are there: mn_fit.tar.gz Mn_Fit source and install scripts mn_fit_x.exe.hpux.tar.gz Mn_Fit hpux X windows executable + other files mn_fit.ps.tar.gz Mn_Fit manual To unpack one of these files do the following: cd $MN_FIT (or cd the Mn_Fit top-level directory) gunzip filename.tar.gz (or gzip -d ...) tar xvf filename.tar If you get mn_fit.tar.gz you will have the Mn_Fit car files, the install scripts and GNU readline compressed tar file. You can then run the appropriate install script. The Mn_Fit source code can be obtained from the following directories: Vax: vxl3j0::l3daq$dat:[gra.mn_fit.pro] vxcern::disk$scratch:[l3.week.brock.mn_fit.pro] lns62::ud:[mn_fit.pro] cmphys.phys.cmu.edu col$root:[brock.mn_fit.pro] Apollo: CERN /user/brock/mn_fit/pro Hp: CERN /user/brock/mn_fit/pro IBM: cernvm brock.499 Decstations: fermi.phys.cmu.edu /users/brock/mn_fit/pro lns717.lns.cornell.edu /cdat/tem/mnfit/pro Note that the files on vxcern may disappear after a while as I do not logon there very regularly. The following files should be copied from these directories: mn_fit.car mn_util.car typscn.car minuit.car install.vms -> install.com (VMS) install.hpux (HP) install.decs (Decs) install.sgi (SGI - not tested) install.apollo (Apollo) mn_fit.doc mn_readline-1.1.tar.gz (Unix machines) mn_readline-1_1.tar_gz (from VMS for Unix) readline.tar_gz (from CERNVM for Unix) These directories will saty there for as long as I regularly login to vxcern! If you get the files by ftp then you should do a binary get on mn_readline-1.1.tar.gz. For Unix machines I also have a compressed tar file that I can mail to you if you cannot access any of the nodes given above. If I mail you this file you need to do the following: From mail: Save the mail to a file in the Mn_Fit top-level directory (or /tmp). e.g. in elm: s $MN_FIT/mn_fit.tar.gz.mail or /tmp/mn_fit.tar.gz.mail Outside mail: cd $MN_FIT (or cd the Mn_Fit top-level directory) uudecode mn_fit.tar.gz.mail (or /tmp/mn_fit.tar.gz.mail) Then follow the procedure given above to unzip and detar the file. The install procedure should be fairly self-explanatory. On Unix machines I assume that you have cmz. In theory it is possible to get all the Fortran on VMS, but I have not tried that option. More documentation can be found in mn_fit.doc. Vax and Alpha machines: _______________________ The standard way to define the cmz command on VMS is: cmz == "@cern:[pro.exe]cmz" This does not work with cmz/batch. You must redefine cmz to be something like: cmz == "$cern:[cmz.pro.exe]cmz.exe" Decstations: ____________ For the moment I have had some difficulty compiling the c version of the Mn_Fit main program on Decstations. I have changed the c compiler command to c89 and this works fine at Cornell. If you do not have c89, then you must change the command to cc in //mn_util/$kumacs/mn_macro and also change mn_fit.lnk to include mn_main.o instead of mn_main_cc.o there. Please let me know if you still have problems. Apollo: _______ Note that the command recall version does not work properly in Apollo pads. I therefore check the TERM environment variable on the Apollo and if it is "Apollo" then I run the non-readline version. This means doubling the number of executables on Apollos. Regards Ian +DECK,REL_V301. Version 3.01/03 of Mn_Fit is hereby released. There are many changes in this version of Mn_Fit, particularly in the code storage. All necessary code, files ... are now kept in 4 CMZ files. With this release the CMZ files mn_fit.cmz and mn_util.cmz have been cleaned up and all history has been removed. In the following mail I will send you the installation instructions which can also be found in the file mn_util.cmz, in the deck //mn_util/doc/install. The installation has been tested for L3 on the Vax and Apollo with GKSGRAL and DECGKS graphics interfaces. There are probably errors for other institutes. Please let me know what problems you have and any fixes you find for them. In particular the Decstation implementation is certainly not complete and you should probably start from the Apollo version. Jon Lewis is working on the DI3000 version at FNAL and a preliminary version of the code is released with this version. Note that the Mn_Fit help library has been renamed to mn_fit.hlb and that all manual and demonstration files (including symbol.mnf) have been moved to mn_fit_help:. Regards Ian +DECK,REL_V302. Mn_Fit version 3.02/11 is hereby released. This version includes an X Windows interface. The DI3000 interface is running at Fermilab. The Decstation version has been improved and been tested with X Windows. It can also run with DGKS3D and XGKS (from Cornell). I would hope to drop the XGKS interface in the near future as it apparently has bugs and is not officially supported anywhere. There is some work going on to get Mn_Fit working on Sun workstations and interest has also been expressed in IBM RISC processors. I have added a new flag UNIX for all Unix machines and the flags APOLLO and DECS are reserved for Apollo or Decstation specific code. The current Unix version creates links in the users home directory. In the next version I intend to replace these with environment variables. There have been quite a few bug fixes, particularly for Ntuples. Note that projecting onto expressions had an error in the limts calculation for early 3.02 versions and projecting onto a binned histogram could also give unpredictable errors, if a value was too far outside the limits. You should have HIGZ version 1.12 or greater for the X Windows of Mn_Fit and preferably 1.13. I had to add a C routine to set environment variables. For the compilation of this to work properly you need CMZ version 1.37/08. Otherwise you have to compile it yourself - $MN_FIT/lib/mn_util_cc.c. The same applies to the TYPSCN routine typscn_cc.c for Decstations. The default setup for each experiment is now in the deck //mn_util/cdes/expnam. The default graphics package is in //mn_util/cdes/grafpack. The CERN libraries are in //mn_util/cdes/cernlib and //mn_util/cdes/graflib. You may have to make changes to these for your institution. Again if you have to modify any of the decks please let me know and I will try to include the changes in my cmz files. Regards Ian +DECK,BUG_V302. Mn_Fit version 3.02/16 is hereby released. This version contains bug fixes relative to version 3.02/11. In addition it contains 2 new commands SET BREAK and SET MOUSE and the ability to use the mouse to position comments and keys. I will store the Mn_Fit code in the following directories: Apollo: /user/brock/mn_fit/pro Vax: vxl3on::l3daq$dat:[gra.mn_fit.pro] CERNVM: brock.499 I will keep the cmz and car files. The car files contain the latest version only - no history. Correction cradles mn_fit_mods.cra, mn_util_mods.cra with respect to the previous release mn_fit 3.02/11, mn_util 1.03/07 can be found in the same directories. There was an error in the sizing of the windows with Decwindows. The X Windows interface has been improved. Break handling is no longer turned on and off in the program. If a user has problems with the break handling please let me know. Note that if Mn_Fit is doing I/O on the Vax you should always do a CTRL_O before a CTRL_C. Falco's now work properly with DECGKS. Xterm now works properly on Decstations and Apollos. The pictures are centred properly in X Windows. Note that HARDCOPY POST will give an error 54 in GSWKVP if you are using Decwindows. This is a HIGZ bug and will be fixed in the next release. However the error does not affect the HARDCOPY. The DEC GKS3D version on Decstations apparently dies if you try to close the hardcopy files. This is being worked on at Cornell. The Mn_Fit code can now be copied from CERNVM. If you have a CERNVM account do: ftp cernvm.cern.ch OR zftp cernvm.cern.ch username username password password cd brock.499 cd brock.499 get mn_fit.car getrz mn_fit.cmz get mn_util.car getrz mn_util.cmz get typscn.car getrz typscn.cmz get minuit.car getrz minuit.cmz I am trying to find out if there is an easy way to copy the files if you do not have a CERN account. Again if you have to modify any of decks please let me know and I will try to include the changes in my cmz files. Regards Ian +DECK,REL_V303. Mn_Fit version 3.03/04 is hereby released. This release contains bug fixes with respect to 3.03/02 plus some new functions and new commands for shifting or multiplying the scales for plots. New interfaces for this version include IBM RS6000, SUN and SGI machines. Spawning, editing etc. now work properly for all Unix machines and it should be easy to get Mn_Fit running on other Unix machines. This release contains the final version of the code. I am still working on an updated version of the manual that should be ready within a few days. When that is done mn_util.cmz will be rereleased and its version number updated. The X-windows interface has been much improved. If you have the DISPLAY variable defined, or give it as part of the Mn_Fit startup (using the -n option), just hit when prompted for the screen device. Links have been replaced by the environment variable MN_FIT. All Mn_Fit directories should be sub-directories of this variable. The sub-directories can of course be links to other areas if you do not have enough disk space on the $MN_FIT directory tree. Note that the scripts to link Mn_Fit are now kept in $MN_FIT/mgr. Users can therefore delete any links to Mn_Fit directories that they have in the $HOME area. There was a serious error in merging Ntuples. The first 100 entries of the first Ntuple were set to 0! The reason for this is not understood, but has now been fixed. The framework for convoluting a Gausssian with a function has been installed. A preliminary version will be included in the release. Note for X Windows: You should link with cnl203 or later, as there were bugs in the sizing of pictures and in the drawing of overlayed functions in earlier versions of the CERN libraries. Note for Decstations: v92a of the CERN libraries was compiled with the new DEC non-mips compiler. Therefore if you use the mips compiler on your machine you must link with cnl203. Regards Ian +DECK,BUG_V303. Mn_Fit version 3.03/05 is hereby released. This version contains bug fixes relative to version 3.03/02. In addition the INSTALL command file is now available for the Vax and has been included in the //mn_util/exec patch. The line editing code for Decstations and SGI has been added to //mn_util. Bug fixes: mn_spw: Vax editors are always spawned because of problems when linking with v92b or cernlib. mn_sum: Orthogonality limits properly respected when integrating Chebyshevs and Legendres. mn_ffl: mn_fun: Histograms of functions get proper axis labels and contents. tyqred: IF's fixed. m_ifprs: Missing CDE,MNCMD added. valsub: vl2typ: Fix for parsing user variables. m_tprt: Use of CERN times corrected. m_excl: Fix prompt for INCLUDE. igasci: Routine from HIGZ added to the FALCO patch, which is used by VAXGKS and DEC GKS3D so that they can work with Falco terminals. IGASCI was not available in older versions of HIGZ. falco: Select flag $GRAPHICS missing from the patch. INCLUDE Help added. Regards Ian +DECK,REL_V402. Mn_Fit version 4.02/19 is hereby released. This version includes a new version of the Mn_Fit manual with some extra figures, all the new commands, up-to-date information on fonts and an index. The manual is distributed as a Postscript file - I will not attempt to make the LaTeX compatible with all machines. The install scripts for all Unix machines are being merged into one - install.unix. I need to know the value of the environment variable SYSTEM on the relevant unix machine. Mn_Fit can now be obtained via anonymous ftp - see below. The same compressed files are available on the L3 HP's in the directory /user/brock/mn_fit/tar. The Mn_Fit source code can also be obtained from the following directories: Vax: vxl3j0::l3daq$dat:[gra.mn_fit.pro] vxcern::disk$scratch:[l3.week.brock.mn_fit.pro] HP: CERN /user/brock/mn_fit/pro IBM: cernvm brock.499 Decstations: fermi.phys.cmu.edu /users/brock/mn_fit/pro Alpha: lns101.lns.cornell.edu /home/mnfit/pro Note that the files on vxcern may disappear after a while as I do not logon there very regularly. The following files should be copied from these directories: mn_fit.car mn_util.car typscn.car minuit.car install.vax -> install.com (Vax) install.unix (Unix) mn_fit.doc mn_readline-1.1.tar.gz (Unix machines) mn_readline-1_1.tar_gz (from Vax for Unix) readline.tar_gz (from CERNVM for Unix) If you get the files by ftp then you should do a binary get on the readline file. If you get readline from CERNVM or a Vax then you should rename it to mn_readline-1.1.tar.gz. +DECK,bug_v402. The following bugs are known to exist in Mn_Fit 4.02/19: 1) There is no protection against trying to draw more than 50 items. 2) If you use `HIST FILL' and use the contents of another histogram in the command, Mn_Fit can get confused: Suppose histogram 2 is a normal binned histogram and you want to make an unbinned histogram with the same x-axis: set plot 2 default book/unbin/err 1 'Title' 1 100 do i=1,r131 dep r1 = @i dep r2 = 2*sqrt(i) fill 1 x2(@i) r1 0.0 r2 enddo This will not work. You have to do the following: set plot 2 default book/unbin/err 1 'Title' 1 100 do i=1,r131 dep r1 = @i dep r2 = 2*sqrt(i) dep r3 = x2(@i) fill 1 r3 r1 0.0 r2 enddo +DECK,REL_V403. Release Notes: ______________ Mn_Fit version 4.03/49 is hereby released. The install scripts for all Unix machines have been merged into one - install.unix. I need to know the value of the environment variable SYSTEM on the relevant unix machine. The installation script for VMS systems is now called install.vms. Mn_Fit can also be installed using patchy rather than cmz. The cmz installation works with version 1.47 of cmz (95a Cernlib). It should also work with the 1.46 (94b) version, although I have not tested it. It gives errors with the 94a version. The default version of Mn_Fit is now X11 for all platforms. Note that this version of Mn_Fit is only compatible with versions 93d, 94a, 94b and 95a of the CERN libraries. Most testing has been done with 95a. The CWN interface only works with 94b or later. The C. Rippich version of MINUIT file, minuit.cmz (or .car) has been renamed to cgr_minuit.cmz. You should delete any minuit.cmz, minuit.kumac file in you cmz directory. Some machine dependent information is given below. SGI: ____ Compiling readline with the CC command causes an unresolved external alloca on the L3 SGI machine. I do not know if this happens elsewhere. Compiling with gcc is OK. Sun: ____ The cc command gives an error in hkuip_h.h. This error does not occur with gcc. If gcc is in /usr/local/lib, this directory is not put in the default path when compiling from cmz so you must make a link from your bin directory. e.g. cd ~/bin; ln -s /usr/local/bin/gcc gcc. Alternatively, when you are prompted for the c compiler command you can change it to: /usr/local/bin/gcc ... VMS machines: _____________ The standard way to define the cmz command on the VMS is: cmz == "@cern:[pro.exe]cmz" This did not work with cmz/batch. You therefore had to redefine cmz to be something like: cmz == "$cern:[cmz.pro.exe]cmz.exe" With the 95a release of the Cernlib the standard definition appears to work properly, so thee change of the cmz command is no longer necessary. Apollo: _______ Note that the command recall version does not work properly in Apollo pads. I therefore check the TERM environment variable on the Apollo and if it is "Apollo" then I run the non-readline version. This means doubling the number of executables on Apollos. Version 4.02 of Mn_Fit is the last version that I will support on the apollo's. +DECK,rel_v404. Release Notes: ______________ Mn_Fit version 4.04/15 is hereby released. The install scripts for all Unix machines have been merged into one - install.unix. I need to know the value of the environment variable SYSTEM on the relevant unix machine. The installation script for VMS systems is now called install.vms. Mn_Fit can also be installed using patchy rather than cmz. The cmz installation works with version 1.47 of cmz (95a Cernlib). It should also work with the 1.46 (94b) version, although I have not tested it. It gives errors with the 94a version. The patchy installation uses nypatchy if possible. This works well for 95a, but there is a problem with splitting files in the 94b version, so that you cannot make the test files. The default version of Mn_Fit is now X11 for all platforms. Note that this version of Mn_Fit is only compatible with versions 94b, 95a and 96a of the CERN libraries. Most testing has been done with 95a. The C. Rippich version of MINUIT file, minuit.cmz (or .car) has been renamed to cgr_minuit.cmz. You should delete any minuit.cmz, minuit.kumac file in you cmz directory. Mn_Fit should also be available via my home page on www: http://wwwcn.cern.ch/~brock Some machine dependent information is given below. HP: ___ There appears to be a bug in the optimizer using the -O option unless patch http://wsspinfo.cern.ch/patch/PHSS_6311 has been included. It seems to blow up on lego plot transformations when doing calculations such as (-2.0 - -2.0)!! I have therefore changed the default optimization to +O1 for this version of Mn_Fit. SGI: ____ Compiling readline with the CC command causes an unresolved external alloca on the L3 SGI machine. I do not know if this happens elsewhere. Compiling with gcc is OK. Sun: ____ The cc command gives an error in hkuip_h.h. This error does not occur with gcc. If gcc is in /usr/local/lib, this directory is not put in the default path when compiling from cmz so you must make a link from your bin directory. e.g. cd ~/bin; ln -s /usr/local/bin/gcc gcc. Alternatively, when you are prompted for the c compiler command you can change it to: /usr/local/bin/gcc ... VMS machines: _____________ The standard way to define the cmz command on the VMS is: cmz == "@cern:[pro.exe]cmz" This did not work with cmz/batch. You therefore had to redefine cmz to be something like: cmz == "$cern:[cmz.pro.exe]cmz.exe" With the 95a release of the Cernlib the standard definition appears to work properly, so thee change of the cmz command is no longer necessary. Apollo: _______ This version of Mn_Fit has not been tested on an Apollo. +DECK,rel_v405. Release Notes: ______________ Mn_Fit version 4.05/34 is hereby released. There is one install script for all Unix machines - install.unix. I need to know the value of the environment variable SYSTEM on the relevant unix machine. The installation script for VMS systems is now called install.vms. This release is the first version that also runs under Linux. Mn_Fit can also be installed using patchy rather than cmz. The cmz installation works with version 1.47 of cmz (95a Cernlib). It should also work with the 1.46 (94b) version, although I have not tested it. It gives errors with the 94a version. The patchy installation uses nypatchy if possible. This works well for 95a, but there is a problem with splitting files in the 94b version, so that you cannot make the test files. The default version of Mn_Fit is now X11 for all platforms. Note that this version of Mn_Fit is only compatible with versions 94b, 95a, 96a and 97a of the CERN libraries. Most testing has been done with 96a and 97a. If you use the 96a or earlier version of the CERN libraires, you cannot use the routine FUNLUX and FUNLXP in COMIS functions, as these are new routines in the CERN libraries. readline version 2.2 is now available. If you install Mn_Fit with patchy, you have to create the readline libraries yourself, if they have not been installed for you. Note that if you want to change the location of the readline library that is used, you should create a link in the $MN_FIT/lib directory to the readline include files. If neither a link nor a directory already exist, the install script will prompt you for them. The C. Rippich version of MINUIT file, minuit.cmz (or .car) has been renamed to cgr_minuit.cmz. You should delete any minuit.cmz, minuit.kumac file in you cmz directory. Mn_Fit is available via my home page on www: http://www-zeus.physik.uni-bonn.de/~brock/mn_fit.html. This has replaced the previous standard homepage at CERN: http://home.cern.ch/~brock/mn_fit.html. If you try to access the CERN homepage you will automaitcally be switched to the Bonn page. Some machine dependent information is given below. ALPHA: ______ When using COMIS on alpha machines running Unix, I often get the error: Unaligned access pid=32259 va=5859c6c pc=2075a9c ra=2075a98 type=ldt This does not appear to have any effect on the result, but writes an awful lot onto the screen! HP: ___ There appears to be a bug in the optimizer using the -O option unless patch http://wsspinfo.cern.ch/patch/PHSS_6311 has been included. It seems to blow up on lego plot transformations when doing calculations such as (-2.0 - -2.0)!! I have therefore changed the default optimization to +O1 for this version of Mn_Fit. Linux: ______ It assumes that you have gcc available and that g77 is also available (f77 is often a link to g77). In this case it all seems to work well. Note that on the Bonn system the readline library is in /usr/lib and the termcap library is in /usr/lib/termcap. I therefore have to link with the options: -r /usr/lib -rt /usr/lib/termcap There are currently some inconsistencies between Suse 6.2 Linux, which uses glibc 2.1 instead of 2.0, and the CERN libraries. In Bonn and Hamburg fixes exist for this problem. I have only tried to make the Linux version with nypatchy. SGI: ____ Compiling readline with the CC command used to cause an unresolved external alloca. This is fixed with readline version 1.2 that is distributed with Mn_Fit. Compiling with gcc is OK. With the upgrade to IRIX version 6, there are a number of incompatible compiler options available. The 97a (and earlier) release of the CERN libraries uses the -mips2 flag. If you make the readline library yourself, you should use the following options for configure: CFLAGS='-g -O -mips2' ./configure If you get a segmentation violation while loading it probably means that incompatible mips options have been used somewhere. Sun: ____ The cc command gives an error in hkuip_h.h. This error does not occur with gcc. If gcc is in /usr/local/lib, this directory is not put in the default path when compiling from cmz so you must make a link from your bin directory. e.g. cd ~/bin; ln -s /usr/local/bin/gcc gcc. Alternatively, when you are prompted for the c compiler command you can change it to: /usr/local/bin/gcc ... On Solaris machines you also often have to give the full path of the FORTRAN compiler. In addition, unless you are using the 96a version of the CERN libraires (not yet tested), you should also give the compiler option -DSolaris2 to avoid problmes with vfork.h. VMS machines: _____________ The standard way to define the cmz command on the VMS is: cmz == "@cern:[pro.exe]cmz" This did not work with cmz/batch. You therefore had to redefine cmz to be something like: cmz == "$cern:[cmz.pro.exe]cmz.exe" With the 95a release of the Cernlib the standard definition appears to work properly, so thee change of the cmz command is no longer necessary. Apollo: _______ This version of Mn_Fit has not been tested on an Apollo. +DECK,rel_v406. Release Notes: ______________ Mn_Fit version 4.06/14 is hereby released. The main reason for this release of Mn_Fit is for Y2K compatibility. CERNLIB is only Y2K compatible for version 98 onwards. Although Mn_Fit will compile with older versions, I do not guarantee any date related items will work with older versions. There is one install script for all Unix machines - install.unix. I need to know the value of the environment variable SYSTEM on the relevant unix machine. The installation script for VMS systems is called install.vms. This release is the first version that also runs under Linux. Mn_Fit can also be installed using patchy rather than cmz. The cmz installation works with version 1.47 of cmz (95a Cernlib). It should also work with the 1.46 (94b) version, although I have not tested it. It gives errors with the 94a version. The patchy installation uses nypatchy if possible. This works well for 95a, but there is a problem with splitting files in the 94b version, so that you cannot make the test files. The default version of Mn_Fit is now X11 for all platforms. If you use the 96a or earlier version of the CERN libraires, you cannot use the routine FUNLUX and FUNLXP in COMIS functions, as these are new routines in the CERN libraries. readline version 2.2 is now available. If you install Mn_Fit with patchy, you have to create the readline libraries yourself, if they have not been installed for you. Note that if you want to change the location of the readline library that is used, you should create a link in the $MN_FIT/lib directory to the readline include files. If neither a link nor a directory already exist, the install script will prompt you for them. The C. Rippich version of MINUIT file, minuit.cmz (or .car) has been renamed to cgr_minuit.cmz. You should delete any minuit.cmz, minuit.kumac file in you cmz directory. Mn_Fit is available via my home page on www: http://www-zeus.physik.uni-bonn.de/~brock/mn_fit.html. This has replaced the previous standard homepage at CERN: http://home.cern.ch/~brock/mn_fit.html. If you try to access the CERN homepage you will automatically be switched to the Bonn page. Some machine dependent information is given below. ALPHA: ______ When using COMIS on alpha machines running Unix, I often get the error: Unaligned access pid=32259 va=5859c6c pc=2075a9c ra=2075a98 type=ldt This does not appear to have any effect on the result, but writes an awful lot onto the screen! HP: ___ There appears to be a bug in the optimizer using the -O option unless patch http://wsspinfo.cern.ch/patch/PHSS_6311 has been included. It seems to blow up on lego plot transformations when doing calculations such as (-2.0 - -2.0)!! I have therefore changed the default optimization to +O1 for this version of Mn_Fit. Linux: ______ It assumes that you have gcc available and that g77 is also available (f77 is often a link to g77). In this case it all seems to work well. Note that on the Bonn system the readline library is in /usr/lib and the termcap library is in /usr/lib/termcap. I therefore have to link with the options: -r /usr/lib -rt /usr/lib/termcap The 99 and 2000 version of the CERN libraries need the libraries libXm and libXt (which should both be in /usr/X11R6/lib or /usr/local/lib. libXm (Motif) is sometimes not installed by default. It should be taken from LessTif (which is also where CERN gets it from). If this turns out to be a common problem I can also link a static version of Mn_Fit. There are currently some inconsistencies between Suse 6.2 Linux, which uses glibc 2.1 instead of 2.0, and the CERN 98 (and maybe 99) libraries. In Bonn and Hamburg fixes exist for this problem. This is no longer a problem with the 2000 version of the libraries. SGI: ____ With the upgrade to IRIX version 6, there are a number of incompatible compiler options available. The 97a (and earlier) release of the CERN libraries uses the -mips2 flag. If you make the readline library yourself for use with these old versions of the CERN libraries, you should use the following options for configure: CFLAGS='-g -O -mips2' ./configure If you get a segmentation violation while loading it probably means that incompatible mips options have been used somewhere. The default options used in this version of Mn_Fit include -n32. This is valid for CERN library version 99 and later (I do not know which option the 98 version was compiled with). If you have to use an earlier version off the CERN libraries then you have to look through mn_util.car (or mn_util.cmz) and change any occurences of -n32 to -o32 and -mips3 to -mips2. Compiling readline with the CC command used to cause an unresolved external alloca. This is fixed with readline version 1.2 that is distributed with Mn_Fit. Compiling with gcc is OK. Sun: ____ The cc command gives an error in hkuip_h.h. This error does not occur with gcc. If gcc is in /usr/local/lib, this directory is not put in the default path when compiling from cmz so you must make a link from your bin directory. e.g. cd ~/bin; ln -s /usr/local/bin/gcc gcc. Alternatively, when you are prompted for the c compiler command you can change it to: /usr/local/bin/gcc ... On Solaris machines you also often have to give the full path of the FORTRAN compiler. In addition, unless you are using the 96a version of the CERN libraires (not yet tested), you should also give the compiler option -DSolaris2 to avoid problmes with vfork.h. VMS machines: _____________ The standard way to define the cmz command on the VMS is: cmz == "@cern:[pro.exe]cmz" This did not work with cmz/batch. You therefore had to redefine cmz to be something like: cmz == "$cern:[cmz.pro.exe]cmz.exe" With the 95a release of the Cernlib the standard definition appears to work properly, so thee change of the cmz command is no longer necessary. Apollo: _______ This version of Mn_Fit has not been tested on an Apollo. +DECK,rel_v407. Release Notes: ______________ Mn_Fit version 4.07/35 is hereby released. Given the Y2K problems with the CERN libraries, I only check Mn_Fit for CERN library version 99 and later. There is one install script for all Unix machines - install.unix. I need to know the value of the environment variable SYSTEM on the relevant unix machine. The installation script for VMS systems is called install.vms. Mn_Fit can be installed using patchy rather than cmz. The cmz installation works with version 1.47 of cmz (95a Cernlib). The patchy installation uses nypatchy if possible. Again I make no guarantee that it works properly with ypatchy. The default version of Mn_Fit is now X11 for all platforms. readline version 2.2 is now available. If you install Mn_Fit with patchy, you have to create the readline libraries yourself, if they have not been installed for you. Note that if you want to change the location of the readline library that is used, you should create a link in the $MN_FIT/lib directory to the readline include files. If neither a link nor a directory already exist, the install script will prompt you for them. The C. Rippich version of MINUIT file, minuit.cmz (or .car) has been renamed to cgr_minuit.cmz. You should delete any minuit.cmz, minuit.kumac file in you cmz directory. Mn_Fit is available via my home page on www: http://www-zeus.physik.uni-bonn.de/~brock/mn_fit.html. This has replaced the previous standard homepage at CERN: http://home.cern.ch/~brock/mn_fit.html. If you try to access the CERN homepage you will automatically be switched to the Bonn page. Some machine dependent information is given below. ALPHA: ______ When using COMIS on alpha machines running Unix, I often get the error: Unaligned access pid=32259 va=5859c6c pc=2075a9c ra=2075a98 type=ldt This does not appear to have any effect on the result, but writes an awful lot onto the screen! HP: ___ There appears to be a bug in the optimizer using the -O option unless patch http://wsspinfo.cern.ch/patch/PHSS_6311 has been included. It seems to blow up on lego plot transformations when doing calculations such as (-2.0 - -2.0)!! I have therefore changed the default optimization to +O1 for this version of Mn_Fit. Linux: ______ It assumes that you have gcc available and that g77 is also available (f77 is often a link to g77). In this case it all seems to work well. Note that on the Bonn system the readline library is in /usr/lib and the termcap library is in /usr/lib/termcap. I therefore have to link with the options: -r /usr/lib -rt /usr/lib/termcap The 99 and 2000 version of the CERN libraries need the libraries libXm and libXt (which should both be in /usr/X11R6/lib or /usr/local/lib. libXm (Motif) is sometimes not installed by default. It should be taken from LessTif (which is also where CERN gets it from). If this turns out to be a common problem I can also link a static version of Mn_Fit. SGI: ____ With the upgrade to IRIX version 6, there are a number of incompatible compiler options available. The 97a (and earlier) release of the CERN libraries uses the -mips2 flag. If you make the readline library yourself for use with these old versions of the CERN libraries, you should use the following options for configure: CFLAGS='-g -O -mips2' ./configure If you get a segmentation violation while loading it probably means that incompatible mips options have been used somewhere. The default options used in this version of Mn_Fit include -n32. This is valid for CERN library version 99 and later (I do not know which option the 98 version was compiled with). If you have to use an earlier version off the CERN libraries then you have to look through mn_util.car (or mn_util.cmz) and change any occurences of -n32 to -o32 and -mips3 to -mips2. Compiling readline with the CC command used to cause an unresolved external alloca. This is fixed with readline version 1.2 that is distributed with Mn_Fit. Compiling with gcc is OK. Sun: ____ The cc command gives an error in hkuip_h.h. This error does not occur with gcc. If gcc is in /usr/local/lib, this directory is not put in the default path when compiling from cmz so you must make a link from your bin directory. e.g. cd ~/bin; ln -s /usr/local/bin/gcc gcc. Alternatively, when you are prompted for the c compiler command you can change it to: /usr/local/bin/gcc ... On Solaris machines you also often have to give the full path of the FORTRAN compiler. In addition, unless you are using the 96a version of the CERN libraires (not yet tested), you should also give the compiler option -DSolaris2 to avoid problmes with vfork.h. VMS machines: _____________ The standard way to define the cmz command on the VMS is: cmz == "@cern:[pro.exe]cmz" This did not work with cmz/batch. You therefore had to redefine cmz to be something like: cmz == "$cern:[cmz.pro.exe]cmz.exe" With the 95a release of the Cernlib the standard definition appears to work properly, so thee change of the cmz command is no longer necessary. Apollo: _______ This version of Mn_Fit has not been tested on an Apollo. +PATCH,FREEHEP,t=text. +DECK,header. Mn_Fit Documentation ____________________ Versions of Mn_Fit source files: ________________________________ +DECK,MN_FIT_DBASE. Name: Mn_Fit Version: 4.07/35 Date: 17 September 2003 Title: A Fitting and Plotting Package Using MINUIT Authors(s): Ian C. Brock Contact: Ian.Brock@cern.ch Subject Area(s): analysis, graphics_vis_gui News Group or Email: Ian.Brock@cern.ch Bug reports to: Ian.Brock@cern.ch Software Needed: Cernlib + Patchy or CMZ for installation Hardware Needed: Vax, Alpha VMS or OSF, Decstation, Apollo, HP, SGI, SUN/Solaris, IBM RS6000, Linux. Access: freehep.scri.fsu.edu - anonymous ftp cd freehep/analysis/mn_fit www: http://www-zeus.physik.uni-bonn.de/~brock/mn_fit.html CERN AFS: /afs/cern.ch/user/b/brock/public/mn_fit/pro DESY AFS: /afs/cern.ch/user/b/brock/public/mn_fit/pro CERN Decnet: vxcern::disk$scratch:[l3.week.brock.mn_fit.pro] vxl3j0::l3daq$dat:[gra.mn_fit.pro] lns101.lns.cornell.edu: /home/mnfit/pro User Base: CLEO, L3, ALEPH, CDF, H1, ZEUS and many other High Energy Physics Experiments Documentation: Available from author, WWW and as Postscript file: Mn_Fit Reference Manual Mn_Fit tutorial Published References: Mn_Fit reference manual: L3 Note 918, CLEO Note CSN 245, BONN-MS-99-02 Abstract: Mn_Fit is an interactive fitting and plotting package, that uses MINUIT to fit histograms or data read in from a file and displays the fit results on a screen. Many functions are built into the package and it is easy for the user to add new ones. Fitting of 1-D and 2-D histograms is possible, and you can also fit several histograms simultaneously and apply constraints on the function parameters. Likelihood fitting is built-in and can also take into account limited Monte Carlo statistics. Hardcopies of pictures can easily be made with a quality suitable for publication. Mn_Fit can also be used purely as a plotting package without using the fitting. +DECK,readme. Getting Mn_Fit from compressed tar files ________________________________________ Mn_Fit is available via anonymous ftp from freehep.scri.fsu.edu or via www. The freehep version is usually the oldest. The Bonn version the newest. cd $MN_FIT (or cd the Mn_Fit top-level directory) ftp freehep.scri.fsu.edu cd freehep/analysis/mn_fit get mn_fit.dbase get README binary get mn_fit.tar.gz -- Mn_Fit source and install scripts get mn_fit.ps.tar.gz -- Mn_Fit manual files To unpack one of these files do the following: gzip -cd filename.tar.gz | tar xvf - If you get mn_fit.tar.gz you will have the Mn_Fit car files, the install scripts and GNU readline compressed tar file. You can then run the appropriate install script. If you want to install Mn_Fit from the compressed tar files on a VMS machine you should probably get the compressed files onto a Unix machine and unpack them there. Then copy the files in the pro directory onto your VMS machine. The manual tar file contains the following Postscript files: mn_fit.ps -- The manual mn_fit_2ppp.ps -- The manual as 2 pages per page mn_fit0.ps -- The manual without the problem fonts mn_fit0_2ppp.ps -- The manual as 2 pages per page without the problem fonts mn_fit_cover.ps -- The cover page (in colour) mn_fit_figs.ps -- The figures from Appendix B mn_fit0_figs.ps -- The figures from Appendix B without problem fonts mn_fit_font.ps -- 2 pages with possible problem fonts The mn_fit.ps files saves your eyes, while those with _2ppp save some trees! Some printers do not work with Postscript fonts -14 onwards. To test this print mn_fit_font.ps first - 2 pages should be printed. If this works OK, then you can print the normal files, otherwise print the mn_fit0... files. The compressed files are also available through www: http://www-zeus.physik.uni-bonn.de/~brock/mn_fit.html http://home.cern.ch/~brock/mn_fit.html The tar file names also include the version number. +DECK,install. Installing Mn_Fit from car files ________________________________ For Unix machines use the script install.unix and for the Vax/Alpha (VMS) use install.vms. Copy install.unix (or install.com) to the top level Mn_Fit directory. Set your default directory to the Mn_Fit top level directory and run the install script. You should answer the questions appropriately. Note that CMZ converts directory and filenames to lowercase. If your Mn_Fit directory includes upper case letters, you should make a link to it that only has lowercase. (At some point I hope to fix this by making all my decknames lowercase). The install procedure should be fairly self-explanatory. On Unix machines you can use cmz or patchy to install Mn_Fit. If you use patchy, then I assume that you already have the readline library. In theory it is possible to start from the Fortran code on VMS, but I have not tried that option recently. All Unix machines use cc again as the default c compiler. It is used both for the Mn_Fit code and for readline. You can use gcc instead by giving the @GCC option in the installation procedure. If you use gcc and want to relink Mn_Fit using the mn_fit.lnk file, you must export USE_GCC=1 (setenv USE_GCC 1 for csh) before executing the file. More documentation can be found in mn_fit.doc. Installing Ready-Made Mn_Fit Executables: _________________________________________ Ready-made executables exists for some machines. The tar files should include all the files you neded to run Mn_Fit, test it and get help. You should get a compressed tar file from one of the usual places and put it in the top-level Mn_Fit directory, e.g. /usr/local/lib/mn_fit. Then unpack it using the command: gzip -cd mn_fit_x.exe.xxxxx_nnnnn.tar.gz | tar xvf - or tar xvf mn_fit_x.exe.xxxxx_nnnnn.tar if your browser has already unzipped it. By default the command file to run Mn_Fit sets the Mn_Fit top-level directory to `/usr/local/lib/mn_fit'. If you put the files elsewhere then you should change the setting of this variable in bin/mn_fit. If you also copy the executable to another directory, `/usr/local/bin' for example, you should also modify the variable `direxe'. Common Problems: ________________ install.unix: 1) Often problems occur when trying to include readline. I recommend that you remove all files from $MN_FIT/lib and $MN_FIT/cmz before starting the install procedure. In this way you can be sure of where the readline files are taken from. 2) If the loader complains that it cannot find mn_main_k.o, then probably all c files have failed to compile. One possibility if you use gcc is that it is not in the default PATH that cmz defines. Try doing 'which gcc' to see where gcc is, and make a link from your ~/bin directory to there. 3) If the loader complains that it cannot find typreadc, then there is probably a problem with readline. Either the include files are not in the directory that you specified, or if you are installing readline as part of the install procedure, then this installation failed. Look back at the installation log to try and find any error messages. 4) The Cern libraries are not in the tree /cern/... Before starting install.unix you should define the environment variable CERN, e.g. export CERN=/CERN. 5) The install script cannot find cmz or starts the wrong version. Make a link in you ~/bin area to the cmz executable that you want to run, e.g. cd ~/bin; ln -s /cern/cmz/1.47/bin/cmz cmz. 6) By default readline uses the termcap library for the terminal control. If you tell the install procedure to also make the readline libraries this is no problem, as the readline package comes with its own termcap library. However if you want to use a readline library that has already been installed (required for AIX, ALPHA Unix machines and SGI machines that do not have gcc, because the version distributed with Mn_Fit does not compile properly), then you may have problems. The termcap library is no longer supported with AIX version 4, at least on CERNSP. The ncurses library seems to work fine as an alternative, but I do not know if it is available on all machines. If you try to link with the -r or -rl option and it fails because it cannot find termcap than try the -rc or -rcl options instead. These will link using the ncurses library. If ncurses is available everywhere I can make it the default library at some point. install.vms: 1) Getting the correct compiler options is no longer obvious. You should first find out which fortran and c comilers are installed (Vax or Dec) and which version of VMS you are running. The install procedure gives some hints as to the options you should have. +DECK,carfiles. Getting Mn_Fit source files ___________________________ The Mn_Fit source code can also be obtained from the following directories: www: http://www-zeus.physik.uni-bonn.de/~brock/mn_fit.html AFS: /afs/cern.ch/user/b/brock/public/mn_fit/pro /afs/desy.de/user/b/brock/public/mn_fit/pro Decnet: vxl3j0::l3daq$dat:[gra.mn_fit.pro] vxcern::disk$scratch:[l3.week.brock.mn_fit.pro] Alpha OSF: lns101.lns.cornell.edu /home/mnfit/pro Note that the files on vxcern may disappear after a while as I do not logon there very regularly. In order to install Mn_Fit first create a top level Mn_Fit directory (e.g. $HOME/mn_fit). Then copy the following files from one of the above sources into a convenient place. mn_fit.car mn_util.car typscn.car cgr_minuit.car install.vms -> install.com (VMS) install.unix (Unix) mn_fit.doc mn_readline-1.2.tar.gz (Unix machines) mn_readline-1_2.tar_gz (from VMS for Unix) If you get the files by ftp then you should do a binary get on the readline file. If you get readline from VMS then you should rename it to mn_readline-1.2.tar.gz. +DECK,fill. Mn_Fit freehep database entry: ______________________________ +PATCH,MN_FIT_HELP,T=TEXT. +DECK,HELP. 1 HELP ! Rules for the HELP file: ! An exclamation mark is a comment if there is nothing in column 2 ! ! Anything in column 2 is treated as TeX control for printing ! ! An = means don't switch to or from verbatim if the following line is blank ! An ^ means ignore the following line ! ! Anything else is TeX control and is written as is to the TeX file ! ! A : at the end of a line signals that the next paragraph will be printed ! in verbatim. A blank line after the : is ignored. ! ! After a command (in upper case) the following lines are printed in ! verbatim until the first blank line. ! ! Examples except at level 1 are always printed in verbatim. The must have ! the header "Example" or "Examples" and this is case sensitive ! ! All help topics in lower or mixed case are printed first. Topics ! HELP, Introduction, Numbers and Changes are not printed as they ! are part of the TeX file MN_INTRO.TEX. ! ! "Menu" gets special treatment and all menus are printed after the ! lower and mixed case topics ! Welcome to the Mn_Fit Help Facility To get a list of commands and a short description of them look at Menu. For details on MINUIT commands look at MINUIT and then the sub-topic you are interested in. See HELP Introduction to get you started. See HELP CHANGES for the latest changes. The source for this HELP is in the file `MN_FIT_HELP:MN_FIT_HELP.FIL' (VMS) or `$MN_FIT/help/mn_fit_help.fil' (Unix). Note that you can get the help on VMS machines outside Mn_Fit by giving the command: HELP @MN_FIT_HELP:MN_FIT (provided you have the Mn_Fit logicals defined). Parameters in square brackets are optional and parameters separated by | mean that you must use one of them. If you do not want to use a pager on Unix machines give the command SET PAGER ''. +DECK,MENU. 1 Menu The following is a list of the available commands. For more information see the detailed HELP on each command. For the MINUIT commands see HELP MINUIT. EXIT Exits from program or back to previous level. ADD Adds 2 histograms together. ALIAS Defines an alias. UNALIAS Undefines one or all aliases. ATTACH Attaches you to another process (VMS only). AVERAGE Makes a weighted average of the contents of 2 histograms. AVE_FETCH Fetches an AVEHST format histogram (ASCII files only). BOOK Books a new plot inside Mn_Fit (alias for `HIST BOOK'). CALCULATE Calculates an expression, changes a register, parameter etc., or defines a user variable. CALL_COMIS Calls a COMIS subroutine. CAPTURE Captures a new output device. CDIRECTORY Changes the current HBOOK directory immediately. CLEAR Clears the screen device display. CLOSE Closes the hardcopy devices output files. COMIS Invokes the COMpilation and Interpretation System package. COMMENT Adds a comment to a plot. COPY Copies one histogram to another one. CUT Defines cuts for Ntuples and multi-dimensional histograms (see HELP CUT for more). NO_CUT Deletes all cuts. DAT_FETCH Reads a series of data points from a file (alias for `READ DATA'). DAT_STORE Stores a series of data points in a file (alias for `WRITE DATA'). DATABASE Interface to plotting contents of L3 database. DB_HISTORY Plots the history of an element in L3 database. DB_SNAP Plots the contents of an L3 database entry. DEFINE Defines a new command. UNDEFINE Deletes a command you made with the `DEFINE' command. DELETE Deletes one or more plots. DEPOSIT Calculates an expression, changes a register, parameter etc., or defines a user variable. DISPLAY Makes a special display - only in L3 or ZEUS display version. DIVIDE Divides 2 histograms. DO Starts a `DO' loop (only available inside macro's or `DEFINE'd commands). DRAW Draws a line, arrow, box etc. on a picture. EDIT Edits a file (use `SET EDIT' to select your favourite editor). EFFICIENCY Divides 2 histograms using binomial errors. ELIF Else if in an `IF' block. ELSE Else in an `IF' block. ENDDO Terminates a `DO' loop. ENDIF End of an `IF' block. EXAMINE Examines the contents of a register, parameter, bin etc. EXECUTE Reads a list of commands from a file (alias for `READ COMMAND'). EXTRACT Extracts part of an HBOOK histogram (alias for `HIST EXTRACT'). FETCH Fetches one or more HBOOK version 4 histograms. FI End of an `IF' block. FILL Fills a plot inside Mn_Fit (alias for `HIST FILL'). FIT Fits a plot (only valid in `MN_CMD>' level). FUNCTION Do things with functions (see HELP FUNCTION for more). HARDCOPY Makes a hardcopy of the last picture. HB3_FETCH Fetches one or more HBOOK version 3 histograms. HB_FETCH Fetches one or more HBOOK version 4 histograms. HB_OPEN Opens an HBOOK version 4 histogram file. HB_STORE Stores one or more HBOOK version 4 histograms in a file. HB_MN_FIT Converts HBOOK plots to Mn_Fit plots. HCOPY Copies one HBOOK histogram to another one (HCOPY). HDELETE Deletes an HBOOK histogram. HINDEX Gives the HBOOK index for histograms currently in core. HISTOGRAM Plots, overlays or dumps a histogram (see HELP HISTOGRAM for more information). history History of commands read by GNU readline (cannot be abbreviated and must be in lowercase). HMAKE Makes an HBOOK histogram from another sort. HMERGE Merges the HBOOK histograms from one or more RZ files. HPRINT Does an HPRINT on the given histogram. HRENAME Renames an HBOOK histogram. HY_FETCH Fetches one or more HYBRID histograms. IF Conditional control of statement execution. IGTABLE Plots 2-D histograms in various ways (almost the same as `2DIM'). INDEX Gives an index of the histograms read in. INQUIRE Gets the value for a macro parameter (only available inside macros or DEFINEd commands). INTEGRATE Integrates a function over a range. KEY Gives a key for the meaning of symbols. LDIRECTORY Lists the contents of the current HBOOK directory. LEGO Makes a lego plot of a 2-dimensional histogram. MDIRECTORY Makes a new HBOOK directory in memory. MESSAGE Writes a message to the current output device. MN_FETCH Reads in plots in Mn_Fit format. MN_STORE Stores plots in Mn_Fit format. MULTIPLY Multiplies 2 histograms. NORMALIZE Normalizes the total contents of a histogram. NTUPLE Operations on Ntuples and multi-dimensional histograms (see HELP NTUPLE for more). OPEN Opens an HBOOK version 4 histogram file. OVERLAY Overlays one histogram on another (alias for `HIST OVERLAY'). PARTITION Cuts out part of a histogram. PARSE Parses and executes a command line with formatting. PLOT Plots a histogram (alias for `HIST PLOT'). 2DIM Plots 2-D histograms in various ways. PRINT Prints a histogram on the terminal or to a file. PROJECT Makes a projection of an Ntuple or n-dimensional histogram (alias for `NTUPLE PROJECT'). QUIT Emergency stop of Mn_Fit. READ Reads in commands or data (see HELP READ for more). REBIN Rebins a histogram. REDRAW Redraws the last picture. REMOVE Deletes a user defined variable. RENAME Renumbers a histogram. RETURN Returns from a macro. SCALE Multiplies the contents of a histogram by a scale factor. SCT_FETCH Fetches an AVEHST true scatter plot. SET Changes a plotting parameter (see HELP SET for more). SHELL Executes a single DCL command or spawns a subprocess (VMS). Executes a shell command or starts a new shell (Unix). SHOW Shows plot drawing parameters (see HELP SHOW for more). SMOOTH Smooths a histogram. SPAWN Executes a single DCL command or spawns a subprocess (VMS). Executes a shell command or starts a new shell (Unix). SPLINE Spline fits a histogram. SURFACE Makes a surface plot of a 2-dimensional histogram. STORE Stores one or more HBOOK histograms in a file. SQUEEZE Gets back unused space for Mn_Fit. SUBTRACT Subtracts 2 histograms. SUM Sums the contents of a plot. TEXT Adds text to a picture or plot - not yet implemented. TITLE Gives a new title to a histogram. WAIT Stops Mn_Fit for a time. WINDOW Draws several plots on one page. NO_WINDOW Goes back to one plot per page. WDIRECTORY Sets the current working directory for opening files. WRITE Writes out a list of commands or data points. ZDIRECTORY Makes an RZLDIR of the current HBOOK directory. +DECK,INTRODUCTION. 1 Introduction Mn_Fit is an interactive fitting and plotting package, that uses MINUIT to fit histograms or data read in from a file and displays the fit results on a screen. Hardcopies of pictures can easily be made with a quality suitable for publication. Mn_Fit can also be used purely as a plotting package without using the fitting. Features of the plotting include user specification of all the plotting variables, overlaying of one or more histograms or functions and the trivial changing of symbols used in plotting. There are also secondary histogram identifiers so that you can keep track of data and Monte Carlo plots for example by giving them different secondary identifiers. If you make projections or slices of a plot, they will be stored with the same primary identifier, but will be given a different secondary identifier. It is also possible to interactively specify cuts on a plot and then make projections of the plots using the cuts (see HELP CUT and HELP PROJECT). For suitable commands you can give a range of either primary or secondary identifiers for the command (e.g. `FET 1:300' will fetch all histograms with identifiers between 1 and 300); see HELP Identifiers. For details on the implementation of the MINUIT package see HELP MINUIT. It has all the standard features available plus several new ones, such as the ability to modify variables. Mn_Fit can be run either interactively or from a file or you can execute a series of commands in a file. The exact command to run depends on where you are, but it has the general form `@disk:[directory]MN_FIT'. If the `DO' command is available you should be able to say `DO MN_FIT'. On VXL3ON you can just give the command mn_fit. The following is a list of some of the directories: Cornell: UD2:[CLEO14.COM] "Official version" UD1:[MN_FIT] "Latest version" VXCERN: DISK$L32:[BROCK] VXL3ON: L3DAQ$GRA: "Official version" USR0:[BROCK] "Latest version" L3 Apollo: /user/brock/mn_fit To run from a file issue the command `DO MN_FIT filename'. To read from a file while running interactively issue the command `EXEC (or READ COMMAND) filename'. You can also define your own commands using the `DEFINE' command. When you start up Mn_Fit it will look for the file `MN_LOGON.MNF' in your local directory and if that does not exist it will look for the logical name `MN$LOGON'. The file will be executed and then control given to the terminal. Functions can be defined interactively using the CERN COMIS package, meaning you can write your own functions to fit with without relinking Mn_Fit (see HELP COMIS and HELP FUNCTION LIST COMIS for more details). All commands can be abbreviated to the point of ambiguity, and commands are read in using the TYPSCN package. Mn_Fit is designed, so that you do not have to know the complete command syntax, before starting to give a command. Just give the first word of a command and you should be prompted for everything else needed. Within a command you can often get more help by typing `?'. The prompt will indicate if this is possible. +DECK,EXPRESSIONS. 1 Expressions An expression can include any of the parameters which can be used for numbers (see HELP Numbers for more details). It is a FORTRAN-like calculation including `+,-,*,/,** (or ^), sin, cos, sqrt' etc. Parentheses are also allowed. The code has been adapted from Paul Avery's MULFIT, so all the operations listed there are available. If you want to use an expression in a cut or as a variable to project onto I recommend that you enclose it in parentheses. The following operations are available: +, -, *, /, ** (or ^) SQRT, SIN, COS, TAN, ALOG, ALOG10, EXP, ASIN, ACOS, ATAN ABS, INT, NINT, MIN, MAX, MOD, SIGN DATE, TIME, DATE_TIM, DATE_MIN, TIME_MIN Note the result of an expression is always returned as a floating point number, i.e. also the results of `INT' and `NINT' are converted back to floating point immediately. `MIN' and `MAX' take 2 arguments. The `DATE' function expects the date in the form `YYMMDD', `TIME' is in the form `HHMMSS', `DATE_TIM' and `DATE_MIN' take 2 arguments `YYMMDD,HHMMSS'. `DATE_MIN' and `TIME_MIN' expect the time in the form `HHMM'. The date functions return the number of days,hours,minutes or seconds (depending on the time mode that has been set with the `SET TIME' command) since the reference time (or 1-Jan-1980 if not reference time has been set). The time functions return the same things, but always starting from midnight. In addition the following operations on functions are available: FPOS, FNEG, DFPOS, DFNEG, DDFPOS, DDFNEG, FINT where `POS' and `NEG' mean the value of the function at the given value of `X' or just below it. `DFPOS, DFNEG' are the first derivatives of the function and `DDFPOS, DDFNEG' are the second derivatives. `FINT' is the integral of the function between 2 limits, which you give as arguments. The syntax is `FPOSn(x)' where `n' is the function number and `x' is the value at which it should be evaluated. For `FINT' the syntax is `FINTn(xlo,xhi)'. `x', `xlo' and `xhi' can also be registers, parameters, or even expressions. For the derivative the step size is currently set to 1.0. It is possible to set it using the `SET FUNCTION STEP' command. The number of intervals to integrate over can be set using the command `SET FUNCTION INTEGRATE nint' (default is 100). The function number can be that of a single function, or `0' to mean all currently selected functions. For evaluating expressions with functions, if the bin width is set (i.e. you have done a fit, or used the `FUNCTION HISTOGRAM' command), then it is used. You can turn off the use of the bin width with the `SET FUNCTION BIN_WIDTH' command. 2 Examples !\begin{enumerate} !\item !^ Example 1: Calculate the integral of a Gaussian using either `INTEGRATE' or `FINT': fun add gaus sigma 1000 0 1 integrate 1 0 3 message 'Integral is {r101,(f6.2)}' dep r1 = 0 dep r2 = 1.5 dep r3=fint1(r1,2*r2) message 'Integral is {r3,(f6.2)}' !\item !^ Example 2: Illustating the effect of the bin width: fun add gaus sigma 1000 0 1 dep r1 = fpos1(0) fun hist 1 &1 0 100 -2 2 set function bin_width on dep r2 = fpos1(0) set function bin_width off dep r3 = fpos1(0) !\end{enumerate} +DECK,IDENTIFIERS. 1 Identifiers Identifiers are numbers associated with a plot. In Mn_Fit there are two identifiers associated with each plot. For some commands, e.g. `INDEX, FETCH, PLOT', you can specify a range of plots which the command applies to. The range is delimited by a `:'. You can specify a range of primary or secondary identifiers or both. In general if you give as primary identifier 0, this means all histograms you have read in or created; e.g. `FETCH filename 0' will fetch all the histograms in file `filename'. It is also possible to use a register, parameter etc. as a histogram identifier or secondary identifier. For more on secondary identifiers, see HELP Secondary_Identifiers. +DECK,SECONDARY_IDENTIFIERS. 1 Secondary_Identifiers Instead of the usual single identifier for each plot Mn_Fit has two identifiers associated with each plot. This permits significantly more flexibility in numbering your histograms and enables you to group together histograms which are associated with each other. To select a plot with a particular secondary identifier when you are asked for a histogram number use the syntax `id&idb' (e.g. `10&1' to get histogram 10 which has secondary identifier 1). If the secondary identifier is omitted, the default will be used. The default can be changed with the `SET IDB' command. Any plots read in after this command have the new secondary identifier. It is also possible to use a register, parameter, etc. as a histogram identifier or secondary identifier. You can use the `MN_STORE' and `MN_FETCH' commands to store and fetch histograms in Mn_Fit format, that will retain the secondary identifiers. 2 Examples !\begin{enumerate} !\item !^ Example 1: If you fit a histogram and want to store the function as a plot, it will be given the same primary identifier as the histogram you are fitting, but a different secondary identifier so that you know with which histogram it is associated. For example if you are fitting histogram 10 issue the commands: DISPLAY FUN PLOT 0 1 -1 This will store all the functions you are using in the fit as a smooth curve in histogram 10&1. !\item !^ Example 2: If you wish to compare Monte Carlo and data histograms, you can read in both sets of histograms, giving them different secondary identifiers, but they will have the same primary identifiers, so that you know which ones to compare and can use the same code to make Monte Carlo and data plots. For example: SET IDB 10 FET MONTE.HIS 0 SET IDB 0 FET DATA.HIS 0 PLOT 1&0 OVER 1&10 2/BLUE The Monte Carlo plots will now all have secondary identifier 10, while the data have secondary identifier 0. !\end{enumerate} +DECK,NUMBERS. 1 Numbers In most places when Mn_Fit asks for a number, such as a cut or the bin limits for a new plot or the axis label parameters you can give one of the following possibilities. In addition you can define new variable names using the command `DEPOSIT' and these can then be used in the same way. The variable names must be alphanumeric expressions including `$' and `_', of maximum length 8 characters. Variable names which match one of the names below (e.g. R, ERR), or a FORTRAN intrinsic function are not allowed nor is the name `ALL'. The names are converted to upper case. The new variables can be deleted using the `REMOVE' command. See HELP DEPOSIT for more details: e.g. dep pi = 3.14159 dep r2 = sin(pi/2) These extra variables are stored in registers >300. You can look at the values of registers, parameters, bin contents etc. using the `EXAMINE' command or the `SHOW REGISTER' command for registers only. Note that numbers are always floating point, with the exception of `IR'. A number, e.g. 4, -5.2, 3.2E+02. It is not necessary to give the decimal point for real numbers. A register Rn or IRn where n can be from 0 to 400. Note that you are allowed to fill registers 0-99 with whatever you wish using the `DEPOSIT' command. All register contents are stored as real numbers. The integer format `IR' is used when you want to convert the contents to an integer to put them in a text string (see HELP Text). Registers 100 and above contain the following information: 101 The result of a `SUM' or `INTEGRATE' command 102 The number of points summed over in `SUM' 111 The chi**2 or likelihood from the fit 112 The confidence level of a fit Registers 121 onwards are filled if you give the command `SET PLOT id [&idb] DEFAULT' or `SET HISTOGRAM id': 121 The plot identifier 122 The secondary plot identifier 123 The number of entries (histograms) or points 124 The dimension of the plot (positive for histograms, negative for Ntuples and a series of points). 125 The area under the plot (i.e. sum of weights) 126 The minimum number of entries (weight) 127 The maximum number of entries (weight) 128 The creation date of the histogram (yymmdd) 129 The creation time of the histogram (hhmm) 131 The number of bins on x-axis (0 for Ntuples and points) 132 The lower limit of the x-axis 133 The upper limit of the x-axis 134 The mean value for the x-axis 135 The sigma for the x-axis 136 The number of bins on y-axis (0 for Ntuples and points) 137 The lower limit of the y-axis 138 The upper limit of the y-axis 139 The mean value for the y-axis 140 The sigma for the y-axis etc. up to 14th dimension of an Ntuple. Registers 201-204 contain the positions of the corners of the current plot in cm: 201 x position left 202 x position right 203 y position bottom 204 y position top Registers 205-210 contain the limits used for the drawing of each of the axes in plot coordinates: 205 x minimum 206 x maximum 207 y minimum 208 y maximum 209 z minimum 210 z maximum Registers 231-257 contain total contents, as well as underflows and overflows of the default histogram: 231 Underflows x-axis 232 Contents x-axis 233 Overflows x-axis For 2 dimensional histograms 9 registers are filled contents in register 235), while for 3-dimensional histograms 27 registers are filled (contents in register 244). Registers > 300 contain the values of the extra variables that you have defined. A parameter, its parabolic error, or its positive or negative error, or its limits. The syntax to use is: Pn(m) for the parameter ERRn(m) for the parabolic error on the parameter ERNn(m) for the negative MINOS error on the parameter ERPn(m) for the positive MINOS error on the parameter LOLIMn(m) for the lower limit on the parameter value HILIMn(m) for the upper limit on the parameter value where n is the function number and m is the parameter number The centre of a bin, the bin width, the contents or the error on the contents (including asymmetric errors). The syntax to use is: Xn(m) for the bin centre or the x value of a point Yn(m) for the bin contents. DXn(m) for half the bin width or the error on the x value DYn(m) for the error on the y value DNXn(m) for half the bin width or the negative error on the x value DNYn(m) for the negative error on the y value DPXn(m) for half the bin width or the positive error on the x value DPYn(m) for the positive error on the y value where n is the plot number (including the optional secndary identifier if needed). For 2-dimensional histograms give both bin numbers. e.g. Xn(l,m). However note that it is not possible to use the Y value of a bin a Y ALWAYS means the bin contents for histograms. You can always calculate the y value of a particular bin or the y bin width using registers 134,135 and 136. For plots with asymmetric errors `DX' and `DY' are interpreted as the negative errors if you want to get the value and as both errors if you are using the `DEPOSIT' command. The value of an Ntuple variable. The syntax to use is: Xn(m,nvar) or Xn(m,tvar) where n is the plot number, m is the event number nvar is the variable number and tvar is the variable name. For cuts and expressions for projections you can just give the variable name. Within the `DEPOSIT' command you can access CWN variables, but not arrays. In general if you want to keep the current value of a number use the `=' sign. You can also add, subtract, multiply or divide the current value by using the syntax `=+1.0, =*R2', etc. +DECK,SYMBOLS. 1 Symbols For each type of plot a default symbol is defined (which you get if you give the command `SET SYMBOL 0'): Symbol 1 for 1-D histograms -1 for a series of points without errors -32 for a series of points with errors 12 for 2-D histograms 1 for scatter plots Note that histograms always get converted to a series of points when fitting, so the default symbol for `DISPLAY' is always -32. To get a picture of the available symbols issue the command `exec $MN_FIT/help/symbol.mnf' (Unix) or `EXEC MN_FIT_HELP:SYMBOL.MNF' (VMS). This picture is in Appendix B of the Mn_Fit manual. In HIGZ/GKS versions hatching and patterns are available. You can specify the type using the commands `SET HATCH' and `SET PATTERN'. See HELP SET HATCH for details on some of the hatching available and the figures in Appendix B. Also see the HIGZ/PAW documentation for HIGZ hatchings, and the GKS device documentation. As far as I know patterns are only available with DECGKS. The following symbols are available for histograms: -1 Solid line joining the centres of the bins -2 Dashed line joining the centres of the bins -3 Dotted line joining the centres of the bins -4 Dash-dot line joining the centres of the bins -5 HIGZ line style 12 - a dashed line -6 HIGZ line style 13 - a dash-dot line -7 HIGZ line style 14 - a widely spaced dotted line -8 HIGZ line style 15 - a dotted line 1 Solid line histogram mode 2 Dashed line histogram mode 3 Dotted line histogram mode 4 Dash-dot line histogram mode 5 HIGZ line style 12 histogram mode 6 HIGZ line style 13 histogram mode 7 HIGZ line style 14 histogram mode 8 HIGZ line style 15 histogram mode 10 Dot 11 Circle 12 Square 13 Triangle 14 Inverted triangle 15 Diamond 16 Plus (+) 17 Cross (x) 18 Asterix (*) 19 Octogon (used to be 11) 20-28 Show x error bars for histograms 30-38 Show y error bars 40-48 Show x and y error bars 60-69 Show x error bars with line at end (symbol size, SET SSIZE) 70-79 Show y error bars with line at end (symbol size, SET SSIZE) 80-89 Show x and y error bars with line at end (symbol size, SET SSIZE) -n Show symbol filled The following symbols are available for scatter plots: -1 Joins the points with a solid line -2 Joins the points with a dashed line -3 Joins the points with a dotted line -4 Joins the points with a dash-dot line -5 HIGZ line style 12 - a dashed line -6 HIGZ line style 13 - a dash-dot line -7 HIGZ line style 14 - a widely spaced dotted line -8 HIGZ line style 15 - a dotted line 1-10 One dot per point 10-19 As for histograms 20-49 As for 10-19 -n Show symbol filled The following symbols are available for 2-dimensional histograms: -1 .,1,2,3,...X,Y,Z -2 Number of entries i.e. table form 1-10 Randomized dots, where the number of dots is equal to the number of entries 10-19 Area of symbol is proportional to number of entries in the bin 20-49 As for 10-19 -n Show symbol filled If the minimum weight is negative and the maximum weight is positive for 2-D histograms and you use a symbol number greater than 10 or less than -10 you will get the symbol for positive weights and its inverse for negative weights. This mode is also used for displaying the result of a 2-D fit. This mode is only used if either the lower or upper plotting limit is 0.0. Use the `SET Z LIMIT' command to set the limits. Otherwise only those entries within the specified range are shown. 2-D histograms can also be plotted using the `LEGO' or `SURFACE' commands or preferably using the interface to the HIGZ IGTABL routines, `2DIM' or `IGTABLE'. I use the HIGZ circle routine to draw circles. It is also possible to use large dots (symbol 10 or -10) and set the dot scale size using the `SET DSIZE' command. A scale factor of 10 or 20 is usually good. Note that you only see the big dots when you print the picture. +DECK,TEXT. 1 Text You should normally just type in the text you want to see. For details on how to get special characters, Greek letters, German special character etc. see the subtopic fonts. If you are required to give a title, comment, key, or axis label the text should be enclosed in single quotes, if you want to also put other parameters on the same line. If you omit the quotes the whole of the rest of the line will be used. This enables you to put the parameters associated with the text (e.g. comment position) on the same command line: COMMENT id new 'This is a comment positioned at 10,10' 10.0 10.0 Text which is always a single word (parameter names, filenames etc.) should not be included in quotes. If you want to pass text as a parameter to a macro, enclose the whole string in double quotes: EXEC test "'Text to pass'" With this form the parameter `@1' would contain 'Text to pass'. If you want to pass or give a null string (for example set the axis label back to a blank), give 2 single quotes: Give axis label: '' A `' always keeps the current text. As well as giving normal text, it is also possible to include the values of parameters or registers etc. in a text string. The format to use is: Text {parameter[,format]} MORE TEXT i.e. a section enclosed in braces `{ }' signifies that this part should be translated into text. `Parameter' can be a number, register, parameter, bin contents etc. (see HELP Numbers for what is available). `Format' is a FORTRAN format statement including parentheses. If you omit the format statement the default format is `(1PG12.5)' and `(I8)' for real and integer numbers respectively. Integers are integer registers (syntax `IR') and any user variable name that starts with a letter between `I' and `N'. `NINT' is used to convert real numbers to integers. This form of text string applies to comments, keys, axis labels, titles etc. To include a normal `{' in a text string, precede it by a `@'. If you also want to translate numbers into strings in other commands you can use the `PARSE' command (see HELP PARSE and the examples). Superscripts and subscripts are terminated by a `!'. `!' is also used for command line history in the Unix version (4.01 onwards), therefore you have to quote `!' with a backslash to get an exclamation mark if you give the command interactively. In addition if `!' is defined as the comment character you must also enclose the expression in single quotes (version 4.03 onwards): set x label '(GeV/c^2\!)' 2 Examples !\begin{enumerate} !\item !^ Example 1: Two examples of how to include the contents of registers and parameters in a text string: The cat took {IR3,(I3)} weeks to eat the dog. The parameter limits are {LOLIM2(3)} {HILIM2(3),('and',1PG11.4)}. !\item !^ Example 2: You can use the even use `PARSE' to set the name of a macro that you want to execute: do i=1,10 parse exec demo{@i,(i2.2)} enddo will execute `demo01' to `demo10'. !\end{enumerate} +DECK,FONTS. 2 Fonts If you use a negative font number, e.g. -13 and precision 1 then IGTEXT (i.e. font 2000) will be used on the screen and Postscript fonts will be used for hardcopies. This seems to be a good way to get the best of both worlds (special, Greek characters etc. on your screen and Postscript fonts in a file, which save a lot of space and are nicer than font 2000). Font -1004 (Helvetica) is therefore now the default font on all machines. The only minor drawbacks are that underscores appear as `z' on the screen and the text width is a bit different for the 2 fonts. Font 2000 uses the IGTEXT routine (formerly HPLSOF). It is the default on the screen and is always available. Font -1004 (Helvetica) is nicer for plots and is the default when you print a picture. Another commonly used font is -1013 (Times-Roman). A list of the characters available is given in Appendix B of the Mn_Fit write-up and in the HPLOT and HIGZ write-ups (see subtopic IGTEXT). The font and precision are specified with the form `spfff' where `s' is the sign of the font, `p' is the precision and `fff' is the font (e.g. -1013 to get font -13 with precision 1). Use the `SET FONT' command to change the general font, or you can set the font used in the `COMMENT, KEY, SET SCALE, SET LABEL' and `SET TITLE' commands. Postscript fonts are available for hardcopies if you have a Postscript printer. Fonts -1 to -24 are availble if you use the HIGZ Postcript interface, which is the default, while fonts -1 to -13 are available with GKSGRAL. HIGZ Postscript fonts can be obtained using precision 0,1, or 2. They are identical when you make a hardcopy. The differences are how they appear on the screen. If you use Postscript fonts and precision 2 you get the hardware default font on the screen. If you use precision 1 then the standard IGTEXT font (font 2000) is used on the screen and the Postscript font is used when printing. If you use precision 0, you get the Postscript fonts on the screen, but not superscripts, subscripts, Greek characters etc. Postscript characters that are not part of the normal keyboard can !^ be obtained with the syntax `\nnn' where `nnn' is the Postscript !be obtained with the syntax \verb#\nnn# where \texttt{nnn} is the Postscript character number. A set of tables with the complete set of Postscript characters can be obtained by running the macro `exec $MN_FIT/help/ps_char' and printing out the file `ps_char.ps' on a Postscript printer. If you have a complete Mn_Fit installation this file should be available as `$MN_FIT/help/ps_char.ps'. Some Postscript characters such as German letters with umlauts are !^ available with a simpler syntax, `\"a' for example. See the subtopic !available with a simpler syntax, \verb#\"a# for example. See the subtopic IGTEXT for more details. Note that there is an offset between the HIGZ/Postscript font numbers and those in GKSGRAL. Times-Roman is -1 in GKSGRAL and -13 in HIGZ/Postscript, Times-Italic is -2 and -1 respectively. In GKS the fonts available depend on the workstation - see details in the GKS implementation manual. In the GKSGRAL implementation of GKS fonts -1 to -11, -101 to -111, -201 to -211, and -301 to -311 are available for normal text, plus fonts -13, -113, -213, -313 for Greek characters, and -51, -151, -251, -351 which are solid filled. These fonts are all with precision 2. See Appendix B for examples of the fonts available. In addition all the other fonts listed in the PAW manual (section 8.10 - Text Fonts) are available. Within PLTSUB there is only one other font (the PLTSUB SYMBOL routine). 2 IGTEXT There are a number of changes from the standard IGTEXT input in the way you give a text string to make it easier and quicker to get what you want. Upper and lower case characters should be entered as you want them to be, including Greek and special characters. To switch modes precede the string you want in a different mode by the relevant escape character given below. You will stay in the new mode until you give the termination character. The exception is `@' which is only valid for the next character. The following escape characters are used as in IGTEXT: [ go to Greek ] end of Greek " go to special symbols # end of special symbols ^ go to superscript ? go to subscript ~ go to Zapf Dingbats font (HIGZ Postscript only) ! end of superscript or subscript or Zapf Dingbats & backspace one character $ termination character (do not use in your strings) @ to get any of the escape characters (if they are in the IGTEXT character set) The following characters can be entered directly: a,b...z lowercase alphabetic A,B...Z uppercase alphabetic 0,1...9 the digits , comma . period ; semicolon : colon + plus sign - minus sign * star / slash = equals _ underscore | vertical bar ' quote or apostrophe < > less than, greater than ( ) left/right parentheses { } curly brackets The following sequences will be printed as a single character: =< less than or equal to >= greater than or equal to -> right arrow <- left arrow +/- plus or minus German letters with umlauts as well as the sharp s (also called sz) !^ can be obtained with the syntax `\"a' etc. The sharp s is `\"S'. !can be obtained with the syntax \verb#\"a# etc. The sharp s is \verb#\"S#. As the < and > signs can be typed in directly, you cannot use them for switching between lower and upper case. This only affects getting small versions of digits. You can force a switch by preceding the symbol by an `@'. Superscripts and subscripts are terminated by a `!'. `!' is also used for command line history in Unix version (4.01 onwards), therefore you have to quote `!' with a backslash to get an exclamation mark if you give the command interactively. In addition if `!' is defined as the comment character you must also enclose the expression in single quotes (version 4.03 onwards): set x label '(GeV/c^2\!)' If you put the command in a file, then do not include the backslash, but you must still include the quotes: set x label '(GeV/c^2!)' There are some characters that are often requested but are not readily available. I list a few of the more common ones here: Prime [\242] Postscript character 242 in Greek Per mille \275 \vartheta [\112] The commonly used TeX character \varphi [\152] The commonly used TeX character !^ Unfortunately the commonly used '\ell' TeX character is not available, !Unfortunately the commonly used $\ell$ TeX character is not available, as I far as I can tell. I recommend that you browse through `$MN_FIT/help/ps_char.ps' if you are searching for some other characters. These tables are also included in Appendix B of the Mn_Fit manual. 3 Examples !^ '@<1234@>' will get you a very small 1234. !^ '[p]^+![p]^-! Invariant Mass (GeV/c^2!)@!' will get you !^ Dipion Invariant Mass (GeV/c**2)! with the proper Greek letters and !^ superscripts! !^ 'Die Bl\"atter sind gro\"S' will get the proper German letters !^ when printed on a Postscript printer. !\verb#@<1234@># will get you {\tiny 1234} and \newline !\verb#'[p]^+![p]^-! Invariant Mass (GeV/c^2!)@!'# will get you !$\pi^+\pi^-$ Invariant Mass (GeV/c$^2$)! !\verb#Die Bl\"atter sind gro\"S'# will get you !Die Bl\"{a}tter sind gro\ss{} when printed on a Postscript printer. +DECK,MOUSE. 1 Mouse If you are running Mn_Fit at a workstation that has a mouse, you can use it to position `COMMENT's, `KEY's and to `DRAW' things like lines, arrows, boxes and polygons. Use the `SET MOUSE on|off' command to turn on or off usage of the mouse. When asked to give the position move the cursor to the correct position and click on the left mouse button. If you are changing an item and are happy with its current position, just put the cursor anywhere on the picture and click on the right mouse button. Note that posiitoning things with the mouse only works in `CM' mode. For experts: I use the HIGZ routine IRQLC to get the mouse position. +DECK,Using_Ntuples. 1 Using_Ntuples When talking about Ntuples in Mn_Fit most commands apply to Ntuples, scatter plots, series of points, tables and multi-dimensional histograms (including 2-D). There are a number of commands available for manipulating them all. See HELP NTUPLE for details. You can define cuts, which are either simple expressions (variable condition value), more complicated expressions (expression condition expression), or a COMIS function filename. These cuts can then be applied using the `NTUPLE PROJECT' or `NTUPLE PLOT' commands and you can project onto either a 1 or 2-dimensional histogram, a profile plot, a scatter plot or another Ntuple. You can either specify what the binning should be for the resultant plot or let the program do it for you. It is possible to use a variable as a weight or error on the weight for each point. I have used this when measuring a 2-dimensional surface. The measurements were stored in a table as `x,y,z,dx,dy,dz' and read in using `DAT_FETCH' with an `NTUPLE' card. It is also possible to plot Ntuples directly. This is most useful if you have read in a table of numbers (using the `DAT_FETCH' command for example) and want to plot one vs. the other without applying any cuts. If you specify a COMIS function as a cut (`CUT FILE' command), and the file does not exist a skeleton will be made. If you give the identifier of an existing Ntuple as part of the command then the variable names will be used in the skeleton, making it easy for you to specify your cuts. It is also possible to merge several Ntuples together, which have been created by separate jobs for example. You can call a COMIS subroutine for each event in the Ntuple (`NTUPLE SCAN') and can make whatever plots or calculations you wish there. You can select the events that you want to use for further analysis using the `NTUPLE FILTER' command. It should be trivial to adapt COMIS functions which have been used in PAW to Mn_Fit. Although KUIP vectors are not available, Mn_Fit registers and user variables are, so you can use these instead. Columnwise Ntuples (CWNs) are also supported. For details on how to book this sort of Ntuple see the HBOOK manual. The main advantage of them is the variable number of columns per event and that only the columns that are needed are fetched. If you `SCAN' a CWN, all columns will be fetched. `NTUPLE FILTER' does not yet work with CWNs. If you `PROJECT' then only those variables that are projected onto will be fetched. However I do not know which variables you want to access if you are using a COMIS function as a cut, so you have to give the command `SET NTUPLE VARIABLE' to list which variables are needed. Ntuple commands are still being developed and so there are likely to be additions and improvements to them in the future. Suggestions for new commands or how to make existing commands easier to use or more flexible are welcome. +DECK,columnwise_ntuples. 1 ColumnWise_Ntuples ColumnWise Ntuples (CWN) are now (version 4.03) supported in Mn_Fit. In addition to treating them like single variable ntuples you can also specify a range of elements or an array element that should be accessed. The number of columns you give for a CWN variable should always be the same as its definition. Use `:' to give a range of variables. If you want to give a range of more than 1 variable, it is up to you to make sure that the ranges are consistent: ntuple project 34 rval2(2:nval2)*rval3(1,2:nval2) rval3(4,2:nval2) - &11 75 -5 10 75 -5 10 Note that the limits of each variable of a CWN are not known. Therefore you always have to give the limits for plotting yourself. CWN variables that you want to access in a COMIS function as part of an `NTUPLE PROJECT' command have to be specified using the `SET NTUPLE VARIABLE' command. However, for the `NTUPLE SCAN' command all variables will be fetched. WARNING: If you try to loop over a `CUT' variable this will not be checked, but the loop will be ignored. If you need a cut variable to change with the element number of a CWN, then you will have to use a COMIS function for the cut. For more details see HELP NTUPLE PROJECT. +DECK,USING_COMIS. 1 Using_COMIS COMIS is the COMpilation and Interpretation System that enables you to write and execute FORTRAN functions without having to relink your program. COMIS is used in several places in Mn_Fit. You can use COMIS to write a function to fit to (see HELP FUNCTION LIST COMIS for more details), as a cut when projecting an Ntuple or n-dimensional histogram (see HELP NTUPLE PROJECT), as a function which is called for every event of an Ntuple (see HELP NTUPLE SCAN), or as a subroutine which you can just call (see HELP CALL_COMIS). In all cases if the filename you give does not exist a skeleton file will be written and you can then edit it. You can also just invoke COMIS by giving the command `COMIS' if you have something special to do (see HELP COMIS), although the `CALL_COMIS' command is probably better for all the purposes I have been able to think of. See HELP NTUPLE for details of the common blocks available when you are looking at Ntuples. From any COMIS function or subroutine you can call many CERNLIB subroutines. These routines are the same as in PAW with a few additions. You can find documentation on most of the CERNLIB routines via the CERNLIB web pages: `http://wwwinfo.cern.ch/asd/cernlib/libraries.html' and `http://wwwinfo.cern.ch/asdoc/cernlib.html'. The following routines are known and therefore can be used: Mn_Fit: XMNCLC, XMNCNT, XMNFRG, XMNHIS, XMNRD3, XMNRES, XMNC2D, XMNDFUN RMNCLC, RMNCNT, RMNFRG, RMNHIS, RMNRD3, RMNRES, RMNC2D, RMNDFUN SMCTRL, SMQHAN, SMRMED, SMRMEN, SMSORT MINUIT: MNEMAT,MNERRS,MNSTAT HBOOK: HBOOK1,HBOOK2,HBOOKN,HFILL,HF1,HPRINT,HDELET,HRESET HFITGA,HFITPO,HFITEX,HPROJ1,HPROJ2,HFN,HGNPAR HROPEN,PAOPEN,PACLOS,PAREAD,PAWRIT,HCDIR,HGIVEN HPAK,HPAKE,HUNPAK,HGIVE,HGN,HGNF,HF2,HFF1,HFF2 HMAXIM,HMINIM,HMAX,HMIN,HSUM,HNORMA,HREND HI,HIE,HIX,HIJ,HIF,HIDALL,HNOENT,HX,HXY HRIN,HROUT,HCOPY,HBPROF,HOPERA,HIDOPT,HDERIV,HGFIT HEXIST,HRGET,HRPUT,HSCR,HFIND,HCX,HCXY,HLABEL HBPROX,HBPROY,HBANDX,HBANDY,HBSLIX,HBSLIY HBOOKB,HBSTAT,HDIFF,HUNPKE,HREBIN,HERROR,HPROF2 HOUTPU,HERMES,HISTDO,HFUNC,HXI,HIJXY,HXYIJ,HFINAM HSTATI,HLPOS,HFC1 HSPLI1,HSPLI2,HMDIR,HLDIR,HRDIR,HLOCAT,HFITH,HFITV HTITLE,HBFUN1,HBFUN2,HRNDM1,HRNDM2,HBARX,HBARY HBNT,HBNAME,HBNAMC,HFNT,HFNTB,HGNT,HGNTF,HGNTV,HBSET HGNTB,HNBENT,HVXIST HPLOT: HPLOT,HPLSYM,HPLERR,HPLEGO,HPLNT,HPLSUR,HPLSOF,HPLFRA HPLABL,HPLSET,HPLGIV,HPLOC,HPLTOC,HPLNEW,HPLOPT KUIP: KUGETV,KUDPAR,KUVECT,KILEXP,KUTIME,KUEXEL,KUPROS KUNWG,KUCMD,KUGUID,KUNDPV,KUPAR,KUPVAL,KUACT HIGZ: IPL,IPM,IFA,IGTEXT,IGBOX,IGAXIS,IGPIE,IGRAPH,IGHIST IGARC,IGLBL,IGRNG,IGMETA,IGSA,IGSET,IRQLC,IRQST,ISCR ISELNT,ISFAIS,ISFASI,ISLN,ISMK,ISVP,ISWN,ITX,ICLRWK IGPAVE,IGTERM ZEBRA: FZIN,FZOUT,FZFILE,FZENDI,FZENDO,MZLOGL RZCDIR,RZLDIR,RZFILE,RZEND,RZIN,RZOUT,RZVIN,RZVOUT RZOPEN,RZIODO,RZCLOS,RZQUOT CERNLIB: VZERO,UCOPY,RNDM,RANNOR,LENOCC,CLTOU,CUTOL SBIT0,SBIT1,SBYT,JBIT,JBYT,UCTOH,UHTOC,TIMED ERF,ERFC,FREQ,PROB,RANLAN DENLAN,DSTLAN,DIFLAN,XM1LAN,XM2LAN BINSIZ,DERF,DERFC,DFREQ,GAMMA,DGAMMA RANMAR,RMARIN,RMARUT,RMMAR,RMMAQ,RANECU,RANECQ RANLUX,RLUXGO,RLUXAT,RLUXIN,RLUXUT,RNORML,RNORMX FUNLXP,FUNLUX,RADAPT,RGS56P +DECK,time. 1 Time Use the `SET X MODE DATE' or `SET X MODE TIME' commands to plot things as a function of date or time. For the date the day will be printed as the scale and the month will be shown below the scale. Note that the command `SET X MODE DATE|TIME' has more effect than the usual `INTEGER, REAL' or `LOG' modes. If `DATE|TIME' mode is selected plot limits must also be given as a date or time. If you project an Ntuple, then the x-axis is also assumed to be in date or time mode. See HELP Y2K for details on how I cope with the 21st century in Mn_Fit. In general years less than 80 are assumed to be in the 21st century. Mn_Fit can only cope with 2 digit years, i.e. 99 or 02. If you have a date in an Ntuple stored as YYYYMMDD single precision is not sufficient to reliably get the month and day correct. It is possible to make plots as a function of date and/or time. The easiest way to read in and store something as a function of time is to use the `DAT_FETCH' command or to store the data in an Ntuple and then use one of the date/time functions. The time can be given in a number of different forms: DATE_TIM YYMMDD HHMMSS DATE YYMMDD TIME HHMMSS DATE_MIN YYMMDD HHMM TIME_MIN HHMM VAXTIME Char*23 Vaxtime DD-MMM-YYYY HH:MM:SS.SS `VAXTIME' can be abbreviated on VMS, but must be the full CHAR*23 format on any other computer. The data are stored in the form given on the `TIME' card or with the `SET TIME' command and can be (`DAY', `HOUR', `MINUTE' or `SECOND', default is `DAY'). A reference time (T=0) can be given and this must be in the form `YYMMDD HHMMSS'. Internally the plots are then stored in terms of the numbers of days (hours, minutes or seconds) since the reference time or since the 1st point if you have not specified a reference time. The reference date/time is only used if you have set the axis mode to the same as the time mode: SET X MODE DATE and SET TIME DAY yymmdd SET X MODE TIME and SET TIME HOUR yymmdd.hhmmss Otherwise the reference time is set to 0 and the axis mode is used to specify how the plot should be stored. If you store the date/time in an Ntuple and want to make a plot as a function of date or time use one of the date/time expressions (`DATE, TIME, DATE_TIM, DATE_MIN, TIME_MIN'). For more details on these functions see HELP Expressions. Note that you should avoid giving the Ntuple variables the same name as one of the functions, as Mn_Fit may well get confused! The `VAXTIME' form is not available for Ntuples. If you want to make an HBOOK histogram and then plot it as a function of date you should book it in terms of the numbers of days since 1-Jan-1980 00:00. For plots as a function of time book it in terms of the number of hours since 1-Jan-1980 00:00. At present reading in plots as a function of date and/or time only works for the x-axis. While you can specify date or time mode for other axes it is not fully implemented. 2 Examples !\begin{enumerate} !\item !^ Example 1: You have an Ntuple which contains dates, times and temperature. You want to plot the temperature vs date from the beginning to the end of 1995. Here is a simple ASCII file (`file.mnd'), but you could store the same thing in an HBOOK Ntuple: id 1 title Temperature vs. time ntuple 3 ndate ntime temp data 950203 120000 13 950303 080000 -4 950503 040000 0 950603 165700 19 950703 201000 30 950903 120000 18 end You read in the file and make and plot a projection: dat_fetch file.mnd set x mode date project 1 date_tim(ndate,ntime) temp &1 0 950101 960101 ! Plot from 1-Jan-1995 to 1-Jan-1996 plot 1&1 ! Plot from 1-Jan-1995 to 1-Jun-1995 set x lim 950101 950601 plot 1&1 !\end{enumerate} 1 Y2K For Mn_Fit the magic year is 1980! In most of the code I stick with a 2 digit year. If the year is less than 80 I put it in the 21st century. If it is more than 80 it is assumed to be in the 20th century. In addition a year such as 101 should be treated at 2001 in most cases. Unfortunately I cannot cope properly with 4 digit years. You should use 020410 and not 20020410 to specify the 10th April 2002. The reason is that Mn_Fit internally uses real numbers and single precision is not sufficient for an 8 digit date. Note that for the L3 database interface year 2000 MUST be given as 100 etc. If histograms have been or are created in 2000 or later using CERN library versions 98 or earlier, then the date within the histogram file will be screwed up. If Mn_Fit has been compiled with a 1998 or earlier version of the CERN library, you may also have problems with the display of dates. +DECK,vectors. 1 Vectors While vectors as such do not exist in Mn_Fit, you can use registers and/or a series of points for almost all such purposes. A series of x and y values can be read in from a table using the `DAT_FETCH' command. If you want to store a series of x and y values, e.g. the results of a fit to a series of histograms, book an unbinned histogram and then fill it with the results. 2 Examples !\begin{enumerate} !\item !^ Example 1: Fit a series of histograms 1&1 to 1&20 with a Gaussian and plot the area as a function of the histogram number: fun del 0 fun add gaus s 1000 100 0 0.5 1 2 ! Book the results plot book/unbin/err 1 'Fit results' 1 20 do i=1,20 fit/like 10&@i minimize display fill 1 @i p1(1) 0.5 err1(1) enddo ! Set the limits of the result histogram properly part 1 0 21 plot 1 !\end{enumerate} +DECK,EXAMPLES. 1 Examples Appendix C contains some demonstration Mn_Fit macros, which have also been used to make the figures there. These macros are in the directory referred to by the logical name `mn_fit_help' (VMS) or by the directory `$MN_FIT/help' (Unix). The macros used to produce the figures in Appendix B are also available in the same directory. To execute these files give the command `exec $MN_FIT/help/filename' (Unix) or `exec mn_fit_help:filename' (VMS): demonn.mnf - Demonstration macro number nn (nn = 01, 02 ...) symbol.mnf - Shows the available symbols font.mnf - Shows a sample of the HIGZ Postscript fonts font_gksgral.mnf - Shows a sample of the GKSGRAL fonts hatch.mnf - Shows HIGZ hatchings hatch_gksgral.mnf - Shows GKSGRAL hatchings pattern.mnf - Solid and hollow fill + grey shading key.mnf - Different styles of keys to describe the plot symbol ps_char.mnf - All the Postscript characters If these files are not available they can be found in the CMZ file `mn_fit_cmz:mn_util.cmz' (VMS) or `$MN_FIT/cmz/mn_util.cmz' (Unix) in the directory `//mn_util/demo'. To make the files startup CMZ and give the following commands: * Unix file $MN_FIT/cmz/mn_util -r sel UNIX * VMS file mn_fit_cmz:mn_util -r sel VMS * set *.mnf -d ctot -y demo A series of test files are available in the directory referred to by the by `$MN_FIT/test' (Unix) or the logical name `mn_fit_test' (VMS). Be aware that these files reserve the right to delete any plots or functions you have already read in or defined. To execute the files first give the command `exec $MN_FIT/test/init_test' (Unix) or `exec mn_fit_test:init_test' (VMS) and then `exec $MN_FIT/test/filename' (Unix) or `exec mn_fit_test:filename' (VMS). The following files are available: all_test.mnf - Runs all of the following command files fetch_test.mnf - Tests all the fetch commands store_test.mnf - Tests the various store commands plot_test.mnf - Tests lots of the plotting features slice_test.mnf - Tests extracting and plotting HBOOK slices etc. time_test.mnf - Tests plotting vs. date or time fit_test.mnf - Tests the fitting fun_check.mnf - Checks many of the Mn_Fit built-in functions frag_test.mnf - Tests fragmentation functions dipi_test.mnf - Tests the dipion invariant mass functions char_test.mnf - Tests parsing commands, plus comments and continuations do_test.mnf - Tests DO loops if_test.mnf - Tests if blocks comis_test.mnf - Tests the COMIS interface define_test.mnf - Test defining new commands alias_test.mnf - Tests defining aliases squeeze_test.mnf - Tests recovery of unused space ntuple_test.mnf - Tests operations on Ntuples without cuts cut_test.mnf - Tests cut and project operations merge_test.mnf - Tests merging Ntuples scan_test.mnf - Tests scanning Ntuples call_test.mnf - Tests calling a COMIS function or subroutine oper_test.mnf - Tests the plot operation commands: partition, add etc. eff_test.mnf - Tests the efficiency calculations calc_test.mnf - Tests calculations, use of registers, parameters etc. var_test.mnf - Tests defining user variables smooth_test - Tests smoothing of histograms spline_test.mnf - Test spline fitting draw_test.mnf - Tests drawing lines etc. symb_test.mnf - Tests the available symbols pattern_test.mnf - Shows the available patterns (DECGKS, DEC GKS3D) font_test.mnf - Tests out changing fonts pfont_test.mnf - Tests Postscript fonts Note that `plot_test', `fit_test', `ntuple_test' and `cut_test' run many other macros that test different aspects of plotting, fitting and Ntuple handling. If you are not at Cornell, CERN or DESY and do not have the files please ask me to send them to you. These are also the files used to check out Mn_Fit, so if you have any problems please let me know. Note that there are some errors built in to test out error handling. See: http://www-zeus.physik.uni-bonn.de/~brock/mn_fit/pro/mn_fit.doc for details of what to expect. +DECK,SCREEN_DEVICES. 1 Screen_Devices The screen devices that can be referred to by name depend on the graphics package used. Below I list most of the devices that are available. The letters following the name indicate which graphics package they are available in. (G = GKSGRAL, V = DECGKS, DG = DEC GKS-3D, DI = DI3000, X = X Windows, P = PLTSUB). You can use any other device by giving its number (see the relevant manual). You can find the complete list of devices available by asking for help when you start up Mn_Fit or giving the command `CAPTURE ?'. When you start up Mn_Fit you will be prompted for which device you want to use. Give a ? when asked for the screen device at the beginning of Mn_Fit to find out which ones are available. If your Tektronix is another device you must give the logical name for the device. In addition you must be able to allocate the device for it to work. In X Windows you can specify the display in the following ways when you are prompted inside Mn_Fit. However this does not work for Decnet communication on VMS: uses the DISPLAY name and line 10 of higz_windows.dat n.hostname DISPLAY is set to hostname and added to higz_windows.dat n DISPLAY is taken from line n of higz_windows.dat if available n. DISPLAY uses environment variable DISPLAY and line n of higz_windows.dat For the X windows version you can define the DISPLAY variable before you start Mn_Fit or in the command line (using `-n hostname' (Unix) or `-n hostname -t transport -s server' (VMS)). The transport is usually either decnet or tcpip (for Multinet tcpip). The host name is either the decnet name or the tcp/ip name. If you specify the display in one of these ways just hit `' when prompted for the screen device. Line 10 of `higz_windows.dat' will be used to set the display size. If you start the X windows version and the environment variable `DISPLAY' is not defined and if you do not give the `hostname' then ``hostname`' (Unix) will be used. Under VMS if the logical `decw$display' is not defined, then the display will be set to `sys$node'. `hostname' is of the form `host:m' where `host' is the host name (e.g. `hpl3cmu3.cern.ch') and `m' is the display number (usually 0). The `higz_windows.dat' file is searched for in your current directory and then in your home directory. If it does not exist it is created in your home directory. It contains 10 lines with the format `4(1X,I4),1X,A'. The four numbers are the x and y sizes of the display and the offset from the top left corner (in pixels). The character string is the `DISPLAY' name. `higz_windows.dat' is initially created with display sizes of 600 pixels and 0 offsets. If you are logged directly onto a computer or use `ssh' to connect to another computer `DISPLAY' should always be set correctly. Device `None' is useful if you want Mn_Fit to go through the motions of making a picture without actually making one, as in `FUNCTION HIST' if you just want the histogram without looking at it: None All Capture a null device. Display X X Windows Display Xterm X Xterm Tektronix window Tektronix G/V/DG/DI/P Tektronix screen. You will be prompted for type and the logical name if it is another device. T10 P 10 bit resolution Tektronix T12 P 12 bit resolution Tektronix Vaxstation G/V/DG/DI/P Opens a UIS window VS2000 DG Vaxstation 2000 VS3200 DG Vaxstation 3200 VS3500 DG Vaxstation 3500 VSII DG Vaxstation II monochrome CVSII DG Vaxstation II/GPX colour Decwindows V/DG/P Decwindows input and output device Motif V/DG Motif input and output device VT240 G/V/DG/P VT240 graphics terminal CVT240 DG VT240 colour VT340 G/DG VT340 graphics terminal Pericom G Pericom graphics terminal Falco G/P/X Falco graphics terminal Apollo G Apollo monochrome workstation CApollo G Apollo colour workstation Grinnell P Grinnell screen nnnn G/V/DG/DI/P The workstation type number For DI3000 you must define which devices you want to have available before you start Mn_Fit. You have to check your local DI3000 documentation to find out what devices you can define. Help inside Mn_Fit will then tell you what you have defined. +DECK,HARD_DEVICES. 1 Hardcopy_Devices The hardcopy devices that can be referred to by name depend on the graphics package used. Below I list most of the devices that are available. The letters following the name indicate which graphics package they are available in. (G = GKSGRAL, V = DECGKS, DG = DEC GKS-3D, DI = DI3000, X = X Windows, P = PLTSUB). The default filename is also given. You can use any other device by giving its number (see the relevant manual). When you give the command `HARDCOPY' you are prompted for the device you want to use. Use the `SET HARDCOPY' command to change the output filename for hardcopies if you want to (this is only implemented in HIGZ/GKS versions). This command is also useful if you run Mn_Fit in a script and want to output all pictures to a file. Use the sequence of commands: mn_fit none set hard filename.ps capture postscript fetch ... plot ... close exit If you are reading commands from a file and omit the device a `METAFILE' will be assumed. Postscript (Landscape, Portrait and Encapsulated) is now always HIGZ Postscript. To get other Postscript interfaces precede the device name with G (GKSGRAL) or D (DECGKS), e.g. GPostscript. The following hardcopy devices are supported: Metafile G/V/DG plot.meta GKS Metafile Postscript All plot.ps Postscript file (portrait) EPostscript G/V/DG/X plot.eps Encapsulated Postscript file LPostscript G/V/DG/X plot.ps Postscript file (landscape) CPostscript G/X plot.ps Colour Postscript file (portrait) CLPostscript G/X plot.ps Colour Postscript file (landscape) Tektronix G plot.tek Tektronix 4014 file Tektronix P plot.t12 12 bit for a real Tektronix Talaris P plot.qms Talaris laserprinter file Imagen P plot.tek Imagen printer Versatec P plot.vrs Versatec printer LN03 P plot.t12 LN03 plus printer (Tektronix) If you try to put more than one page into an encapsulated postscript file, then the pages will each be put into separate files with the names `file.eps, file.eps_1, file.eps_2' etc. You can set the paper size using the `SET PAPER' command. +DECK,CONDITION_HANDLER. 1 Condition_Handler Mn_Fit uses the KUIP condition handler which traps errors and `CTRL/C' interrupts. If an error is detected control is returned to the `MN_CMD>' level. This means that overflows and any other arithmetic errors should not cause the program to exit. It will return to the `MN_CMD>' level instead. WARNING: A `CTRL/C' during FORTRAN I/O can cause strange effects, particularly on VMS. To suppress the output during an `INDEX' command for example use `CTRL/O' and then you can try `CTRL/C' with care. If you interrupt with `CTRL/C' inside MINUIT, Mn_Fit sometimes gets confused and refuses to start fitting again, so you have to exit and restart. +DECK,EXIT. 1 EXIT Syntax: EXIT Exits the current level. If you are in `MN_CMD>' then you exit the program, otherwise you get back to the last level. e.g. `MINUIT>' -> `MN_CMD'. Note that the minimum abbreviation for this command is `EXI' to avoid accidental exits. +DECK,QUIT. 1 QUIT Syntax: QUIT Emergency exit of Mn_Fit. This is useful if you get an error when trying to exit normally. Note that no files are closed if you use `QUIT'. The minimal abbreviation for this command is `QUI' to avoid accidental exits. +DECK,ADD. 1 ADD Syntax: ADD id1 [:id1n] [&idb1] id2 [:id2n] [&idb2] id3 [:id3n] [&idb3] [scale1] [scale2] (default scale = 1.0 1.0) where: id1,id2 are the input histogram identifiers id3 is the output histogram identifier idb1,idb2 are the (optional) input secondary identifiers idb3 is the (optional) output secondary identifier Adds two histograms (id1, id2) together to make a third one. To specify the secondary identifier, precede it by a `&', otherwise the default will be used. (Use the `SET IDB' command to change the default). The scale factors are optional. To avoid confusion, you should give a `' after the identifiers or make sure the scale factors are given as real numbers. To add a range of histograms, the primary identifiers you give for the input and output histograms must be the same, but you can specify different secondary identifiers. For example, `ADD 300:400&1 300:400&2 300 : 400 & 10' will add all histograms with primary identifiers 300 to 400 and secondary identifiers 1, to those with secondary identifiers 2, putting the results into histograms with the same primary identifiers and secondary identifier 10. If you give primary identifier 0, the operation will be performed on all plots with the given secondary identifier. +DECK,ALIAS. 1 ALIAS Syntax: ALIAS name string where: name is the alias name string is the string that the alias defines Defines an alias for a string. If you do not want to continually type a long string or keep macros computer independent it is often useful to define an alias. It is not allowed to define `ALL' as an alias name. When a command line is parsed any defined aliases are searched for. To be recognized as an alias the `name' must be followed by a non-alphanumeric character. If you want to concatenate an alias with another string you can use `//'. Alias translation can be turned on and off using the command `SET ALIAS ON|OFF'. By default it is on. If you do not want a `name' to be translated as an alias precede it by a `@'. You can undefine an alias using the command `UNALIAS name', but see the warnings below. You can list one or more aliases using the command `SHOW ALIAS name'. If you omit the `name' all aliases will be listed. Aliases can be up to 20 characters long and translate into strings that are up to 80 characters long. WARNINGS: If alias translation is on and you want to undefine an alias you must use the syntax `UNALIAS @name'. Similarly if you want to redefine an alias use the syntax `ALIAS @name string', or to show the translation use `SHOW ALIAS @name'. HINT: I find it useful to precede all aliases by a prefix (e.g. `a_'), so that you cannot accidentally include an alias in a command and get unexpected results. 2 Examples !\begin{enumerate} !\item !^ Example 1: This example defines an alias `junk', uses it and then lists all aliases: alias junk show junk all -> `show all' show alias all unalias @junk Note the use of `@junk' to remove the alias. !\item !^ Example 2: Shows concatenating aliases and effect of turning alias translation off: alias name1 'John Smith' alias name2 son message name1//name2 -> `John Smithson' alias name 'Jane Jones' message name1's real @name is name -> `John Smith's real name is Jane Jones' set alias off message What is your name? -> `What is your name?' You can now remove the alias with `unalias name'. !\end{enumerate} +DECK,UNALIAS. 1 UNALIAS Syntax: UNALIAS name|ALL where: name is the alias name Undefines the alias `name' or all aliases if the command `UNALIAS ALL' is given. See HELP ALIAS for a complete description of the alias mechanism. +DECK,ATTACH. 1 ATTACH Syntax: ATTACH [process_name] Attaches you to another process. If you omit the process name you will be attached to the name you gave last. This command is only valid on VMS. +DECK,AVERAGE. 1 AVERAGE Syntax: AVERAGE id1 [:id1n] [&idb1] id2[:id2n] [&idb2] id3[:id3n] [&idb3] where: id1,id2 are the input histogram identifiers id3 is the output histogram identifier idb1,idb2 are the (optional) input secondary identifiers idb3 is the (optional) output secondary identifier Makes a weighted average of the contents of two histograms (id1, id2) to make a third one. To specify the secondary identifier, precede it by a `&', otherwise the default will be used. (Use the `SET IDB' command to change the default). To average a range of histograms, the primary identifiers you give for the input and output histograms must be the same, but you can specify different secondary identifiers. For example, `AVERAGE 300:400&1 300:400&2 300 : 400 & 10' will add all histograms with primary identifiers 300 to 400 and secondary identifiers 1, to those with secondary identifiers 2, putting the results into histograms with the same primary identifiers and secondary identifier 10. If you give primary identifier 0, the operation will be performed on all plots with the given secondary identifier. +DECK,AVE_FETCH. 1 AVE_FETCH Syntax: AVE_FETCH filename id1[:id2] [id3...] Fetches one or more AVEHST histograms from an ASCII file. If you want to fetch all the histograms give the command `AVE_FETCH filename 0'. To fetch a range of histograms give the command `AVE_FETCH filename id1:id2'. If you want to fetch another histogram(s) from the same file give the command `AVE_FETCH id1[:id2] [id3...]'. +DECK,BOOK. 1 BOOK Syntax: BOOK[/BINNED|/UNBINNED|/ERROR|/NOERR|/ASYMMETRIC] id [&idb] title ndim maxpnt OR nbinx xlo xhi [nbiny ylo yhi ...] where: id is the plot identifier idb is the (optional) secondary identifier title is the title for the new plot ndim is the number of dimensions maxpnt is the maximum number of points (for an unbinned plot) nbinx is the number of x bins xlo is the lower limit on x xhi is the upper limit on x Alias for `HISTOGRAM BOOK'. See HELP HISTOGRAM BOOK for more details. +DECK,CALCULATE. 1 CALCULATE Syntax: CALCULATE [parameter =] expression Alias for `DEPOSIT'. If you omit the parameter the expression will be evaluated and the answer put in `R0', i.e. Register 0. See HELP DEPOSIT for more details. +DECK,CALL_COMIS. 1 CALL_COMIS Syntax: CALL_COMIS filename[(arg)] Y|N where: filename is the name of the file with the COMIS subroutine arg is the (optional) argument with which the subroutine will be called Y|N decides if the file will be edited before compilation Defaults: arg = 0.0 Calls a COMIS subroutine with argument `arg'. You can use this to do anything you want. However it is probably most useful to do things with histograms you have read in with Mn_Fit and cannot do easily directly in Mn_Fit. You will be asked whether you want to edit the file or not before compiling it. +DECK,CAPTURE. 1 CAPTURE Syntax: CAPTURE device_name [Grinell_number] or device_name [Logical_name] Captures a new output device for the plots. See HELP Screen_Devices and Hardcopy_Devices for details of the devices available. If you want a device other than those listed you must give its number (see the relevant manual for GKS or PLTSUB) and it will be captured as device type `Unknown'. +DECK,cdirectory. 1 CDIRECTORY Syntax: CDIRECTORY dirname where dirname is the directory name Sets the current HBOOK directory name to `dirname'. Note that the HCDIR command is executed immediately, whereas it is only executed when you do `FETCH', `LDIR', `ZDIR' or `SHOW DIR' after a `SET DIR' command. You should therefore always use `SET DIR' before a `FETCH' command. Note that the directory name should not be preceded by a '/'. However '//' is allowed so you can go to the top level. You can use either !^ '\' or '..' to go up a directory level. !$\backslash$ or '..' to go up a directory level. Note that the Mn_Fit HBOOK file top level directory name is `//MN_HBIN'. +DECK,CLEAR. 1 CLEAR Syntax: CLEAR Clears the currently selected screen device. It also deletes any items to be drawn and existing comments and keys. The command is most useful for drawing things without using the `PLOT' command. Note that in order to use registers > 200, which contain the plot corners in cm and plot coordindates, you first have to draw something. +DECK,CLOSE. 1 CLOSE Syntax: CLOSE Closes all the hardcopy output devices that have been selected. This enables you to print out plots (use the `SPAWN' or `SHELL' command) without exiting your Mn_Fit session. Next time you give a `HARDCOPY' command a new file will be opened. On Unix machines the `HARDCOPY' command will overwrite an existing file. Use the `SET HARDCOPY' command to change the filename. +DECK,COMIS. 1 COMIS Syntax: COMIS Invokes COMIS, the CERN COMpilation and Interpretation System, enabling you to write FORTRAN functions and use them without relinking Mn_Fit. For more details on how COMIS is interfaced to Mn_Fit see HELP Using_COMIS. See the COMIS manual for more details on COMIS. Normally you should use one of the Mn_Fit commands that automatically invokes COMIS: `FUN ADD COMIS', `NTUPLE SCAN, PROJECT or PLOT', `CALL_COMIS' etc. rather than this command. This direct interface is provided in case you want to do something special. +DECK,COMMENT. 1 COMMENT Syntax: COMMENT command [ncomm] or COMMENT id [&idb] command [ncomm] text x, y, size, angle, option, mode, font, colour, thickness where: id is the histogram number the comment applies to idb is the optional secondary identifier command can be ?|NEW|CHANGE|DELETE|LIST|END ncomm is the comment number to change or delete text is the text you want to display x,y are the position of the comment size is the size of the text in cm (default = 0.4cm) angle is in degrees with respect to the horizontal option can be: LEFT Comment is left adjusted CENTRE Comment is centered RIGHT Comment is right adjusted (default) mode can be: CM = Position is in cm (default) PLOT = Position in terms of plot coordinates font is the font to use colour is the colour number for the comment thickness is the text thickness factor When the `COMMENT' command is given in a file or a defined command the last syntax must always be used and the comment number must be given if it is applicable to the command (`CHANGE' or `DELETE'). You always need the `END' command when reading from a file to exit `COMMENT' unless you give the `command' on the same line as `COMMENT'. Comments are associated with histograms you have already plotted. Therefore, if you have only plotted one histogram on the picture (using the `PLOT', `2DIM', `LEGO', `SURFACE', `DISPLAY' or `OVERLAY/DIFF' commands - `OVERLAYS' on the same scale do not count), the syntax is the first line. If you have plotted more than one histogram on the display you will be prompted for the identifier the comment applies to. If you just give the command `COMMENT' or `COMMENT id[&idb]' you will remain in `COMMENT' until you give the `END' command or `'. However, if you give some or all of the rest of the `COMMENT' command on the same line you will automatically exit `COMMENT' after you have finished the command. By default the text will be written using the HIGZ routine IGTEXT. For details on formatting text and the other fonts available see HELP Text. The default colour and thickness of the comments are the same as the title. If you use the option `SET MOUSE ON', then the position of the comment is specified by the mouse. Move the mouse to where you want to have the comment and click on the left button. To keep the comment in the same position (if you are changing it) click on the right mouse button. Note that using the mouse only works properly in `CM' mode. You can omit all of the parameters except `x' and `y' for a new comment. For `mode CM', `x=0, y=0' is the bottom left-hand corner of the picture If you change or delete a comment use the command `REDRAW' to see the effect of what you have done. +DECK,COPY. 1 COPY Syntax: COPY id1 [&idb1] id2 [&idb2] where: id1 and id2 are the input and output histogram identifiers idb1 and idb2 are the secondary identifiers Makes a copy of a histogram. You can copy all histograms with a particular secondary identifier using the syntax `COPY 0 &idb1 0&idb2'. Note that `COPY' only copies the Mn_Fit histogram and not any associated HBOOK histogram. Use the `HCOPY' command to copy the HBOOK histogram also. +DECK,CUT. 1 CUT Syntax: CUT or CUT command where: command is one of ?|NEW|NAME|FILE|EDIT|COMPILE| CHANGE|DELETE|LIST|USE|END Specifies what cuts to use when making a projection of a plot, or modifies, deletes or lists existing cuts. To define cuts you can either use a FORTRAN syntax (`.EQ., .NE., .LT., .LE., .GT., .GE.') or symbols (`=, <>, <, <=, >, >='). Cuts can either be expressions or a COMIS function. If the nearest integer to the return value of the Comis function is 1, the cut is passed. If the command is included on the same line as `CUT' then you will exit `CUT' after the command has been executed. If the histogram is an Ntuple or has been made with the M_BOOK package the variable names are as you gave them at booking time, otherwise the default names are `x',`y' and `z' for the first 3 dimensions. The sequence to use is `CUT NEW' or `CUT NAME' to define the cuts you want to use and then use the `CUT USE' command to say how they should be strung together using the usual FORTRAN syntax with `.AND.' and `.OR.'. You can also use the symbols (`&' and `|'). For a COMIS function you can also give the value of the argument that it is called with. When you have finished cut give the command `END' or hit `'. Then give the `PROJECT' command to implement the cuts you have selected (see HELP NTUPLE PROJECT for more details). For a short description of the commands see HELP CUT Menu. See the individual topics for more information. WARNING: In versions before 4.07/30, if you combined simple cuts (where the expression2 (see HELP CUT NEW) was a number or a register) with more complicated ones that had to be parsed (Ntuple variables, or arithmetic expressions), and the more complicated expression was specified later in the `CUT USE' command the cut value of another cut could be overwritten. 2 Menu The following is the list of `CUT' commands. For more details see HELP CUT and the individual subtopics: NEW Specifies a new cut. NAME Specifies or changes a named cut. CHANGE Changes an existing cut. FILE Gives a COMIS filename to be used as a cut function. EDIT Edits and then compiles a COMIS cut. COMPILE Compiles a COMIS cut. DELETE Deletes one or more cuts. LIST Lists the currently defined cuts. USE Specifies the cuts to use when making a projection. END Ends a list of cut commands. 2 NEW Syntax: CUT NEW expression1 condition expression2 where: expression1 is a variable name or an expression condition can be one of .LT., .LE., .GT., .GE., .EQ., .NE. or <, <=, >, >=, =, <> expression2 is a variable name or an expression Specifies a new cut. In its simplest form `expression1' is the name of a variable and `expression2' is a number. A number can be given in the form of a number, register, parameter etc. For more details on expressions see HELP Expressions. Note that you cannot use the form `x.lt..4' for a cut, although `x<.4' is OK. In general it makes it easier if you leave spaces between the expressions and the conditions. This problem may be fixed in a future version of Mn_Fit. If your cut expression starts with a parenthesis then you should enclose the whole expression in parentheses: cut new ((a+b)/(c+d)) The text of the cut will be stored and then parsed when you ask for a projection. Thus if you use registers etc. in the cut their values at the time that the projection is made will be used. 2 NAME Syntax: CUT NAME name expression1 condition expression2 where: name is a name for the cut expression1 is a variable name or an expression condition can be one of .LT., .LE., .GT., .GE., .EQ., .NE. or <, <=, >, >=, =, <> expression2 is a variable name or an expression Specifies or modifies a named cut. The name of the cut can be use later with the `CUT USE' command. In its simplest form `expression1' is the name of a variable and `expression2' is a number. A number can be given in the form of a number, register, parameter etc. For more details on expressions see HELP Expressions. The name of the cut should start with a letter. All names will be converted to upper case and only the first 10 letters are significant. If the name already exists you will modify an exisiting cut. If the name does not exist it will be added as a new cut. Names cannot be abbreviated in either the `CUT NAME' or the `CUT USE' commands. Note that you cannot use the form `x.lt..4' for a cut, although `x<.4' is OK. In general it makes it easier if you leave spaces between the expressions and the conditions. This problem may be fixed in a future version of Mn_Fit. If your cut expression starts with a parenthesis then you should enclose the whole expression in parentheses: cut new ((a+b)/(c+d)) The text of the cut will be stored and then parsed when you ask for a projection. Thus if you use registers etc. in the cut their values at the time that the projection is made will be used. 2 CHANGE Syntax: CUT CHANGE [ncut] expression1 condition expression2 where ncut is the cut number to change expression1 is a variable name or an expression condition can be one of .LT., .LE., .GT., .GE., .EQ., .NE. or <, <=, >, >=, =, <> expression1 is a variable name or an expression Change a cut (use the = sign if you don't want to change something). Note that you must use `==' if you want to keep the same condition, as `=' would change the condition to `.EQ.': cut new x>0.5 cut CHANGE 1 = == 1.0 end would change the above cut `X .GT. 0.5' to `X .GT. 1.0'. Registers, parameters etc. can be used for the value of the cut. Remember that they only get evaluated when the cut is used in making a projection. You should use the `PARSE' command if you want the values to be translated immediately. 2 FILE Syntax: CUT FILE filename [id[&idb]] Y|N where filename is the name of a file containing a COMIS function id is the plot number associated with the cut. Y|N decides if the file is to be edited before compilation Adds a new cut that is a COMIS function. The function will be called for each event in the Ntuple or each bin in the n-dimensional histogram. If the nearest integer to the return value is 1 the event will pass the cut. If the filename does not exist a skeleton file will be written. If you give a plot number then the variable names from that plot will be used to make the skeleton file. Therefore I recommend always giving a plot number when you make a new file. Information on the Ntuple is available in 3 common blocks: `PAWIDN, MNTPL1, MNTPL2'. For the contents of these common blocks and when and how they are filled see HELP NTUPLE. 2 EDIT Syntax: CUT EDIT filename or CUT EDIT ncut where filename is the name of a file containing a COMIS function ncut is a cut number which is a COMIS function Edits the file with the default editor (set with the SET EDIT command) and then recompiles the cut. 2 COMPILE Syntax: CUT COMPILE filename or CUT COMPILE ncut where filename is the name of a file containing a COMIS function ncut is a cut number which is a COMIS function Recompiles the cut. You can use this command if you edit the cut from outside Mn_Fit or just with the `EDIT' command instead of `CUT EDIT'. Note that the cut is always recompiled just before it is used in `NTUPLE PROJECT or PLOT'. 2 DELETE Syntax: CUT DELETE [ncut] where ncut is the cut number to change Deletes a cut (`DELETE 0' means delete all cuts). 2 LIST Syntax: CUT LIST Lists the cuts already specified. 2 USE Syntax: CUT USE expression where expression is the list of cuts to use and how to combine them Gives the list and order of cuts to use e.g. `1 .and. (2 .or. 3)' including whatever parentheses are necessary. You can use `.AND.' or `.OR.' or the symbols `&' and `|'. If you do not include the complete cut in parentheses they will be added for you. If a cut is a COMIS function you can give the argument with which the function should be called. e.g. `1 .and. 2(0.5)' would call the COMIS function corresponding to cut 2 with the argument value 0.5. The are 3 special values of the expression allowed: 0 means no cuts are to be used -1 means all cuts should be ANDed -2 means all cuts should be ORed 2 END Syntax: CUT END Exits cut. 2 Examples !\begin{enumerate} !\item !^ Example 1: Define the cuts: CUT NEW X .GT. 0.5 CUT NEW X< 2.0 NEW Y.LT.7.0 NEW Y.GT.10.0 file cut.for Specify which cuts to use. The COMIS function will be called with argument 1: CUT USE 1 .AND. 2 .AND. (3 | 4) & 5(1) END Make a projection: PROJECT id X &idb Change one of the cuts: CUT CHANGE 3 = .LE. 4 END Make a second projection: PROJECT id X &idb2 !\item !^ Example 2: Use a more complicated expression for a cut. Also illustrate how to use `CUT NAME'. Assume you have an Ntuple with 3 variables, gaus1, gaus2 and flat: cut del 0 cut name gauss gaus1 > gaus2 cut new abs(flat-0.5) < 0.5*(gaus1+gaus2) cut use -1 ntuple plot 31 (gaus1-gaus2) &1 50 -5 5 cut use gauss ntuple plot 31 (gaus1-gaus2) &2 50 -5 5 !\end{enumerate} +DECK,NO_CUT. 1 NO_CUT Syntax: NO_CUT Deletes all the specified cuts on a particular histogram. Same effect as `CUT DELETE 0'. +DECK,CWN. 1 CWN This is an abbreviation for ColumnWise Ntuple. See HELP ColumnWise_Ntuples and HELP NTUPLE for more details. +DECK,DATABASE. 1 DATABASE Syntax: DATABASE DB_HISTORY|DB_SNAP Interface to plotting from the L3 database. This facility should be able to be easily extended to anyone who uses an RZ based database. The following detector databases are known: FLUM, ECAL, HCAL, TECH, MUCH, L3RC. Following the L3 database conventions years after 1999 should be given in the form (100 + YY), i.e. 2000 is year 100 etc. 2 DB_HISTORY Syntax: DB_HISTORY[/qual] directory chan1 chan2 start stop mode [version] where: qual is PLOT|NOPLOT|PEDESTAL|NOPEDESTAL directory is the full pathname (e.g. //DBFL/BGO/LED/AVG) chan1 is the first channel number chan2 is the last channel number start is the starting date and time (default=today) stop is the finishing date and time (default=today) mode specifies the mode to plot (default is S) U plots the numbers as is S scales them by a reference entry - you give the date/time C scales them by the latest entry version is the FLUM database version or specifies the detector part for the ECAL database Plots one or more elements of a database vs. time. The default qualifiers are `/PLOT/NOPEDESTAL'. You can use the `SET TIME' command to specify which mode to store the data (default is days). In the future you will be able to set the plotting mode (`DATE' or `TIME'). For now if no x label has been given the reference time will be shown (i.e. T=0 on the plot). If you give more than 1 channel they will be averaged. All times should be given in the form `yYYMMDD.HHMMSS'. Year 2000 should be given as 100 etc. The default starting time and finishing times are the current time. If you want the database entries prior to some time, give that time first and the number of days, months, years before as a negative number. e.g. 0 -20 will get the database entries for the past 20 days and 941030 -100 will get the database entries between 940930 and 941030. If the time is omitted it is 000000 by default. You can plot the data as is or scaled by either a reference entry, for which you give the date and time, or the latest entry. The version number is required for the ECAL database and optional for all the others. The ECAL database has a separate bank for each of the half-barrels and each of the endcaps. The version number is in the form kji where: k = 0 means get the top-level data (e.g. the pedestals) = 1 means get the data from the down link (e.g. the pedestal widths) j = 0 means low energy data = 1 means low energy data = 2 means high energy data i = -1 means get the -Z detector data (barrel + endcap) = -2 means get the +Z detector data (barrel + endcap) = 0 means get all the data - does not work! = 1 means get the data for -Z half-barrel = 2 means get the data for +Z half-barrel = 3 means get the data for -Z endcap 1 = 4 means get the data for +Z endcap 2 For example version 111 for directory //DBEC/ELECTRONICS/PEDESTALS/BEAM will get the pedestals widths for the -Z half-barrel, for the low energy range of the Level-1 board. i=0,-1 and -2 do not work yet, nor does pedestal subtraction. The channel number for the ECAL database is interpreted as the box number. The plot is stored in identifier 98766 with the current secondary identifier (specified with the `SET IDB' command). 2 DB_SNAP Syntax: DB_SNAP[/qual] directory chan1 chan2 time mode [version] where: qual is PLOT|NOPLOT|PEDESTAL|NOPEDESTAL directory is the full pathname (e.g. //DBFL/BGO/LED/AVG) chan1 is the first channel number chan2 is the last channel number time is the time for which you want the data (default = latest) mode specifies the mode to plot (default is S) U plots the numbers as is S scales them by a reference entry - you give the date/time P scales them by the previous entry D gives the difference between the previous entry RD gives the difference between a reference entry - you give the date/time version is the FLUM database version or specifies the detector part for the ECAL database Plots part or all of the contents of a database directory. By default the qualifiers are `/PLOT/NOPEDESTAL'. Time should be given in the form (`yYYMMDD.HHMMSS'). Year 2000 should be given as 100 etc. The default time gets you the last entry. You can plot the data as is or scaled by either a reference entry, for which you give the date and time, or the previous entry. The plot is stored in identifier 98767 with the current secondary identifier (specified with the `SET IDB' command). The version number is required for the ECAL database and optional for all the others. The ECAL database has a separate bank for each of the half-barrels and each of the endcaps. The version number is in the form kji where: k = 0 means get the top-level data (e.g. the pedestals) = 1 means get the data from the down link (e.g. the pedestal widths) j = 0 means low energy data = 1 means low energy data = 2 means high energy data i = -1 means get the -Z detector data (barrel + endcap) = -2 means get the +Z detector data (barrel + endcap) = 0 means get all the data - does not work! = 1 means get the data for -Z half-barrel = 2 means get the data for +Z half-barrel = 3 means get the data for -Z endcap 1 = 4 means get the data for +Z endcap 2 For example version -111 for directory //DBEC/ELECTRONICS/PEDESTALS/BEAM will get the pedestals widths for the -Z detector (half-barrel + endcap), for the low energy range of the Level-1 board. For the ECAL data base the data always gets stored in a 160x41 2-dimensional histogram for now, so that it is easily interfaced with the BGEO ECAL display. See HELP SET PARAMETER ECAL for more details. +DECK,dat_fetch. 1 DAT_FETCH Syntax: DAT_FETCH filename Reads a file containing a series of data points or an Ntuple which have been written in ASCII format. The file can also contain data vs. time. The first non-comment line of the file should contain the identifier for the plot. If the identifier is omitted it will be set to 1 with the current secondary identifier. The following cards are allowed: ! denotes a comment card (must be in column 1 or 2 for the datacards) ID id [idb] to specify the identifier for the plot NTUPLE ndim name1 name2 ... gives the number of dimensions and the names of the variables for an Ntuple LIMIT xlo xhi to specify the lower and upper limits for the plot TITLE title to specify the title for the plot ORDER to specify the order of the variables TIME to specify the time mode to store and the reference time DATA to flag that the cards following this contain the data END to flag that this is the end of the data The default order for the data is: `x y dx dy' or if you want asymmetric error bars: `x y dnx dny dpx dpy'. You can change the order either by having an `ORDER' card or using the `SET ORDER' command (see HELP SET ORDER for more details). The following ways of giving the time are recognized: DATE_TIM YYMMDD HHMMSS DATE YYMMDD TIME HHMMSS DATE_MIN YYMMDD HHMM TIME_MIN HHMM VAXTIME Char*23 Vaxtime DD-MMM-YYYY HH:MM:SS.SS `VAXTIME' can be abbreviated on VMS, but must be the full CHAR*23 format on any other computer. These commands can be given on the `ORDER' card or with the `SET ORDER' command. The data are stored in the form given on the `TIME' card or with the `SET TIME' command and can be (`DAY', `HOUR', `MINUTE' or `SECOND', default is `DAY'). A reference time (T=0) can be given and this must be in the form `YYMMDD HHMMSS'. If this is omitted or not specified the first point will be used. If you want to ignore some columns in the data, give `DUMMY' as the name of the column. This works on both the `ORDER' and the `NTUPLE' card. A blank card, one with a number as the first element, or the `DATA' card will be taken to signal the start of data. You can also use `DAT_FETCH' to read in an Ntuple which you have written to a file. Use the `NTUPLE' card to give the dimension and the names of the variables for the Ntuple (there must be as many names as dimensions). The `LIMITS' and `ORDER' cards will be ignored if given. Again the data must be given as 1 record per line and should be in the same order as the names given in the `NTUPLE' card. Either an `END' card or an `ID' card signify the end of one dataset and the start of the next. 2 Examples !\begin{enumerate} !\item !^ Example 1: A simple plot: ID 1 LIMIT 0.0 1.0 TITLE This is a test file 0.4 5.7 0.01 3 0.2 1 0.02 0.5 0.6,0.1 0.1 0.4 !\item !^ Example 2: A file containing dummy entries and an Ntuple: ID 2 TITLE This file is more complicated ORDER X DX DUMMY Y DY DATA 3.4 1.6,35.0,5 2 2.2 1 45.0,6 1 END !^ ID 3 TITLE A second dataset in the same file 0.4 0.1 35.0 3 1.0 0.2 0.05 45.0 0.5 0.2 0.6,0.1 55.0 0.4 0.1 !^ ID 4 NTUPLE 4 P MASS dummy THETA PHI TITLE Ntuple containing particle parameters 0.35 0.498 Angle 0.6 3.6 1.20 0.480 Angle -0.5, 1.6 END !\end{enumerate} +DECK,dat_store. 1 DAT_STORE Syntax: DAT_STORE filename id [&idb] [id2 [&idb2]...] Alias for `WRITE DATA'. Writes one or more plots to a file, in ASCII image format. You can read the plot in again using the `READ DATA' or `DAT_FETCH' commands. This format is useful if you want to change something in the histogram like deleting a point or if you at some time later want to add more points. You can edit the file with your normal editor. This is also a good trick for converting a histogram to a series of points. Ntuples or scatter plots with up to 10 variables can be stored. Interactively you are warned if you try to write more than 1000 points! You can give a list of plot numbers to store, but all id's must be on 1 line. +DECK,DB_HISTORY. 1 DB_HISTORY Syntax: DB_HISTORY[/qual] directory chan1 chan2 start stop mode [version] where: qual is PLOT|NOPLOT|PEDESTAL|NOPEDESTAL directory is the full pathname (e.g. //DBFL/BGO/LED/AVG) chan1 is the first channel number chan2 is the last channel number start is the starting date and time (default = 890801) stop is the finishing date and time (991231) mode specifies the mode to plot (default is S) U plots the numbers as is S scales them by a reference entry - you give the date/time C scales them by the latest entry version is the FLUM database version or specifies the detector part for the ECAL database Alias for `DATABASE DB_HISTORY'. See HELP DATABASE DB_HISTORY for more details. +DECK,DB_SNAP. 1 DB_SNAP Syntax: DB_SNAP[/qual] directory chan1 chan2 time mode [version] where: qual is PLOT|NOPLOT|PEDESTAL|NOPEDESTAL directory is the full pathname (e.g. //DBFL/BGO/LED/AVG) chan1 is the first channel number chan2 is the last channel number time is the time for which you want the data (default = latest) mode specifies the mode to plot (default is S) U plots the numbers as is S scales them by a reference entry - you give the date/time P scales them by the previous entry D gives the difference between the previous entry RD gives the difference between a reference entry - you give the date/time version is the FLUM database version or specifies the detector part for the ECAL database Alias for `DATABASE DB_SNAP'. See HELP DATABASE DB_SNAP for more details. +DECK,DEFINE. 1 DEFINE Syntax: DEFINE name where: name is the new command name `DEFINE' creates interactively whole sets of commands, where `name' is any name you like except `ALL'. However, if there already is a command of that `name' the new definition will be ignored. Also, first standard Mn_Fit commands are searched for and then ones made with `DEFINE'. Therefore, if your new command is ambiguous with a Mn_Fit command, the Mn_Fit command will always be used. After giving the command line you will see the prompt `DEFINE>' and you give the defining commands one at a time. If you give the command `ENDDEF', you will revert to the usual prompt and are ready to use the new command. `DEFINE' works both at the `MN_CMD>' and the `MINUIT>' level. If you want to `DEFINE' a command with parameters from inside a file then use the syntax `@@1, @@2' etc. This will be translated to `@1, @2,' etc and then you can use the parameters within the `DEFINE' command. If you `DEFINE' a command interactively, use the syntax `@1, @2,' etc. For more on the use of parameters see HELP EXECUTE. 2 Examples !\begin{enumerate} !\item !^ Example 1: Define the command LOOK: MN_CMD> DEFINE LOOK DEFINE> PRINTOUT -5 DEFINE> SIMPLEX @1 50 @2 DEFINE> MIGRAD @1 @2 DEFINE> INFO DEFINE> ENDDEF If you then give: MINUIT> LOOK 5 3 then you will execute: PRINTOUT -5 SIMPLEX 5 50 3 MIGRAD 5 3 INFO If you give: MINUIT> LOOK then you will execute: PRINTOUT -5 You will be prompted for the values of parameters @1 and @2. If you hit then you will execute: SIMPLEX 50 MIGRAD INFO !\item !^ Example 2: You can nest commands: MN_CMD> DEFINE FULL DEFINE> INQUIRE 1 'Give histogram id to fit' DEFINE> FIT @1 DEFINE> 0 DEFINE> LOOK @2 @3 DEFINE> PRINTOUT -5 DEFINE> MINOS 1000 @3 DEFINE> PRINTOUT 1 DEFINE> ENDDEF FULL will invoke the just defined LOOK command. All resulting actual commands will be echoed on the screen, just so that you know what is going on. Also if you have not given a parameter when invoking the command you will be prompted for its value the first time that the parameter is found. !\end{enumerate} +DECK,UNDEFINE. 1 UNDEFINE Syntax: UNDEFINE name|ALL Deletes a command that you have created using the `DEFINE' command. If you give the command `UNDEFINE ALL' all defined commands will be deleted. You, therefore, are not allowed to define a command `ALL'. +DECK,DELETE. 1 DELETE Syntax: DELETE id[:id2] [&idb [:[idb2]] Deletes one or more histograms. To delete all the histograms, issue the command `DELETE 0'. To delete all those with a particular secondary identifier, issue the command `DELETE 0 &IDB'. To delete a range of histograms, use the command `DELETE 1:300 & 0 : 50'. This will delete all histograms with primary identifiers between 1 and 300 and secondary identifiers between 0 and 50. `DELETE 0&1:2' will delete all histograms with secondary identifiers between 1 and 2. +DECK,DEPOSIT. 1 DEPOSIT Syntax: DEPOSIT parameter = expression where: parameter is the parameter you want to change expression is the expression for its new value The expression can be any sort of mathematical calculation using numbers, registers, parameters, errors, bin contents, errors on bin contents, centre of bins etc. See HELP Expressions for more details. See HELP Numbers for details on the meaning of all the parameters. Use the `EXAMINE' command to look at any of the parameters described below. The parameter can be any of the possibilities given below or a user variable. User variables are alphanumeric strings (including `_' and `$') up to 8 characters long. They cannot have the same name as any of the parameters listed below. User variables can be deleted using the `REMOVE' command. If you give a user variable with a length longer than 8 characters it will be truncated. There are 100 registers available for your use numbered 0 to 99. Registers >=100 are used by Mn_Fit and contain numbers you may wish to access. See HELP Numbers for what is in them. Registers >300 contain user variables in the order that they are defined. You can use the `SHOW REGISTER' command to list a range of registers. To change the contents of a register: DEPOSIT Rn = expression where n is the register number To change the value of a parameter or its error in a function: DEPOSIT Pn(m) = expression ERRn(m) = expression ERNn(m) = expression ERPn(m) = expression LOLIMn(m) = expression HILIMn(m) = expression where n is the function number (as in FUNCTION INFO) m is the parameter number (as in FUNCTION INFO) This command also changes the values of MINUIT parameters so can be used instead of `MODIFY'. However, if you want to change a parameter and its error, for example, `MODIFY' is probably simpler to use. You can use the MINUIT parameter numbers when you are fitting using the form `Pn' where `n' is the MINUIT parameter number. !^ !\par\noindent To change the contents or errors of a bin in a plot: DEPOSIT Yn(m) = expression Xn(m) = expression DYn(m) = expression DXn(m) = expression DNXn(m) = expression DNYn(m) = expression DPXn(m) = expression DPYn(m) = expression where n is the plot number (can include the secondary id) m is the bin number Note that the x values and their errors can only be changed for a series of data points. For plots with asymmetric errors `DX' and `DY' are interpreted as the negative errors. !^ !\par\noindent You can also change the contents of a 2-D histogram using the form: DEPOSIT Yn(l,m) = expression where n is the plot number (can include the secondary id) l,m are the bin numbers !\par\noindent You can change a variable in an Ntuple, provided that the Ntuple is stored in memory (<50000 words long): DEPOSIT Xn(m,nvar) = expression or Xn(m,tvar) = expression where n is the plot number (can include the secondary id) m is the event number nvar is the variable number tvar is the variable name If the histogram identifier is in a register use the syntax `PARSE DEPOSIT X{IRn,(I6.6)}(m,nvar)' etc. to convert the register to a number. 2 Examples !\begin{enumerate} !\item !^ Example 1: Setting the initial values of parameters before fitting or plotting a function: DEPOSIT P1(2) = 1000 DEPOSIT ERR1(2) = 500 EXAMINE P1(2) FIT ... !\item !^ Example 2: Using a register to calculate an upper limit and putting that in a plot. Store the upper limit in one plot and the result with asymmetric errors in another plot: DEPOSIT R10 = R10 + 0.4 !Set x value for which the limit applies DEP R11 = P1(2) + 1.64*ERP1(2) FILL 10 R10 R11 FILL 11 R10 P1(2) 0.2 ERN1(2) 0.2 ERP1(2) !\item !^ Example 3: Evaluate some expression: dep pi = 3.14159 DEP R1 = R1 + 0.3*(R2^2 + SQRT(P1(4) - P2(4))) - sin(pi/4) examine pi show register 1:10 !\end{enumerate} +DECK,directory. 1 DIRECTORY Syntax: DIRECTORY [id1][:id2] [&idb][:idb2] Alias for INDEX. Gives a directory of the histograms currently in memory. If you specify the primary identifier, you will get an index of all histograms with that identifier. To get all the histograms with a particular secondary identifier, give the command `DIRECTORY 0 &idb'. To get all the histograms in a particular range, give the command `DIRECTORY id1:id2 &idb1:idb2'. +DECK,DISPLAY. 1 DISPLAY Syntax: DISPLAY detnam id [&idb] where: detnam is the detector name id is the histogram identifier idb is the (optional) secondary identifier Makes a special display. This has been implemented for the following subdetectors in the L3 experiment: `ECAL', `FBGO', `FSIL' and `FWCH'. For the ZEUS experiment it has been implemented for the `FTD' and `TRD' detectors. Alias for `HIST DISPLAY'. See HELP HISTOGRAM DISPLAY for more details. Note that there is also a `DISPLAY' command in MINUIT for showing the results of fits. See HELP MINUIT DISPLAY for more details. +DECK,DIVIDE. 1 DIVIDE Syntax: DIVIDE id1[:id1n] [&idb1] id2[:id2n] [&idb2] id3[:id3n] [&idb3] [scale1] [scale2] (default scale = 1.0 1.0) where: id1,id2 are the input histogram identifiers id3 is the output histogram identifier idb1,idb2 are the (optional) input secondary identifiers and idb3 is the (optional) output secondary identifier Divides two histograms (id1, id2) to make a third one. To specify the secondary identifier, precede it by a `&', otherwise the default will be used. (Use the `SET IDB' command to change the default). The scale factors are optional. To avoid confusion, you should give a `' after the identifiers or make sure the scale factors are given as real numbers. To divide a range of histograms, the primary identifiers you give for the input and output histograms must be the same, but you can specify different secondary identifiers. For example, `DIVIDE 300:400&1 300:400&2 300 : 400 & 10' will divide all histograms with primary identifiers 300 to 400 and secondary identifiers 1, by those with secondary identifiers 2, putting the results into histograms with the same primary identifiers and secondary identifier 10. If you give primary identifier 0, the operation will be performed on all plots with the given secondary identifier. If you really want to calculate an efficiency and the numerator is a subset of the denominator you should use the `EFFICIENCY' command. +DECK,DO. 1 DO Syntax: DO par = low high [step] where par is the loop variable (must be a single letter) low is the starting value high is the finishing value step is the (optional) step size (default = 1) Starts a `DO' loop. The loop is terminated by an `ENDDO'. `DO' loops only work inside macros or `DEFINE'd commands. The limits can be given explicitly or they can be registers, parameters, bin sizes, contents etc. (see HELP Numbers for more details). Please note that I have made no attempt to optimize the speed of execution of a `DO' loop. Every time through the loop the file is rewound. However, they are very useful for doing repetitive procedures. The value of the loop parameter can be used with the syntax `@par' and a direct character substitution is performed. This is useful for constructing histogram identifiers for example. Remember that the `DO' loop variable must be a single character. If you use the loop variable as a number, remember that all comparisons use floating point numbers. 2 Examples !\begin{enumerate} !\item !^ Example 1: The following example adds histogram 1&103 to 2&103 putting the result in histogram 3&3. A new histogram 4&3 is booked. Then a loop over the 100 bins of histogram 3&3 is made and the square of the bin contents is put in histogram 4&3. This procedure is repeated for histograms 1&104, 2&104, 3&4 4&4 etc. up to 1&108 etc: DEP R1 = 3 DEP R2 = 8 DO I= R1,R2 ADD 1&10@I 2&10@I 3&@I 1 1 book/bin/err 4&@I 'New plot' 1 100 0 100 dep R5 = 0.0 set plot 4&@i default DO J=1,r131 dep R5 = R5 + 1 DEP R6 = Y3&@I(@J) ** 2 FILL 4&@I R5 R6 ENDDO ENDDO !\end{enumerate} +DECK,DRAW. 1 DRAW Syntax: DRAW item|command ... where: item is ARC, ARROW, BOX, CIRCLE, ELLIPSE, GLUON, LINE, POLYGON, POLYLINE, SEGMENT, SINE, SYMBOL or TRIANGLE command is CHANGE, DELETE, LIST, FETCH, STORE, or END Draws an item on the plot. See HELP DRAW Menu for a short description of each comand. All of the first set of parameters can take default values if you hit `'. For `mode CM', `x=0, y=0' is the bottom left-hand corner of the picture. If you want to change an item you have drawn, then give the command `DRAW CHANGE' and you will be prompted for the item you want to change and what you want to change. If you just give the command `DRAW' you will remain in `DRAW' until you give the `END' command or `'. However, if you give some or all of the rest of the `DRAW' command on the same line you will automatically exit `DRAW' after you have defined an item. If you have the mouse turned on, `SET MOUSE ON', the coordinates of the items are defined by using the mouse. In the case of a `CIRCLE' give the centre and a point on the radius; for an `ARC' give the centre, the bottom right corner and the top left corner; for an ellipse give the centre, the major axis and the minor axis. The default is for items to be drawn after all the plots. If you set the `fl' option to 1, the items will be drawn after the 1st plot when you give a `REDRAW' or `HARDCOPY' command. You can use this option together with `PLOT/EMPTY' to draw an empty frame and then the items you want before any histograms. This option is useful if you use hatch -3 for example that is not transparent. The option is ignored if you are drawing without a plot. The hatch and pattern colours are by default the same as the outline colour, but can also be given on the command line. If you want to solidly fill an object use pattern 100. If you are fitting more than one histogram the item(s) will only be drawn on the last plot. If you select plot units (`mode PLOT') they will be for the last plot that you have drawn. However, if you have more than one window the correct units will be used. If you want to draw without a plot, you should use `SET X|Y PSIZE' to set the size of the picture and then give the `CLEAR' command to make sure the coorindate system is setup properly. If you want your coordinate system to be more flexible you can also draw in plot coordinates, even if you have not made a plot. Set the X and Y limits, and then specify plot coordinates. Note that the coordinate transformation is done as if you had made a plot, i.e. `SET X|Y SIZE' sets the physical size, and the `X|Y MARGIN' are also respected. If the X and Y limits are set to default, then the plot coordinates are the same as the physical coordinates. If you want to give the coordinates of the item to draw on the same line as the option you must give all the parameters (8 for `POLYLINE' and `POLYGON', 7 for the rest). For those that you do not want to change give an `='. If you give the coordinates on a new line, then you only need to give those parameters for which you are not happy with the default. 2 Menu The following is the list of `DRAW' commands. For more details see HELP DRAW and the individual subtopics: ARC Draws an arc of a circle. ARROW Draws an arrow. BOX Draws a box. CIRCLE Draws a circle. ELLIPSE Draws an ellipse. GLUON Draws a gluon line. LINE Draws a line. POLYGON Draws a polygon. POLYLINE Draws a polyline. SEGMENT Draws a segment of a circle. SINE Draws a sine wave. SYMBOL Draws a symbol. TRIANGLE Draws a triangle. CHANGE Changes a drawn item. DELETE Deletes one or more drawn items. LIST Lists the items to draw. FETCH Fetches a drawing. STORE Stores a drawing in a file . END End of drawing. 2 ARC Syntax: DRAW ARC symbol colour thick units hatch pattern fl hcol pcol x,y r1,r2 phi1,phi2 where: symbol is the symbol number colour is the colour of the line thick is the line thickness (scale factor) units are the units to use (CM or PLOT units) hatch is the hatch symbol to fill the shape pattern is the pattern symbol to fill the shape fl is whether to draw the item first (1) or last (0) hcol is the hatch colour pcol is the pattern colour x,y are the coordinates of the centre of the circle(s) r1,r2 are the inner and outer radii of the circles phi1,phi2 are the phi angles of the arc (in degrees) Draws an arc of one or two circles. If the hatch or pattern is not zero the area between the two arcs is filled. If you want to solidly fill an object use pattern 100. If you want to draw just one circle give the first radius as zero. 2 ARROW Syntax: DRAW ARROW symbol colour thick units type dummy fl x1,y1 x2,y2 where: symbol is the symbol number colour is the colour of the line thick is the line thickness (scale factor) units are the units to use (CM or PLOT units) type is the type of the arrow 1 = tip of arrow on (x2,y2) 2 = tip of arrow on (x1,y1) 3 = tip on both ends 4 = tip in middle -n = arrow is filled dummy is an unused parameter fl is whether to draw the item first (1) or last (0) x1,y1 is the coordinate of the tail of the arrow x2,y2 is the coordinate of the head of the arrow Draws an arrow. 2 BOX Syntax: DRAW BOX symbol colour thick units hatch pattern fl hcol pcol x1,y1 x2,y2 where: symbol is the symbol number colour is the colour of the box thick is the line thickness (scale factor) units are the units to use (CM or PLOT units) hatch is the hatch symbol to fill the shape pattern is the pattern symbol to fill the shape fl is whether to draw the item first (1) or last (0) hcol is the hatch colour pcol is the pattern colour x1,y1 is the coordinate of one corner x2,y2 is the coordinate of the opposite corner Draws a box using the lower left and upper right coordinates. If you want to solidly fill the box use pattern 100. 2 CIRCLE Syntax: DRAW CIRCLE symbol colour thick units hatch pattern fl hcol pcol x,y r1,r2 where: symbol is the symbol number colour is the colour of the line thick is the line thickness (scale factor) units are the units to use (CM or PLOT units) hatch is the hatch symbol to fill the shape pattern is the pattern symbol to fill the shape fl is whether to draw the item first (1) or last (0) hcol is the hatch colour pcol is the pattern colour x,y are the coordinates of the centre of the circle(s) r1,r2 are the inner and outer radii of the circles Draws one or two circles. If the hatch or pattern is not zero the area between the two circles is filled. If you want to solidly fill the circle use pattern 100. If you want to draw just one circle give the first radius as zero. If you use the mouse to give the position and size of the circle, you can only draw a single circle. 2 ELLIPSE Syntax: DRAW ELLIPSE symbol colour thick units hatch pattern fl hcol pcol x,y r1,r2 phi where: symbol is the symbol number colour is the colour of the line thick is the line thickness (scale factor) units are the units to use (CM or PLOT units) hatch is the hatch symbol to fill the shape pattern is the pattern symbol to fill the shape fl is whether to draw the item first (1) or last (0) hcol is the hatch colour pcol is the pattern colour x,y are the coordinates of the centre of the ellipse r1,r2 are the major and minor axis half-lengths phi1 is the rotation angle of the ellipse (in degrees) Draws an ellipse. If the hatch or pattern is not zero the ellipse is filled. If you want to solidly fill the ellipse use pattern 100. 2 GLUON Syntax: DRAW GLUON symbol colour thick units amplitude period fl x1,y1 x2,y2 where: symbol is the symbol number colour is the colour of the line thick is the line thickness (scale factor) units are the units to use (CM or PLOT units) amplitude is the amplitude of the gluon line period is the length of 1 period fl is whether to draw the item first (1) or last (0) x1,y1 is the coordinate of one end of the line x2,y2 is the coordinate of the other end of the line Draws a gluon line. If the period of a gluon oscillation is not given, the amplitude will be used. 2 LINE Syntax: DRAW LINE symbol colour thick units dummy dummy fl x1,y1 x2,y2 where: symbol is the symbol number colour is the colour of the line thick is the line thickness (scale factor) units are the units to use (CM or PLOT units) fl is whether to draw the item first (1) or last (0) x1,y1 is the coordinate of one end of the line x2,y2 is the coordinate of the other end of the line Draws a line. 2 POLYGON Syntax: DRAW POLYGON npoint symbol colour thick units hatch patt fl hcol pcol x1,y1 x2,y2 ... where: npoint is the number of points on the polygon symbol is the symbol number colour is the colour of the line thick is the line thickness (scale factor) units are the units to use (CM or PLOT units) hatch is the hatch symbol to fill the shape patt is the pattern symbol to fill the shape fl is whether to draw the item first (1) or last (0) hcol is the hatch colour pcol is the pattern colour x1,y1 is the coordinate of the first point x2,y2 is the coordinate of the second point etc. Draws a polygon. If you want to solidly fill the polygon use pattern 100. 2 POLYLINE Syntax: DRAW POLYLINE npoint symbol colour thick units dummy dummy fl x1,y1 x2,y2 ... where: npoint is the number of points on the line symbol is the symbol number colour is the colour of the line thick is the line thickness (scale factor) units are the units to use (CM or PLOT units) dummy is an unused parameter fl is whether to draw the item first (1) or last (0) x1,y1 is the coordinate of the first point x2,y2 is the coordinate of the second point etc. Draws a polyline. 2 SEGMENT Syntax: DRAW SEGMENT symbol colour thick units hatch pattern fl hcol pcol x1, y1 x2, y2 sagitta where: symbol is the symbol number colour is the colour of the line thick is the line thickness (scale factor) units are the units to use (CM or PLOT units) fl is whether to draw the item first (1) or last (0) x1,y1 are the coordinates of one end x2,y2 are the coordinates of the other end sagitta is the sagitta Draws a segment of a circle. This form is useful if you know the 2 endpoints and the sagitta, rather than the centre and angles. If you want to fill the area you have to use `DRAW ARC'. 2 SINE Syntax: DRAW SINE symbol colour thick units amplitude period fl x1,y1 x2,y2 where: symbol is the symbol number colour is the colour of the line thick is the line thickness (scale factor) units are the units to use (CM or PLOT units) amplitude is the amplitude of the sine wave period is the length of 1 period fl is whether to draw the item first (1) or last (0) x1,y1 is the coordinate of one end of the line x2,y2 is the coordinate of other end of the line Draws a sine curve. If the period of the sine wave is not given, the amplitude will be used. 2 SYMBOL Syntax: DRAW SYMBOL symbol colour size units dummy dummy fl x1,y1 where: symbol is the symbol number colour is the colour of the line size is the size of the symbol units are the units to use (CM or PLOT units) fl is whether to draw the item first (1) or last (0) x1,y1 is the coordinate of the symbol Draws a symbol. 2 TRIANGLE Syntax: DRAW TRIANGLE symbol colour thick units hatch pattern fl hcol pcol x1,y1 x2,y2 x3,y3 where: symbol is the symbol number colour is the colour of the line thick is the line thickness (scale factor) units are the units to use (CM or PLOT units) size is the amplitude of the sine wave fl is whether to draw the item first (1) or last (0) hcol is the hatch colour pcol is the pattern colour x1,y1 is the coordinate of the first point x2,y2 is the coordinate of the second point x3,y3 is the coordinate of the third point Draws a triangle. If you want to solidly fill the triangle use pattern 100. 2 CHANGE Syntax: DRAW CHANGE number where: number is the item number to change Changes a drawn item. 2 DELETE Syntax: DRAW DELETE number where: number is the item number to change Deletes one or more items to draw. `DELETE 0' deletes them all. 2 FETCH Syntax: DRAW FETCH filename where: filename is the file with a stored drawing Fetches a list of drawing commands made with `DRAW STORE'. The new items are added to any that have already been made. 2 LIST Syntax: DRAW LIST Lists the items to draw. 2 STORE Syntax: DRAW STORE filename number where: filename is the file with a stored drawing number is the item number to store Stores one or more drawn items in a file. Item number 0 means store all items. 2 END Syntax: DRAW END Finish drawing. Only used if you are already in `DRAW'. 2 Examples !\begin{enumerate} !\item !^ Example 1: Draw a red arrow in cm with a filled arrow symbol in the middle with ends (1,1), (3,4) Put the complete syntax on one line: set x psize 10 set y psize 5 clear DRAW ARROW 1 red 4 cm -4 = = 1 1 3 4 !\item !^ Example 2: Draw an arc in cyan. The centre of the arc is at (5,5). It has radii of 2 and 4 cm, and goes from 50 to 100 degrees. The arc is filled with hatch 345. Split things across several lines to avoid giving all parameters: set x psize 10 set y psize 10 clear DRAW arc 3 cyan = 345 5 5 2 4 50 100 !\item !^ Example 3: Make a square in plot coordinates. Set the margins to a non-zero small value, as 0 will set them to the default: set x psize 10.2 set y psize 10.2 set x margin 0.1 set y margin 0.1 set x size 10 set y size 10 clear set x lim -10 10 set y lim -10 10 DRAW box 3 magenta = pl -6 -6 +6 +6 ! Now distort it set y lim -8 8 redraw !\end{enumerate} +DECK,DUMP. 1 DUMP Syntax: DUMP id [&idb] Y|N|npnt1 [npnt2] where: id is the histogram identifier idb is the (optional) secondary identifier npnt1 is the 1st point to dump npnt2 is the last point to dump Alias for `HIST DUMP'. See HELP HISTOGRAM DUMP. Inside MINUIT you must use `HIST DUMP' as `DUMP' dumps the fit results point by point. +DECK,EDIT. 1 EDIT Syntax: EDIT filename Edits a file. The default `EDIT' command is `emacs' on Unix, `EDIT/TPU' on VMS, and `dm' on the Apollo machines. If the environment variable `EDITOR' is defined it is used instead. To change it to your favourite editor use the `SET EDIT' command. +DECK,EFFICIENCY. 1 EFFICIENCY Syntax: EFFICIENCY id1[:id1n][&idb1] id2[:id2n][&idb2] id3[:id3n][&idb3] where: id1,id2 are the input histogram identifiers id3 is the output histogram identifier idb1,idb2 are the (optional) input secondary identifiers and idb3 is the (optional) output secondary identifier Divides two histograms (`id1, id2') to make a third one using binomial errors. To specify the secondary identifier, precede it by a `&' otherwise the default will be used. (Use the `SET IDB' command to change the default). To calculate the efficiency for a range of histograms, the primary identifiers you give for the input and output histograms must be the same, but you can specify different secondary identifiers. For example, `EFF 300:400&1 300:400&2 300 : 400 & 10' will divide all histograms with primary identifiers 300 to 400 and secondary identifiers 1, by those with secondary identifiers 2, putting the results into histograms with the same primary identifiers and secondary identifier 10. If you give primary identifier 0, the operation will be performed on all plots with the given secondary identifier. The error on the efficiency is calculated using form derived by Paul Avery for MULFIT. This form makes some assumptions about the prior distribution, but is better than the naive one derived from a binomial. The form is: sigma = sqrt [(n+1) * (N-n+1)] / [(N+3) * (N+2)^2] If the efficiency is 0 or 1 then the unbiased estimate of `n/N' is added to the error. This gives a better estimate of the confidence level: sigma = sigma + 1/(N+2) You should only use the `EFFICIENCY' command if the errors on the number of entries in each bin are Poisson distributed and the numerator is a subset of the denominator. If this is not the case you should use the `DIVIDE' command. It assumes that the numerator and denominator are uncorrelated when calculating the error. +DECK,elif. 1 ELIF Syntax: IF expression block of statements [ELIF expression] [block of statements] [ELSE] [block of statements] ENDIF Else if clause in an `IF' block. See HELP IF for more details. +DECK,else. 1 ELSE Syntax: IF expression block of statements [ELIF expression] [block of statements] [ELSE] [block of statements] ENDIF Else clause in an `IF' block. See HELP IF for more details. +DECK,ENDDO. 1 ENDDO Syntax: ENDDO Terminates a `DO' loop. See HELP DO for more details. +DECK,endif. 1 ENDIF Syntax: IF expression block of statements [ELIF expression] [block of statements] [ELSE] [block of statements] ENDIF End of an `IF' block. You can also use the `FI' command. See HELP IF for more details. +DECK,EXAMINE. 1 EXAMINE Syntax: EXAMINE parameter where: parameter is a register, function parameter, bin etc. Enables you to find the contents of a register (similar to the `SHOW REGISTER' command), the value of a parameter or its error, the contents of a bin, their error, the bin centre or bin width, or a user variable. See HELP Numbers and HELP DEPOSIT for details on the meaning of all the parameters. +DECK,EXECUTE. 1 EXECUTE Syntax: EXECUTE filename [parameter_list] where: filename is the filename with the commands parameter_list are parameters you want to pass This command is an alias for `READ COMMAND'. It executes a series of commands which you have written to a file. You can input parameters to the file and they are referenced with the syntax `@1', `@2', etc. You are allowed up to 9 parameters and the parameters can be either numbers or character strings. Parameters are separated by spaces. If you omit a parameter in the `EXECUTE' command, you will be prompted for its value the first time it is referenced. Blanks are used to delimit parameters. Therefore, if a parameter contains an imbedded blank it should be included in single or double quotes. e.g. 'This name' or "Who is this". !^ A null parameter can be passed as ''. !A null parameter can be passed as '\,'. You can also use the `INQUIRE' command to ask for the value of a parameter and/or specify a default value for a parameter. See HELP INQUIRE for more details. The default filename qualifier is `.mnf'. You can exit a command file at any point by putting the `RETURN' command in it. Comment lines begin with a `!' by default. Use the `SET CHARACTER COMMENT' command to change the comment character. Continuation lines are denoted by a `-' as the last character of the line. Use the `SET CHARACTER CONTINUATION' command to change the continuation character. Within macros you can have `DO' loops (see HELP DO for more details) and `IF' blocks (see HELP IF for more details). If you give a `PLOT' command in the file and it is not the first picture this Mn_Fit session you have to give a `' for the next plot. If you give any other character the plot command will be skipped and if you give a `q' the file will be aborted. Use the `SET WAIT_CR OFF' command to avoid this. If you do not want to give the directory name with the filename, you can use the `SET PATH' command to specify a search path. See HELP SET PATH for more details. WARNING: In Mn_Fit versions before 4.07/32 you should not include comment lines inside `DEFINE' commands, if there is a `DO' loop inside the same file. Inline comments are OK. Mn_Fit keeps track of which line is being read for future use in IF blocks and DO loops. If you have comment lines inside the DEFINE command, the counting of the line number gets out of sync. As a result any DO loops that are executed after the definitions (within the same macro) will not work properly. After the first run through the loop Mn_Fit will rewind the file and then jump to the wrong line for the second and future runs through the loop. 2 Examples !\begin{enumerate} !\item !^ Example 1: You write 2 files TEST.MNF and TEST2.MNF with the following commands: ! ! This file fetches, renames and plots a histogram ! inquire 1 'Give filename' inquire 2 'Give histogram number(s)' FET @1 @2 REN @2 1000&@3 PLOT 1000&@3 INDEX EXEC TEST2 1000 @3 2000 The file TEST2.MNF contains the following commands: COP @1&@2 @3 PLOT @3 ! This is a way to look at a plot before deciding whether you want ! a hardcopy for example inquire 4 'Give extra command (e.g. hardcopy)' @4 HIST DUMP @3 inquire -4 'Give extra command or ' @4 RETURN ! The following command will not be executed HELP To execute the file you give the command: EXEC TEST.MNF 3S_EXCL.HIS 300 10 and the following commands will be executed: FET 3S_EXCL.HIS 300 REN 300 1000&10 PLOT 1000&10 INDEX EXEC TEST2 1000 10 2000 and TEST2.MNF will execute the following commands: COP 1000&10 2000 PLOT 2000 ! This is a way to look at a plot before deciding whether you want ! a hardcopy for example Give extra command: HARD P HIST DUMP 2000 Give extra command or : RETURN !\end{enumerate} +DECK,EXTRACT. 1 EXTRACT Syntax: HIST EXTRACT id part [npart] [&idb] Alias for `HIST EXTRACT'. See HELP HISTOGRAM EXTRACT. +DECK,FETCH. 1 FETCH Syntax: FETCH [filename] id1 [:id2] [&cycle] [id3...] [&cycle] Fetches HBOOK version 4 histogram(s) from a file. To fetch all histograms give the command `FETCH filename 0'. To specify a range of histograms give the command `FETCH filename id1:id2'. If you want to fetch another histogram(s) from the same file give the command `FETCH id1,id2...'. If the histogram number you ask to fetch already exists it will be overwritten. All the histograms will be given the default secondary identifier. You can use the secondary identifier to specify which cycle to fetch from HBOOK RZ files. The cycle number will be added to the current setting for the secondary identifier. This is useful if you store a series of Mn_Fit histogram which have the same primary identifier, but different secondary identifiers, as they then get stored in an HBOOK RZ file with the same identifier, but different cycles. Use the `ZDIR' command to see which cycle numbers exist. It is a good idea to set the record length for direct access HBOOK version 4 files, if it is known. Otherwise you will get an error message and then Mn_Fit will try to open the file again with the correct record length. The default is 1024 words. If your files have been made with a different record length, use the `SET RECL' command to set the length. This length will also be used for `STORE' commands. Ntuples, profile plots and variable bin width plots can also be fetched using the above syntax. RowWise Ntuples of <50000 words will be read directly into memory. The data for longer Ntuples which have been made with the disk option, will not be read in. You also plot histograms directly from an HBOOK RZ file by opening the file (`OPEN' or `HB_OPEN') and then giving the plot command. This feature can be suppressed using the `SET AUTOFETCH OFF' command. If your histograms are in several subdirectories, you should use `SET DIRECTORY' in connection with the `SET IDB' command to give them different secondary identifiers. See the examples. If you do not know the directory structure of the file use the `HB_OPEN' command and the `LDIR', `ZDIR' and `CDIR' commands to list what is in the directory, before giving the `FETCH' command. Note that the top level directory name for the file is `//MN_HBIN'. WARNING: If you fetch all histograms from a file, or specify a range, any existing HBOOK histograms in the current directory in memory will be deleted! However, Mn_Fit will still store the histograms internally. This means that you will lose any slices, bands, projections or functions associated with the HBOOK histogram unless you have already extracted them into Mn_Fit plots. It is a good idea to set the record length for direct access HBOOK version 4 files, if it is known. Otherwise you will get an error message and then Mn_Fit will try to open the file again with the correct record length. The default is 1024 words. If your files have been made with a different record length, use the `SET RECL' command to set the length. This length will also be used for `STORE' commands. If the histogram file is locked, then Mn_Fit will try to remove the lock so that it can be read properly. This feature has not been fully tested yet, as I cannot find a locked histogram file! 2 Examples !\begin{enumerate} !\item !^ Example 1: Get all plots from a file: FETCH filename 0 !\item !^ Example 2: Get some plots from the same file as the last fetch: FETCH 1:10,20,100:200 !\item !^ Example 3: Get all the plots from various subdirectories: SET DIRECTORY dir1 IDB 100 ENDSET FETCH filename 0 SET DIRECTORY dir2 IDB 200 ENDSET FETCH filename 1:100 SET DIRECTORY \/dir3 IDB 300 ENDSET FETCH 0 or: HB_OPEN filename SET DIRECTORY dir1 IDB 100 ENDSET FETCH 0 SET DIRECTORY dir2 IDB 200 ENDSET FETCH 0 SET DIRECTORY dir3 IDB 300 ENDSET FETCH 0 Note that if you give a filename then the directory name you give is relative to the top directory. If you do not give a filename then the name is relative to the current directory name. The second method avoids opening and closing the file for every fetch. !\item !^ Example 4: Use a `DO' loop to calculate and fetch the histograms that are required: open filename.rz do i=1,10 fetch @i deposit r1 = 1000 + @i parse fetch {ir1,(i6)} enddo The `PARSE' command is needed here, because `FETCH ir1' would try to open file `ir1.his', which is not what you want! !\end{enumerate} +DECK,fi. 1 FI Syntax: IF expression block of statements [ELIF expression] [block of statements] [ELSE] [block of statements] FI End of an `IF' block. You can also use the `ENDIF' command. See HELP IF for more details. +DECK,FILL. 1 FILL Syntax: FILL id [&idb] x y [dx [dy] ...] or FILL id [&idb] x [y] where: id is the plot identifier idb is the (optional) secondary identifier x is the x value of the point y is the y value of the point dx is the error on x dy is the error on y etc. Fills a plot. Alias for `HIST FILL'. See HELP HISTOGRAM FILL for more details. +DECK,FIT. 1 FIT Syntax: FIT[/qual] id1 [&idb1] [-nfun1 [-nfun2 ...]] id2 [&idb2] ... nmode where: qual are (optional) qualifiers: CHI means do a chi**2 fit LIKELIHOOD means do a likelihood fit SLIKELIHOOD means do a likelihood fit including Poisson function errrors NORMALIZE means use an overall normalization factor FRACTION normalizations are fractional GAUSS means fit a Gaussian FLAT means fit a flat line LINE means fit a line with a slope id1,id2 are the histograms to fit idb1,idb2 are the (optional) secondary identifiers nfun are the numbers of functions not to be used in the fit to the preceding id nmode = 0 chi**2 fit = 1 likelihood fit = 2 likelihood fit including function statistics = 1n parameters are fractions + overall normalization Gets you into MINUIT, so that you can actually start fitting. You must have already fetched the histogram(s) you want to fit and added the function(s) you want to use. If you have not given the qualfier that says which sort of fit you want to do, you will be asked whether you want to do a chi**2 or likelihood fit. Default is chi**2. Note that the chi**2 or the likelihood is stored in register 111 (access it using the syntax `R111'), and the confidence level is stored in register 112, so that you can use it to put in a plot for example. A fit including the function statistics assumes that you are fitting with a histogram or some other function where the error on the function for each bin is given by the Poisson error on the value of the function, e.g. the function is a Monte Carlo histogram of the background without any reweighting or scale factor applied. This sort of fit implies that the parameters are fractions and an overall normalization is included. See the section in the manual "Fitting With Mn_Fit" for more complete details on how to fit. See HELP Errors for more information on MINUIT errors and how to interpret them. The normal way to fit is by using the `FUNCTION ADD' command to add the function(s) that you want to use and then using the `FIT' command. However, if you want to do a simple fit of a Gaussian, flat line or a line with a slope you can use the `FIT/qual' syntax. This form will add the correct function(s), disable all others and start fitting. The default MINUIT commands are `MINIMIZE' followed by `DISPLAY'. You can change these using `SET FIT COMMANDS'. It is possible to fit 1 or 2 dimensional histograms or a series of data points. However, it is not possible to fit to a true scatter plot. Use the `PROJECT' command to make a binned 2-D histogram out of the scatter plot if you want to fit it. You can simultaneously fit 2 or more plots by giving both their identifiers with the fit command. If you want to use different background functions for each plot, but the same signal, e.g. when you fit a mass peak from 2 different decay modes, you should give the function numbers NOT to be used for a plot after you give its identifier. However, if you are using the option `SET RATIO ON', which means that the areas are parametrized as ratios, this only works properly for 2 plots as Mn_Fit could not constrain the sum of a set of parameters to be 1 in MINUIT. If you give the `FIT' command inside a macro I recommend that you leave a blank line after the fitting mode This is because you are sometimes asked if you want to calculate new orthogonality limits. Note that when you enter MINUIT, any limits you have set on plots will be reset to 0 0. This is so that you do not get confused, if you do a `DISPLAY' and only see part of the fit. You can of course set the limits to whatever you like again, if you really do not want to see the whole plot. When inside MINUIT it is possible to include or exclude regions from the fit and also to constrain parameters relative to other parameters. For more details see HELP MINUIT. The following is a list of commands which control how you fit and what parameters are used: SET NORM ON|OFF Turns on/off an overall normalization factor. SET RATIO ON|OFF Controls how the areas are parametrized, when fitting more than one plot. SET FIT DEFAULT Sets fitting option to default INTEGRATE ON|OFF Turns on/off integrating functions across each bin. CONVOLUTE ON|OFF Turns on/off convoluting functions with a Gaussian. AREA Calculate the AREA for dipion and fragmentation functions. COMMANDS Commands used in the quick fitting mode 2 Likelihood The formula used for the likelihood is: -log(L(i)) = 2 * n(i) * log(n(i) / mu(i)) - (n(i) - mu(i)) != where n(i) is the number of entries in bin i and mu(i) is the expected number of entries If either `n(i)' or `mu(i)' are `<= 0', the log term is set to 0. If the log likelihood is negative then I take `1000 * abs(-log(L(i)))' for that point. This formula can be derived as follows. The probability of observing `n(i)' events in bin `i', when the expected number is `mu(i)' is: L(i) = exp(-mu(i)) * mu(i)**n(i) / n(i)! In the fit one wants to determine `mu(i)'. For the total likelihood the product of the individual likelihoods is taken so an arbitrary normalization can be applied to the likelihood function that can depend on `n(i)', but not on `mu(i)'. I therefore define: exp(-mu(i)) * mu(i)**n(i) * n(i)! L(i) = ------------------------- ----------------------- n(i)! exp(-n(i)) * n(i)**n(i) != exp(-mu(i)) * mu(i)**n(i) L(i) = ------------------------- exp(-n(i)) * n(i)**n(i) != -log(L(i)) = -(-mu(i) - n(i)) - n(i) * log(mu(i) / n(i)) != = n(i) * log(n(i) / mu(i)) - (n(i) - mu(i)) This value is multiplied by 2 so that a log likelihood change of 1 corresponds to a 1 sigma error. The likelihoods are summed and then this is the value that is minimized. 2 Examples !\begin{enumerate} !\item !^ Example 1: To do a chi**2 fit to plot 300: FIT 300 0 !\item !^ Example 2: Do a likelihood fit to plots 400 and 501&10 simultaneously, using the same functions for each plot: FIT/like 401 501&10 !\item !^ Example 3: Do a chi**2 fit to plots 1 and 17 simultaneously. Function 1 will be used as the signal in all plots and function 4 will be the background for plot 1, function 3 for plot 17: func use 1 2 3 4 fit/chi 1 -2 -3 17 -2 -4 !\end{enumerate} +DECK,FUNCTION. 1 FUNCTION Syntax: FUNCTION command Does something with a function. See HELP FUNCTION Menu for a short description of each command. For a detailed help on the functions available see HELP FUNCTION LIST and its subtopics. When you are asked to give function number(s), 0 means all the defined or selected functions. Note that all Mn_Fit functions by default include the bin width in the calculation of the function value. Thus, if you want to fit a histogram that is actually stored as a series of data points, then you have to make sure that `DX' for each point corresponds to the bin width. You can use the `SET FUNCTION BIN_WIDTH ON|OFF' command to change whether the bin width is taken into account. 2 Menu The following is a list of the available commands. For more details see HELP FUNCTION and the individual subtopics: ADD Adds a new function. COMPILE Compiles a COMIS function. DELETE Deletes a function from the list. EDIT Enables you to edit and recompile a COMIS function. FETCH Fetches a function that has been stored in a file. HISTOGRAM Stores the fit in a histogram. HOVERLAY Overlays a function as a histogram on a plot. INFO Gets information on the functions used. LIST Lists the predefined functions that you can add. OVERLAY Overlays a function on a plot. PLOT Plots one or more of the functions. STORE Stores a function in a file. USE Uses a function in the fit or not. 2 ADD Syntax: FUNCTION ADD nfun where: nfun is either the function name or number Only valid in `MN_CMD>'. Selects a new function to be used for fitting with or plotting. You will be prompted for the initial values of the parameters. See HELP FUNCTION LIST for a list of the available functions and the various subtopics for details of the syntax for USER and COMIS functions and how to fit using histograms as functions. In general I recommend using the function name rather than the number, as the number may change at some point, if I add new functions. Several functions have names consisting of more than one word. If you add a new function using the name, then just give the first word. For 2-D functions use the syntax `FUNCTION ADD 2D GAUSS SIGMA'. For the lepton and hadron spectra you will be given a list of the functions and must then give the relevant number. This is the same as the function number. 2 COMPILE Syntax: FUNCTION COMPILE nfun where: nfun is the function number as in FUNCTION INFO Only valid in `MN_CMD>'. Recompiles a COMIS function which you have already added with the `FUNCTION ADD COMIS' command. 2 EDIT Syntax: FUNCTION EDIT nfun where: nfun is the function number as in FUNCTION INFO Only valid in `MN_CMD>'. Invokes the editor and then recompiles the COMIS function you have already added with the `FUNCTION ADD' command. See HELP EDIT for details on the default editor. You can change the editor with the `SET EDIT' command. 2 DELETE Syntax: FUNCTION DELETE nfun1 [nfun2 ...] where: nfun1 is the 1st function number to delete as in FUNCTION INFO where: nfun2 is the 2nd function number to delete etc. Only valid in `MN_CMD>'. Deletes one or more functions from the list of those you have added. `nfun = 0' will delete all functions that have been added. 2 FETCH Syntax: FUNCTION FETCH filename where: filename is the name of the file containing the functions. Only valid in `MN_CMD>'. Fetches functions which you have previously stored from a file. 2 HISTOGRAM Syntax: FUNCTION HISTOGRAM nfun1 [nfun2...] [&]idb nsymb/col npoint xlo xhi where: nfun is the function number(s) as in FUNCTION INFO idb is the secondary identifier for the function nsymb is the symbol you want to plot the function with and col is the (optional) colour for the symbol. Plots one or more of the functions you have added as a histogram. `nfun = 0' means use all functions which are currently in use. This command is the same as `FUN PLOT', but the function will be stored as a histogram. If you are fitting and your last picture was a `DISPLAY', the function will be given the same primary identifier as the one you are fitting. Otherwise it will be given the primary identifier 98765. To specify the secondary identifier on the same line as the function numbers precede it by a `&'. It will be given the secondary identifier you specify. 2 HOVERLAY Syntax: FUNCTION HISTOGRAM nfun1 [nfun2...] [&]idb nsymb/col where: nfun is the function number(s) as in FUNCTION INFO idb is the secondary identifier for the function nsymb is the symbol you want to plot the function with and col is the (optional) colour for the symbol. Overlays one or more of the functions you have added as a histogram. `nfun = 0' means use all functions which are currently in use. This command is the same as `FUN OVERLAY', but the function will be stored as a histogram with the same number of points as the plot you are fitting. If you are fitting and your last picture was a `DISPLAY', the function will be given the same primary identifier as the one you are fitting. Otherwise it will be given the primary identifier 98765. To specify the secondary identifier on the same line as the function numbers precede it by a `&'. It will be given the secondary identifier you specify. 2 INFO Syntax: FUNCTION INFO Gives information on the functions you have selected, whether they are in use, whether they are signal or background, and the values of their parameters. 2 LIST Syntax: FUNCTION LIST Note that all Mn_Fit functions by default include the bin width in the calculation of the function value. You can use the `SET FUNCTION BIN_WIDTH ON|OFF' command to change this behaviour. List of the functions which are available: 1 Polynomial 2 Exponential 3 Quadratic Joining Two Lines 4 Chebyshev Polynomial 5 Legendre Polynomial 6 Gaussian Distribution (sigma) 7 Gaussian Distribution (FWHM) 8 Landau Distribution 9 Breit-Wigner Distribution 10 x-a Gaussian Distribution (sigma) 11 x-a Gaussian Distribution (FWHM) 12 Lepton Spectrum Phase Space 13 Lepton Spectrum V-A 14 Lepton Spectrum V+A 15 Lepton Spectrum Spin 0->Spin 0 16 Hadron Spectrum Phase Space 17 Hadron Spectrum V-A or V+A 18 Hadron Spectrum Spin 0->Spin 0 19 Two Gaussians (sigma) 20 Two Gaussians (FWHM) 21 Bifurcated Gaussian (sigma) 22 Bifurcated Gaussian (FWHM) 23 Sum Two Bifurcated Gaussians (sigma) 24 Sum Two Bifurcated Gaussians (FWHM) 25 ARGUS background function - phase space going to 0 at beam energy 26 Pexp(Q) A polynomial multiplied by the exponential of a polynomial 27 Trigonometric Functions 28 CB Line Shape 29 Power Law Function 30 Lifetime Function 31 OChebyshev Polynomial - parameter 1 is not overall normalization 32 OLegendre Polynomial - parameter 1 is not overall normalization 33 Fermi Function (positive going) 34 Fermi Function (negative going) 35 Threshold Function 36 Dipion Inv Mass 37 Fragmentation Functions 38 Resonance Cross Section 39 Continuum Cross Section 40 User Defined Function (see subtopic USER for details) 41 Histogram used as a function 42 Smooth Histogram used as a function 43 COMIS defined function (see subtopic COMIS for details) 44 Convolution function 45 2D Gaussian Distribution (sigma) 46 2D Gaussian Distribution (FWHM) 3 Polynomial Polynomial of any order with an offset. The form used is: BIN_WIDTH * (NORM + POLY01*(x-OFFSET) + POLY02*(x-OFFSET)**2 + ...) != The parameters are: NORM POLY01 POLY02... OFFSET The parameter `OFFSET' is redundant and should usually be fixed to a convenient value. 3 Exponential Falling exponential with an offset. The form used is: NORM * EXP(-SLOPE * (x - OFFSET)) The parameters are: NORM SLOPE OFFSET The parameter `OFFSET' is redundant and should usually be fixed to a convenient value. 3 Quadratic_Joining_Two_Lines Given ordinate `CONST' and abscissa `JOIN1' of one point on a straight line of slope `SLOPE1', it finds a quadratic curve that smoothly connects this line at that point to another straight line of slope `SLOPE2' at an abscissa `JOIN2'. In terms of the five parameters, the equation of the quadratic equation is: a + b*x + c*x**2 != where c = (SLOPE2 - SLOPE1)/(2.0*(JOIN2-JOIN1) b = (SLOPE1*JOIN2 - SLOPE2*JOIN1)/(JOIN2 - JOIN1) a = CONST - b*JOIN1 - c*JOIN2**2 The constant term of the second straight line `(a2 + SLOPE2*x**2)' is: a2 = a +b*JOIN2 + c*JOIN2**2 - SLOPE2*JOIN2 The parameters are: CONST SLOPE1 SLOPE2 JOIN1 JOIN2 3 Chebyshev The Chebyshev is valid between the minimum and maximum limits which are either set to the plot limits or can be manually set with the `SET ORTHOG' command. The form used is: DELX = (2*X - XMIN - XMAX) / (XMAX - XMIN) 1st term = NORM 2nd term = CHEB01 * DELX 3rd term = CHEB02 * (2*DELX*DELX - 1) 4th term = CHEB03 * (2*DELX*(2*DELX*DELX - 1) - DELX) etc. and the function value is given by the sum of the terms. The first parameter is the overall normalization. This is new for version 4 of Mn_Fit. The previous form of the Chebyshev is in the function OChebyshev. The parameters are: NORM CHEB01 CHEB02... 3 Legendre The Legendre is valid between the minimum and maximum limits which are either set to the plot limits or can be manually set with the `SET ORTHOG' command. The first parameter is the overall normalization. This is new for version 4 of Mn_Fit. The previous form of the Legendre is in function OLegendre. The parameters are: NORM PARM01 PARM02... 3 Gaussian Gaussians can be given either in terms of `SIGMA' or `FWHM'. They are normalised, so that the area is what it says. The form in terms of `SIGMA' is: AREA / (SQRT(2*PI) * SIGMA) * EXP( (X-MEAN)**2/(2*SIGMA**2) The parameters are: AREA MEAN SIGMA In terms of `FWHM' it is the same except for the scale factor between the two. 3 Landau Gives the Landau density function in the form: AREA * DENLAN( (X - XLAN)/ WIDTH) `DENLAN' is the CERN library routine for the Landau density function of a normalized variable. The parameters are: AREA XLAN WIDTH Note that `XLAN' is not actually the peak of the distribution, which is why its name was changed in Mn_Fit version 4.07/22. This is discussed in the long write-up for the `DENLAN' routine. The actual peak is at -0.222782*WIDTH below the parameter `XLAN'. 3 Breit_Wigner This is the Breit-Wigner signal shape. Its form is: (1/2*pi) * (AREA * WIDTH) / ( (X-MEAN)**2 + (WIDTH**2)/4 ) The function is bin-width normalized. The parameters are: AREA MEAN WIDTH 3 x-a_Gaussian Gaussians can be given either in terms of `SIGMA' or `FWHM'. They are normalised, so that the area is what it says. The form in terms of `SIGMA' is: AREA * (X-OFFSET) / (SQRT(2*PI) * SIGMA) * EXP( (X-MEAN)**2/(2*SIGMA**2) The parameters are: AREA MEAN SIGMA OFFSET In terms of `FWHM' it is the same except for the scale factor between the two. 3 Lepton_Spectra A series of lepton momentum spectra for semileptonic b and c meson decays are available. For all the spectra the parameters are: AREA MS/MC Ratio of strange/charm mass, or charm/bottom mass SCALE1 SCALE2 Although the second parameter is called `MS/MC' it means the ratio of the relevant quark masses, i.e. `MC/MB', `MU/MB' etc. The form for the phase space is: NORM * VAL * (1 - (MS/MC)**2 - VAL) / (1 - VAL) where VAL = X*SCALE2/SCALE1 i.e. the spectrum is by default between 0 and `(1-(MS/MC)**2)'. You should set `SCALE1' and `SCALE2' so that their ratio gives the b or c quark momentum for your data. The forms for (V-A), (V+A) and Spin 0 -> Spin 0 are a bit more complicated. I am not sure why there are 2 parameters `SCALE1' and `SCALE2'. As far as I can tell only the ratio is used. You should therefore decide what ratio is needed and fix the parameters accordingly. 3 Hadron_Spectra A series of hadron momentum spectra for semileptonic b and c meson decays are available. For all the spectra the parameters are: AREA MS/MC Ratio of strange/charm mass, or charm/bottom mass SCALE1 SCALE2 Although the second parameter is called `MS/MC' it means the ratio of the relevant quark masses, i.e. `MC/MB', `MU/MB' etc. The form for the phase space is: NORM * VAL * SQRT(VAL**2 - 4*(MS/MC)**2) where VAL = X*SCALE2/SCALE1 You should set `SCALE1' and `SCALE2' so that their ratio gives the b or c quark momentum for your data. It is not clear to me that the form for the hadron spectra is correct or where it comes from. In particular for the phase space and Spin 0 -> Spin 0 form it rises monotonically, while for the (V-A) and (V+A) functions it goes negative. I do not know where these forms came from (I originally got them from Paul Avery's MULFIT). Any input would be welcome. The forms for (V-A), (V+A) and Spin 0 -> Spin 0 are a bit more complicated. I am not sure why there are 2 parameters `SCALE1' and `SCALE2'. As far as I can tell only the ratio is used. You should therefore decide what ratio is needed and fix the parameters accordingly. 3 Two_Gaussians Gaussians can be given either in terms of `SIGMA' or `FWHM'. They are normalised, so that the area is what it says. The parameters for the 2 Gaussians are such that it is easy to fix the difference in the means, or the ratio of the widths. The parameters for the second Gaussian are `AREA2/AREA', `(MEAN2-MEAN1)' and `SIGMA2/SIGMA1'. The form of each Gaussian in terms of `SIGMA' is: AREA / (SQRT(2*PI) * SIGMA) * EXP( (X-MEAN)**2/(2*SIGMA**2) The parameters are: AREA MEAN SIGMA1 AR2/AREA DELM SIG2/SIG1 For the first Gaussian the area is `AREA * (1-AR2/AREA)'. For the second Gaussian the area is `AREA * (AR2/AREA)'. The mean of the first Gaussian is `MEAN', while the mean of the second Gaussian is `MEAN + DELM'. The width of the first Gaussian is `SIGMA1' and the width of the second is `SIGMA1 * (SIG2/SIG1)'. In terms of `FWHM' everything is the same except for the scale factor between the two. 3 Bifurcated_Gaussian A Gaussian with different slopes either side of the mean. The form used is: AREA * (2 * SIGA / (SIGA + SIGB)) / (SQRT(2 * PI) * SIGA) * EXP(-0.5 * (X - MEAN) / SIGA**2) for X < MEAN AREA * (2 * SIGB / (SIGA + SIGB)) / (SQRT(2 * PI) * SIGB) * EXP(-0.5 * (X - MEAN) / SIGB**2) for X >= MEAN The parameters are: AREA MEAN SIGA SIGB 3 Sum_Two_Bifurcated_Gaussians The sum of two Gaussians with different slopes either side of the mean. The mean is the same for both Gaussians. The form used for each Gaussian is: AREA * (2 * SIGA / (SIGA + SIGB)) / (SQRT(2 * PI) * SIGA) * EXP(-0.5 * (X - MEAN) / SIGA**2) for X < MEAN AREA * (2 * SIGB / (SIGA + SIGB)) / (SQRT(2 * PI) * SIGB) * EXP(-0.5 * (X - MEAN) / SIGB**2) for X >= MEAN The parameters are: AREA MEAN SIGA1 SIGB/SIGA AR2/AREA SIG2/SIG1 The parametrization uses `AR2/AREA' so that you can fix the ratio of the areas, and `SIGB/SIGA' so you can fix the ratio of the widths. In addition the ratio of both of the widths for the two Gaussians is same and is the parameter `SIG2/SIG1'. 3 ARGUS_Background This function is the form ARGUS uses to parametrize their background for fitting B mass peaks. The form used is: P(1) * (x + P(2)) * SQRT(1 - ((x + P(2)) / P(3))**2) * EXP(P(4) * (1 - ((x + P(2)) / P(3))**2)) where P(1) is the normalization P(2) is an offset which should always be fixed when fitting If you plot the mass P(2) should be 0, but if you plot (Mass - Ebeam), P(2) should be Ebeam P(3) is the beam energy P(4) is a scale factor for the exponential (0 to not use it) The parameters are: NORM OFFSET EBEAM EFACT 3 Pexp(Q) This function can be used to combine a polynomial with the exponential of a polynomial. In each case the polynomial for is: NORM * (1 + POLY01*(X-OFFSET) + POLY02*(X-OFFSET)**2 + ...) The parameters are: NORM OFFSET POLY01 POLY02... EPOLY01 EPOLY02... The parameter `OFFSET' is redundant and should usually be fixed to a convenient value. 3 Trigonometric The form used is: ASINE * SIN(OMEGA * x) + ACOSINE * COS(OMEGA * x) The parameters are: ASINE ACOSINE OMEGA 3 CB_Line_Shape This function uses the NaI line shape as obtained by the Crystal Ball experiment. The form used is: AREA * exp( -.5*((Et-Em)/s)**2 ) for Em > Et - a*s AREA * (n/a)**n * exp(-.5*a**2) / (((Et-Em)/s +n/a -a )**n) for Em < Et - a*s where 1/A = s*( (n/a)*exp(-.5*a**2)/(n-1.) + sqrt(pi/2.)*(1.+erf(a/sqrt(2.)) )) Em is measured energy Et is true energy s(igma) is energy resolution n and a(lpha) are empirical parameters as far as I can tell. The parameters are: AREA MEAN SIGMA ALPHA N 3 Power_Law The form used is: NORM * (x / SLOPE)**POWER Note that there is no protection against `(x / SLOPE)**POWER' going into overflow. The parameters are: NORM POWER SLOPE 3 Lifetime Falling exponential with an offset for lifetime fitting. The form used is: AREA * ABS(SLOPE) * EXP(-SLOPE * (x - OFFSET)) for (x - OFFSET) >= 0 The parameters are: AREA LIFETIME OFFSET The parameter `OFFSET' is redundant and should usually be fixed to a convenient value. The function can also be combined with a resolution function by using the `SET FIT CONVOLUTE' command. 3 Fermi A Fermi function. This form is useful for threshold or efficiency turn ons. It can be selected as either positive or negative going. The positive going form used is: NORM / (1 + EXP((X-X0)/SLOPE)) with `(X0-X)' for the negative going function. The parameters are: NORM X0 SLOPE The function can also be combined with a resolution function by using the `SET FIT CONVOLUTE' command. 3 Threshold Threshold function. The form has a sharp rise followed by an exponential tail. The form used is: NORM * (X-OFFSET)**POWER * EXP(COEFF1*(X-OFFSET) + COEFF2*(X-OFFSET)**2) where NORM is the normalization OFFSET is the threshold POWER is the power of the turnon COEFF1 is the coefficient linear in x COEFF2 is the coefficient quadratic in x As the function is not smooth at the threshold it seems to be better to fix `OFFSET', if all other parameters are left free. Alternatively it should be possible to fix the `POWER' and leave the offset free. 3 Dipion_Inv_Mass This is a set of functions containing theoretical formulae for the dipion invariant mass spectrum from J/Psi and Upsilon decays. By default, the `AREA' has an arbitrary normalization. Use the `SET FIT AREA ON' command to make it meaningful. A Simpson integration of the function is then performed if any of the parameters change. These functions all prompt you for the parent and daughter resonance names and the pion type, and the following fit parameters, whose significance depends on the model chosen: AREA PARM 4 Phase_Space This is the dipion invariant mass according to phase space arguments. It takes the form: AREA * SQRT(((Ep + Ed)**2 - x**2)*((Ep - Ed)**2 - x**2)*(x**2 - 4*mpi**2)) where Ep is the energy of the parent resonance, Ed is the energy of the daughter resonance, mpi is the mass of the pion. 4 Yan_Model This is the first order dipion invariant mass from the Yan model. It takes the form: AREA * PHASE SPACE * [(x**2 - 2*mpi**2) + (PARM/3)*(x**2 - 2*mpi**2)* (x**2 - 4*mpi**2) + 2*(x**2 + 2*mpi**2)* (((Ep**2 + x**2 - Ed**2)/(2*Ep))**2)/x**2] where Ep is the energy of the parent resonance, Ed is the energy of the daughter resonance, mpi is the mass of the pion, PHASE SPACE has the functional form of the Phase_Space model. `x' is limited to the range `(2 * mpi) < x < (Ep - Ed)'. 4 Voloshin_Model This is the dipion invariant mass from the Voloshin-Zakharov model. It takes the form: AREA * PHASE_SPACE * ... 4 Novikov_Model This is the dipion invariant mass from the Novikov-Shifman model. It takes the form: AREA * PHASE_SPACE * ... 4 Full_Yan_Model This is the second order calculation of the dipion invariant mass from the Yan model. It takes the form: AREA * PHASE_SPACE * [ YAN_MODEL + ( ( PARM**2 ) / 20 ) * ((X**2 - 4*mpi**2) + 4/3 * (X**2 - 4*mpi**2) * (X**2 + 6*mpi**2)*(((Ep**2 + X**2 - Ed**2)/(2*Ep))**2)/X**2) + ( 8/3 * ( X**4 + 2 * ( X**2 ) * ( mpi**2 ) + 6*mpi**4 ) * ( ( Ep**2 + X**2 - Ed**2 ) / ( 2 * Ep ) )**4 / X**2 )] where Ep is the energy of the parent resonance, Ed is the energy of the daughter resonance, mpi is the mass of the charged pion (0.1396 GeV/c). PHASE_SPACE has the functional form of the Phase_Space model. YAN_MODEL is the first order Yan model calculation. HW problem: derive this for yourself some weekend. 4 Peskin_Model This is the dipion invariant mass from the Peskin model, the corrected formula. 4 Isovector_Model This is the dipion invariant mass from the Voloshin Isovector model. 4 BW_x_Phase_Space This model for the dipion invariant mass takes the form of a Breit-Wigner function times the Phase_Space model. 4 Moxhay_Resonance This is the Moxhay resonance form for the dipion invariant mass. 3 Fragmentation_Functions This is a set of functions containing various theoretical predictions for the fragmentation of quarks and gluons. The following models are available: 1: Peterson 2: Kartvelishveli 3: Andersson 4: Collins 5: Bowler By default, the `AREA' has an arbitrary normalization. Use the `SET FIT AREA ON' command to make it meaningful. A Simpson integration of the function is then performed if any of the parameters change. 3 Resonance_Cross_Section Parametrizes a resonance cross section such as an Upsilon state. The parameters are: AREA MEAN SIGMA AXIS 3 Continuum_Cross_Section Parametrizes the continuum cross-section, including new flavour thresholds and the beam energy dependence, for e+e- annihilation. The parameters are: LEVEL THRESH HEIGHT 3 Histogram Use one histogram to fit to another. You will be asked if you want to include the errors on the histogram you are fitting with in the chi**2. The errors will not be included if you do a normal likelihood fit even if you ask them to be. However you can use the `SLIKELIHOOD' fitting option (see HELP FIT) if you want them to be taken into account. This sort of function is very useful if you want to fit a complicated shape you got from Monte Carlo or an efficiency corrected function to a plot. It can also be used to fit the data to a number of different components which are described by histograms. If you want to be have the x coordinate free in the fit you should use a `Smooth Histogram' function. 3 Smooth_Histogram Use a smooth histogram to fit to another. You will be asked if you want to include the errors on the histogram you are fitting with in the chi**2. The errors are assumed to be the square root of the value of each point. The errors will not be included if you do a normal likelihood fit even if you ask them to be. However, you can use the `SLIKELIHOOD' fitting option (see HELP FIT) if you want them to be taken into account. The possible modes for using the histogram are: 0 Do not use the errors on the histogram function 1 Errors are the square root of the value of each point 1n The ordinate is scaled by a free parameter This function is very useful if you want to fit a complicated shape you got from Monte Carlo, or an efficiency corrected function to a plot, or if you have a mass peak from Monte Carlo and want to determine its position and/or its relative width (mode 10 or 11). Note that what this function actually does is to smoothly interpolate using a cubic spline between the centres of the histogram bins. If your histogram also includes statistical fluctuations, then maybe you should first smooth the histogram itself. Use the `SMOOTH' command to do this. 3 2D_Gaussian Gaussians can be given either in terms of `SIGMA' or `FWHM'. They are normalised, so that the area is what it says. The form in terms of `SIGMA' is: AREA / (SIGMA1 * SIGMA2) * EXP( (X-MEAN1)**2/(2*SIGMA1**2) * EXP( (Y-MEAN2)**2/(2*SIGMA2**2) The parameters are: AREA MEAN1 MEAN2 SIGMA1 SIGMA2 In terms of `FWHM' it is the same except for the scale factor between the two. 3 COMIS Syntax: FUN ADD COMIS filename [nfun] Y|N nparm Title Name(s) where: filename is the file containing the function nfun is the (optional) user function number Y|N is whether you want to edit the file or not nparm are the number of parameters in the function Title is a title for the user function ( means the title will be "Comis Function [name]" Name(s) are the names of the parameters Uses the CERN COMIS facility (COMpilation and Interpretation System) to enable you to define FORTRAN functions interactively and execute them without recompiling the code. If you give the command in a macro you must either put `Y|N' on a separate line or include the function number (which can be 0). The form of the function is identical to that of a user defined function. The function name can be whatever you like, but the arguments must be the same as the user function. Note that if you want to fit with 2 COMIS functions at the same time, the functions must have different names: DOUBLE PRECISION FUNCTION XMNCMI(XX,YY,NP,DPAR,NFUSER,WFERR) where XX is the current x value for which the function is to be evaluated (REAL) YY is the current y value for which the function is to be evaluated (REAL) NP is the number of parameters DPAR is a DOUBLE PRECISION array containing the parameters NFUSER is the Comis function number (set by the command FUN ADD COMIS n, where n is the Comis function number) WFERR is the error on the function (usually 0, except when you are fitting with histograms) in DOUBLE PRECISION. All the arguments are input, except `WFERR'. An example of a COMIS function can be found in `mn_fit_test:comis_test.for' (VMS) or `$MN_FIT/test/comis_test.for' (Unix). If you add two or more COMIS functions and want to use them simultaneously, then the functions must have different names, otherwise whichever one you compile last will be used for all of them. The orthogonality limits for legendres etc. and the bin widths are stored in the common block: COMMON/MNUSR/XMINNM,XMAXNM,XBINNM,YMINNM,YMAXNM,YBINNM XMINNM,XMAXNM are the orthogonality limits for the x axis YMINNM,YMAXNM are the orthogonality limits for the y axis XBINNM is the bin width for the x axis YBINNM is the bin width for the y axis If you want to have debug printout you can use the common block: COMMON/MNDBG/QDEBUG,NDEBUG QDEBUG is a logical set with the SET DEBUG command NDEBUG is the printout level for DEBUG output You can call any of the Mn_Fit predefined functions from within your own COMIS function. The calling sequence is: WVAL = XMNCLC(NFUN,DPAR,NP,NPAR2,X,Y) where NFUN is the function number DPAR are the function parameters (in DOUBLE PRECISION) NP is the number of parameters NPAR2 only applies to function 26 - polynomial multiplied by the exponential of a polynomial X is the X value for which the function returns its value (REAL) Y is the Y value - not used in this routine (REAL) The 2-dimensional functions (only Gaussians at present) can also be called using the same calling sequence with function name XMNC2D. You will be prompted for the file containing the function and if the file does not exist a new one will be created with the correct function name and arguments supplied. You can then edit the file. See HELP EDIT for more details on editing. Use the `SET EDIT' command to change to your favourite editor. If the file is a new one the `EDIT' command will be executed automatically. When you exit the editor, the function will be compiled and is then ready to be used. Refer to the COMIS manual as to how to edit the function if it has compilation errors or type `HELP' if you get the prompt `MED>'. The same Cernlib subroutines and functions are available in Mn_Fit as in PAW with a few additions. For complete list of the routines available see HELP Using_COMIS. If you want your user function to be displayed as a histogram instead of a smooth curve then the title should start with `Hist'. To change a COMIS function you have already added either edit it and use the `FUNCTION COMPILE' command or use the `FUNCTION EDIT' command. Note that the file must be in a directory that you have write access to, and that its name must begin with a letter. These are Comis restrictions. Note that single precision constants cannot be assigned directly to double precision variables in a COMIS routine - but you can use `DBLE(X)' etc. if you need to. Also COMIS is fairly picky about your FORTRAN. For example if `DVAL' is in `DOUBLE PRECISION', the `IF' statement `IF(DVAL.LT.36.0)' will always be `.FALSE.'. You must use the form `IF(DVAL.LE.36.0D0)'. You should do all relevant calculations in the COMIS functon in `DOUBLE PRECISION'. The `XX' and `YY' values are passed in single precision for historical reasons only. 4 Mn_Fit_Functions_in_COMIS All Mn_Fit functions (except the dipion mass spectra) may be called in a COMIS routine. The function names and arguments are listed below. Note that the functions are all `DOUBLE PRECISION'. There also exist single precision versions of the same functions, with the name RMN... (instead of XMN...). Note that all Mn_Fit functions include the bin width in the calculation of the function value. The arguments generally used are: NPAR= Number of parameters P= Parameters (DOUBLE PRECISION) X, Y= X and Y (REAL) Y is only appropriate for 2D functions. In order to find out exactly what is calculated for each function you can look at the source code: $MN_FIT/lib/fsub/xmnclc.f etc. You can look at the source code via www: http://www-zeus.physik.uni-bonn.de/~brock/mn_fit_lib/ http://www-zeus.physik.uni-bonn.de/~brock/mn_fit_lib/fsub/ Other arguments are listed with the functions: 1) General Functions (1-35): XMNCLC(NFUN,DPAR,NPAR,NPAR2,X,Y) NFUN= Function number NPAR2= Number of secondary parameters != 2) Continuum cross section: XMNCNT(DPAR,NPAR,X) != 3) Resonance cross section: XMNRES(DPAR,NPAR,X) != 4) Fragmentation functions: XMNFRG(MODEL,BIN,DPAR,NPAR,X) BIN= Unused != 5) Histogram: XMNHIS(IDHA,IDHB,MODE,X,Y,WMNHER) IDHA= Primary Identifier of Histogram IDHB= Secondary Identifier of Histogram NMODE= 0= No Errors, 1= Errors from histogram WMNHER= Error returned from XMNHIS - DOUBLE PRECISION != 6) Smooth Histogram: XMNHSM(IDHA,IDHB,OFFSET,NHS,MODE,X,Y,WMNHER) IDHA= Primary Identifier of Histogram IDHB= Secondary Identifier of Histogram OFFSET= X Shift of histogram NHS= Element number that stores the spline parameters NMODE= 0= No Errors, 1= Errors from histogram WMNHER= Error returned from XMNHSM - DOUBLE PRECISION != The element number is defined if you do FUNCTION ADD SMOOTH id. You should therefore add the smooth histogram as a function, do a FUNCTION INFO and the element number is given after the id. != 6) 2D Functions: XMNC2D(NFUN,DPAR,NPAR,NPAR2,X,Y) 3 User Syntax: FUN ADD USER [nfun] nparm Title Name(s) where: nfun is the (optional) user function number nparm are the number of parameters in the function Title is a title for the user function ( means the title will be "User Function [nfun]" Name(s) are the names of the parameters User functions are identical to COMIS functions except that they must have the function name XMNUSR, so see HELP FUNCTION LIST COMIS for details. To link Mn_Fit with a user function you can use the command file `mn_fit_dir:mn_user.lnk' (VMS) or `$MN_FIT/mgr/mn_user.lnk' (Unix). You just have to give the executable name (default is `mn_user_x.exe' if you using X-Windows for the graphics), the filename for your compiled function and any extra libraries or object files that you need, e.g.: $MN_FIT/mgr/mn_user.lnk /home/brock/exe/mn_user fittest.f To run with your user version give the command: mn_fit -u /home/brock/exe/mn_user Note that Mn_Fit must have been compiled on your system or installed on your system with the the Mn_Fit libraries available for this to work. 2 OVERLAY Syntax: FUNCTION OVERLAY nfun1 [nfun2...] [&]idb nsymb/col where: nfun is the function number(s) as in FUNCTION INFO idb is the secondary identifier for the function nsymb is the symbol you want to plot the function with and col is the (optional) colour for the symbol. Stores one of the functions being fitted as a histogram and overlays it on the current picture. `nfun = 0' means use all functions which are currently in use. If you are fitting and your last picture was a `DISPLAY', the function will be given the same primary identifier as the one you are fitting. Otherwise, it will be given the primary identifier 98765. It will be given the secondary identifier you specify. To specify the secondary identifier on the same line as the function numbers precede it by a `&'. The function will be drawn with 500 points (unless at least one of them is a histogram), so it will appear as a smooth curve. You can change the number of points with the `SET FUNCTION POINT' command. 2 PLOT Syntax: FUNCTION PLOT nfun1 [nfun2...] [&]idb nsymb/col [xlo xhi] where: nfun is the function number(s) as in FUNCTION INFO idb is the secondary identifier for the function nsymb is the symbol you want to plot the function with and col is the (optional) colour for the symbol. Stores one of the selected functions as a histogram and plots it. `nfun = 0' means use all functions which are currently in use. You will be prompted for the lower and upper limits for the plot. The plot will be given the primary identifier 98765. It will be given the secondary identifier you specify. To specify the secondary identifier on the same line as the function numbers precede it by a `&'. The function will be drawn with 500 points (unless at least one of them is a histogram), so it will appear as a smooth curve. You can change the number of points with the `SET FUNCTION POINT' command. 2 STORE Syntax: FUNCTION STORE filename n1 [n2...] where: n1,n2... are the function numbers you want to store Stores functions in a file. You can access them at some other time with the `FUNCTION FETCH' command. 2 USE Syntax: FUNCTION USE n1 [n2...] where: n1,n2 are the function number(s) as in FUNCTION INFO Only valid in `MN_CMD>'. Selects the function(s) you want to use in fitting. `n' positive means use the function, negative means do not. +DECK,HARDCOPY. 1 HARDCOPY Syntax: HARDCOPY [device] The first time you ask for a hardcopy you will be prompted for the hardcopy device you want. All subsequent plots will go to the same device, unless you say `HARD new_device'. If you give the `HARDCOPY' command in a macro and omit the device name the first time, device `METAFILE' will be selected. To print the plots you have already made issue the command `CLOSE'. You can then print the file from another session, or use the `SPAWN' or `SHELL' commands. Use the `SET HARDCOPY' command to change the filename. Note that what `HARDCOPY' actually does is to repeat the plotting commands that were used to make the picture. Thus if you change a histogram, by fetching in a new one with the same identifier or performing some operation on it after that histogram has been plotted, the new histogram will get drawn when you give the `HARDCOPY' command. Another, sometimes unexpected, side-effect is that if you are windowing and project an Ntuple several times with the same secondary identifier each time, but different cuts, the `HARDCOPY' command will plot the last histogram only for all the projections. If your hardcopy comes out differently from the picture on the screen this is probably the reason. Try the `REDRAW' command before `HARDCOPY' to see what the hardcopy will actually look like. Different hardcopy devices are supported for different graphics packages. See HELP Hardcopy_Devices for more details. If you want to use a device other than those listed, you must give its number (see GKS or PLTSUB manuals). It will be captured as device type `unknown' and the output file will be `plot.dat' unless you have specified otherwise. +DECK,HB3_FETCH. 1 HB3_FETCH Syntax: HB3_FETCH filename id1 [:id2] [id3...] Fetches HBOOK version 3 histograms from a file. To fetch all histograms, give the command `HB3_FETCH filename 0'. To specify a range of histograms, give the command `HB3_FETCH filename id1:id2'. If you want to fetch other histograms from the same file give the command `HB3_FETCH id1,id2...'. If the histogram number you ask to fetch already exists, it will be overwritten. All the histograms will be given the default secondary identifier. WARNING: If you fetch all histograms from a file or specify a range any existing HBOOK histograms will be deleted! However, Mn_Fit will still store the histograms internally. This means that you will lose any slices, bands projections or functions associated with the HBOOK histogram unless you have already extracted them into Mn_Fit plots. +DECK,HB_FETCH. 1 HB_FETCH Syntax: HB_FETCH filename id1 [:id2] [id3...] Alias for `FETCH'. See HELP FETCH for more details. +DECK,HB_MN_FIT. 1 HB_MN_FIT Syntax: HB_MN_FIT [id1:[id2]] where: id1 is the lower limit fo the range of identifers to fetch id2 is the (optional) upper limit on the range Converts all or selected HBOOK histograms in the current HBOOK directory into Mn_Fit histograms. This command is automatically invoked after `NTUPLE SCAN' and `CALL_COMIS'. However if you have made HBOOK histograms in directories other than the current one when you exit the COMIS subroutine you should give the commands: SET DIR newdir or CD newdir HB_MN_FIT to get those histograms into Mn_Fit memory. In addition if you have created more than 200 new histograms you will have to use this command with a range of identifiers to fetch the extra ones. +DECK,HB_OPEN. 1 HB_OPEN Syntax: HB_OPEN filename where filename is the name of the file to open. Opens an HBOOK4 file. This command is not usually necessary if you just want to fetch histograms, but is useful in connection with the commands `CDIR' and `LDIR' (or `SET DIRECTORY' and `SHOW DIRECTORY'). You can then find out what histograms are in a file and fetch histograms from several subdirectories and give them separate secondary identifiers. It is a good idea to set the record length for direct access HBOOK version 4 files, if it is known. Otherwise you will get an error message and then Mn_Fit will try to open the file again with the correct record length. The default is 1024 words. If your files have been made with a different record length, use the `SET RECL' command to set the length. This length will also be used for `STORE' commands. +DECK,HB_STORE. 1 HB_STORE Syntax: HB_STORE filename id1 [id2...] Alias for `STORE'. See HELP STORE for more details. +DECK,HCLOSE. 1 HCLOSE Syntax: HCLOSE Closes all open histogram files. This enables you to write to the same filename from another program without having conflicts. +DECK,HCOPY. 1 HCOPY Syntax: HCOPY id1 id2 Calls subroutine HCOPY to copy one HBOOK histogram to another. +DECK,HDELETE. 1 HDELETE Syntax: HDELETE id Calls subroutine HDELET to delete an HBOOK histogram. +DECK,HINDEX. 1 HINDEX Syntax: HINDEX Calls subroutine HINDEX to give an index of the HBOOK histograms currently in memory. +DECK,histogram. 1 HISTOGRAM Does something with a plot. See HELP HISTOGRAM Menu for a short description of each command. See HELP 2DIM for more commands on different ways of plotting 2-dimensional histograms. 2 Menu The following is a list of the available commands. For more details see HELP HISTOGRAM and the individual subtopics: BOOK Books a new plot inside Mn_Fit. DISPLAY Makes an L3 or ZEUS detector display - only in display version. DUMP Dumps the contents of a histogram. ERRORS Changes the errors of a plot. EXTRACT Extracts part of an HBOOK histogram e.g. BANX or SLIY or FUN. FILL Fills a new plot inside Mn_Fit. IGTABLE Interface to HIGZ IGTABL routines for 2-D histograms. LEGO Makes a lego plot of a 2-D histogram. OVERLAY Overlays a histogram on the present plot. PLOT Plots a histogram. SURFACE Makes a surface plot of a 2-dimensional histogram. 2DIM Interface to HIGZ IGTABL routines for 2-D histograms. 2 BOOK Syntax: BOOK[/BINNED|/UNBINNED|/ERROR|/NOERR|/ASYMMETRIC] id [&idb] title ndim maxpnt OR nbinx xlo xhi [nbiny ylo yhi ...] where: id is the plot identifier idb is the (optional) secondary identifier title is the title for the new plot ndim is the number of dimensions maxpnt is the maximum number of points (for an unbinned plot) nbinx is the number of x bins xlo is the lower limit on x xhi is the upper limit on x etc. Books a new plot inside Mn_Fit. The default is an unbinned plot with errors. This command is useful if you want to fill a plot with the results of a fit for example. See HELP HISTOGRAM FILL for more details. Note that the `title' must be included in quotes if it is on the same line as the number of dimensions. 3 /BINNED Books a binned plot. You will be prompted for the number of bins and the upper and lower limits for each variable. 3 /UNBINNED Books an unbinned plot. When you fill the plot the data you give will be stored as the next point. Use the `PROJECT' command to convert an unbinned to a binned plot if you want to do so. 3 /NOERRORS Plot will be booked with no space reserved to store the errors on the data. Use the `HIST ERROR' command to add errors at a later time if you wish to. 3 /ERRORS Plot will be booked with space reserved for errors. When you fill the plot you will be prompted for the errors if it is an unbinned plot. 3 /ASYMMETRIC Plot will be booked with space reserved for asymmetric errors. When you fill the plot you will be prompted for both the negative and positive errors if it is an unbinned plot. 3 Examples !\begin{enumerate} !\item !^ Example 1: Book a binned histogram with errors: BOOK/BIN/ERR 1 'A New Histogram' 1 100 0 100 !\item !^ Example 2: Book a series of points with asymmetric errors and allow a maximum of 1000 points: BOOK/UNBIN/ASYM 1 'A New Histogram' 1 1000 !\end{enumerate} 2 DISPLAY Syntax: HIST DISPLAY[/CLEAR|/NOCLEAR] detnam id [&idb] where: detnam is the detector name id is the histogram identifier idb is the (optional) secondary identifier Makes a special display. This has been implemented for the following subdetectors in the L3 experiment: `ECAL', `FBGO' and `FSIL' and `FWCH'. For the ZEUS experiment it has been implemented for the `FTD' and `TRD' detectors. You have to use the `SET PARAMETER det' command to set the display options. 3 /CLEAR Default option. Specifies that the screen will be cleared before the next plot is made. Note that if you are plotting with more than 1 window (see HELP SET WINDOW) this option will be overridden, except for the plot in the top lefthand corner (`WINDOW 1 1'). 3 /NOCLEAR Specifies that the screen not be cleared before drawing this plot. This is useful if you want to overlay displays. 3 ECAL Displays the L3 BGO electromagnetic caloriter. This command must be preceded by the command `SET PAR ECAL mode xlo xhi ylo yhi'. See HELP SET PARAMETER ECAL for more information. 3 FBGO Makes a 2-D display of the L3 forward luminosity monitor BGO. See HELP SET PARAMETER FBGO for more information on what parameters can be changed. To overlay the forward luminosity monitor chamber hits see HELP HISTOGRAM DISPLAY FWCH and to overlay the silicon tracker hits see HELP HISTOGRAM DISPLAY FSIL. 3 FSIL Makes a 2-D display of the L3 forward luminosity monitor silicon tracker. See HELP SET PARAMETER FSIL for more information on what parameters can be changed. You can overlay the silicon tracker on the BGO by using the following syntax: SET PAR FBGO 4 0 0 DISP FBGO id1 SET PAR FSIL 1 0 1 0 DISP/NOCLEAR FSIL id SET PAR FSIL 1 0 2 0 DISP/NOCLEAR FSIL id SET PAR FSIL 1 0 3 0 DISP/NOCLEAR FSIL id 3 FWCH Makes a 2-D display of the L3 forward luminosity monitor planar chambers. See HELP SET PARAMETER FWCH for more information on what parameters can be changed. You can overlay chambers and also the BGO by using the following syntax: SET PAR FWCH mode side 1 0 DISP FWCH id SET PAR FWCH mode side 2 0 DISP/NOCLEAR id etc. Note that this will only work properly if you display one chamber at a time. 3 FTD Syntax: HISTOGRAM DISPLAY[/CLEAR|/NOCLEAR] FTD id[&idb] nevt where: id is the histogram identifier idb is the (optional) secondary identifier nevt is the Ntuple event number Makes a display of the ZEUS forward tracking detector. See HELP SET PARAMETER FTD for more information on what parameters can be changed. The display assumes that you are using the standard FTD Ntuple format and that there is one event per Ntuple event. You can use the `SET X|Y LIMIT' commands to show only part of the detector. However this only works if you are displaying a single chamber. The default limits are -100 to +100cm. 3 TRD Syntax: HISTOGRAM DISPLAY[/CLEAR|/NOCLEAR] TRD id[&idb] nevt where: id is the histogram identifier idb is the (optional) secondary identifier nevt is the Ntuple event number Makes a display of the ZEUS forward tracking detector. See HELP SET PARAMETER TRD for more information on what parameters can be changed. The display assumes that you are using the standard TRD Ntuple format and that there is one event per Ntuple event. If you want to see both the TRD and the FTD information you should use the combined Ntuple format. You can use the `SET X|Y LIMIT' commands to show only part of the detector. However this only works if you are displaying a single chamber. The default limits are -100 to +100cm. 2 DUMP Syntax: HIST DUMP id [&idb] Y|N|npnt1 [npnt2] where: id is the histogram identifier idb is the (optional) secondary identifier npnt1 is the 1st point to dump npnt2 is the last point to dump Dumps the contents of a histogram. If you omit the secondary identifier the default is used. If you answer `Y' when asked whether you want to see the points they will all be dumped. You can also give the range of point numbers that should be dumped. This is most useful for Ntuples. 2 ERRORS Syntax: HIST ERROR id [&idb] nmode [val] where: id is the histogram identifier idb is the (optional) secondary identifier nmode is the mode: -1 = remove errors altogether, 0 = zero errors, 1 = square root of the number of entries, 2 = same as 1, except the error on 0 points is set to 1. 3 = errors on all points are set to val val is the value of the error for mode 3 Changes the errors for a histogram. By default all HBOOK histograms get errors assigned to the bin contents when they are read in. If errors were not stored with the histogram they are set to the square root of the bin contents. Note that the errors are included in the calculation of the minimum and maximum limits when plotting the histograms. 2 EXTRACT Syntax: HIST EXTRACT id part [npart] [idb] where: id is the histogram identifier part is the name of the part you want to extract HIST, FUN, PROX, PROY, SLIX, SLIY, BANX, or BANY npart is the slice or band number idb is the secondary identifier for the part Extracts part of an HBOOK histogram, such as an associated function, projection, slice or band that you have filled. You cannot make a part that you have not already booked. To make a slice or band use the `CUT' and `PROJECT' commands. 2 FILL Syntax: HIST FILL id [&idb] x y [dx [dy] ...] or HIST FILL id [&idb] x [y] [weight] where: id is the plot identifier idb is the (optional) secondary identifier x is the x value of the point y is the y value of the point dx is the error on x dy is the error on y etc. weight is the weight for that point Fills a plot. The first syntax is for an unbinned plot and the second for a binned plot. The values and errors can be numbers, registers, parameters, etc. See HELP Numbers for more details on the things available and see HELP DEPOSIT on how to fill registers etc. 3 Examples !\begin{enumerate} !\item !^ Example 1: If you want to fill the plot with an upper limit, for example, use the `DEPOSIT' command to calculate the upper limit, storing the answer in a register and then `FILL' the plot with that value: DEPOSIT R10 = P2(1) + 1.64*ERP2(1) FILL 10 0.5 R10 !\end{enumerate} 2 IGTABLE Syntax: HIST IGTABLE id [&idb] where: id is the histogram identifier idb is the (optional) secondary identifier Interface to HIGZ IGTABL routine. Specify the parameters for how to show the table using the command `SET IGTABLE'. See HELP SET HIGZ TABLE and the HIGZ/HPLOT manual for more details. IGTABL allows you to display 2-dimensional histograms as contours, lego plots, surface plots with and without colour and in different coordinate systems. If you omit the secondary identifier the default is used. 2 LEGO Syntax: HIST LEGO[/qual] id [&idb] theta phi (default theta=30, phi=30) where: qual can be /C1|/C2|/BAR|/POL|/CYL|/SPH|/PSD|/NFB|/NBB id is the plot identifier idb is the (optional) secondary identifier theta is the viewling angle in theta phi is the viewing anlge in phi Makes a lego plot of a 2-dimensional histogram. `Theta' and `phi' are the angles from which you want to view the lego plot in degrees. They must lie between 0 and 90. This limit does not apply if the IGTABL interface is used. The current lego plotting code will soon be replaced by that in the `2DIM LEGO' command, which has no restrictions on the rotation angles and has a number of diffferent colour options. If you give one of the qualifiers, the HIGZ IGTABL routine will be used for the drawing. See HELP 2DIM LEGO for more details. The `2DIM' command can also be used to have many more options on how to plot 2-D histograms. See HELP 2DIM for more details. One of the qualifiers `/C1,/C2,/BAR' can be given and one of the coordinate system qualifiers `/POL,/CYL,/SPH,/PSD' can be given. The qualfiers `/NFB, /NBB' turn off the font and back boxes respectively. 2 OVERLAY Syntax: HIST OVERLAY[/option] id [&idb] [symb/col hatch/col patt/col] or HIST OVERLAY[/option] id part or HIST OVERLAY/NEXT [symb/col hatch/col patt/col] where: option can be /SAME|/DIFFERENT|/NEXT/|/NTUPLE|/SMOOTH id is the plot identifier idb is the (optional) secondary identifier symb is the symbol number to use (default = previous + 1) hatch is the hatching to use (default = none) patt is the pattern to use (default = none) col is the (optional) colour for the symbol, hatch or pattern. Overlays a histogram on the last one you plotted. To plot the next histogram in memory use the form `OVERLAY/NEXT'. If you omit the secondary identifier, the default is used. If you omit the symbol the default is taken as 1 greater than the current symbol number. If you are reading the command from a macro or `DEFINE'd command the symbol number must be included on the same line, otherwise the defaults will be used. If you give the command interactively, you have to hit `' to get the default values. Hatching and patterns only work with the HIGZ versions of Mn_Fit and are device dependent (see HELP SET HATCH and HELP SET PATTERN for more details). You can add the symbol, hatch or pattern colour to the symbol number as a qualifier, e.g. `32/red' instead of just 32. By default the plot will have the same y scale as the last one (`/SAME' qualifier). If you want it on a different y scale, give the command `OVERLAY/DIFFERENT'. The new scale will be drawn on the right-hand side of the plot. Give the command `REDRAW' to get rid of the scale on the right from the first plot. Use `OVERLAY/NTUPLE' to plot variables from an Ntuple. You have to give the command `SET NTUPLE ...' first to specify the variables. Note that this form does not apply any cuts and is most useful for plotting different columns from a table of entries read in with `DAT_FETCH' for example. You can also plot histograms directly from an HBOOK RZ file by opening the file (`OPEN' or `HB_OPEN') and then giving the overlay command. This feature can be suppressed using the `SET AUTOFETCH OFF' command. 3 /SAME Default option. Specifies that the overlayed plot will have the same y scale as the first one. 3 /DIFFERENT Specifies that the overlayed plot will have its own y scale drawn on the right hand side of the plot. 3 /NEXT Draws the next plot that is in memory. Useful for scanning a series of plots, following an `id' that you know. 3 /NTUPLE Draws the specified variables from an Ntuple. Use the `SET NTUPLE ...' command to specify which variables to put on which axis. 3 /SMOOTH Draws the plot as a smooth curve using a cubic spline interpolation between the points. 2 PLOT Syntax: HIST PLOT[/option] id1[:id2] [&idb1:idb2]] [sym/col hat/col pat/col] or HIST PLOT[/option] id part or HIST PLOT/NEXT [sym/col hat/col pat/col] where: option can be /CLEAR|/NOCLEAR|/NEXT/|/NTUPLE|/SMOOTH|/EMPTY id is the plot identifier idb is the (optional) secondary identifier sym is the symbol number to use (default from `SET SYMBOL') hat is the hatching to use (default from `SET HATCH') pat is the pattern to use (default from `SET PATTERN') part is the part of an HBOOK histogram that you want to plot e.g. BANX, FUN etc. col is the (optional) colour for the symbol, hatch or pattern. Plots a histogram on the currently selected screen device. If you omit the secondary identifier, the default is used. You can plot a range of histograms by using the syntax `id1:id2' for either or both the primary and secondary identifiers. To plot all histograms use the syntax `PLOT 0'. To plot the next histogram in memory use the form `PLOT/NEXT'. The default option is `/CLEAR'. If you want to add a second plot as an insert, for example, use the `/NOCLEAR' qualifier and specify the size and position of the second plot with the `SET X|Y MARGIN' and `SIZE' commands. If the plot is within a window you should use the `SET X|Y WMARGIN' and `WSIZE' commands. Use `PLOT/NTUPLE' to plot variables from an Ntuple. You have to give the command `SET NTUPLE ...' first to specify the variables. Note that this form does not apply any cuts and is most useful for plotting different columns from a table of entries read in with `DAT_FETCH' for example. If you want to plot an empty frame, without any error messages, book a new histogram with `HISTOGRAM BOOK' and then plot it with `PLOT/EMPTY'. If you omit the symbol, hatch or pattern the default will be used. If you specify a symbol this only applies to the current plot command and will not change the default. Use `SET SYMBOL' to change the default. If you are using a colour as a shading for an overlay and need to get the ticks redrawn use the `PLOT/NOCLEAR' command and redraw the 1st histogram. 2-D histograms can also be plotted using the `LEGO' or `SURFACE' commands, or by using the interface to the HIGZ IGTABL routine, via the `2DIM' or `IGTABLE' commands. See HELP 2DIM for more details. The normal procedure is to `FETCH' the histograms from a file and then plot them using the above syntax. You can also plot histograms directly from an HBOOK RZ file by opening the file (`OPEN' or `HB_OPEN') and then giving the plot command. This feature can be suppressed using the `SET AUTOFETCH OFF' command. Note that this only works for single histograms and not for a range nor for all histograms. If you want to check whether a histogram exists in a macro before deciding what to do you can use the following commands: SET PLOT ida&idb DEFAULT IF r121 = ida & r122 = idb ... ENDIF Note that this only works for histograms that you have tried to fetch. It does not yet work for histograms in an RZ file. 3 /CLEAR Default option. Specifies that the screen will be cleared before the next plot is made. Note that if you are plotting with more than 1 window (see HELP SET WINDOW) this option will be overridden, except for the plot in the top lefthand corner (`WINDOW 1 1'). 3 /NOCLEAR Specifies that the screen not be cleared before drawing this plot. This is useful if you want to make inserts and specify exactly where they should go and how big they should be (`SET X|Y MARGIN' and `SIZE' or `SET X|Y WMARGIN' and `WSIZE' commands). It can also be used if you make a plot with a pattern (or hatch -3), which obscures the scale. You can then say `PLOT/NOCLEAR id' for the 1st histogram again. 3 /EMPTY Draws an empty plot without giving an error message. This is useful if you want the frame of a plot for drawing in etc. 3 /NEXT Draws the next plot that is in memory. Useful for scanning a series of plots, following an `id' that you know. 3 /NTUPLE Draws the specified variables from an Ntuple. Use the `SET NTUPLE ...' command to specify which variables to put on which axis. 3 /SMOOTH Draws the plot as a smooth curve using a cubic spline interpolation between the points. 2 SURFACE Syntax: HIST SURFACE[/qual] id [&idb] theta phi (default theta=30, phi=30) where: qual can be /C1|/C2|/CONT|/SHADE|/POL|/CYL|/SPH|/PSD|/NFB|/NBB id is the plot identifier idb is the (optional) secondary identifier theta is the viewling angle in theta phi is the viewing angle in phi Make a surface plot of a 2-dimensional histogram. `Theta' and `phi' are the angles from which you want to view the plot in degrees. They must lie between 0 and 90. This limit does not apply if the IGTABL interface is used. The current surface plotting code will soon be replaced by that in the `2DIM SURFACE' command, which has no restrictions on the rotation angles and has a number of diffferent colour options. If you give one of the qualifiers, the HIGZ IGTABL routine will be used for the drawing. See HELP 2DIM SURFACE for more details. The `2DIM' command can also be used to have many more options on how to plot 2-D histograms. See HELP 2DIM for more details. One of the qualifiers `/C1,/C2,/CONT,/SHADE' can be given and one of the coordinate system qualifiers `/POL,/CYL,/SPH,/PSD' can be given. The qualfiers `/NFB, /NBB' turn off the font and back boxes respectively. 2 2DIM Syntax: HIST 2DIM option id [&idb] [par1 par2 ...] where: id is the histogram identifier idb is the (optional) secondary identifier option is the 2-D display option par are parameters needed Interface to HIGZ IGTABL routine. The parameters needed can either be given on the command line or specified using the command `SET IGTABLE'. IGTABL allows you to display 2-dimensional histograms as contours, lego plots, surface plots with and without colour and in different coordinate systems. See HELP 2DIM for more details. If you omit the secondary identifier the default is used. The 2-D plotting options available are `SCATTER, BOX, ARROW, CONTOUR, COLOUR, TEXT, CHAR, LEGO' and `SURFACE', with extra options for the style and coordinate system for `CONTOUR', `COLOUR', `LEGO' and `SURFACE' plots. +DECK,history. 1 HISTORY Syntax: history Gives a history of the commands read by GNU readline. This is implemented for Unix versions only. You can then use the command numbers given to recall commands. If this command does not work, you have a version of Mn_Fit without readline. On Unix machines this means that command recall and filename completion are not available. Note that this command cannot be abbreviated and must be given in lowercase. +DECK,hmake. 1 HMAKE Syntax: HMAKE id [&idb] where: id is the histogram identifier idb is the (optional) secondary identifier Makes an HBOOK histogram from another sort of histogram. The HBOOK histogram will have the same identifier. +DECK,hmerge. 1 HMERGE Syntax: HMERGE filout filein1 [filein2 [filein3 ...]] where: fileout is the name of the output file filein1 is the first filename etc. Merges one or more HBOOK RZ files into a single output file. This command calls the HBOOK routine `HMERGE' which combines Ntuples and adds histograms. The files should have identical structures. A `' signifies that the list of files to merge has finished. A maximum of 100 files can be merged in one command. +DECK,HRENAME. 1 HRENAME Syntax: HRENAME id1 id2 Renames an HBOOK histogram by calling HCOPY and HDELET. +DECK,HY_FETCH. 1 HY_FETCH Syntax: HY_FETCH filename id1[&idb] [:id2] [id3...] Fetches HYBRID histograms from a file. To fetch all histograms give the command `HY_FETCH filename 0'. To specify a range of histograms, give the command `HY_FETCH filename id1:id2'. If you want to fetch other histograms from the same file give the command `HY_FETCH id1,id2...' To fetch 2-dimensional plots give the command `HY_FETCH filename 0&2'. To fetch 1 and 2-dimensional plots give the command `HY_FETCH filename 0&1:2'. All the 1-dimensional histograms will be given the default secondary identifier. The 2-dimensional histograms will be given the default secondary identifier `+1'. +DECK,ifs. 1 IF Syntax: IF expression block of statements [ELIF expression] [block of statements] [ELSE] [block of statements] ENDIF This is a rudimentary conditional block structure. If the expression is true, then the first block of statements is performed, if it is false, then the control goes to the block of alternate statements following the `ELSE'. A second block can be started with the `ELIF' statement. If there is no `ELSE' block, execution picks up normally after the `ENDIF'. Note the result of an expression is always returned as a floating point number, i.e. also the results of `INT' and `NINT' are converted back to floating point immediately. The `IF' statement can only be used from a command file or in a defined command. WARNING: In Mn_Fit versions before 4.07/32 you should not include comment lines inside `DEFINE' commands, if there is a `DO' loop inside the same file. Inline comments are OK. Mn_Fit keeps track of which line is being read for future use in IF blocks and DO loops. If you have comment lines inside the DEFINE command, the counting of the line number gets out of sync. As a result any DO loops that are executed after the definitions (within the same macro) will not work properly. After the first run through the loop Mn_Fit will rewind the file and then jump to the wrong line for the second and future runs through the loop. 2 expression The expression can involve registers, parameters, or real numbers. At this time, you are limited to no more than four simple logical expressions per `IF' statement, linked by `.AND.' or `.OR.', and the whole expression must appear on the same line as the `IF'. The whole expression may be surrounded by a pair of parentheses, but individual expressions within the whole may not. You should not use the word `THEN' after the expression. 2 Examples !\begin{enumerate} !\item !^ Example 1: Here is a simple IF which decides whether to use a Maximum Likelihood fit or a Chi-square fit based on the area of the histogram: SET PL 10 DEFAULT IF R125 .LT. 100 MESSAGE USING MAXIMUM LIKELIHOOD FIT 10 1 ELSE MESSAGE CHI-SQUARE FIT 10 0 ENDIF !\item !^ Example 2: Here is a rather mundane example which illustrates Nesting of IF statements: DEFINE BIGGEST IF ( @1 .GT. @2 ) MESSAGE First is biggest ELSE IF @2 .GT. @1 MESSAGE Second is biggest ELIF @2 .LT. 1 MESSAGE 'If is screwed up, as this has already been checked' ELSE MESSAGE They are equal ENDIF ENDIF ENDDEF !\item !^ Example 3: This example illustrates linking of conditionals in a single IF statement: IF ( @1 > @2 & R4 > R6 | R4 .GT. 25 ) block of statements ENDIF Conditionals in MN_FIT are evaluated left-to-right, so the above would be evaluated as: IF (( @1 > @2 & R4 > R6 ) | ( R4 > 25 )) NOT IF (( @1 > @2 ) & ( R4 > R6 | R4 > 25 )) Notice that you CANNOT use parentheses to overide the order of evaluation. Only ONE set of parentheses is allowed - around the whole expression - individual subexpressions should not be surrounded by parentheses! !\end{enumerate} +DECK,igtable. 1 IGTABLE Syntax: IGTABLE id [&idb] where: id is the histogram identifier idb is the (optional) secondary identifier Interface to the HIGZ IGTABL routines for plotting 2-D histograms in different ways. See HELP HISTOGRAM IGTABLE for more details. Use the command `HISTOGRAM 2DIM' or `2DIM' to pass the option and parameters on the command line. +DECK,index. 1 INDEX Syntax: INDEX [id1][:id2] [&idb][:idb2] Alias for `DIRECTORY'. Gives an index of the histograms currently in memory. If you specify the primary identifier, you will get an index of all histograms with that identifier. To get all the histograms with a particular secondary identifier, give the command `INDEX 0 &idb'. To get all the histograms in a particular range, give the command `INDEX id1:id2 &idb1:idb2'. +DECK,INQUIRE. 1 INQUIRE Syntax: INQUIRE par [prompt] [default] where: par is the parameter number prompt is the optional prompt default is the optional default value Defaults: prompt = 'Give parameter n:' Only valid inside macros. If a parameter has not been defined you are prompted to give the value of the parameter. You can force a new value for the parameter by giving a negative parameter number. A `: ' will automatically be added at the end of the prompt: INQUIRE 1 'Give label' inq -3 You can specify a default value for a parameter after the prompt. The default is read in as a string. If spaces exist in the string you should enclose it in quotes: inquire 1 'Give extra offset' 0.5 inquire 2 'Give title' 'Dummy Title' If you do not give the parameter value with the above form the default will be taken. If you give a negative parameter number, then you will still be prompted for a new value. If you want a parameter to take its default value type `=': exec test 1 = -3 test.mnf: inquire 1 'Give first value' 2 inquire 2 'Give second value' 4 inquire 3 'Give third value' 6 dep r1 = @1 * @2 * @3 message 'The result is {ir1,(i6)}' would have as answer -12. If you are prompted for a parameter and want the default value also type `='. Note that no check is made on whether a default value exists. +DECK,INTEGRATE. 1 INTEGRATE Syntax: INTEGRATE nfun1 [nfun2...] xlo xhi where: nfun1,nfun2 are the function number(s) to integrate xlo is the lower limit of the integration xhi is the upper limit of the integration Integrates one or more functions over the given range. The default number of intervals to sum over is 100 and can be changed using the `SET FUNCTION INTEGRATE' command. If you want to integrate all selected functions, give the function number 0. The result is printed and is also stored in register 101, which you can use with the syntax `R101'. +DECK,KEY. 1 KEY Syntax: KEY command [nkey] or KEY id [&idb] command [nkey] nsymb text x, y, size, angle, opt, mode, font, colour, thick, unit, tcolour where: id is the histogram number the key applies to idb is the optional secondary identifier command can be ?|NEW|CHANGE|DELETE|LIST|END nkey is the key number to change or delete nsymb is the symbol number to describe Use the form +/-(n000 + abs(nhat|npat)) where the sign is the sign of the hatch or pattern number if you want a symbol which includes a hatch or pattern text is the text you want to display x,y are the position of the key size is the size of the text in cm (default = 0.4cm) angle is in degrees with respect to the horizontal opt can be: LEFT Key is left adjusted (default) CENTRE Key is centered RIGHT Key is right adjusted mode can be: CM = Position is in cm (default) PLOT = Position in terms of plot coordinates font is the font to use colour is the colour number for the key thick is the text thickness factor unit is the segment size for drawing lines (default = 0.01) Only works for symbols 5->8 tcolour is the text colour. When the `KEY' command is given in a file or a defined command, the last syntax must always be used and the key number must be given if it is applicable to the command (`CHANGE or DELETE'). You always need the `END' command when reading from a file to exit `KEY' unless you give the `command' on the same line as `KEY' Keys are associated with histograms you have already plotted. Therefore, if you have only plotted one histogram on the picture (using the `PLOT', `2DIM', `LEGO', `SURFACE', `DISPLAY' or `OVERLAY/DIFF' commands - `OVERLAYS' on the same scale do not count), the syntax is the first line. If you have plotted more than one histogram on the display, you will be prompted for the identifier the key applies to. If you just give the command `KEY' or `KEY id[&idb]' you will remain in `KEY' until you give the `END' command or `'. However, if you give some or all of the rest of the `KEY' command on the same line you will automatically exit `KEY' after you have finished the command. The position you give is where the symbol will be drawn. The text will be started twice the text size to the right of the symbol. The size of the symbol will be the same as the text size. If you do not give the text colour it will be the same as symbol colour. The text colour is useful for plots where you are using colour as a shading to print in black and white. If you want a symbol that includes a hatch or pattern use the symbol number in the form `+/-(n000 + abs(nhat|npat))'. `n' can be between 1 and 8: +/-(1000+nhat) square symbol with hatch nhat +/-(2000+npat) square symbol with pattern npat +/-(3000+nhat) histogram symbol with hatch nhat +/-(4000+npat) histogram symbol with pattern npat +/-(5000+nhat) square symbol with hatch nhat +/-(6000+npat) square symbol with pattern npat +/-(7000+nhat) histogram symbol with hatch nhat +/-(8000+npat) histogram symbol with pattern npat The special values, 1000,3000,5000,7000 draw a filled symbol and the values 2000,4000,6000,8000 draw a hollow symbol. For values >=5000 an edge is drawn round the symbol in the same colour as the text. Try the macro `exec MN_FIT_HELP:key' (VMS) or `exec $MN_FIT/help/key' (Unix) for some examples. If you use the option `SET MOUSE ON', then the position of the key is specified by the mouse. Move the mouse to where you want to have the key and click on the left button. To keep the key in the same position (if you are changing it) click on the right mouse button. Note that using the mouse only works properly in `CM' mode. By default the text will be written using the HIGZ routine IGTEXT. For details on formatting text and the other fonts available see HELP Text. The default colour and thickness of the comments are the same as the title. For `mode CM', `x=0, y=0' is the bottom left-hand corner of the picture You can omit all of the parameters except x and y for a new key. The option for the key will always be set to `LEFT', whether you try to change it or not. If you change or delete a key, use the command `REDRAW' to see the effect of what you have done. +DECK,ldirectory. 1 LDIRECTORY Syntax: LDIRECTORY Alias for `SHOW DIRECTORY'. List of the contents of the currently selected HBOOK directory in an HBOOK4 file. +DECK,lego. 1 LEGO Syntax: LEGO[/qual] id [&idb] theta phi (default theta=30, phi=30) where: qual can be /C1|/C2|/BAR|/POL|/CYL|/SPH|/PSD|/NFB|/NBB Alias for `HIST LEGO'. Makes a lego plot of a 2-dimensional histogram. `Theta' and `phi' are the angles from which you want to view the lego plot in degrees. If you give the command without any qualifier the angles must lie between 0 and 90. If you give a qualifier the IGTABLE interface will be used. The current lego plotting code will soon be replaced by that in the `2DIM LEGO' command, which has no restrictions on the rotation angles and has a number of diffferent colour options. See HELP 2DIM for more details. +DECK,mdirectory. 1 MDIRECTORY Syntax: MDIRECTORY dirnam where: dirnam is the name of the new directory in memory Creates a new HBOOK directory in memory and changes the default directory to that one. Subsequent `STORE' commands maintain the same directory structure as in memory. 2 Examples !\begin{enumerate} !\item !^ Example 1: Make a new directory, copy some histograms and then store them in that directory. Plots 1,2 will be stored in //MN_HBOUT, the top level directory, while 101 and 102 will be stored in //MN_HBOUT/NEWDIR: store file.hsto 1,2 mdir newdir copy 1 101 copy 2 102 store/update file.hsto 101,102 !\end{enumerate} +DECK,MERGE. 1 MERGE Syntax: MERGE id fileout filein1 [filein2 ...] where id is the ntuple identifier fileout is the name of the output file for the Ntuple filein1 is the first filename etc. Merges several Ntuples with the same identifier into a single Ntuple. Alias for `NTUPLE MERGE'. See HELP NTUPLE MERGE for more details. +DECK,MESSAGE. 1 MESSAGE Syntax: MESSAGE text where: text is the text of the message Writes a message to the current output device (selected by `SET DUMP'. The default is to the terminal). This command is most useful in macros to let the user know what is going on. The text can include registers, parameters etc., using the form `{Parameter,(Format)}'. See HELP Text for more details. You can get more fancy and even use `MESSAGE' to write fit results to a file in the form of a LaTeX table, for example! +DECK,MN_FETCH. 1 MN_FETCH Syntax: MN_FETCH filename id1[:id2] [&idb1[:idb2]] [id3...] where: filename is the file the plots are stored in id1,id2,id3 are the identifiers you want to fetch Fetches plots made with the M_BOOK package or ones stored with the `MN_STORE' command. To fetch all the plots, use the command `MN_FETCH filename 0'. To fetch a range of plots, use the command `MN_FETCH filename id1:id2', or `MN_FETCH filename 0&idb1:idb2' to get all the plots with secondary identifiers between `idb1' and `idb2'. +DECK,MN_STORE. 1 MN_STORE Syntax: MN_STORE filename id1[:id2] [&idb1[:idb2]] [id3...] where: filename is the file to store the plots id1,id2 are the identifiers you want to store Stores plots in a format for reading with the `MN_FETCH' command. To store all the plots, use the command `MN_STORE filename 0'. To store a range of plots, use the command `MN_STORE filename id1:id2', or `MN_STORE filename 0&idb1:idb2' to store all the plots with secondary identifiers between idb1 and idb2. If you omit the secondary identifier the default will be used, and only plots with the default secondary identifier will be stored (unless you say `MN_STORE filename 0' which stores all the plots you have made or fetched). +DECK,MULTIPLY. 1 MULTIPLY Syntax: MULTIPLY id1[:id1n] [&idb1] id2[:id2n] [&idb2] id3[:id3n] [&idb3] [scale1] [scale2] (default scale = 1.0 1.0) where: id1,id2 are the input histogram identifiers id3 is the output histogram identifier idb1,idb2 are the (optional) input secondary identifiers and idb3 is the (optional) output secondary identifier Multiplies two histograms (`id1, id2') together to make a third one. To specify the secondary identifier, precede it by a `&', otherwise the default will be used. (Use the `SET IDB' command to change the default). The scale factors are optional. To avoid confusion, you should give a `' after the identifiers or make sure the scale factors are given as real numbers. To multiply a range of histograms, the primary identifiers you give for the input and output histograms must be the same, but you can specify different secondary identifiers. For example, `MULT 300:400&1 300:400&2 300 : 400 & 10' will multiply all histograms with primary identifiers 300 to 400 and secondary identifiers 1, by those with secondary identifiers 2, putting the results into histograms with the same primary identifiers and secondary identifier 10. If you give primary identifier 0, the operation will be performed on all plots with the given secondary identifier. +DECK,NORMALIZE. 1 NORMALIZE Syntax: NORMALIZE id1 [:id1n] [&idb1] id2 [:id2n] [&idb2] [normalization] (default normalization = 1.0) or HIST id3 [&idb3] where: id1 is the input histogram identifiers id2 is the output histogram identifier idb1 is the (optional) input secondary identifier and idb2 is the (optional) output secondary identifier Normalizes a histogram (`id1') to the given area or to the area of another histogram. To specify the secondary identifier, precede it by a `&', otherwise the default will be used. (Use the `SET IDB' command to change the default). The scale factors are optional. To avoid confusion you should give a `' after the identifiers or make sure the scale factors are given as real numbers. To normalize a range of histograms, the primary identifiers you give for the input and output histograms must be the same, but you can specify different secondary identifiers. For example, `NORM 300:400&1 300 : 400 & 10 10.0' will normalize all histograms with primary identifiers 300 to 400 and secondary identifiers 1, to an area of 10, putting the results into histograms with the same primary identifiers and secondary identifier 10. If you give primary identifier 0, the operation will be performed on all plots with the given secondary identifier. +DECK,NTUPLE. 1 NTUPLE Syntax: NTUPLE DUMP|MERGE|PLOT|PROJECT|EPROFILE|SPROFILE|FILTER|SCAN Does an operation on an Ntuple. If you want to apply cuts you should first define them using `CUT NEW' or `CUT FILE', and `CUT USE' to specify which cuts should be used. Cuts will be applied when using the `PLOT', `PROJECT', `EPROFILE', `SPROFILE' and `FILTER' commands. ColumnWise Ntuples (CWN's) are supported, but do not yet work with the `FILTER' or `MERGE' commands. If you use a COMIS function for a cut on a CWN then you have to give the list of variables that you want to use in the COMIS function using the `SET NTUPLE VARIABLE' command. For general help on CWN's see HELP ColumnWise_Ntuples. Each time you project or scan an Ntuple that is stored with the disk option, it is usually refetched from the HBOOK file. This ensures that everything is synchronised properly. However, for very large Ntuples, this can take a long time. You can use the `SET AUTOFETCH OFF' command to suppress the extra fetches. In this case you have to make sure that you have not opened another file and that the HBOOK directory is set properly. Ntuple commands are still under development. It is possible that syntaxes will change and very likely that new commands and options will be added. When you use a Comis function five common blocks are available to you. `MNTPL2' is only available from version 4.03 onwards: COMMON /PAWIDN/ IDNEVT,VIDN1,VIDN2,VIDN3 , X1, X2, ... COMMON /MNTPL1/ ID,NVAR,ALO(NVAR),AHI(NVAR) COMMON /MNTPL2/ TITLE,TAGS(NVAR) COMMON /MNREGI/ REGIS(0:300) , VAR1, VAR2, ... COMMON /MNDBG/ QDEBUG,NDEBUG != IDNEVT is the current Ntuple event number VIDN1,VIDN2,VIDN3 are the values of the variables you are projecting onto X1,X2... are the Ntuple variables for the current event ID is the Ntuple identifier NVAR is the number of variables ALO are the lower limits for each variable AHI are the upper limits for each variable TITLE is the Ntuple title TAGS are the variable names REGIS are Mn_Fit registers VAR1,VAR2 are user defined Mn_Fit variables QDEBUG is a logical set with the SET DEBUG command NDEBUG is the printout level for DEBUG output Note that the `PAWIDN' common block is compatible with PAW so that you should be able to use the same functions in Mn_Fit and PAW. For CWN's the variables are also available in the same common blocks as for PAW: COMMON /PAWCR4/ rvar1, rvar2 COMMON /PAWCR8/ zvar1, zvar2 COMMON /PAWCCH/ cvar1, cvar2 where `PAWCR4' contains `REAL',`INTEGER' and `LOGICAL' variables, `PAWCR8' contains `DOUBLE PRECISION' variables, and `PAWCCH' contains `CHARACTER' variables. When you specify a Comis function as a cut it will be a real function. For a cut and `SCAN' the name of the function will be the name of the file without the header and type. When you give the cut to use you can give an argument for the function. User variables are stored in registers >300. Therefore you can either use the variable names or `REGIS(301)' etc. in the subroutine or function. These function as a substitute for KUIP vectors which are not available. 2 Menu The following is a list of the available commands. For more details see HELP NTUPLE and the individual subtopics: DUMP Dumps the contents of an Ntuple. EPROFILE Makes a profile plot from an Ntuple - errors are error on mean. FILTER Filter an Ntuple by applying cuts. MERGE Merges Ntuples from different files into a single Ntuple. PLOT Projects and plots the projection of an Ntuple. PROJECT Projects an Ntuple. SCAN Calls a Comis subroutine for every Ntuple event. SPROFILE Makes a profile plot from an Ntuple - errors are r.m.s. spread. 2 DUMP Syntax: NTUPLE DUMP id [&idb] Y|N|npnt1 [npnt2] where id is the ntuple identifier and idb is the (optional) secondary identifier Dumps the contents of an Ntuple. If you omit the secondary identifier the default is used. If you answer `Y' when asked whether you want to see the points they will all be dumped. You can also give the range of point numbers that should be dumped. 2 EPROFILE Syntax: NTUPLE EPROFILE id[&idb] var1 var2 &idb2 nbinx [xlo xhi] ylo yhi [nevt1 nevt] where id is the ntuple identifier var1 is the x-axis variable or expression to project onto var2 is the y-axis variable or expression idb2 is the secondary identifier of the projection nbinx are the number of bins for the x-axis of the profile plot if the input is an Ntuple. -1 means automatic binning xlo is the lower limit for the x-axis xhi is the upper limit for the x-axis ylo is the lower limit for the y-axis yhi is the upper limit for the y-axis nevt1 is the first event to scan and nevt is the number of events to scan Makes a profile plot from an Ntuple. Either variables or expressions can be used for both axes. The mean of the y-axis variable is calculated. The error on the y-axis variable is the error on its mean. Only events that have y-axis variables between the y limits will be used. If `ylo' and `yhi' are both 0, no checking will be done. Note that for technical reasons the profile plot has both negative and positive errors. 2 FILTER Syntax: NTUPLE FILTER id&idb [&]idb2 [nevt1 nevt] or: NTUPLE FILTER id idb2 where id is the ntuple identifier idb is the (optional) secondary identifier idb2 is the secondary identifier of the output Ntuple nevt1 is the first event to scan and nevt is the number of events to scan Scans an Ntuple applying the currently selected cuts. Events that pass the cuts are stored in a second Ntuple with secondary identifier `idb2'. This command is useful for applying a preliminary set of cuts on an Ntuple to decrease its size. This command does not work with CWN's. 2 MERGE Syntax: NTUPLE MERGE id fileout filein1 [filein2 [filein3 ...]] where id is the ntuple identifier fileout is the name of the output file for the Ntuple filein1 is the first filename etc. Merges several Ntuples with the same identifier into a single Ntuple. A `' signifies that the merging has finished. The merged Ntuple will then be read in and is available for further manipulation. This command does not work with CWN's. If you want to merge complete RZ files use the command `HMERGE' which calls the HBOOK routine `HMERGE' directly. 2 PLOT Syntax: NTUPLE PLOT id[&idb] var1 [var2 ...] [#weight [#dweight]] &idb2 nbinx [xlo xhi] [nbiny] [ylo yhi] [nevt1 nevt] where id is the ntuple identifier var1 is the first variable or expression to project onto var2 is the second etc. weight is a variable name or number to be used as the weight dweight is a variable to be used as the error on the weight idb2 is the secondary identifier of the projection nbinx are the number of bins for the x-axis of the projection if the input is an Ntuple. -1 means automatic binning 0 means keep as an Ntuple xlo is the lower limit for the x-axis xhi is the upper limit for the x-axis nbiny are the number of bins for the y-axis ylo is the lower limit for the y-axis yhi is the upper limit for the y-axis nevt1 is the first event to scan and nevt is the number of events to scan Projects and plots the projection of an Ntuple or an n-dimensional histogram. For more details see HELP NTUPLE PROJECT. 2 PROJECT Syntax: NTUPLE PROJECT id[&idb] var1 [var2 ...] [#weight [#dweight]] &idb2 nbinx [xlo xhi] [nbiny] [ylo yhi] [nevt1 nevt] where id is the ntuple identifier var1 is the first variable or expression to project onto var2 is the second etc. weight is a variable name or number to be used as the weight dweight is a variable to be used as the error on the weight idb2 is the secondary identifier of the projection nbinx are the number of bins for the x-axis of the projection if the input is an Ntuple. -1 means automatic binning 0 means keep as an Ntuple xlo is the lower limit for the x-axis xhi is the upper limit for the x-axis nbiny are the number of bins for the y-axis ylo is the lower limit for the y-axis yhi is the upper limit for the y-axis nevt1 is the first event to scan and nevt is the number of events to scan The project command has several uses. For example if you have specified cuts on a plot, use the `PROJECT' command to make a second plot which shows the results of the cuts; or if you have a scatter plot and want to make a binned histogram out of it. The end of the list of variables is signified by the end of line or the `&' of the secondary identifier. As for cuts you can give a variable name or an expression for the projection. You can also give the variable number instead. While this also works for single variables in CWNs, it is not a recommended way of proceeding, as it does not work for arrays. An expression is recognized if it starts with a `(' or if it contains any arithmetic operator `+-*/^()'. Thus if, for some strange reason you want to use a register for an axis you would have to enclose the register in parentheses `(R1)' so that it is recognized as an expression. When an expression is parsed, first Ntuple variable names are searched for, then user defined variables and then the standard registers, parameters etc. If you want to project onto an element of a CWN, use the form `var(n)', where `n' is the element number you want to project onto. To project many elements of a CWN use the form `var(m,n1:n2)' for the case when `var' is a 2-dimensional array. You can also use this form inside expressions (see example 8), or when projecting onto more than 1 axis (see example 9). Note that the limits of each variable of a CWN are not known. Therefore you always have to give the limits for plotting yourself. If you want one of the Ntuple variables to be the weight precede the variable name or number by `#'. For the error on the weight give another variable name or number preceded by `#'. This form is useful if you store a series of points in an Ntuple and then want to manipulate them as a series of points with errors. You only need to specify the binning if the input is an Ntuple. If you are projecting a scatter plot, specify 0 bins to keep it as a scatter plot, or give the binning if you want the projection to be a histogram. If you give the number of bins as -1 automatic binning will be used, taking as default lower and upper limits the lower and upper limits of the relevant variables in the Ntuple. However, as CWN's do not have the limits stored you are always given the opportunity to specify your own limits. If you want to keep the suggested limits just hit `' when asked for new limits. If you want to plot the result directly you can use the `NTUPLE PLOT' command. If you project onto a scatter plot then you can also give the limits on 1 or more of the axes for the projections - see example 4. These limits will be used as cuts, i.e. any events outside the limits will be dropped. The first event and the number of events to be scanned can also be given. If you omit them all events in the Ntuple will be scanned. If you specify 0 bins (i.e. you want to make a scatter plot, then you must give the limits for both axes if you also want to give the event numbers. Use limits of 0 0 if they should be taken from the Ntuple. If you want to make a plot vs. date or time, you can use the various time expressions that are available (see HELP Expressions). Note that the reference time is always set to 80/01/01 00:00 for such plots. This should be changed in the future when I have a bit more experience with such plots. Use the command `SET X MODE DATE|TIME' to decide is the plot should be stored in terms of days or minutes. Somewhat more flexibility is available if the information is stored in an ASCII file and can then be read in using the `DAT_FETCH' command. 3 Examples !\begin{enumerate} !\item !^ Example 1: Project an Ntuple onto a 2-D histogram using automatic binning: FET 10 filename PROJ 10 VAR1 VAR2 &1 -1 !\item !^ Example 2: Project the sum of 2 variables and specify the binning: PROJ 10 (VAR1+VAR2) &2 100 0 50 !\item !^ Example 3: Make a scatter plot of an expression and a variable using a COMIS function as a cut plus a cut on another variable. Let the limits be calculated internally. Start scanning at event 100 and do 1000 events: CUT DEL 0 CUT NEW VAR4.GT.5 FILE CUT_NTUPLE.FOR USE 1 .OR. 2 END NTUPLE PLOT 10 var3 (var1/var2) &3 0 0 0 0 0 100 1000 !\item !^ Example 4: Make a scatter plot of an expression and a variable using a COMIS function as a cut plus a cut on another variable. Specify the limits. Start scanning at event 20 and do 2000 events. This is the same as Example 3, except for the limits: CUT DEL 0 CUT NEW VAR4.GT.5 FILE CUT_NTUPLE.FOR USE 1 .OR. 2 END NTUPLE PLOT 10 var3 (var1/var2) &3 0 -3 3 0 10 20 2000 !\item !^ Example 5: Project a 2-D histogram onto 1 of its axes: NTUPLE PLOT 10 1 &1 !\item !^ Example 6: Project a 2-D histogram onto the sum and difference of the axes. If you project onto an expression the lower and upper limits on each variable will be used and the expression evaluated for them. These will then be the default limits for the projection. This is usually not what you want and so you should set the limits afterwards by hand: NTUPLE PROJ 1 (X+Y) X-Y &4 -1 partition 1&4 -5 5 -10 10 !\item !^ Example 7: Project an Ntuple onto a series of points and use one of the variables as the y value and another as its error: NTUPLE PROJ 1 X #WEIGHT #ERR &5 0 !\item !^ Example 8: Project the absolute value of a range of CWN array entries onto a 1-dimensional histogram (note that if nval2 = 0, no entry will be made in the projection): ntuple plot 34 abs(rval2(1:nval2)) &11 75 -5 10 !\item !^ Example 9: Project a range of CWN entries into a scatter plot. Note that the scatter plot limits must be given as the limits for CWN variables are not known:: ntuple plot 34 abs(rval2(2:nval2)) rval3(2,2:nval2) &12 0 - -5 10 -10 10 !\end{enumerate} 2 SCAN Syntax: NTUPLE SCAN id[&idb] filename[(arg)] Y|N [nevt1 nevt] where id is the ntuple identifier idb is the (optional) secondary identifier filename is the name of a file containing the Comis subroutine that should be called arg is an optional argument for the subroutine nevt1 is the first event number to scan nevt is the number of events to scan Loops over all the events in an Ntuple and calls a function which is contained in `filename'. If the file does not exist a skeleton file with the common blocks containing information on the Ntuple will be created. You will be asked if you want to edit the file or not. The function will be called with the optional argument `arg', which can be a register, parameter etc. If it is not given it will be set to `0.0'. After the scan all HBOOK histograms in the current directory in memory will be read in as Mn_Fit histograms. If you also want to get histograms from another directory you can use the command `HB_MN_FIT' (see HELP HB_MN_FIT for more details). 2 SPROFILE Syntax: NTUPLE SPROFILE id[&idb] var1 var2 &idb2 nbinx [xlo xhi] ylo yhi [nevt1 nevt] where id is the ntuple identifier var1 is the x-axis variable or expression to project onto var2 is the y-axis variable or expression idb2 is the secondary identifier of the projection nbinx are the number of bins for the x-axis of the profile plot if the input is an Ntuple. -1 means automatic binning xlo is the lower limit for the x-axis xhi is the upper limit for the x-axis ylo is the lower limit for the y-axis yhi is the upper limit for the y-axis nevt1 is the first event to scan and nevt is the number of events to scan Makes a profile plot from an Ntuple. Either variables or expressions can be used for both axes. The mean of the y-axis variable is calculated. The error on the y-axis variable is its r.m.s. Only events that have y-axis variables between the y limits will be used. If `ylo' and `yhi' are both 0, no checking will be done. Note that for technical reasons the profile plot has both negative and positive errors. +DECK,open. 1 OPEN Syntax: OPEN filename where filename is the name of the file to open. Opens an HBOOK4 file. This command is not usually necessary if you just want to fetch histograms, but is useful in connection with the commands `CDIR' and `LDIR' (or `SET DIRECTORY' and `SHOW DIRECTORY'). You can then find out what histograms are in a file and fetch histograms from several subdirectories and give them separate secondary identifiers. It is a good idea to set the record length for direct access HBOOK version 4 files, if it is known. Otherwise you will get an error message and then Mn_Fit will try to open the file again with the correct record length. The default is 1024 words. If your files have been made with a different record length, use the `SET RECL' command to set the length. This length will also be used for `STORE' commands. +DECK,OVERLAY. 1 OVERLAY Syntax: OVERLAY[/option] id [&idb] [symb/col hatch/col patt/col] or OVERLAY[/option] id part or OVERLAY/NEXT [symb/col hatch/col patt/col] where: option can be /SAME|/DIFFERENT|/NEXT/|/NTUPLE|/SMOOTH id is the plot identifier idb is the (optional) secondary identifier symb is the symbol number to use (default = previous + 1) hatch is the hatching to use (default = none) patt is the pattern to use (default = none) col is the (optional) colour for the symbol, hatch or pattern. Alias for `HIST OVERLAY'. Overlays a histogram on the last one you plotted. To plot the next histogram in memory use the form `OVERLAY/NEXT'. If you omit the secondary identifier, the default is used. If you omit the symbol the default is taken as 1 greater than the current symbol number. If you are reading the command from a macro or `DEFINE'd command the symbol number must be included on the same line, otherwise the defaults will be used. If you give the command interactively, you have to hit `' to get the default values. Hatching and patterns only work with the HIGZ versions of Mn_Fit and are device dependent (see HELP SET HATCH and HELP SET PATTERN for more details). You can add the symbol, hatch or pattern colour to the symbol number as a qualifier, e.g. `32/red' instead of just 32. By default the plot will have the same y scale as the last one (`/SAME' qualifier). If you want it on a different y scale, give the command `OVERLAY/DIFFERENT'. The new scale will be drawn on the right-hand side of the plot. Give the command `REDRAW' to get rid of the scale on the right from the first plot. Use `OVERLAY/NTUPLE' to plot variables from an Ntuple. You have to give the command `SET NTUPLE ...' first to specify the variables. Note that this form does not apply any cuts and is most useful for plotting different columns from a table of entries read in with `DAT_FETCH' for example. 2 /SAME Default option. Specifies that the overlayed plot will have the same y scale as the first one. 2 /DIFFERENT Specifies that the overlayed plot will have its own y scale drawn on the right hand side of the plot. 2 /NEXT Draws the next plot that is in memory. Useful for scanning a series of plots, following an `id' that you know. 2 /NTUPLE Draws the specified variables from an Ntuple. Use the `SET NTUPLE ...' command to specify which variables to put on which axis. 2 /SMOOTH Draws the plot as a smooth curve using a cubic spline interpolation between the points. +DECK,parse. 1 PARSE Syntax: PARSE command where: command is a Mn_Fit command that can include formatting Parses and then executes a command line. This command is useful if you want to convert a register, parameter etc. into a number to pass to another macro or defined command for example. 2 Examples !\begin{enumerate} !\item !^ Example 1: Pass the contents of a series of registers that contain the histograms to be plotted and the limits to be used: ! Histogram id's deposit r1 = 8162 deposit r2 = 8180 deposit r3 = 7296 ! Plot limits deposit r11 = 200 deposit r12 = 400 deposit r13 = 50 show register 1:3 show register 11:13 ! Plotting command undef test_plot define test_plot set y limit 0 @2 plot @1 enddef ! window 1 3 2 2 do i=1,3 parse test_plot {ir@i,(i4)} {r2,(f6.1)} enddo test_plot will be executed 3 times with the following parameters: test_plot 8162 200.0 test_plot 8180 400.0 test_plot 7296 50.0 !\item !^ Example 2: This example illustrates how you can store the histogram identifiers that you want to work with in registers and then use the `PARSE' command to put the content of the registers into the command line. In this example the errors of all bins are set to 10: dep r1 = 102 dep r2 = 1102 do i=1,2 ! Get the number of bins etc. for the histogram into registers set plot r@i default do j=1,r131 parse deposit dy{ir@i,(i4.4)}(@j) = 10.0 enddo enddo Note the use of `i4.4' to avoid spaces identifiers which have fewer than 4 digits. !\end{enumerate} +DECK,partition. 1 PARTITION Syntax: PARTITION id [&idb] xlo xhi [ylo yhi] where: id is the histogram identifier idb is the (optional) secondary identifier xlo is the new lower limit for the x axis xhi is the new upper limit for the x axis ylo is the new lower limit for the y axis (only for 2-D plots) yhi is the new upper limit for the y axis (only for 2-D plots) Cuts out part of a plot between the limits `xlo' and `xhi' (and between `ylo' and `yhi' if it is a 2-D plot). The new plot will be stored with the same identifiers as the old one. To make one with different identifiers use the `CUT' and `PROJECT' commands, or `COPY' then `PARTITION'. The commmand is also useful to set the limits and fill the arrays that contain the mean etc. for histograms and scatter plots that have been booked and filled using the `BOOK' and `FILL' commands, as Mn_Fit does not know when you have finished filling a plot. +DECK,plot. 1 PLOT Syntax: PLOT[/option] id1[:id2] [&idb1:idb2]] [symb/col hatch/col patt/col] or PLOT[/option] id part or PLOT/NEXT [symb/col hatch/col patt/col] where: option can be /CLEAR|/NOCLEAR|/NEXT/|/NTUPLE|/SMOOTH/|/EMPTY id is the plot identifier idb is the (optional) secondary identifier symb is the symbol number to use (default from `SET SYMBOL') hatch is the hatching to use (default from `SET HATCH') patt is the pattern to use (default from `SET PATTERN') part is the part of an HBOOK histogram that you want to plot e.g. BANX, FUN etc. col is the (optional) colour for the symbol, hatch or pattern. Alias for `HIST PLOT'. Plot a histogram on the currently selected screen device. If you omit the secondary identifier, the default is used. You can plot a range of histograms by using the syntax `id1:id2' for either or both the primary and secondary identifiers. To plot all histograms use the syntax `PLOT 0'. To plot the next histogram in memory use the form `PLOT/NEXT'. The default option is `/CLEAR'. If you want to add a second plot as an insert, for example, use the `/NOCLEAR' qualifier and specify the size and position of the second plot with the `SET X|Y MARGIN and SIZE' commands. If the plot is within a window you should use the `SET X|Y WMARGIN and WSIZE' commands. Use `PLOT/NTUPLE' to plot variables from an Ntuple. You have to give the command `SET NTUPLE ...' first to specify the variables. Note that this form does not apply any cuts and is most useful for plotting different columns from a table of entries read in with `DAT_FETCH' for example. If you want to plot an empty frame, without any error messages, book a new histogram with `HISTOGRAM BOOK' and then plot it with `PLOT/EMPTY'. If you omit the symbol, hatch or pattern the default will be used. If you specify a symbol this only applies to the current plot command and will not change the default. Use `SET SYMBOL' to change the default. You can add the symbol, hatch or pattern color to the symbol number as a qualifier, e.g. `32/red' instead of just 32. If you are using a colour as a shading for an overlay and need to get the ticks redrawn use the `PLOT/NOCLEAR' command and redraw the 1st histogram. The normal procedure is to `FETCH' the histograms from a file and then plot them using the above syntax. You can also plot histograms directly from an HBOOK RZ file by opening the file (`OPEN' or `HB_OPEN') and then giving the plot command. This feature can be suppressed using the `SET AUTOFETCH OFF' command. Note that this only works for single histograms and not for a range nor for all histograms. If you want to check whether a histogram exists in a macro before deciding what to do you can use the following commands: SET PLOT ida&idb DEFAULT IF r121 = ida & r122 = idb ... ENDIF Note that this only works for histograms that you have tried to fetch. It does not yet work for histograms in an RZ file. Many other options for plotting 2-D histograms exist using the `2DIM' command. See HELP 2DIM for more details. 2 /CLEAR Default option. Specifies that the screen will be cleared before the next plot is made. Note that if you are plotting with more than 1 window (see HELP SET WINDOW) this option will be overridden, except for the plot in the top lefthand corner (`WINDOW 1 1'). 2 /NOCLEAR Specifies that the screen not be cleared before drawing this plot. This is useful if you want to make inserts and specify exactly where they should go and how big they should be (`SET X|Y MARGIN' and `SIZE' or `SET X|Y WMARGIN' and `WSIZE' commands). It can also be used if you make a plot with a pattern (or hatch -3), which obscures the scale. You can then say `PLOT/NOCLEAR id' for the 1st histogram again. 2 /EMPTY Draws an empty plot without giving an error message. This is useful if you want the frame of a plot for drawing in etc. 2 /NEXT Draws the next plot that is in memory. Useful for scanning a series of plots, following an `id' that you know. 2 /NTUPLE Draws the specified variables from an Ntuple. Use the `SET NTUPLE ...' command to specify which variables to put on which axis. 2 /SMOOTH Draws the plot as a smooth curve using a cubic spline interpolation between the points. 2 Examples !\begin{enumerate} !\item !^ Example 1: Use color shading as an overlay and put a black edge on all plots. Also put on a key in the same form: set colour symbol yellow plot 7 1 0 100 set colour symbol green scale 6 6&1 0.9 overlay 6&1 1 0 100 set colour symbol black plot/noclear 7 overlay 6&1 1 ! Add a key with yellow symbol and black text key 7 new 8100 'Signal + background' 10 15 0.4 = = cm -1004 yellow = = black ! This form works, but the above method is simpler key 7 new 2100 'Background' 10 14 0.4 = = cm -1004 green = = black ! Draw a black edge around the symbol draw symbol 12 black 0.4 10 14 !\item !^ Example 2: Same as part of the previous example with the colours in the `PLOT' command: ! Yellow symbol and black pattern - probably not what is wanted plot 7 1/yellow 0 100 ! Other way round plot 7 1 0 100/yellow scale 6 6&1 0.9 ! All in green overlay 6&1 1/green 0 100/green ! Default symbol colour is still black plot/noclear 7 overlay 6&1 1/red !\end{enumerate} +DECK,2dim. 1 2DIM Syntax: 2DIM option[/qual] id [&idb] [par1 par2 ...] where: option is the 2-dimensional histogram plotting mode. id is the histogram identifier idb is the (optional) secondary identifier par are any parameters Interface to the HIGZ IGTABL routines for plotting 2-dimensional histograms in different ways. This command is an alias for `HISTOGRAM 2DIM'. The `2DIM' command is useful if you want to change the parameters on the command line. Use the command `HISTOGRAM IGTABLE' or `IGTABLE' if you have specified the option and any relevant parameters with the `SET IGTABLE' command. The `SET IGTABLE' and `IGTABLE' commands are useful if you want to make many plots with the same parameters. The following options are available: ARROW Arrows with magnitude and direction proportional to rate of change. BOX Boxes with area proportional to the number of entries. CHAR Number of letter with number of entries. COLOUR Colour plot. CONTOUR Contour plot joining points with equal values. SCATTER Scatter plot. TEXT Number of entries drawn in each bin. LEGO Lego plot with different styles. SURFACE Surface plot with different styles. For `LEGO' and `SURFACE' plot additional qualifiers can be given that specify the coordinate system to be used and the style of the plot. The possible coordinate systems are: POL Polar coordinates, CYL Cylindrical coordinates, SPH Spherical coordinates, PSD Pseudo-rapidity coordindates. Some of the options allow qualifiers which further control the style. See the `LEGO' and `SURFACE' subtopics for the other options on colour and shading which only apply to such plots. Fine control of the contours is also possible. If you want to make a contour plot with solid colours you can use the `SURFACE/C2' command. There are also a number of options available for drawing 2-dimensional histograms using the normal `PLOT' command and setting the appropriate symbol number. See HELP SET SYMBOL for more details. The normal procedure is to `FETCH' the histograms from a file and then plot them using the above syntax. You can also plot histograms directly from an HBOOK RZ file by opening the file (`OPEN' or `HB_OPEN') and then giving the plot command. This feature can be suppressed using the `SET AUTOFETCH OFF' command. Note that this only works for single histograms and not for a range nor for all histograms. 2 ARROW Syntax: 2DIM ARROW id[&idb] Draws a 2-D histogram with an arrow for each bin. The size and magnitude of the arrow show the slope from each bin to its neighbour. An alternative syntax is: SET IGTABLE ARROW IGTABLE id[&idb] 2 BOX Syntax: 2DIM BOX id[&idb] Draws a 2-D histogram with a box for each bin, the area of which is proportional to the number of entries. An alternative syntax is: SET IGTABLE BOX IGTABLE id[&idb] 2 CHAR Syntax: 2DIM CHAR id[&idb] Draws a 2-D histogram with the a number or letter for the number of entries given for each bin. The font is set using the `SET FONT SYMBOL' command. An alternative syntax is: SET IGTABLE CHAR IGTABLE id[&idb] 2 COLOUR Syntax: 2DIM COLOUR[/qual] id[&idb] mode where: qual Z means show the colour scale (default) NZ means do not show the colour scale mode 0 means uses the standard 8 colours Draws a 2-D histogram with colours for the number of entries. By default the scale is given on the right-hand side. Use the qualifier `/NZ' to turn the scale off. An alternative syntax is: SET IGTABLE COLOUR IGTABLE id[&idb] With this syntax the colour scale is not shown. 2 CONTOUR Syntax: 2DIM CONTOUR id[&idb] nlevel mode [level1 level2 ...] where: nlevel is the number of levels to show. mode is the mode to use: 0 = Use colour to distinguish the contours 1.nnn = Use the lines type with colour n 2.nnn = Use the same line type and colour for all contours level1 is the z-value for the contour Default: nlevel=20, mode=0 Draws a 2-D histogram as a contour plot. To use the default number of levels give `nlevel' as 0. Different modes are available to distinguish between the contour lines. The numbers of the colours are the same as for the `SET COLOUR' command. Note that you have to give the full 3 digits for the colour, e.g. 1.004, to use the line type and draw the contour in blue. You can set the line type used for the contours with mode 2.nnn by using the command `SET HIGZ LTYP n'. An alternative syntax is: SET IGTABLE CONTOUR nlevel mode [level1 level2 ...] IGTABLE id[&idb] Use the `2DIM SURFACE/C2' command to make a contour plot with solid colours. See the examples for how this is done. 2 LEGO Syntax: 2DIM LEGO[/qual] id[&idb] theta phi [ncol1 ncol2 ncol3 ...] where: qual describes the style of the lego plot theta is the theta viewing angle phi is the phi viewing angle ncol1... are the colours to use for the colour options Default: theta=30, phi=30 Draws a LEGO plot. An alternative syntax is `LEGO/IGTABLE[/qual]'. The possible qualifiers and their equivalent `SET IGTABLE' commands are: /C1 LEGOC1 Colour lego plot - mode 1. /C2 LEGOC2 Colour lego plot - mode 2 (most common). /BAR LEGOBAR Reduced the bin width plot. Use the commands `SET HIGZ BARW frac' and `SET HIGZ BARO frac' to adjust the bin width and offset. /POL LEGOPOL LEGO plot in polar coordinates. /CYL LEGOCYL LEGO plot in cylindrical coordinates. /SPH LEGOSPH LEGO plot in spherical coordinates. /PSD LEGOPSD LEGO plot in pseudo-rapidity coordinates. /NFB Do not draw the front box. /NBB Do not draw the back box. One of the options `C1,C2,BAR' can be combined with one of the coordinate system options. While any angles can be specified for theta and phi, theta between 0 and 90 degrees works best. If you want to look at the bottom of your surface, use a theta angle between 90 and 180 degrees. You can specify your own colour scheme by giving the colour numbers. Use the `SET COLOUR REPRESENT ncol r g b colname' command to define new colours or redefine existing ones. 2 SCATTER Syntax: 2DIM SCATTER id[&idb] marker maxpnt where: marker is the marker type to use maxpnt is the maximum number of random points in a cell Draws a 2-D histogram with random points per bin, where the number of points is proportional to the number of entries. An alternative syntax is: SET IGTABLE SCATTER IGTABLE id[&idb] 2 SURFACE Syntax: 2DIM SURFACE[/qual] id[&idb] theta phi [ncol1 ncol2 ncol3 ...] where: qual describes the style of the surface plot theta is the theta viewing angle phi is the phi viewing angle ncol1... are the colours to use for the colour options Default: theta=30, phi=30 Draws a SURFACE plot. An alternative syntax is `SURFACE/IGTABLE[/qual]'. The possible qualifiers and their equivalent `SET IGTABLE' commands are: /C1 SURFC1 Surface plot with colours and contour lines. /C2 SURFC2 Surface plot with colours only. /CONT SURFCONT Surface plot with colour contour plot on top. /SHADE SURFSHADE Surface plot with shading. /POL SURFPOL Surface plot in polar coordinates. /CYL SURFCYL Surface plot in cylindrical coordinates. /SPH SURFSPH Surface plot in spherical coordinates. /PSD SURFPSD Surface plot in pseudo-rapidity coordinates. /NFB Do not draw the front box. /NBB Do not draw the back box. One of the options `C1,C2,CONT,SHADE' can be combined with one of the coordinate system options. The `2DIM SURFACE/C2 id 90 0' command can be used to draw a contour with solid colours. You can control the values for each colour by specifying the `Z LIMIT' and then giving a corresponding number of colours on the command line. See the examples for how this is done. While any angles can be specified for theta and phi, theta between 0 and 90 degrees works best. If you want to look at the bottom of your surface, use a theta angle between 90 and 180 degrees. You can specify your own colour scheme by giving the colour numbers. Use the `SET COLOUR REPRESENT ncol r g b colname' command to define new colours or redefine existing ones. 2 TEXT Syntax: 2DIM TEXT id[&idb] Draws a 2-D histogram with the number of entries given for each bin. The font is set using the `SET FONT SYMBOL' command. An alternative syntax is: SET IGTABLE TEXT IGTABLE id[&idb] 2 Examples !\begin{enumerate} !\item !^ Example 1: Make a lego plot of 2-D histogram 10: 2dim lego 10 30 30 ! Use colour option 2 lego/c2 10 30 30 !\item !^ Example 2: Make a contour plot with contours at 1,4 and 9: ! Take default parameters 2dim contour 10 0 ! 2dim command with parameters on the command line 2dim contour 10 3 1 1 4 9 ! Using the set igtable command for plots 10 and 11 set igtable contour 10 3 1 1 4 9 igtable 10 igtable 11 !\item !^ Example 3: Make a contour plot with solid colours using the SURFACE command. Note that the scale is not drawn properly here: ! Default colours 2dim surface/c2/nfb/nbb 10 90 0 ! Specify my own colours ! Violet set col rep 8 0.60 0.0 0.9 violet ! Orange set col rep 9 1.0 0.5 0.0 orange ! Set limit as 0 to 10 and specify the 10 colours ! The standard colours are: ! 1 black ! 2 red ! 3 green ! 4 blue ! 5 yellow ! 6 magenta ! 7 cyan set z lim 0 10 2dim surface/c2/nfb/nbb 10 90 0 7 7 7 9 8 4 3 2 1 7 !\item !^ Example 4: Make a contour plot with solid colours using the SURFACE command. Draw the frame at the centre of the first bin rather than the edge, so that the whole plot is filled. Note that you could also plot the 2-D Gaussian using `FUNCTION PLOT', rather than fitting it, as is done here. This example also shows how to use the registers containing the number of bins and the bin boundaries as well as those containing the corners of the plot: fet $MN_FIT/help/tutorial/hbook_example.his 10 ! ! Make a nice Gaussian by fitting the data ! fun del 0 fun add 2dim sig 1000 0 0 1 1 fit/like 10 mini display exit ! Define some new colours ! Violet set col rep 8 0.60 0.0 0.9 violet ! Orange set col rep 9 1.0 0.5 0.0 orange ! ! Draw the Gaussian without any frame ! set frame all off ! Set the z limit and give the 10 colours set z lim 0 10 ! The 2-D Gaussian is in plot 10&981 2d surface/c2/nbb/nfb 10&981 90 0 7 7 7 9 8 4 3 2 1 7 ! ! Move the scale and frame half a bin inside the plot ! ! Plot coordinates - these are set with the set plot default command ! Use the bin boundaries and the number of bins set plot 10&981 default dep r01 = r205 + 0.5*(r133-r132)/r131 dep r02 = r206 - 0.5*(r133-r132)/r131 dep r03 = r207 + 0.5*(r138-r137)/r136 dep r04 = r208 - 0.5*(r138-r137)/r136 dep r05 = r02 - r01 dep r06 = r04 - r03 ! ! In cm - these are only set once the histogram has been plotted dep r11 = r201 + 0.5*(r202-r201)/r131 dep r12 = r202 - 0.5*(r202-r201)/r131 dep r13 = r203 + 0.5*(r204-r203)/r136 dep r14 = r204 - 0.5*(r204-r203)/r136 dep r15 = r12 - r11 dep r16 = r14 - r13 dep r17 = r11 - r201 dep r18 = r13 - r203 ! ! The number of bins is effectively reduced by 1 dep r21 = r131 - 1 dep r22 = r134 - 1 book/bin/noerr 9999 'Frame' 2 r21 r01 r02 r22 r03 r04 set x lim r01 r02 set y lim r03 r04 ! ! Move the frame in by half a bin and make it one bin smaller set x wmarg r17 set y wmarg r18 set x wsize r15 set y wsize r16 ! ! Draw the frame ! set frame all on set title off plot/noclear/empty 9999 !\end{enumerate} +DECK,PRINT. 1 PRINT Syntax: PRINT id [&idb] where: id is the histogram identifier idb is the (optional) secondary identifier Prints a histogram on the terminal or in a file. The output is set using the `SET DUMP' command. If you want to make a line printer copy of the histogram, use the commands: SET DUMP LPT PRINT id [&idb] SET DUMP CLOSE Then either `SHELL' or `SPAWN' a print command or go to another session and print the file `mn_dump.dat'. You can change the filename with the `SET DUMP FILE' command. +DECK,PROJECT. 1 PROJECT Syntax: NTUPLE PROJECT id[&idb] var1 [var2 ...] [#weight [#dweight]] &idb2 nbinx [xlo xhi] [nbiny ylo yhi] [nevt1 nevt] where id is the ntuple identifier var1 is the first variable or expression to project onto var2 is the second etc. weight is a variable name or number to be used as the weight dweight is a variable to be used as the error on the weight idb2 is the secondary identifier of the projection nbinx are the number of bins for the x-axis of the projection if the input is an Ntuple. -1 means automatic binning 0 means keep as an Ntuple xlo is the lower limit for the x-axis xhi is the upper limit for the x-axis nbiny are the number of bins for the y-axis ylo is the lower limit for the y-axis yhi is the upper limit for the y-axis nevt1 is the first event to scan and nevt is the number of events to scan Projects a plot (either a scatter plot or an n-dimensional histogram) onto 1 or more axes. Alias for `NTUPLE PROJECT'. See HELP NTUPLE PROJECT for more details. +DECK,READ. 1 READ Syntax: READ COMMAND|DATA Reads in a series of commands from a file or a histogram stored in card image format. See HELP READ Menu for a short description of the commands. 2 Menu The following is a list of the available commands. For more details see HELP READ and the individual subtopics: COMMAND Reads a series of commands and executes them from a file. DATA Reads data points or Ntuples from an ASCII file. 2 COMMAND Syntax: READ COMMAND filename [parameter_list] Alias for `EXEC'. See HELP EXECUTE for more details. 2 DATA Syntax: READ DATA filename Alias for `DAT_FETCH'. See HELP DAT_FETCH for more details. +DECK,REBIN. 1 REBIN Syntax: REBIN id [&idb] nbinxlo nbinxhi nbinx [nbinylo nbinyhi nbiny] where: id is the histogram identifier idb is the (optional) secondary identifier nbinxlo is the first bin nbinxhi is the last bin nbinx is the number of new bins Rebins a plot into `nbin' new bins from bin `nbinlo' to bin `nbinhi'. If `(nbinhi - nbinlo)' is not divisible by `nbin', `nbinhi' is rounded down until it is. Rebin works on 1 and 2-dimensional histograms. +DECK,REDRAW. 1 REDRAW Syntax: REDRAW Redraw the last picture you made with any changes you made via the `SET, COMMENT, KEY' or `DRAW' commands implemented. Note that what `REDRAW' actually does is to repeat the plotting commands that were used to make the picture. Thus if you change a histogram, by fetching in a new one with the same identifier or performing some operation on it after that histogram has been plotted, the new histogram will get drawn when you give the `REDRAW' command. Another, sometimes unexpected, side-effect is that if you are windowing and project an Ntuple several times with the same secondary identifier each time, but different cuts, the `REDRAW' command will plot the last histogram only for all the projections. +DECK,REMOVE. 1 REMOVE Syntax: REMOVE var|ALL where: var is the user variable name Removes the user variable name `var'. If the command `REMOVE ALL' is given all user variables will be deleted. See HELP Numbers and HELP DEPOSIT for details on defining user variables. +DECK,RENAME. 1 RENAME Syntax: RENAME id1 [&idb1] id2 [&idb2] where: id1 is the input identifier idb1 is the (optional) input secondary identifier id2 is the output identifier idb2 is the (optional) output secondary identifier Renames a plot. If you omit a secondary identifier, the default is used. Use the `SET IDB' command to change the default. If you give `id1' and `id2 = 0' all the plots with secondary identifier `idb1' will be renamed to have secondary identifier `idb2'. Note that `RENAME' only copies the Mn_Fit histogram and not any associated HBOOK historam. Use the `HRENAME' command to copy the HBOOK histogram also. +DECK,RETURN. 1 RETURN Syntax: RETURN Returns from a macro or `DEFINE'd command. +DECK,SCALE. 1 SCALE Syntax: SCALE id1 [:id1n] [&idb1] id2 [:id2n] [&idb2] [scale] (default scale = 1.0) where: id1 is the input histogram identifiers idb1 is the (optional) input secondary identifiers id2 is the output histogram identifier and idb2 is the (optional) output secondary identifier Scales a histogram (`id1') by a given factor. To specify the secondary identifier, precede it by a `&', otherwise the default will be used. (Use the `SET IDB' command to change the default). The scale factors are optional. To avoid confusion you should give a `' after the identifiers or make sure the scale factors are given as real numbers. To scale a range of histograms, the primary identifiers you give for the input and output histograms must be the same, but you can specify different secondary identifiers. For example, `SCALE 300:400&1 300 : 400 & 10 10.0' will scale all histograms with primary identifiers 300 to 400 and secondary identifiers 1, by a factor of 10, putting the results into histograms with the same primary identifiers and secondary identifier 10. If you give primary identifier 0, the operation will be performed on all plots with the given secondary identifier. +DECK,SCAN. 1 SCAN Syntax: SCAN id[&idb] filename[(arg)] Y|N [nevt1 nevt] where id is the ntuple identifier idb is the (optional) secondary identifier filename is the name of a file containing the Comis subroutine that should be called arg is an optional argument for the subroutine nevt1 is the first event number to scan nevt is the number of events to scan Loops over all the events in an Ntuple and calls a function which is contained in `filename'. Alias for `NTUPLE SCAN'. See HELP NTUPLE SCAN for more details. +DECK,SCT_FETCH. 1 SCT_FETCH Syntax: SCT_FETCH filename id1[:id2] [id3...] where: filename is the file containing the plots id1,id2,id3 are the plot number you want to fetch Fetch scatter plots made with the AVEHST package. To fetch all the plots, give the command `SCT_FETCH filename 0'. To fetch a range of plots, give the command `SCT_FETCH filename id1:id2'. +DECK,set. 1 SET Syntax: SET parameter value(s) or X|Y|Z parameter value(s) or SET PLOT id [&idb] parameter value or SET PLOT id [&idb] X|Y|Z parameter value In general if you `SET' something, it will affect the next plot you make. To change something on a picture you have already made, use the format `SET PLOT id [&idb]'. This will not change the value of that parameter for any other plots. If you want to change something for all plots, use the format `SET PLOT 0 ...' This will also change the value of the parameter for all subsequent plots. You can usually omit the word `PLOT' in the above syntax. If you do not want to change the value of a parameter, you can use `=' in the position where the value would go, in the same way as in the `MODIFY' command. See HELP Numbers for more details. Set the parameters to 0 to get back to their default values or to turn off their effect. For example. `SET Y LIMIT 0 0' returns you to automatic limit setting. If you give the `parameter' on the same line as `SET' or `SET PLOT id [&idb]', you will exit automatically at the end of your command. Otherwise you must give the `ENDSET' command to exit `SET' if you are reading commands from a file or a `DEFINE' command. If you are giving commands interactively you can also hit `'. To change a parameter in the `DISPLAY' of the fit results, use the `SET DISPLAY parameter' form. See HELP SET PLOT and HELP SET DISPLAY for more details. If a parameter has to be preceded by the axis it applies to, you do not have to leave a space between the axis label and the parameter name, i.e. `SET X LIMIT' and `SET XLIMIT' are both valid. If you turn off the frame for a plot then no ticks, grid or scale will be drawn. If you turn off the ticks then no scale will be drawn either. Possible positions for the frame, scale, ticks and label are the `ALL', `BOTTOM', `TOP', `LEFT' or `RIGHT' of the picture. In addition for lego and surface plots you can set parameters for the `VERTICAL' axis. For the grid and the line at `x' or `y = 0', you specify whether it is for the `X', `Y', or `Z' axes. 2 Menu The following is a list of the available commands. For more details see HELP SET and the individual subtopics: EXIT Exits from SET (deprecated). ENDSET Exits from SET (use instead of EXIT in command files). X Sets a variable for the X-axis. Y Sets a variable for the Y-axis. Z Sets a variable for the Z-axis. ABORT Turns on or off the aborting of macros when an error occurs. ALIAS Turns on or off alias translation. AUTOFETCH Automatically refetch Ntuples when they are projected or scanned, or fetches histograms when they are plotted. AUTOSCALE Scale text sizes when windowing. AUTOSWITCH Switches between plotting and alphanumeric without asking for a `'. AUTOTRIM Do not draw the last scale value when windowing with 0 spacing between the windows or for the 1st y-axis scale value in a lego plot. AXIS Sets axis labelling text, position, size and angle (deprecated). BACKGROUND Specifies which functions should be considered as background. BIN Sets an scale factor or offset for each bin when plotting. BOX Turns on or off drawing a box round the plot. BREAK Turns on or off the condition handler. CHARACTER Sets continuation and comment characters. COLOR Same as `SET COLOUR' for Americans. COLOUR Changes the colour of all or part of a picture. DBASE Sets database access parameters. DEBUG Turns on/off the debug flag. DEFAULT Sets parameters back to default values or sets the default plot. DIRECTORY Sets the current HBOOK4 directory. DISPLAY Changes the mode or defaults for displaying fit results. DSIZE Sets the scale factor for the dot size. DUMP Changes the output unit for the printout from commands. ECHO Turns on or off echoing commands when reading from a file. EDIT Gives the command to invoke your favourite editor. ERR_ZERO Sets the error on zero points to 1 or not. EXCLUSIONS Turns on or off showing excluded parts of functions. FIT Specifies options for fitting (see HELP SET FIT for more details). FONT Sets the font for text in pictures. FOOTER Turns on or off the footer on a picture and allows a user footer to be specified. FRAME Sets where you want a frame round the plot. FSIZE Sets the text size of the footer. FUNCTION Specifies options for calculating function values (see HELP SET FUNCTION for more details). GRID Turns on or off a grid. GSIZE Sets the global/user title size. HATCH Sets the hatching number. HARDCOPY Sets the name of the file that hardcopies are written to. HEADER Turns on or off displaying the histogram identifiers and and other information on the picture. HIGZ Sets IGSET or IGTABLE parameters. HISTOGRAM Sets the default histogram number. IDB Specifies the default secondary identifier. IDSIZE Sets size of text for histogram identifier. IDSHOW Turns on or off displaying the histogram identifiers on the picture. IGARC Uses HIGZ IGARC routine for arcs and circles. IGTABLE Sets the IGTABLE parameters for `IGTABLE' or `2DIM' command. LABEL Sets axis labelling text, position, size and angle. LOG Turns on or off logging of all commands - for a log scale in a histogram see HELP SET MODE. LSIZE Sets the segment length for drawing lnes. MANUAL Turns on or off special command echoing used to make Mn_Fit manual. MOUSE Turns on or off using the mouse to position comments/keys. NEXT_WINDOW Sets the window for the next plot. NTUPLE Specifies the axes corresponding to Ntuple variables. NORMALIZE Turns on or off an overall normalization factor when fitting. ORDER Specifies the order of variables in a file read with `DAT_FETCH'. ORTHOGONAL Sets the orthogonality limits for Chebyshev polynomials etc. PAGER Gives the command to invoke your favourite pager. PAPER Sets the paper size for Postscript files. PARAMETER Sets parameters for the L3 detector displays. PATH Sets the list of directories searched when opening existing files. PATTERN Sets the pattern number (only works with GKS). PI Turns on or off the ability to use pi as a scale symbol. PLOT Specifies which plot you want to change something for. RATIO Specifies using ratio of areas or not when fitting more than 1 plot. RECL Sets the record length for HBOOK version 4 files. REDRAW Redraws the last picture with the `SET' changes on it. ROTATION Rotates a plot - not yet fully implemented. SCALE Sets where to put the scale and its position and size. SECONDARY_ID Specifies the default secondary identifier. SHELL Specifies the shell to be used on Unix systems. SHOW_ZERO Shows zero points which have zero errors or not. SIGNAL Specifies which functions should be considered as signal. SSIZE Sets the symbol size. STATISTICS Specifies whether HBOOK or Mn_Fit calculation of means and sigmas should be used. SYMBOL Sets the symbol number. TEXT Turns on or off showing fit information on the screen. THICKNESS Changes the line thickness for all or part of a picture. TICKS Sets the number of ticks and where to put them. TIME Sets the time mode for storing data and the reference time. TITLE Sets the user title or changes the title position or size for a histogram. TKTCL Turns on/off TK/TCL interface. TSIZE Sets the title size. USIZE Sets the size for printing the fit results. WAIT_CR Turns on or off waiting for a `' before the next picture. WINDOW Sets up windowing or changes the window for a particular plot. NO_WINDOW Turns off windowing. WORKING_DIR Sets the current working directory for files. Parameters specific to an axis. The commands `FRAME', `TICKS', `SCALE' and `LABEL|AXIS' can either be preceded by the axis name `X', `Y' or `Z' or followed by the postion on the picture that they refer to `ALL', `LEFT', `RIGHT', `BOTTOM', `TOP' or `VERTICAL'. The other commands must be preceded by the axis name: AXIS Sets axis labelling text and position, size and angle. GRID Turns on or off a grid. LABEL Sets axis labelling text and position, size and angle. LIMITS Sets the lower and upper plotting limits for axis. MARGIN Sets size of lefthand or lower margin. MODE Sets mode to draw scale, `Real', `Integer', `Log', or `Time'. NULL Turns on or off drawing a line at `x=0' or `y=0'. OPT_ZERO Turns on or off having 0 as the lower scale limit for entries. PSIZE Sets the overall size of the picture. SCALE Sets variables for scale. SIZE Sets the histogram size. TICKS Sets number of ticks. WMARGIN Changes the margin inside a window. WSIZE Changes the size of a plot inside a window. ZERO Turns on or off drawing a line at `x=0' or `y=0'. 2 ABORT Syntax: SET ABORT ON|OFF (default = ON) Turns on or off the aborting of macros when an error occurs. The default behaviour is to ask if the macro or defined command should be aborted. If this option is turned off the macro will continue whether an error occurs or not. 2 ALIAS Syntax: SET ALAIS ON|OFF (default = ON) Turns on or off alias translation on the command line. See HELP ALIAS for full details on aliases. 2 AUTOFETCH Syntax: SET AUTOFETCH ON|OFF (default = ON) Automatically refetches Ntuples when they are projected or scanned. This means you are sure that everything is setup OK before the operation on the Ntuple. However for very big Ntuples, even though they have been made with the disk option, this can take a long time. If you are sure you know what you are doing you can turn this option off, but you must be sure not to change the HBOOK file or current directory after you have fetched the Ntuple. With this option turned on, if you try to plot a histogram that does not exist, Mn_Fit will try to fetch it from an open HBOOK RZ input file. 2 AUTOSCALE Syntax: SET AUTOSCALE ON|OFF (default = ON) Enables automatic rescaling of text sizes, if they are set to their default values, when windowing. By default the sizes are reduced by a factor of 2/3 of the number of windows in the x direction. This is sometimes too much, especially when preparing a plot for a publication. 2 AUTOSWITCH Syntax: SET AUTOSWITCH ON|OFF (default = ON) Enables automatic switching between Tektronix plotting and alphanumeric mode. If your screen clears when you switch modes, you should set this option off. Also if you are running Versaterm with 2 windows on top of one another, this option should probably be `OFF'. 2 AUTOTRIM Syntax: SET AUTOTRIM ON|OFF (default = ON) Enables automatic dropping of the last scale value when windowing with 0 spacing between the plots. 2 AXIS Syntax: SET X|Y AXIS text x y size angle option font or SET AXIS X|Y text... or SET AXIS ALL|BOTTOM|TOP|LEFT|RIGHT|VERTICAL ON|OFF|PLOT|PAGE where: text is the axis label x,y are its position relative to the centre of the axis size is the size of the text angle is the angle with respect to the horizontal option can be LEFT = left adjusted to x,y CENTRE = centred (default) RIGHT = right adjusted font is the font to use for the text Alias for `SET LABEL'. See HELP SET LABEL for more details. 2 BACKGROUND Syntax: SET BACKGROUND nfun1 [nfun2...] Specifies which of the functions you have defined should be considered as background when you do a background subtraction. `nfun1 = 0' means that they are all background. When you add a new function, it is defined to be signal by default. 2 BIN Syntax: SET BIN SCALE|OFFSET value where: value is the scale factor or offset Sets a scale factor or an offset for each bin. This command works only for 1-D histograms when they are plotted as such, i.e. symbols 1->10. The command is useful if you want to show each bin of a binned histogram, or have several histograms with the same binning that you want to compare next to each other. If you want to shift the points of a histogram you can also use `XSCALE' and `XSHIFT' commands, but these permanently modify the histogram. 2 BOX Syntax: SET BOX ON|OFF Default: OFF Turns on or off drawing a box around the plot. 2 BREAK Syntax: SET BREAK ON|OFF Default: ON Turns on or off the condition handler. 2 CHARACTER Syntax: SET CHARACTER COMMENT|CONTINUATION char where: char is the comment or continuation character Default: Comment is '!', continuation is '-' Sets the comment or continuation line characters. The defaults are the same as in VMS DCL: '!' for comments and '-' for continuation lines. Command lines in Mn_Fit can have a maximum of 255 characters. You should usually include the character in quotes to avoid it being interpreted as a comment character, which would mean that it would be ignored. 3 Examples !\begin{enumerate} !\item !^ Example 1: Set the comment character and continuation line character to be the same as Unix: SET CHARACTER COMMENT '#' SET CHARACTER CON '\' !\end{enumerate} 2 COLOR Syntax: SET COLOR [item] color|ON|OFF|DEFAULT or: SET COLOR REPRESENTATION index red green blue name where: item is the name of what you want to change color is the name or number of the color you want name is the (optional) name for the colour Exactly the same as `SET COLOUR' for Americans! 2 COLOUR Syntax: SET COLOUR [item] colour|ON|OFF|DEFAULT or: SET COLOUR REPRESENTATION index red green blue name where: item is the name of what you want to change colour is the name or number of the colour you want name is the (optional) name for the colour Changes the colour of the lines and/or text on a picture (only works in HIGZ version). To change the colour a particular plot, precede the command with `SET PLOT id [&idb]'. You can also turn on or off the use of colour with the command `SET COLOUR ON|OFF'. This is useful to convert a colour macro into a black and white one for including figures in a paper. The default colour map is that of HIGZ: 0 = White (Background) 4 = Blue 1 = Black (Foreground) 5 = Yellow 2 = Red 6 = Magenta 3 = Green 7 = Cyan If you omit the item, the colour of all items will be changed, with the exception of the background. The following items are valid: FRAME TICK SCALE LABEL HEADER TITLE SYMBOL HATCH PATTERN ZERO_LINE COMMENT FIT BACKGROUND REPRESENTATION Note that `SET COLOUR 0' sets colours to default (i.e. black) while `SET COLOUR WHITE' will set the colour to the background colour. The command `SET COLOUR REPRESENTATION index red green blue name' changes the colour representation for that index. This enables you to customize your colour indices if you wish. `index' is the colour index, `red, green, blue' are the fractions of red, green and blue for that index. They must be between 0 and 1. If the index is larger than 7 then you must also give a name. For lower indices, you can give a name. The name MUST be a single word. Note that the `REPRESENTATION' command may only change the colours for the currently active output device, i.e. the screen or the file. If this is the case, then to change things for both (assuming you are using a X display and a Postscript file) you have to give the commands: capture display set col rep 1 0.3 0.4 0.5 cap post set col rep 1 0.3 0.4 0.5 capture display You can define up to a total of 20 colours. The colour indices should be continuous. To help you get started with your own definitions, the colour fractions for the default HIGZ colour scheme are: Index Colour Red Green Blue 0 Background (white) 1.0 1.0 1.0 1 Foreground (black) 0.0 0.0 0.0 2 Red 1.0 0.0 0.0 3 Green 0.0 1.0 0.0 4 Dark blue 0.0 0.0 1.0 5 Yellow 1.0 1.0 0.0 6 Magenta 1.0 0.0 1.0 7 Cyan 0.0 1.0 1.0 Note that the `SET COLOUR DEFAULT' command now sets all colours back to the HIGZ colour map. This has changed with Mn_Fit version 4.07. For earlier version the command `SET COLOUR ON' also reset the colour map. 2 DBASE Syntax: SET DBASE YEAR|LIMITS Sets the database year to access or the limits on the values that are included in calculating the averages for `DATABASE DB_HISTORY'. 2 DEBUG Syntax: SET DEBUG ON|OFF level where: level is a number for the debug level Defaults: OFF, level=0 Turns on or off a logical `QDEBUG' and sets the debug level. These variables are available in COMIS functions in the common block: LOGICAL QDEBUG COMMON/MNDBG/QDEBUG,NDEBUG This is very useful for debugging COMIS functions, meaning you can interactively change the amount of printout you get. It can equally well be used in user functions. Print levels >100 are reserved for future Mn_Fit debug output. Although not used much at the moment, it is a useful debugging tool for me. 2 DEFAULT Syntax: SET DEFAULT or SET PLOT id [&idb] DEFAULT If you do not precede the command with `PLOT', all plot parameters are set back to their default values. If you precede command with `PLOT', it is equivalent to `SET HIST' (see HELP SET HISTOGRAM for more details), and fills registers 121-199 as well as 231-257 with information on the histogram and defines the default plot for the `DEPOSIT' command. See HELP Numbers for a list of what is in the registers. 2 DIRECTORY Syntax: SET DIRECTORY dirname where dirname is the directory name Sets the current HBOOK directory name to `dirname'. Note that the HCDIR command is only executed when a `FETCH', `LDIR', `ZDIR' or `SHOW DIR' command is executed. This enables you to `SET' the directory you want to fetch from, and the secondary identifier you want to give the plots, before fetching them. However, this means that successive `SET DIR' commands without a `FETCH' etc. in between will only remember the last name. Note that the directory name should not be preceded by a '/'. However '//' is allowed so you can go to the top level. You can use either !^ '\' or '..' to go up a directory level. !$\backslash$ or '..' to go up a directory level. Note that the Mn_Fit HBOOK top level file directory name is `//MN_HBIN'. 2 DISPLAY Syntax: SET DISPLAY MODE|X|Y|Z [parameter] You can give this command to change parameters in the `DISPLAY' of the fit results or to change what is displayed. If you give a `X Y or Z' or hit `' after the `SET DISPLAY' command then any subsequent parameters you change will apply to the `DISPLAY' only. The command `SET DISPLAY MODE' changes the display form for the fit results. 3 MODE Syntax: SET DISPLAY MODE nmode where: nmode = 1 means show the fit and the function = 2 means show the background subtracted fit = 3 means show both -ve means divide by the background also before making the background subtracted plot You can show the standard plot, background subtracted, or both. For the background subtracted plot, you can do a simple subtraction or divide by the background also. You must specify which functions are the background using the `SET BACKGROUND' command. 2 DSIZE Syntax: SET DSIZE size (default = 1.0) Controls the scale factor for the dot size. This command only works in the HIGZ version of Mn_Fit. The effect is only usually seen when you make a Postscript version of the figure. 2 DUMP Syntax: SET DUMP SCREEN|TTY|>|LPT|CLOSE SET DUMP FILE filename or SET DUMP > filename Change the output unit for the `DISPLAY, FIT_INFO, DUMP, HIST DUMP, INDEX' and `MESSAGE' commands. If you specify `LPT' or `>' the output will be written to the file `mn_dump.dat'. To close the file, specify `CLOSE'. To change the filename from `mn_dump.dat', use the command `SET DUMP FILE filename'. You then still have to give the command `SET DUMP LPT' to change the output routing to that file. Alternatively you can use the syntax `SET DUMP > filename' to both reroute the output and start sending it to a file. If a file is already open you must close it first using `SET DUMP CLOSE', otherwise the output will just be appended to the open file. 2 ECHO Syntax: SET ECHO ON|OFF (default = ON) Turns on or off echoing of commands read from a file. 2 EDIT Syntax: SET EDIT command Changes the command used to invoke the editor. The default editor is `EDIT/TPU' on VMS, `dm' on the Apollo and `emacs' on Unix. If the environment variable `EDITOR' exists (Unix), this will be used as the default edit command. 2 ENDSET Syntax: ENDSET Gets you back to the `MN_CMD>' or `MINUIT>' level. You must use `ENDSET' in command files to exit `SET' if you did not give the parameter on the same line as the `SET' command. 2 ERR_ZERO Syntax: SET ERR_ZERO ON|OFF (default = ON) Sets the error on zero points to 1 when a plot is fit or one of the commands `ADD, SUBTRACT, MULTIPLY, DIVIDE, EFFICIENCY, AVERAGE' is applied to the plot. 2 EXCLUSIONS Syntax: SET EXCLUSIONS ON|OFF (default = ON) Turns on or off showing the excluded parts of plots when drawing in a function. 2 EXIT Syntax: EXIT Gets you back to the `MN_CMD>' or `MINUIT>' level. Use `ENDSET' rather than `EXIT' to avoid confusion and accidental exiting from Mn_Fit. 2 FIT Syntax: SET FIT option where: option is the fit option Sets options for fitting. 3 DEFAULT Syntax: SET FIT DEFAULT Sets all fitting and function options associated with fitting to their default values. 3 AREA Syntax: SET FIT AREA ON|OFF Uses Simpson integration to calculate the area of fragmentation functions and dipion invariant mass functions. Slows down the fitting, but means that the `AREA' is meaningful. 3 COMMANDS Syntax: SET FIT COMMANDS command1 command2 ... END where: comand1, comand2, ... are a list of commands Defines the list of commands to be used when using the quick fitting option, e.g. `FIT/GAUSS', where the functions to use are included in the `FIT' command. The default commands are `MINIMIZE', `DISPLAY'. 3 CONVOLUTE Syntax: SET FIT CONVOLUTE ON|OFF [width ninterval nsigma] where: width is the width of the Gaussian ninterval is the number of intervals to integrate over nsigma is the number of sigmas of the Gaussian Defaults: width = 1, ninterval = 100, nsigma = 3 WARNING: This command's results should be carefully checked to ensure that they are correct. Its syntax could also change in response to suggestions. Convolutes the fitting function(s) with a Gaussian resolution function. Useful for things such as lifetime fits, where you want to include the experimental resolution. You should normally set the Gaussian width. Increasing the number of intervals slows down the fitting, but gives a more precise result. The same applies to the number of sigma. At present it is not worth going beyond 6 sigma, as I set a Gaussian to 0 there. 3 INTEGRATE Syntax: SET FIT INTEGRATE ON|OFF [ninterval] where ninterval is the number of intervals in the integration. Defaults: ninterval = 100 Specifies whether the function is integrated over each bin of the plot you are fitting. The integration uses Simpson's approximation and the number of intervals must be even. 2 FONT Syntax: SET FONT [item] nfont where: item is the name of what you want to change nfont is the font number in the form spfff s is the sign of the font (+|-) p is the precision fff is the font number Defaults: nfont = -1004 Sets the font used for text on a picture. To change the font of an item in a particular plot, precede the command with `SET PLOT id [&idb]'. If you omit the item, the font of all items will be changed. The following items are valid: HEADER TITLE COMMENT SYMBOL SCALE LABEL Font 2000 uses the IGTEXT routine (see HELP TEXT for details). The other fonts available depend on the workstation type. HIGZ also has a number of device independent fonts. See the HIGZ manual for more details. In addition all the other fonts listed in the PAW manual (section 8.10 - text fonts) are available. e.g. `SET FONT -1004' will choose font -4 (Helvetica) with precision 1. Note that if you change the font for the `SCALE' or `LABEL' it will be changed for all axes. To change it for a particular axis use the `SET X|Y|Z SCALE' or `SET X|Y|Z LABEL' commands. If the `SET SCALE' or `SET LABEL' commands are not for a particular plot then the font will be set to that specified in the `SET FONT' command. 2 FOOTER Syntax: SET FOOTER ON|OFF|USER [text] (default = OFF) Controls whether to print the footer that shows the date and time that a picture was made or user specified text. For user specified footer give the text that should be in the footer. Use the command `SET FSIZE' to change the size of the text. In a user specified footer the following strings have special meaning: @file Filename for the hardcopy @date The date @time The time @| Splits the text at this point, putting the text before at the bottom left-hand corner of the picture and the text after at the bottom right-hand corner. For example to get the date and time at the bottom left-hand corner and the hardcopy filename at the bottom right-hand corner give the command: SET FOOTER USER 'Mn_Fit @date @time@|@file' 2 FRAME Syntax: SET FRAME ALL|BOTTOM|TOP|LEFT|RIGHT|VERTICAL ON|OFF Defaults: ALL ON Sets up where you want a frame around the plot. Default is to draw a frame all around it. If you want open axes (i.e. only the x and y axes drawn), give the commands `SET FRAME TOP OFF RIGHT OFF'. `VERTICAL' is the z-axis in `LEGO' and `SURFACE' plots. To set or change the frame for a particular plot, precede the command with `SET PLOT id [&idb]'. 2 FSIZE Syntax: SET FSIZE size (default = 0.2cm) Controls the size of the footer text if the footer is turned on (command `SET FOOTER'). 2 FUNCTION Syntax: SET FUNCTION option where: option is the function option Set options used in calculating functions. Use the `SET BACKGROUND' and `SET SIGNAL' commands to specify which functions are background and which are signal for the different `DISPLAY' modes. 3 BIN_WIDTH Syntax: SET FUNCTION BIN_WIDTH ON|OFF Specifies whether the bin width should be used when calculating the value of a function. This now applies to all functions, as they all include the bin width in their calculation. 3 POINTS Syntax: SET FUNCTION POINTS npnt where: npnt is the number of points Default: npnt=500 Specifies how many points to use when drawing a function. 3 INTEGRATE Syntax: SET FUNCTION INTEGRATE nint where: nint is the number of intervals Default: nint=100 Specifies how many intervals will be used when integrating a function. This is used in the `INTEGRATE' command and the expression `FINT'. 2 GRID Syntax: SET X|Y GRID ON|OFF [option nsymb] where: option use which ticks to draw the grid on (BIG or ALL) nsymb is the symbol number for the grid Defaults: OFF BIG 3 except for z-axis: ON BIG 3 Turns on or off drawing a grid on the plot and specifies which ticks to put the grid on (`ALL' or `BIG') and the symbol to use for it. The default is that the grid will be drawn at the big tick positions. The grid in each direction can be turned on or off independently. Turning off the frame means that no grid will be drawn. To change the grid for a particular plot, precede the command with `SET PLOT id [&idb]'. 2 GSIZE Syntax: SET GSIZE value (default = 0.4cm) Changes the size of the global and/or user title. To change the title size for a particular plot, precede the command with `SET PLOT id [&idb]'. You can also use the `SET TITLE GPOSITION' command to do this. 2 HARDCOPY Syntax: SET HARDCOPY filename where filename is the name of the file you want hardcopy output in Defaults: PLOT.PS, PLOT.META etc. Changes the name of the file written to by the `HARDCOPY' command or if you `CAPTURE' a hardcopy device. 2 HATCH Syntax: SET HATCH nhatch where: nhatch is the hatch number Sets the hatch number to use for plots. WARNING: This command only works with the HIGZ version of Mn_Fit, and the hatchings available are device dependent. For the Vaxstation and Postscript, numbers -1 to -11 are available; the Vaxstation has more, but they will be plotted as -1 if you make a hardcopy. GKSGRAL has a number of device independent hatchings numbers -101 to -124. See the HIGZ or CERN graphics manuals for more details. For all versions using HIGZ, the HIGZ portable hatches are available. These use an index coded using 3 digits `ijk': i: Specifies the distance between each hatch; j: Specifies the angle between 90 and 180 degrees; k: Specifies the angle between 0 and 90 degrees. The numbers are coded according to the table below: i j k 0 180 degrees 0 0 degrees 1 0.75mm 1 170 degrees 1 10 degrees 2 1.50mm 2 160 degrees 2 20 degrees 3 2.25mm 3 150 degrees 3 30 degrees 4 3.00mm 4 135 degrees 4 45 degrees 5 3.75mm 5 Not drawn 5 Not drawn 6 4.50mm 6 120 degrees 6 60 degrees 7 5.25mm 7 110 degrees 7 70 degrees 8 6.00mm 8 100 degrees 8 80 degrees 9 6.75mm 9 90 degrees 9 90 degrees Note that the space between hatch lines is visible. If you overlay a plot with a hatch, then the one below it can be seen. The area under a pattern is not visible. 2 HEADER Syntax: SET HEADER ON|OFF|BRIEF|DEFAULT|COMPLETE (default = DEFAULT) Controls whether to print the histogram numbers being plotted on the picture. The `OFF' mode turns off the text, `BRIEF' shows the identifiers and the symbols; `DEFAULT' also shows the area, mean and r.m.s. for the plot; `COMPLETE' also show the number of underflows and overflows. Alias for `SET IDSHOW'. 2 HIGZ Syntax: SET HIGZ name value or: SET HIGZ TABLE option val1 [val2...] where: name is the IGSET parameter name value is its value option is the IGTABL option val1,val2 are IGTABL parameters Changes the HIGZ IGSET parameters or sets the plotting mode and parameters for the 2-dimensional histogram plotting routine IGTABL. The command `SET HIGZ TABLE' is an alias for `SET IGTABLE'. See HELP SET IGTABLE for more details. 3 TABLE Syntax: SET HIGZ TABLE option val1 [val2...] Alias for `SET IGTABLE'. See HELP SET IGTABLE and 2DIM for more details. 2 HISTOGRAM Syntax: SET HISTOGRAM id [&idb] where: id is the histogram identifier idb is the (optional) secondary identifier Defines a default histogram for the `DEPOSIT' command, and fills registers 121 - 199 as well as 231 - 257 with information on the histogram. See HELP Numbers for a list of the variables stored. 2 IDB Syntax: SET IDB n (default = 0) Changes the default secondary identifier. All histograms subsequently fetched will have this secondary identifier. In addition if you omit the secondary identifier anytime you are asked for a plot number, the default will be used. Alias for `SET SECONDARY_ID'. 2 IDSHOW Syntax: SET IDSHOW ON|OFF|BRIEF|DEFAULT|COMPLETE (default = DEFAULT) Controls whether to print the histogram numbers being plotted on the picture. The `OFF' mode turns off the text, `BRIEF' shows the identifiers and the symbols; `DEFAULT' also shows the area, mean and r.m.s. for the plot; `COMPLETE' also show the number of underflows and overflows. Alias for `SET HEADER'. 2 IDSIZE Syntax: SET IDSIZE size (default = 0.3cm) Controls the size of the histogram numbers if the `IDSHOW' option is turned on. 2 IGARC Syntax: SET IGARC ON|OFF (default = ON) Uses the HIGZ IGARC routine for drawing arcs and circles. This routine appears to have a bug and sometimes ignores what you set for the line thickness and colour. 2 IGTABLE Syntax: SET IGTABLE option [parameters] where: option is the option for drawing the table parameters are the associated parameters Specifies how to draw a 2-D histogram. All `HIGZ IGTABL' modes are available: `SCATTER, BOX, ARROW, CONTOUR, COLOUR, TEXT, CHAR,' `LEGO, LEGOC1, LEGOC2, SURF, SURFC1, SURFC2, SURFCONT, SURFSHADE' with extra options for the coordinate system for `LEGO' and `SURFACE' plots: `POL, CYL, SPH, PSD'. Note that the extra `LEGO' and `SURFACE' options cannot be abbreviated. The parameters such as the minimum and maximum bin numbers and the lower and upper limits on the `z' axis are set using the normal `SET X|Y|Z LIMIT' commands. The parameters you should give here are the lego or surface plots viewing angles, the number of contours, the contour distinguishing mode and the `z' values for the contours (if required). See HELP 2DIM for a fuller description of the options and parmaeters. Even more details can be found in the HIGZ manual !~\cite{higz}. Certain features are not in the manual! For example you can specify the colours of coloured lego and surface plots by giving the numbers of the colours as parameters after the viewing angles. 2 LABEL Syntax: SET X|Y LABEL text x y size angle option font or SET LABEL X|Y text... or SET LABEL ALL|BOTTOM|TOP|LEFT|RIGHT|VERTICAL ON|OFF|PLOT|PAGE where: text is the axis label x,y are its position relative to the centre of the axis size is the size of the text angle is the angle with respect to the horizontal option can be LEFT = left adjusted to x,y CENTRE = centred (default) RIGHT = right adjusted font is the font to use for the text Changes or adds a label to an axis. You will be prompted for the text and the position of the label. If you want to specify on which axes the labels should be written, use the `SET LABEL ALL|BOTTOM|TOP' etc. command. `VERTICAL' is the z-axis in `LEGO' and `SURFACE' plots. If you do not give a font, it will be that chosen with the `SET FONT' command (default = 0). To set or change the label for a particular plot, precede the command with `SET PLOT id [&idb]'. The mode `PLOT' will put a label on each plot, whereas `PAGE' will put one label on each page, centering it with respect to the overall plot size. Using `option' left puts the label aligned with the left-hand or bottom edge of the plot and left adjusted. With `option' right it is aligned with the right-hand or top edge and right adjusted (as in the PAW default). For the lego plots axes the offsets for the x and y axes are flipped to match the scale offsets. In addition the x and y offsets for the y-axis are flipped, so that by default the label will be put at the x offset below the centre of the axis. 2 LIMITS Syntax: SET X|Y|Z LIMIT low high (default = 0 0) where: low is the lower limit on the axis scale and high is the upper limit on the axis scale Specifies the lower and upper limits for the scale. To reset the limits back to default, use the command `SET X|Y|Z LIMIT 0 0'. To change the limits for a particular plot, precede the command with `SET PLOT id [&idb]'. Note that when you start a fit all limits get reset. This means that you have to give the command `SET X|Y|Z MODE LOG ...' or `SET X|Y|Z LIMIT ...' if you want to get the limits that you were using again. In addition when you switch to or from a log scale (`SET X|Y|Z MODE LOG') the appropriate limits also get reset, in order to avoid trying to calculate the log of 0. If you want to specify date and/or time limits you must first set the plotting mode to `DATE' or `TIME' and then you can give the limits in the form `YYMMDD.HHMMSS', `YYMMDD' or `HH:MM'. If you want to set or change the limits for fit parameters use the command `MODIFY' when inside MINUIT, or `DEPOSIT LOLIMn(m)' and `DEPOSIT HILIMn(m)'. See HELP MINUIT MODIFY and HELP DEPOSIT for more details. 2 LOG Syntax: SET LOG ON|OFF Default: OFF Turns on or off writing all commands typed in at the terminal to a log file. The file is called `mn_fit.log'. The commmand for a log scale on a plot is `SET X|Y|Z MODE LOG'. 2 LSIZE Syntax: SET LSIZE size (default = 0.01) Sets the segment size for drawing lines - calls IGSET('BASL',size). The segment size is in Normalized Device Coordinates (NDC), which means that effectively the size is a fraction of the picture size. 2 MANUAL Syntax: SET MANUAL ON|OFF Default: OFF Turns on or off the special logfile syntax for making the Mn_Fit manual. 2 MARGIN Syntax: SET X|Y MARGIN size (default = 3.0/2.0 cm) Sets the offset of the plot from the bottom left-hand corner of the picture. 2 MODE Syntax: SET X|Y|Z MODE REAL|INTEGER|LOG|DATE|TIME [low ndecade] Default: INTEGER Changes the way the scale is drawn on the x or y axis. For a log scale you can give the lower limit and the number of decades that you want to plot. The following modes are available: REAL = real numbers INTEGER = integer numbers LOG = log scale. You can give the lower limit and the number of decades you want to plot. DATE = day of month, with month also printed. TIME = time of day. To change the mode for a particular plot, precede the command with `SET PLOT id [&idb]'. For a log scale with automatic scaling the nearest decade above and below the calculated plot limits is used. If the lower limit is thus zero, then 3 decades are plotted. Note that when you start a fit all limits get reset. This means that you have to give the command `SET MODE LOG ...' or `SET X|Y|Z LIMIT ...' if you want to get the limits that you were using again. In addition when you switch to or from a log scale (`SET X|Y|Z MODE LOG') the appropriate limits also get reset, in order to avoid trying to calculate the log of 0. `SET Z MODE LOG' works for lego and surface plots and when the area of the symbol is proportional to the number of entries. If you want to specify date and/or time limits you must first set the plotting mode and then you can give the limits in the form `YYMMDD.HHMMSS' or `HH:MM'. 2 MOUSE Syntax: SET MOUSE ON|OFF Default: OFF Turns on or off using the mouse to specify the position of comments/keys and items that you draw. See HELP COMMENT and HELP KEY for more details. There is also a general section on usage of the mouse at the beginning of the Mn_Fit manual. 2 NEXT_WINDOW Syntax: SET NEXT_WINDOW nx ny where: nx is the window number in the x direction ny is the window number in the y direction Changes the window number for the next plot you make. If you select `1 1' the screen will be cleared before the plot is drawn. This can be overridden by using the `PLOT/NOCLEAR' command. 2 NORMALIZE Syntax: SET NORMALIZE ON|OFF Only valid in `MN_CMD>'. Turns on or off an overall normalization factor for the function(s) you are fitting with. The parameter will be called `NORM00' and will be the first parameter. This is useful if you want to fit to functions of the form: NORM00 * (HIST1 + ALPHA*HIST2) where `HIST1' and `HIST2' are 2 histograms and `ALPHA' is the relative contribution of each. 2 NTUPLE Syntax: SET NTUPLE NAME|PLOT|VARIABLE Commands for setting options for Ntuples. `PLOT' specifies the Ntuple variables to be plotted with the `PLOT/NTUPLE' command. `VARIABLE' specifies the extra CWN variables that have to be fetched. `NAME' gives the names of Ntuple variables that are used in subsequent `HISTOGRAM BOOK' commands. 3 NAME Syntax: SET NTUPLE NAME var1,var2,... where var1 is an Ntuple variable name Gives a list of variable names that are used for subsequent `HISTOGRAM BOOK' commands for Ntuples. 3 PLOT Syntax: SET NTUPLE PLOT id[&idb] X|Y|Z var1 [X|Y|Z var2 [...]] where: id is the Ntuple identifier (0 = all Ntuples) idb is the (optional) Ntuple secondary identifier var1 is the Ntuple variable name to be associated with the specified plot axis Specifies which Ntuple variables will be plotted on which axes when using `PLOT/NTUPLE' command. As usual the Ntuple variable can be specified as a name or a number. 3 VARIABLE Syntax: SET NTUPLE VARIABLE var1,var2,... where var1 is an Ntuple variable name or `$CLEAR' Gives a list of CWN variable names that should be fetched when a projection of a CWN is made. This command is used to list the variables that need to be accessed in a COMIS function used to make cuts on a CWN. 2 NULL Syntax: SET X|Y NULL ON|OFF nsymb (default = ON) where: nsymb is the symbol number for the line (default = -1) Alias for `SET ZERO'. See HELP SET ZERO for more details. 2 OPT_ZERO Syntax: SET X|Y|Z OPT_ZERO ON|OFF (default = ON) Turns on or off having 0 as the lower limit for plotting the number of entries in a plot. For 1-dimensional histograms use `SET Y OPT_ZERO' and `SET Z OPT_ZERO' for lego and surface plots of 2-dimensional histograms. 2 ORDER Syntax: SET ORDER X|Y|DX|DY|DNX|DNY|DPX|DPY|DUMMY|DATE... Specifies the order of the variables in a file to be read in with the `DAT_FETCH' or `READ DATA' commands. The name `DUMMY' can be used if a variable is not to be read in. The default order is `X Y DNX DNY DPX DPY'. `N' signifies the negative error and `P' the positive error if you have asymmetric error bars. If a variable is time, the following names and formats are supported: DATE_TIM YYMMDD HHMMSS DATE YYMMDD TIME HHMMSS DATE_MIN YYMMDD HHMM TIME_MIN HHMM VAXTIME Char*23 Vaxtime DD-MMM-YYYY HH:MM:SS.SS The old variable names of `DXN, DYN, DXP' and `DYP' are still recognized, but are not recommended. 3 Examples !\begin{enumerate} !\item !^ Example 1: If I have a series of numbers: 1.0 3.0 0.8 which are `X,Y,DY' the command is: SET ORDER X,Y,DY !\item !^ Example 2: If I have a series of numbers: 1.0 5.0 8.0 10.0 0.3 0.5 1.0 1.2 where the first 2 are `x' and `y' and their asymmetric errors are in variables 5,6,7,8 the command is: SET ORDER X Y DUMMY DUMMY DNX DPX DNY DPY !\end{enumerate} 2 ORTHOGONAL Syntax: SET ORTHOGONAL xlo xhi where: xlo is the lower orthogonality limit xhi is the upper limit Sets the orthogonality limits for Chebyshevs and Legendres. If the limits are not set, they will be taken as the lower and upper limits on the plot(s) you are fitting. To restore the automatic setting of limits, `SET ORTHOGONAL 0 0'. 2 PAGER Syntax: SET PAGER command Changes the command used to invoke the pager. The default pager is `TYPE/PAGE' on VMS, `dm' on the Apollo and `more -e' on Unix. If the environment variable `PAGER' exists (Unix), this will be used as the default edit command. The pager is used with the `HELP' command on Unix machines and the `DUMP' command. !^ If you give the command `SET PAGER ''', !If you give the command `SET PAGER '\,'', then no pager will be invoked. 2 PAPER Syntax: SET PAPER type where: type is the paper type A4,A3,A2,A1,A0,Letter,Legal or Ledger Sets the paper type for future `HARDCOPY' commands. This command must be given before you open the output file: set paper letter hard post close The command also works with the `CAPTURE' command. Plots will be centred on the paper. 2 PARAMETER Syntax: SET PARAMETER detnam values where: detnam is the detector name (ECAL, FBGO, FWCH, FTD or TRD) values are the new values (see subtopics for their meaning) Sets parameters for the L3 or ZEUS detector displays. Use the syntax `SET PARAMETER detnam' followed by `' to see the current values. As usual to keep the current value of a parameter give an `='. 3 ECAL Syntax: SET PARAMETER ECAL mode xlo xhi ylo yhi [nres] where: mode selects the display mode xlo minimum box|crystal number in phi xhi maximum box|crystal number in phi ylo minimum crystal number in theta yhi maximum crystal number in theta symbol is the symbol to use nres is the number of subdivisions for the BGEO display There are 2 ECAL displays available. The original is a grid of the BGO barrel written by Anne Heavey. A modified version of Vinod Gupta's BGEO package is also available. This shows either the +Z or -Z side of the BGO in the form of concentric circles. Anne Heavey's version is described in the `Barrel' subtopic. The following describes the BGEO display mode. The command `SET PARAMETER' must precede the command `DISPLAY ECAL id[&idb]'. The mode for display is given in the form `+/-kji' where: k = 1 means show the -Z or +Z detector using BGEO. It needs a 160x41 2-D histogram or a 160x82 histogram or an Ntuple. j = 0 means length of side proportional to entries = 1 means area proportional to entries = 2 means use a log scale with length of side proportional to the log of the number of entries i = 0 means use line thickness - quicker, but not visible on all screens = 1 means use filled areas = 2 means use a symbol for each crystal with an entry. Lower and upper limits in theta can be set for the BGEO display, but the only allowed combinations are: -41 -1 (-z) or 1 41 (+z) -41 -25 (-z endcap) or 25 41 (+z endcap) -24 -1 (-z barrel) or 1 24 (+z barrel) If you have a 2-D histogram with all the BGO detector, i.e. 160x82, you must give the theta range to show. For an Ntuple you must also give the theta range. If the data are in the form of a 2-D histogram it should always have 160 bins for the x-axis. If the crystal number in theta is `it', the y-axis should be booked and filled with one of the following ranges: 41 bins 0.0 -> 41.0 Fill with float(iabs(it))-0.5 82 bins -41.0 -> 41.0 Fill with sign(float(iabs(it))-0.5,it) 83 bins -41.0 -> 42.0 Fill with float(it)+0.5 84 bins -42.0 -> 42.0 Fill with sign(float(iabs(it))+0.5,it) In the case of 83 bins, the 42nd bin will be ignored. In the case of 84 bins the 42nd and 43rd bin will be ignored. If the data is in the form of an Ntuple, the Ntuple must have 2 or 3 variables in the order phi, theta (energy). If your Ntuple has more variables or a different order use the `NTUPLE PROJECT' command to get the right number and order. The BGO detector is divided into 16 boxes in phi, and you can select which box(es) you want to display. Box 1 starts at crystal phi=2 in the barrel and phi=1 in the endcap. A positive number for the mode means averages will be calculated for the display. A negative number means totals will be calculated. For modes i=0,1 a colour code is used to distinguish the value of each crystal. It is evaluated as a fraction of the allowed range: 0.00 -> 0.25 Black 0.25 -> 0.50 Blue 0.50 -> 0.75 Green 0.75 -> 1.00 Red The lower and upper limits can be set using the `SET Z LIMIT' command. For mode 2 a symbol is drawn for each crystal with an entry above the lower limit. The symbol size is set with the `SET SSIZE' command and the colour with the `SET COLOUR SYMBOL' command. The BGEO display can be combined with the ECAL database interface to plot database entries in a more useful form than just as histograms. The display also fills HBOOK histograms 98001-98016 for each readout box and 98100 with all the data in a 1-dimensional histogram. You can use the command `HB_MN_FIT' to copy these histograms into Mn_Fit memory and then plot them. For the BGEO display the following `SET' commands can be used to control the frame etc: SET FRAME BOTTOM ON|OFF Turns on/off drawing of the box boundaries SET FRAME LEFT ON|OFF Turns on/off drawing of the ring boundaries SET LABEL BOTTOM ON|OFF Turns on/off printing -Z or +Z label SET LABEL TOP ON|OFF Turns on/off printing of phi and theta numbers SET SCALE BOTTOM ON|OFF Turns on off mean or total values for each quadrant and all crytals SET SCALE LEFT ON|OFF Turns on/off mean or total values for each box The sizes of the text are 2/3 of the corresponding `LABEL' or `SCALE' sizes, except for the `-/+Z' label which is drawn with the title size. The thicknesses and colours of the lines or text are also set with the corresponding `SET COLOUR' or `SET THICKNESS' commands, except for the ring boundaries whose colour and thickness is set using the `SET COLOUR|THICKNESS ZERO_LINE' command. 4 Barrel Syntax: SET PARAMETER ECAL mode xlo xhi ylo yhi where: mode 10 displays a status histogram using a color scale 21-24 displays a 2-D histo using a color scale: 21 for energy 22 for ADC 23 for number of events 24 for temperature -2 displays a 2-D histo as a table with (real) values printed in the grid squares xlo minimum crystal number in phi that you choose to display xhi maximum crystal number in phi ylo minimum crystal number in theta yhi maximum crystal number in theta This mode is only able to display the barrel and because of that has mostly been superceded by the BGEO display. However some of the options are still not fully implemented in the BGEO display, e.g. the status display. For `mode = 10' there are specially filled 2-D histograms in `ECAL$HIST:ECAL0000.HFILE', directory: `ECAL/DETECTOR_STATUS'. For modes 2 and -2, 2-D histograms can be found in the directory `ECAL/DATA'. `xlo' and `xhi' (the phi values) should be between 1 and 160 inclusive, and `ylo' and `yhi' (the theta values) should be between -24 and -1, and 1 and 24. `xhi > xlo' and `yhi > ylo' are expected. The y region to be displayed may span the two regions, for example `ylo=-12, yhi=12' is acceptable. Entering 0 for any of the four last parameters yields the default value, which for `xlo' and `ylo' is the lowest crystal number for which the histogram was booked, and for `xhi' and `yhi' is the highest. 4 Examples !\begin{enumerate} !\item !^ Example 1: Get the -Z detector low energy pedestal widths and compare them with the previous entry in the database. Plot the difference in MeV (note the database stores the entries in uV and the conversion factor is 1 MeV = 50 uV): set idb 2 ! The first 2 zeros mean get all channels, the 3rd means get the ! data for now. database db_snap/noplot //dbec/electronics/beam/pedestals 0 0 0 d 102 zscale 98767 988767&12 0.02 set default set y psize 25 y size 21 wind 1 2 0 0 y wmarg 4 y wsize 17 endset set par ecal 111 disp ecal 98767&12 hb_mn_fit set y wmarg 0 set y wsize 4 plot 98100 !\end{enumerate} 3 FBGO Syntax: SET PAR FBGO mode side sector emin emax where: mode can be -3 -> 4 (default = 1) -5 Floating point numbers (value and error) (F7.3) -4 Integers (value and error) -3 Status (Integers -9 -> 9) -2 Floating point numbers (F7.3) -1 Integers 1 Traffic light -9 -> -1 red 0 -> 0 no colour 1 -> 7 red 8 -> 9 yellow 2 Energy colour scale 3 Status in colour 4 Trapezia with area proportional to energy (default scale is 0 -> 50) 5 Trapezia with area proportional to energy (default scale is 0 -> maximum number of entries) 6 Trapezia with area proportional to energy, not filled (default scale is 0 -> 50) 7 Trapezia with area proportional to energy, not filled (default scale is 0 -> maximum number of entries) 8 Trapezia with area proportional to energy Filled if > emin, not filled if < emin (default scale is 0 -> maximum number of entries) side Side to show, 0 means show -z and +z sides (default) 1 means -z 2 means +z sector sector number to show 0 means show all sectors (default) nnss means show nn sectors starting at sector ss emin is the minimum energy to show (default = 0) emax is the maximum energy (default = 50 - modes 4,6 = max # entries - others) Sets the parameters for the forward luminosity monitor display. The colour of the frame can be set with `SET COLOUR FRAME', that of the contents with `SET COLOUR SYMBOL', that of the title and `+Z, -Z' indicators with `SET COLOUR TITLE' and that of the sector numbers with `SET COLOUR SCALE'. The size of the `+Z, -Z' labels is controlled with the `SET TSIZE' command. The size of the sector numbers can be controlled with `SET USIZE', of the text with the contents with `SET SSIZE'. The font for the title is set with the `SET FONT TITLE nfont' command, that of the sector numbers with `SET FONT SCALE nfont'. This font is also used for the contents. The key colours and fonts are the same as those for `COMMENTS'. The line thickness can be set in the same way as the colours using the `SET THICKNESS' commands. The font used for the symbols can be set using the `SET SYMBOL FONT' command. The frame can be turned on or off using the `SET FRAME' command and the sector labels can be turned on or off using the `SET X SCALE' command. The format used for modes -2 and -5 can be controlled by using the number of digits and the number of decimal places in the `SET X SCALE' command. 3 FSIL Syntax: SET PAR FSIL mode side layer sector where: mode can be 1 side Side to show, 0 means show -z and +z sides 1 means -z 2 means +z layer is the layer number to show sector is the sector number to show 0 means show all sectors Defaults: 1 0 0 0 Sets the parameters for the forward luminosity monitor silicon strip display. The default is to show all wafers. Switching on and off of the frame etc. and also the colours, fonts and line thicknesses are controlled in a way very similar to the FBGO display. 3 FWCH Syntax: SET PAR FWCH mode side chamber strip emin emax where: mode can be -1 -> 4 (default = 1) ! -3 Status (Integers -9 -> 9) ! -2 Floating point numbers (F8.4) -1 Integers 1 Traffic light -9 -> -1 red 0 -> 0 no colour 1 -> 7 red 8 -> 9 yellow 2 Pulse height colour scale 4 Hatching scale side Side to show, 0 means show -z and +z sides 1 means -z 2 means +z chamber is the chamber number to show strip is the strip type to show 0 means show all strips 1 means r strips 2 means phi strips 3 means x strips 4 means y strips pmin is the minimum pulse height pmax is the maximum pulse height Defaults: 1 0 0 0 0.0 60.0 Sets the parameters for the forward luminosity monitor planar chamber display. The default is to show all 8 chambers and all strip types. Note that chambers 1 and 2 have strip types 3 and 4, and 3 and 4 have strip types 1 and 2. The colour code is blue, green, yellow, orange, red, where blue is below the limit set and red is above. Similarly hatching increases in intensity, blank means below limits and solid means above the limits. Note that modes -3,-2 and 3 have not yet been implemented. 3 FTD Syntax: SET PAR FTD mode chamber layer where: mode Viewing mode - the various parts can be combined Front view: 1 VC tracks 2 FTD segments 4 FTD LTEs Side view: 101 VC tracks 102 FTD segments 104 FTD LTEs 108 FTD hits 111 VC tracks + FTD hits 112 FTD segments + FTD hits 114 FTD LTEs + FTD hits chamber The chamber number 1,2,3 mean FTD1, FTD2, FTD3 4 means RTD layer is the layer number to show (not yet implemented) Defaults: 3 0 0 Sets the parameters for the ZEUS forward tracking chambers. The default is to show the extrapolated VC tracks and the FTD segments. It is also possible (but not yet implemented) to show the LTEs. The `mode' controls what is shown. A bit pattern is used: Bit 0: VC tracks 1: Segments 2: LTEs 3: Hits Thus mode 3 means show the VC tracks and the segments. If you specify `chamber 0' all chambers are shown in a 2x2 display (only front view). Otherwise only a single chamber is shown. You can use the `SET X|Y LIMIT' commands to show only part of the detector. However this only works if you are displaying a single chamber. The default limits are -100 to +100cm for the front view mode. The default limits for the side view: FTD x-axis y-axis( in cm) 1 0 to 140 -71.25 to 71.25 2 0 to 182.5 -91.25 to 91.25 3 0 to 217.5 -108.75 to 108.75 The colour of the frame can be set with `SET COLOUR FRAME' (only front view), that of the contents with `SET COLOUR SYMBOL', that of the title and detectors with `SET COLOUR TITLE'. The size of the `FTDn' labels is controlled with the `SET TSIZE' command, that of the symbols with `SET SSIZE'. The font for the title is set with the `SET FONT TITLE nfont' command. This font is also used for the contents. The key colours and fonts are the same as those for `COMMENTS'. The line thickness can be set in the same way as the colours using the `SET THICKNESS' commands. The frame can be turned on or off using the `SET FRAME' command. 3 TRD Syntax: SET PAR TRD mode chamber ancat where: mode Viewing mode - the various parts can be combined 1 Wires hit - XY view 2 Clusters - XY view 10 VC tracks 20 FTD segments chamber The chamber number 1,2,3,4 mean TRD1, TRD2, TRD3, TRD4 ancat 1 means show the anodes 2 means show the cathodes 3 means show both Defaults: 1 0 3 Sets the parameters for the ZEUS transition radiation detectors. The default is to show the hit wires. At the moment showing the clusters gives the same picture, as a side view has not yet been implemented. The extrapolated VC tracks and the FTD segments can also be shown, assuming that you have a combined Ntuple. In order to show the VC tracks and FTD segments use the same bit pattern as for the FTD display multiplied by 10: Bit 0: VC tracks 1: Segments 2: LTEs Thus mode 31 means show the VC tracks and the segments overlayed on the TRD. For the VC tracks the extrapolated hit positions in TRD1 and 2 are taken as a linear extrapolation between those in FTDs 1 and 2, while for TRDs 3 and 4 they are between FTDs 2 and 3. For the segments the slope and position of the segments are used to extrapolate linearly to the relevant TRD. (26.08.97 This is not yet the case, but is being worked on!). If you specify `chamber 0' all chambers are shown in a 2x2 display. Otherwise only a single chamber is shown. You can use the `SET X|Y LIMIT' commands to show only part of the detector. However this only works if you are displaying a single chamber. The default limits are -100 to +100cm. The colour of the frame can be set with `SET COLOUR FRAME', that of the contents with `SET COLOUR SYMBOL', that of the title and detectors with `SET COLOUR TITLE'. The size of the `TRDn' labels is controlled with the `SET TSIZE' command, that of the symbols with `SET SSIZE'. The font for the title is set with the `SET FONT TITLE nfont' command. This font is also used for the contents. The key colours and fonts are the same as those for `COMMENTS'. The line thickness can be set in the same way as the colours using the `SET THICKNESS' commands. The frame can be turned on or off using the `SET FRAME' command. 2 PATH Syntax: SET PATH [+]dir1, dir2 dir3, ... where dir are the directory names to be include in the path. Sets a list of directories that are used when trying to open existing files, e.g. macros. When trying to open a file Mn_Fit first tries the filename exactly as given with `~' and environment variable expansion. It then loops over the list of directories to see if the file exists in one of them. You must include the `/' at the end of the directory name on Unix machines. The default list of directories is: $HOME/mnf/, $MN_FIT/help/ (Unix) mn_fit_help: (VMS) This means that you can execute the demonstration macros etc. by just giving the command, e.g. `exec symbol', independent of the directory you are in. You can also collect useful macros in a single directory, e.g. `$HOME/mnf'. You can add directories to the current path by prefixing the first directory name with a `+'. In the case of files such as COMIS functions which may or may not exist already, a loop is first made over the `PATH'. If no existing file is found the working directory (`WDIRECTORY') is added as a prefix. A `' terminates the list of directories. If you set the path in a macro do not forget to include an empty line after the list. Note that filename completion no longer works if the file is not in the current directory. If you give a filename of the form `./file' (Unix) then the path search will not be executed. 2 PATTERN Syntax: SET PATTERN npattern where: npattern is the pattern number Set the pattern number to use for plots. Warning: This command only works with the HIGZ version of Mn_Fit, and the patterns available are device dependent. The pattern is drawn every 250 points of the area you are filling. This means that if you try to make a pattern under a function, you will get a vertical line every 250 points. This seems to be built into at least the GKSGRAL version of GKS, and I do not know how to avoid it. Pattern 100 means solid fill and pattern 200 means hollow fill. For the Vaxstation and Postscript, numbers 1 to 99 are also available. If you try to set any other value, it will be reset to 1, as DECGKS blows up for an invalid pattern number. Note that the current version of DECGKS gives different patterns for the same pattern number on the Vaxstation and in a Postscript file. Note that the area under a pattern is not visible. The space between hatch lines is visible, so if you overlay a plot with a hatch, then the plot below can be seen. 2 PI Syntax: SET PI ON|OFF (default = OFF) Turns on or off using pi as a symbol for the scale. This is useful if you make plots in radians and want to have an easy to understand scale. 2 PLOT Syntax: SET PLOT id [&idb] where: id is the plot identifier idb is the (optional) secondary identifier Specify which plot the following `SET' command applies to. If you give `id=0', the command applies to all plots currently being displayed and also to subsequent plots; otherwise, it only applies to the plot you specified. If you want to change something on a plot you have already made, you must use this form and then issue the `REDRAW' command after you have made your changes to see the effect of them. 2 PSIZE Syntax: SET X|Y PSIZE size (default = 19.5/20.5 cm) Sets the overall size of the picture, i.e. histogram size plus margins each side of the histogram. 2 RATIO Syntax: SET RATIO ON|OFF (default = ON) Only valid in `MN_CMD>'. Turns on or off using the ratio of the areas under each function when fitting more than 1 plot. With the option `OFF', the area of the function under each plot is used as a fitting parameter. With the option `ON' the first parameter is the total area, the second is the fraction of the total area under the first plot, the third is the fraction of the total area under the second plot etc. For the last plot being fit the area used is what is left over from the other plots. 2 RECL Syntax: SET RECL n Sets the record length for HBOOK version 4 direct access files. The default is 1024 words. Changing this affects both the `FETCH' and `STORE' commands. 2 REDRAW Syntax: REDRAW Alias for `REDRAW' so that you can `REDRAW' without exiting `SET'. See HELP REDRAW for more details. 2 ROTATION Syntax: SET ROTATION angle where: angle is the angle to rotate a plot by Rotates a plot - not yet fully implemented. 2 SCALE Syntax: SET X|Y SCALE x, y, size, angle, ndigit, ndecimal, factor, font or SET SCALE X|Y x, y, ... or SET SCALE ALL|BOTTOM|TOP|LEFT|RIGHT|VERTICAL ON|OFF where: x,y are the position of the scale relative to the point where the tick crosses the axis size is the size of the scale numbers angle is the angle with respect to the horizontal ndigit is the maximum number of digits before switching to exponential mode (e.g. 1.0*10-4) ndecimal is the number of decimal places to display -1 means the program will set ndecimal factor is a multiplication factor the scale font is the font to use for the scale Defaults: x axis 0.0, -0.6, 0.4, 0.0, 5, -1, 0, 0 y axis -0.2, 0.0, 0.4, 0.0, 6, -1, 0, 0 z axis -0.2, 0.0, 0.4, 0.0, 6, -1, 0, 0 Changes the position, size or way in which the scale is shown, or sets up where you want the scale put. `VERTICAL' is the z-axis in `LEGO' and `SURFACE' plots. The default is just to put it on the bottom, left and vertical axes. For an overlayed plot with a different scale, the scale will be put on the right axis. To change the scale for a particular plot, precede the command with `SET PLOT id [&idb]'. For the y-axis of a lego or surface plot the x and y offsets are flipped, as the scale should be vertically below the tick. The scales are also offset by the scale text size and the big tick size. Use the command `SET X|Y|Z MODE' to change the numbering of the scale. To get a log scale for example use the commmand `SET X|Y|Z MODE LOG'. 2 SECONDARY_ID Syntax: SET SECONDARY_ID n (default = 0) Change the default secondary identifier. All histograms subsequently fetched will have this secondary identifier. In addition if you omit the secondary identifier anytime you are asked for a plot number, the default will be used. Alias for `SET IDB'. 2 SHOW_ZERO Syntax: SET SHOW_ZERO ON|OFF (default = ON) Controls showing zero points which also have zero errors. 2 SHELL Syntax: SET SHELL command where: command is the shell command Defaults: command = $SHELL Sets the shell used by the `SPAWN' or `SHELL' commands. This option applies to Unix machines. Examples of `command' are `/com/sh, /bin/sh, /bin/ksh, /bin/csh, /bin/tcsh'. The shell given by the command will be invoked when `SHELL' or `SPAWN' is given. 2 SIGNAL Syntax: SET SIGNAL nfun1 [nfun2...] Specifies which of the functions you have defined should be considered as signal when you do a background subtraction. `nfun1 = 0' means that they are all signal. When you add a new function, it is defined to be signal by default. If you have not given the `SET BACKGROUND' command or you specify that all the functions are signal and then give a `BACK_SUB' command or set the `DISPLAY' mode to 2, 3, -2 or -3, you will be prompted for which of the functions are background. 2 SIZE Syntax: SET X|Y SIZE size (default = 15.0/15.0 cm) Alias for `SET HSIZE'. Sets the size of the plot in the x or y direction. To change the size for a particular plot, precede the command with `SET PLOT id [&idb]'. 2 SSIZE Syntax: SET SSIZE size (default = 0.3cm) Sets the size of the symbols in the picture. To change the size for a particular plot, precede the command with `SET PLOT id [&idb]'. 2 STATISTICS Syntax: SET STATISTICS MN_FIT|HBOOK Default: MN_FIT Specifies whether Mn_Fit or HBOOK statistics will be used to calculate the means and sigmas of histograms. The option only applies to 1-D HBOOK histograms. This option is useful if you calculate the HBOOK mean and sigma from the HFILL calls using the option `CALL HIDOPT(ID,''STAT'')'. 2 SYMBOL Syntax: SET SYMBOL n where: n is the symbol number Default: n = 0 For each type of plot a default symbol is defined (which you get if you give the command `SET SYMBOL 0'): Symbol 1 for 1-D histograms -1 for a series of points without errors -32 for a series of points with errors 12 for 2-D histograms 1 for scatter plots Note that histograms always get converted to a series of points when fitting, so the default symbol for `DISPLAY' is always -32. To get a picture of the available symbols issue the command `exec $MN_FIT/help/symbol.mnf' (Unix) or `EXEC MN_FIT_HELP:SYMBOL.MNF' (VMS). This picture is in Appendix B of the Mn_Fit manual. In HIGZ/GKS versions hatching and patterns are available. You can specify the type using the commands `SET HATCH' and `SET PATTERN'. See HELP SET HATCH for details on some of the hatching available and the figures in Appendix B. Also see the HIGZ/PAW documentation for HIGZ hatchings, and the GKS device documentation. As far as I know patterns are only available with DECGKS. The following symbols are available for histograms: -1 Solid line joining the centres of the bins -2 Dashed line joining the centres of the bins -3 Dotted line joining the centres of the bins -4 Dash-dot line joining the centres of the bins -5 HIGZ line style 12 - a dashed line -6 HIGZ line style 13 - a dash-dot line -7 HIGZ line style 14 - a widely spaced dotted line -8 HIGZ line style 15 - a dotted line 1 Solid line histogram mode 2 Dashed line histogram mode 3 Dotted line histogram mode 4 Dash-dot line histogram mode 5 HIGZ line style 12 histogram mode 6 HIGZ line style 13 histogram mode 7 HIGZ line style 14 histogram mode 8 HIGZ line style 15 histogram mode 10 Dot 11 Circle 12 Square 13 Triangle 14 Inverted triangle 15 Diamond 16 Plus (+) 17 Cross (x) 18 Asterix (*) 19 Octogon (used to be 11) 20-29 Show x error bars for histograms 30-39 Show y error bars 40-49 Show x and y error bars 60-69 Show x error bars with line at end (symbol size, SET SSIZE) 70-79 Show y error bars with line at end (symbol size, SET SSIZE) 80-89 Show x and y error bars with line at end (symbol size, SET SSIZE) -n Show symbol filled The following symbols are available for scatter plots: -1 Joins the points with a solid line -2 Joins the points with a dashed line -3 Joins the points with a dotted line -4 Joins the points with a dash-dot line -5 HIGZ line style 12 - a dashed line -6 HIGZ line style 13 - a dash-dot line -7 HIGZ line style 14 - a widely spaced dotted line -8 HIGZ line style 15 - a dotted line 1-10 One dot per point 10-19 As for histograms 20-49 As for 10-19 -n Show symbol filled The following symbols are available for 2-dimensional histograms: -1 .,1,2,3,...X,Y,Z -2 Number of entries i.e. table form 1-10 Randomized dots, where the number of dots is equal to the number of entries 10-19 Area of symbol is proportional to number of entries in the bin 20-49 As for 10-19 -n Show symbol filled If the minimum weight is negative and the maximum weight is positive for 2-D histograms and you use a symbol number greater than 10 or less than -10 you will get the symbol for positive weights and its inverse for negative weights. This mode is also used for displaying the result of a 2-D fit. This mode is only used if either the lower or upper plotting limit is 0.0. Use the `SET Z LIMIT' command to set the limits. Otherwise only those entries within the specified range are shown. 2-D histograms can also be plotted using the `LEGO' or `SURFACE' commands or preferably using the interface to the HIGZ IGTABL routines, `2DIM' or `IGTABLE'. I use the HIGZ circle routine to draw circles. It is also possible to use large dots (symbol 10 or -10) and set the dot scale size using the `SET DSIZE' command. A scale factor of 10 or 20 is usually good. Note that you only see the big dots when you print the picture. To change the symbol for a particular plot, precede the command with `SET PLOT id [&idb]'. 2 TEXT Syntax: SET TEXT ON|OFF (default = ON) Controls whether the header text with the fit results is shown on your screen device. Use the command `SET HEADER' if you want to change it for hardcopies also. 2 THICKNESS Syntax: SET THICKNESS [item] thick (default = 1.0) where: thick is the scale factor to increase the line width by Changes the thickness of the lines on a picture (only works in HIGZ version) To change the pen width for a particular plot, precede the command with `SET PLOT id [&idb]'. If you omit the item, all line thicknesses will be changed. The following items are valid: FRAME TICK SCALE LABEL HEADER TITLE SYMBOL ZERO_LINE COMMENT Note that you may not see the effect of the thickness on the screen. Postscript lines are usually very thin and a thickness factor of 3 or 4 looks a lot better, with 6 or so for the frame thickness. 2 TICKS Syntax: SET X|Y TICK ntick, nbtick, notick, size, bigsize, xtlo, xthi or SET TICK X|Y ntick, nbtick, ... or SET TICK ALL|BOTTOM|TOP|LEFT|RIGHT|VERTICAL [INSIDE|OUT] ON|OFF where: ntick is the number of ticks nbtick is the number of ticks per big tick notick is the offset of the first big tick from the first tick size is the tick size (default=0.25cm) bigsize is the big tick size (default=0.5cm) xtlo is the lower limit for drawing ticks xthi is the upper limit for drawing ticks Specifies exactly how many, what size and where the ticks should start or stop, or on which axes and which side of the axes you want the ticks. To set back to automatic tick calculation and limits, give the command `SET TICK 0'. Unless you specify `xtlo' and `xthi', they will be calculated automatically. To specify where you want the ticks, use the `SET ALL|BOTTOM|TOP' form. If you omit the `INSIDE|OUTSIDE' option, the specification will apply to both sides. `VERTICAL' is the z-axis in `LEGO' and `SURFACE' plots. The default is to put them on the inside of all 4 sides of the plot. For the vertical axis, they are put on the outside. To set or change the ticks for a particular plot, precede the command with `SET PLOT id [&idb]'. 3 Examples !\begin{enumerate} !\item !^ Example 1: This series of commands will give you ticks on the lower and left axes, with the ticks going through the axis and ticks on the top axis: SET TICK ALL OFF SET TICK BOTTOM ON SET TICK LEFT ON SET TICK TOP INSIDE ON !\end{enumerate} 2 TIME Syntax: SET TIME mode reference where: mode is the units in which to store the data reference is the reference time (T=0) Sets the mode for storing data vs. time and the reference time to be used. The mode can be `DAY' (default), `HOUR', `MINUTE', or `SECOND'. The reference time must be given in the form `YYMMDD.HHMMSS'. Give a time of 0 if you do not want to have a reference time. Use the `SET X|Y|Z MODE DATE|TIME' commnd to show the scale in date or time format. 2 TITLE Syntax: SET TITLE USER|GLOBAL title or SET TITLE DEFAULT|ON|OFF or SET TITLE POSITION [xoff yoff size angle option font] or SET TITLE GPOSITION [xoff yoff size angle option font] where: title is an overall title xoff is the x position of the title yoff is the y position of the title size is the character size for the title angle is the angle of the title option can be LEFT, CENTRE, or RIGHT adjusted font is the text font to use default is 0.0 0.4 0.4 0.0 CENTRE 0 Controls whether to display the plot title or not, or whether you want to give a user title to all plots. A user title is put at the top of the picture by default and if it is shown the individual plot titles are not. A global title is also put at the top of the picture, but the individual plot titles are shown inside the plot. `SET TITLE POSITION' controls the position of title, which is relative to the top centre of the plot, and the font used for it. `SET TITLE GPOSITION' controls the position of the global and/or user title, which is relative to the top centre of the plot, and the font used for it. To change whether the title is drawn or its position for a particular plot, precede the command with `SET PLOT id [&idb]'. Note that if the title size is set to default and you have more than 1 plot per page (`WINDOW' command), the title size for the individual histograms is scaled down. To turn off this option use the `SET AUTOSCALE' command. 2 TKTCL Syntax: SET TKTCL ON|OFF (default = OFF) Turns on/off the TK/TCL interface for Mn_Fit. At present this only involves sending a special string at the end of any output. 2 TSIZE Syntax: SET TSIZE value (default = 0.4cm) Changes the size of the title. To change the title size for a particular plot, precede the command with `SET PLOT id [&idb]'. You can also use the `SET TITLE POSITION' command to do this. 2 USIZE Syntax: SET USIZE value (default = 0.3cm) Controls the size of the smaller text in the fit display. To change the size for a particular plot, precede the command with `SET PLOT id [&idb]'. 2 WAIT_CR Syntax: SET WAIT_CR ON|OFF (default = ON) Turns on/off the request for a `' before making the next picture. This command is most useful if you send the output to a file (Postscript) directly without putting it on the screen. It is also useful if you want to put up a new plot every so often and use it in conjunction with the `WAIT' command. 2 WINDOW Syntax: SET WINDOW nwindx nwindy wx, wy or SET PLOT id [&idb] WINDOW nx ny where: nwindx are the number of windows in the x direction nwindy are the number of windows in the y direction wx is the separation of the windows in the x direction wy is the separation of the windows in the y direction nx is the window number in the x direction ny is the window number in the y direction This command enables you to put more than one plot on each page. The plot (overall size specified with `SET X|Y HSIZE') is divided up into `nwindx' by `nwindy' windows with separations `wx, wy' between them. All the plots will be drawn with the same size on the page. To change the size or position of a plot in a window, use the `SET PLOT id [&idb] WMARGIN or WSIZE' commands. If the tick, title, scale and label sizes are default then they will be automatically rescaled if you use more than one window. If you give 0 separation, the scale for plots other than the leftmost or bottom one will be suppressed. You can turn it back on again after you have made a picture using the syntax `SET PLOT id SCALE LEFT ON' etc. In addition, if the last big tick corresponds to the right or top of the plot (and it is not the rightmost or top plot), the number for the scale will not be drawn. This can be turned off with the `SET AUTOTRIM OFF' command. If you want to change the window number of a plot you have already made, use the `SET PLOT id [&idb] WINDOW' command. To set the window number for a plot you are about to make, use the `SET NEXT_WINDOW' command. If you change the windowing the next plot will be put in window 1,1 by default. Use the `SET NEXT_WINDOW' command to change this. If you plot Ntuple projections in windows with different cuts, but with the same secondary identifier you will usually get a surprise when you make a `HARDCOPY' or `REDRAW'. This is because these commands repeat the commands used to make the plots, thus you will get the same hisotgram plotted several times. It is therefore better to give a different secondary identifer to each projection that has different cuts. 3 Examples !\begin{enumerate} !\item !^ Example 1: This example shows how to manipulate windows and move plots around within a window: SET WINDOW 2 2 2.0 0 !Split the plot into 4 windows with no !separation in the y direction PLOT 1 PLOT 2 SET WINDOW 1 2 = = !Change to 2 windows so the bottom plot SET NEXT_WINDOW 1 2 !will go across the full page PLOT 3 SET PLOT 2 X WMARG 1.0 !Move plot 2 1cm over SET PLOT 2 Y WSIZE 5.0 !Make plot 2 5cm wide in x. !Its original size was !(15(HSIZE) - 2.0(WX)) / 2(NWINDX) = 6.5cm REDRAW !Look at the new picture !\end{enumerate} 2 NO_WINDOW Syntax: SET NO_WINDOW Turns off any windowing. All tick, title, label and scale sizes that may have been rescaled will be set back to default. 2 WMARGIN Syntax: SET X|Y WMARGIN size (default = 0.0/0.0 cm) Sets the offset of the histogram from the bottom left-hand corner of the window defined by the x and y margins. To change the size for a particular plot, precede the command with `SET PLOT id [&idb]'. Normally the margin is set to 0 inside the window. Issue this command after the window command. You can also use it in connection with the `PLOT/NOCLEAR' command to make inserts. 2 WORKING_DIR Syntax: SET WORKING_DIR dirname where dirname is the directory name Alias for `WDIR'. Sets the working directory name to `dirname'. If you then try to open a file without a directory name `dirname' will be prepended. 2 WSIZE Syntax: SET X|Y WSIZE size Changes the size of the plot inside a window in the x or y direction. To change the size for a particular plot, precede the command with `SET PLOT id [&idb]'. Normally the size is calculated automatically from the number of windows. Issue this command after the window command. You can also use it in connection with the `PLOT/NOCLEAR' command to make inserts. 2 ZERO Syntax: SET X|Y ZERO ON|OFF nsymb (default = ON) where: nsymb is the symbol number for the line Turns on or off drawing a line at `x=0' or `y=0' and specifies the symbol for the line. To change the line for a particular plot, precede the command with `SET PLOT id [&idb]'. +DECK,SHELL. 1 SHELL Syntax: SHELL [command] Alias for `SPAWN'. Spawns a DCL (VMS) or Shell (Unix) command. You can specify the shell on Unix machines using the `SET SHELL' command. If no command is given a new process is created. Use the command `Return' (VMS) or `exit' (Unix) to return to Mn_Fit when you have finished in the subprocess. On VMS you can also `ATTACH' to the main process and then use `ATTACH' in Mn_Fit to re-enter the subprocess if you wish. +DECK,SHOW. 1 SHOW Syntax: SHOW name|ALL or SHOW PLOT id [&idb] name|ALL The `SHOW PLOT' command enables you to get detailed information on the parameters being used in making the plots currently in the buffer. You can change these parameters with the `SET' and `SET PLOT id [&idb]' commands. `SHOW' is being expanded, so that you can give a `SHOW' command for every `SET' command. Therefore only those `SHOW' commands that are in addition to the `SET' commands are listed. If the `SHOW' command does not give you what you want, you can usually get a list of the current values of parameters for a particular `SET' command by using the syntax `SET command '. 2 Menu The following is a list of the available commands for which there are not SET equivalents. For more details see HELP SHOW and the individual subtopics: ALL Shows everything there is to show. ALIAS Lists the currently defined aliases. COMMANDS Lists the internally defined commands (made with `DEFINE'). COMMENTS Lists the current comments. CONSTRAINT Lists the current constraints on parameters being fit. CUTS Lists the cuts defined and set. DEFINITION Lists the internally defined commands (made with `DEFINE'). DIRECTORY Lists the contents of the currently selected HBOOK4 directory. EXCLUSIONS Lists the parts of histograms excluded or included in the fit. FILES Lists the filenames for hardcopy, dump and currently open. FLAGS Lists the logical flags that control what is plotted. FRAME Lists the parameters affecting the scale and frame. INCLUSIONS Lists the parts of histograms included or excluded in the fit. KEYS Lists the current keys. LABELS Lists the picture labels. LIMIT Lists the parameters affecting the scale and frame. LOG Lists the last 100 commands given. MODE Lists the parameters affecting the scale and frame. ORDER Lists the expected order of variables when doing `DAT_FETCH'. PLOT Lists the plots currently in the buffer for plotting and enables you to list something for a particular plot. REGISTER Lists the contents of one or more registers (0-500). SCALE Lists the parameters affecting the scale and frame. SEGMENTS Lists the segments currently in use (GKS version, mainly for experts). SIZES Lists the parameters relating to plot sizes, margins, windows. TICK Lists the parameters affecting the tick marks. UNITS Lists FORTRAN units and who has grabbed them (mainly for experts). VARIABLE Gives the value of one or all user defined variables. 2 ALL Syntax: SHOW ALL Lists everything there is to show. 2 ALIAS Syntax: SHOW ALIAS [name] where: name is the alias name Lists the definition of alias `name' or all defined aliases if you omit `name'. See HELP ALIAS for more information on use of aliases. 2 COMMANDS Syntax: SHOW COMMANDS Lists the commands defined using the `DEFINE' command. Alias for `SHOW DEFINITION'. 2 COMMENT Syntax: SHOW COMMENT Lists the current comments associated with plots. 2 CONSTRAINT Syntax: SHOW CONSTRAINT Lists the current constraints on parameters that are being fit. See HELP MINUIT CONSTRAIN for more details on how to constrain parameters. 2 CUTS Syntax: SHOW CUT Lists the cuts set for a plot. 2 DEFINITION Syntax: SHOW DEFINITION Lists the commands defined using the `DEFINE' command. Alias for `SHOW COMMANDS'. 2 DIRECTORY Syntax: SHOW DIRECTORY. Alias for `LDIRECTORY'. Lists the contents of the currently selected HBOOK directory in an HBOOK4 file. 2 EXCLUSIONS Syntax: SHOW EXCLUSIONS Lists the parts of histograms excluded and included in the fit. 2 FILES Syntax: SHOW FILES Lists the current filenames for `HARDCOPY' and `DUMP'. Lists the units and the filenames associated with them for units currently open. 2 FLAGS Syntax: SHOW FLAGS Lists the logical flags that control what is plotted. 2 FRAME Syntax: SHOW FRAME Lists the plot limits and the parameters affecting the scale and frame. 2 INCLUSIONS Syntax: SHOW INCLUSIONS Lists the parts of histograms included and excluded in the fit. 2 KEYS Syntax: SHOW KEYS Lists the current keys associated with plots. 2 LABEL Syntax: SHOW LABEL Lists the plot labels and the parameters affecting them. 2 LIMIT Syntax: SHOW LIMIT Lists the plot limits and the parameters affecting the scale and frame. 2 LOG Syntax: SHOW LOG [n] Lists the last `n' commands given. If `n' is not given the last 100 commands are shown. 2 MODE Syntax: SHOW MODE Lists the plot limits and the parameters affecting the scale and frame. 2 ORDER Syntax: SHOW ORDER Lists the expected order of variables when executing `DAT_FETCH'. 2 PLOT Syntax: SHOW PLOT [id [&idb]] Lists which plots are currently in the buffer for plotting and also enables you to get more information on the parameters being used for each plot by preceding what you want to show with the plot identifier (e.g. `SHOW PLOT id SCALE'). 2 REGISTER Syntax: SHOW REGISTER r1:[r2]|ALL where: r1 is a register number r2 is the upper limit of a range of registers to show Lists the contents of one or more registers. If you give the command `SHOW REGISTER ALL' all user registers will be listed (0-99). You can also list a range of registers e.g. `SHOW REGISTER 301:320'. The `DEPOSIT' and `CALCULATE' commands can be used to set the contents of registers 0-99. For example, `DEP R1 = 2.0*P2(1)' will set the contents of register 1 to twice the value of parameter 2 in function 1. You can also use these commands to define user variables which are stored in registers >300 (see HELP DEPOSIT for more details). A more general command that enables you to look at the values of registers, parameters etc. is the `EXAMINE' command. 2 SCALE Syntax: SHOW SCALE Lists the plot limits and the parameters affecting the scale and frame. 2 SEGMENTS Syntax: SHOW SEGMENTS Lists the current segments in use. Only applies to the GKS version and is mainly for expert use. 2 SIZES Syntax: SHOW SIZES Lists the parameters relating to plot sizes, margins, windows, etc. 2 TICK Syntax: SHOW TICK Lists the parameters affecting the tick marks. 2 UNITS Syntax: SHOW UNITS Lists FORTRAN units and who has grabbed them (mainly for experts). The name of the subroutine that booked the unit is shown. 2 VARIABLE Syntax: SHOW VARIABLE name|ALL where name is a user variable name Lists the value of a user variable or all user variables. +DECK,smooth. 1 SMOOTH Syntax: SMOOTH[/option] id [&idb] parameter [&]idb2 [mode] where: option is the type of smoothing: /HBOOK /NAGLIB /IMSL /TOPDRAW parameter is a steering parameter [&]idb2 is the secondary id of the smoothed histogram mode plotting mode - NAGLIB and IMSL versions only Defaults: idb2 = idb + 1, mode = 1, Smooths a histogram. There are a number of possibilities available depending on whether you have the NAGLIB and/or IMSL libraries. The default smoothing type is NAGLIB (if available), IMSL (if available), Topdraw. The result of the smoothing will be put in a histogram with the same primary identifier as the input histogram and the secondary identifier you specify. The two modes are to store it as a smooth curve (errors on each point will be 0), or as a histogram with the same number of points as the input histogram (errors on each point will be the same as errors in the input histogram). Mode 0 is only available for IMSL and NAGLIB smoothing. You can use the `HISTOGRAM ERROR' command to change or remove the errors on the points. If you just give the command `SMOOTH[/option] id' you enter into an interactive mode and can iterate on the smoothing by varying the smoothing parameter. If you give the command this way in a macro then leave a blank line (or the command `YES') at the end of your fitting. 2 /HBOOK Uses the HBOOK routine HSMOOF. This routine returns the chi**2 of the smoothing, but does not give you any control on how much smoothing to do and does not take into account the errors on the bins. 2 /IMSL Uses the IMSL library routine ICSSCU. See the IMSL manual for complete details. The smoothing parameter is the chi**2 for the original histogram and the smoothed histogram. It is recommended to lie between `N-SQRT(2N)' and `N+SQRT(2N)'. Smoothing `parameter = 0' produces the natural cubic spline which interpolates the histogram points. The errors on each point are taken into account. Points with 0 error are not included in the smoothing. Use the `HIST ERROR id 0' command to remove the errors if you do not want to use them. 2 /NAGLIB Uses the NAGLIB library routine E02BEF. See the NAGLIB manual for complete details. The smoothing parameter is the chi**2 for the original histogram and the smoothed histogram. It is recommended to lie between `N-SQRT(2N)' and `N+SQRT(2N)'. Smoothing `parameter = 0' produces the natural cubic spline which interpolates the histogram points. The errors on each point are taken into account. Points with 0 error are not included in the smoothing. Use the `HIST ERROR id 0' command to remove the errors if you do not want to use them. 2 /TOPDRAW Uses the routine SMCTRL coded by Roger Chaffee from an algorithm by J.W. Tukey and A. Tubillo. You can specify the level of smoothing, which must lie between 0 and 5. 0 does not seem to work very well, 1 produces the least amount of smoothing and 5 produces the most. The points are assumed to be equally spaced and monotonically increasing for this routine, but this is not checked by Mn_Fit. +DECK,SPAWN. 1 SPAWN Syntax: SPAWN [command] Alias for `SHELL'. Spawns a DCL (VMS) or Shell (Unix) command. You can specify the shell on Unix machines using the `SET SHELL' command. If no command is given a new process is created. Use the command `Return' (VMS) or `exit' (Unix) to return to Mn_Fit when you have finished in the subprocess. On VMS you can also `ATTACH' to the main process and then use `ATTACH' in Mn_Fit to re-enter the subprocess if you wish. +DECK,spline. 1 SPLINE Syntax: SPLINE[/option] id [&idb] nknot knot1,knot2,... [&]idb2 mode where: option is the type of spliine fitting /HBOOK /NAGLIB /IMSL nknot is the number of knots knot1 is the 1st knot position - not HBOOK verison knot2 is the 2nd knot position etc. [&]idb2 is the secondary id of the smoothed histogram mode plotting mode - NAGLIB and IMSL versions only Defaults: idb2 = idb + 1, mode = 0, Spline fits a histogram. There are a number of possibilities available depending on whether you have the Naglib and/or IMSL libraries. The default spline fitting type is NAGLIB (if available), IMSL (if available), HBOOK. The minimum number and maximum number of knots and their minimum and maximum values depend on the type of fitting - see the relevant section for details. The result of the fit will be put in a histogram with the same primary identifier as the input histogram and the secondary identifier you specify. The two modes are to store it as a smooth curve (errors on each point will be 0), or as a histogram with the same number of points as the input histogram (errors on each point will be the same as errors in the input histogram). Mode 0 is only available for IMSL and NAGLIB smoothing If you just give the command `SPLINE[/option] id' you enter into an interactive mode and can iterate on your fit by varying the numbers of knots and/or their positions. If you give the command this way in a macro then leave a blank line (or the command `YES') at the end of your fitting. 2 /HBOOK Uses the HBOOK routine HBSPLI1. You specify the number of knots, and the routine returns the chi**2 of the spline, but does not give you any control on the knot positions. The errors on the bins are not taken into account.. 2 /IMSL Uses the IMSL library routine ICSVKU. See the IMSL manual for complete details. The number of knots must be at least 2 and the knots must be monotonically increasing. The first knot must be less than or equal to the first point in the histogram and the last knot must be greater than or equal to the last point in the histogram. 2 /NAGLIB Uses the NAGLIB library routine E02BAF. See the NAGLIB manual for complete details. The number of knots must be less than or equal to the number of points - 4, and the knots must be monotonically increasing. The first knot must be greater than first point in the histogram and the last knot must be less than the last point in the histogram. The routine adds 4 knots at the minimum and maximum points. The errors on each point are taken into account. Points with 0 error are not included in the fit. Use the `HIST ERROR id 0' command to remove the errors if you do not want to use them. +DECK,SQUEEZE. 1 SQUEEZE Syntax: SQUEEZE Gets back unused space in the array where the histograms are stored. You `DELETE 0' to remove all histograms. This is much faster than `SQUEEZE'. +DECK,stat. 1 STAT Syntax: STAT Calls RZSTAT for the current HBOOK input file, to give statistics on space usage. +DECK,STORE. 1 STORE Syntax: STORE[/NEW/UPDATE] filename id1[&idb1] [id2[&idb2]...] where: filename is the filename to store the plots in id1,id2... are the plot identifiers idb1,idb2... are the (optional) secondary identifiers Defaults: /NEW Stores histograms in a file. They can be read back in with the `FETCH' command. To store all histograms specify `id1 = 0'. You can also specify a range of histograms using the syntax `id1:id2'. The secondary identifier will not be used in the HBOOK identifier. You can use the `MDIR' and `SET DIR' commands to specify which directory the histogram should be stored in. The file is closed after each `STORE' command. To add more histograms to the file use `STORE/UPDATE'. If you want to keep the secondary identifiers you can use the `MN_STORE' command, together with `MN_FETCH' to read them in again. Note that this format is not machine independent. As of version 4.01 of Mn_Fit the histograms will be stored in RZ exchange format. This means that they cannot be read in properly by older versions of Mn_Fit or PAW. The big advantage of exchange format is that you can just binary ftp files from one machine to another. 2 /NEW Syntax: STORE/NEW ... Stores the histograms in a new file. On computers which do not have version numbers for files any old file will get overwritten. 2 /UPDATE Syntax: STORE/UPDATE ... Stores the histograms in an already existing HBOOK direct access file. +DECK,SUBTRACT. 1 SUBTRACT Syntax: SUBTRACT id1[:id1n] [&idb1] id2[:id2n] [&idb2] id3[:id3n] [&idb3] scale1 scale2 (default scale = 1.0 1.0) where: id1,id2 are the input histogram identifiers id3 is the output histogram identifier idb1,idb2 are the (optional) input secondary identifiers and idb3 is the (optional) output secondary identifier Subtracts two histograms (`id1, id2') to make a third one. To specify the secondary identifier, precede it by a `&', otherwise the default will be used. (Use the `SET IDB' command to change the default). The scale factors are optional. To avoid confusion, you should give a `' after the identifiers or make sure the scale factors are given as real numbers. To subtract a range of histograms, the primary identifiers you give for the input and output histograms must be the same, but you can specify different secondary identifiers. For example, `SUBTRACT 300:400&1 300:400&2 300 : 400 & 10' will subtract all histograms with primary identifiers 300 to 400 and secondary identifiers 1, from those with secondary identifiers 2, putting the results into histograms with the same primary identifiers and secondary identifier 10. If you give primary identifier 0, the operation will be performed on all plots with the given secondary identifier. +DECK,SUM. 1 SUM Syntax: SUM id [&idb] xlo xhi where: id is the plot identifier idb is the (optional) secondary identifier xlo is the lower limit of the range to sum xhi is the upper limit of the range to sum Sums the contents of a plot over the range given. The result is printed and is also stored in register 101, which you can use with the syntax `R101'. The number of points summed over is in register 102. +DECK,surface. 1 SURFACE Syntax: SURFACE id [&idb] theta phi (default theta=30, phi=30) where qual can be /C1|/C2|/CONT|/SHADE|/POL|/CYL|/SPH|/PSD|/NFB|/NBB Alias for `HIST SURFACE'. Makes a surface plot of a 2-dimensional histogram. `Theta' and `phi' are the angles from which you want to view the plot in degrees. If you give the command without any qualifier the angles must lie between 0 and 90. If you give a qualifier the IGTABLE interface will be used. The current surface plotting code will soon be replaced by that in the `2DIM SURFACE' command, which has no restrictions on the rotation angles and has a number of diffferent colour options. See HELP 2DIM for more details. +DECK,TITLE_HELP. 1 TITLE Syntax: TITLE id [&idb] new_title Changes the title on a histogram. +DECK,WAIT. 1 WAIT Syntax: WAIT sec where sec is the time to wait in seconds Tells Mn_Fit to wait for a time. +DECK,wdirectory. 1 WDIRECTORY Syntax: WDIRECTORY dirname where dirname is the directory name Sets the working directory name to `dirname'. If you then try to open a file without a directory name `dirname' will be prepended. +DECK,WINDOW. 1 WINDOW Syntax: WINDOW nx ny sepx sepy where: nx is the number of windows in the x direction ny is the number of windows in the y direction sepx is the separation between the plots in the x direction sepy is the separation between the plots in the y direction Alias for `SET WINDOW'. See HELP SET WINDOW for more details. +DECK,NO_WINDOW. 1 NO_WINDOW Syntax: NO_WINDOW Alias for `SET NO_WINDOW'. Turns off windowing. +DECK,WRITE. 1 WRITE Syntax: WRITE DATA|LOG Writes out either a histogram to a card image format file or a log of the commands you gave at the terminal. 2 Menu The following is a list of the available commands. For more details see HELP WRITE and the individual subtopics: DATA Writes a histogram to a file in card image format. LOG Writes out the log of commands given at the terminal. 2 DATA Syntax: WRITE DATA filename id [&idb] Alias for `DAT_STORE'. See HELP DAT_STORE for more details. 2 LOG Syntax: WRITE LOG filename ncommand Writes the last `ncommand' commands you have given from the terminal to a file, which you can then edit and execute as a command file. Use the `SHOW LOG' command to look at the commands you have given and the `EDIT' command to edit the file you write out. Use the `EXECUTE' or `READ COMMAND' commands to execute the commands in the file. You can use the `SET LOG ON' command to turn on automatic logging of commands and then all commands will get written to the file `mn_fit.log'. +DECK,XSCALE. 1 XSCALE Syntax: XSCALE id1 [:id1n] [&idb1] id2 [:id2n] [&idb2] [scale] where: id1 is the input histogram identifiers idb1 is the (optional) input secondary identifiers id2 is the output histogram identifier idb2 is the (optional) output secondary identifier scale is the amount to scale the x-axis by Scales the x-axis of a plot by `scale'. This is useful if you want to say change a plot scale from seconds to hours. Note that `XSCALE' makes a new histogram. If you just want to scale the values in a picture you can use the `SET BIN' command instead for 1-D histograms. +DECK,XSHIFT. 1 XSHIFT Syntax: XSHIFT id1 [:id1n] [&idb1] id2 [:id2n] [&idb2] [shift] where: id1 is the input histogram identifiers idb1 is the (optional) input secondary identifiers id2 is the output histogram identifier idb2 is the (optional) output secondary identifier shift is the amount to shift the x-axis by Shifts the x-axis of a plot by `shift'. This is useful if you want to overlay plots with error bars that have the same x values for all points. Note that `XSHIFT' makes a new histogram. If you just want to shift the values in a picture you can use the `SET BIN' command instead for 1-D histograms. +DECK,YSCALE. 1 YSCALE Syntax: YSCALE id1 [:id1n] [&idb1] id2 [:id2n] [&idb2] [scale] where: id1 is the input histogram identifiers idb1 is the (optional) input secondary identifiers id2 is the output histogram identifier idb2 is the (optional) output secondary identifier scale is the amount to scale the y-axis by Scales the y-axis of a 2-D plot, or the bin contents or point values of a plot by `scale'. For 1-D plots this is identical to the `SCALE' command. +DECK,YSHIFT. 1 YSHIFT Syntax: YSHIFT id1 [:id1n] [&idb1] id2 [:id2n] [&idb2] [shift] where: id1 is the input histogram identifiers idb1 is the (optional) input secondary identifiers id2 is the output histogram identifier idb2 is the (optional) output secondary identifier shift is the amount to shift the y-axis by Shifts the y-axis of a 2-D plot, or the bin contents or point values of a 1-D plot by `shift'. This is useful if you need to modify the bin contents of a complete plot by the same amount. +DECK,ZSCALE. 1 ZSCALE Syntax: ZSCALE id1 [:id1n] [&idb1] id2 [:id2n] [&idb2] [scale] where: id1 is the input histogram identifiers idb1 is the (optional) input secondary identifiers id2 is the output histogram identifier idb2 is the (optional) output secondary identifier scale is the amount to scale the z-axis by Scales the z-axis of a 3-D plot, or the bin contents of a 2-D plot by `scale'. For 2-D plots this is identical to the `SCALE' command. +DECK,ZSHIFT. 1 ZSHIFT Syntax: ZSHIFT id1 [:id1n] [&idb1] id2 [:id2n] [&idb2] [shift] where: id1 is the input histogram identifiers idb1 is the (optional) input secondary identifiers id2 is the output histogram identifier idb2 is the (optional) output secondary identifier shift is the amount to shift the z-axis by Shifts the z-axis of a 3-D plot, or the bin contents of a 2-D plot by `shift'. This is useful if you need to modify the bin contents of a complete plot by the same amount. +DECK,ZDIRECTORY. 1 ZDIRECTORY Syntax: ZDIRECTORY List of the contents of the currently selected HBOOK directory in an HBOOK4 file using the routine RZLDIR. +PATCH,MINUIT_HELP,T=TEXT. +DECK,MINUIT. 1 Minuit To get a list of the MINUIT commands look at Menu. The source for this HELP is in the file `MN_FIT_HELP:MINUIT_HELP.FIL' (VMS) or `$MN_FIT/help/minuit_help.fil' (Unix). There are 2 versions of the MINUIT package interfaced to Mn_Fit. The default is the CERN library MINUIT. The previous version was based on a much older version of MINUIT and was extensively modified by Chris Rippich. To get this old version, which was the one used in all versions of Mn_Fit up to 3.00, you have to link it at your institute and run Mn_Fit with the option `-c' (short for `-cgr_minuit' and assuming this version has been made). In both versions a number of new commands have been added to give you a graphical display of the fit results and to control which parts of the plots are being fit. All MINUIT commands have the standard syntax, except `MIGRAD', `SIMPLEX' and `MINOS' where the maximum number of calls is not part of the command, but can be set using the `MAX_CALLS' command. This command used to be called `CALLS' (but this is too close to the `CALL_COMIS' and `CALL_FCN' commands). In the CERN version the commands `MATOUT' and `COVARIANCE' both show the covariance matrix. The extra MINUIT commands which have been added are: MODIFY, DISPLAY, EXCLUDE, INCLUDE, NO_EXCLUDE, NO_INCLUDE, DUMP, ITERATIONS, MAX_CALLS, PRECISION, FLOAT, INFO, FIT_INFO, BACK_SUB, CHI_PLOT, PROB_PLOT, FCN_DRAW, FCN_PLOT, MNCONTOUR, CONSTRAIN, UNCONSTRAIN. In addition there are a few commands in the CERN version which are not available in the C. Rippich version: SCAN, STRATEGY, RELEASE. In the CERN version of MINUIT you can give any standard MINUIT command with the standard syntax by prefixing the with `MINUIT'. e.g. `MINUIT SHOW COV'. Note that in all MINUIT commands a number can passed as a register, parameter etc. (see HELP Numbers for the syntax). The default printout level when you startup MINUIT is 0. This gives quite a lot of information about what is going on. If you are doing repetitive fitting I recommend reducing the printout level to -1 (command `PRINTOUT -1' AFTER THE `FIT' command). 2 MINUIT Syntax: MINUIT minuit_command Direct interface to `MINUIT' commands. Only works with the CERN version of `MINUIT'. +DECK,menu. 2 Menu The following is a list of the available commands. For more information see the detailed HELP on each command. If you set a parameter to 0 or do not supply it, the default is taken. The following are the standard MINUIT commands: HELP CALL_FCN Calls FCN with flag `iflag'. MAX_CALLS Sets the maximum number of calls for `SIMPLEX', `MIGRAD' and `MINOS'. CONTOUR Draws a contour plot on the screen. COVARIANCE Reads in the covariance matrix. ERROR_DEF Sets the chi**2 or likelihood change for the errors. EXIT Exits MINUIT. FIX Fixes the value of a variable. FLOAT Floats a previously fixed variable. FORCE_ISW Changes MINUIT status flags - VERY RISKY!! (only in C. Rippich version). GRADIENT Indicates that FCN can calculate derivatives - DO NOT USE. NO_GRADIENT Turns off `GRADIENT' - DO NOT USE. HESSE Recalculates the covariance matrix. IMPROVE Tries to find a new minimum somewhere nearby. INFO Gives information on the current fit status. MATOUT Writes out the covariance matrix. MIGRAD Runs MIGRAD. MINIMIZE Runs SIMPLEX then MIGRAD. MINOS Calculates MINOS errors. MINUIT Executes a MINUIT command (CERN version of MINUIT only). MNCONTOUR Makes a graphical contour minimizing w.r.t. other parameters. MODIFY Changes the value of a parameter, its error or limits. PAGE Starts a new page on standard outupt. PRECISION Sets the convergence criteria. PRINTOUT Changes the printout level. PUNCH Saves the current parameter values in a file. RELEASE Floats a previously fixed variable (CERN version of MINUIT only). RESTORE Floats variable(s) which were fixed. SAVE Saves the current parameter values in a file SEEK Monte Carlo minimization. SIMPLEX Runs the fairly crude SIMPLEX minimizer. STANDARD Calls subroutine STAND. STRATEGY Sets the MINUIT strategy (CERN version of MINUIT only). STOP Stops MINUIT. UNIT Changes the output unit (do not use in Mn_Fit). The following commands have been defined by Mn_Fit to give you more information and control on what to fit and the results: BACK_SUB Makes a background subtracted plot. CHI_PLOT Plots the chi**2 vs. a variable even if you are doing a likelihood fit. CONSTRAIN Constrains a parameter w.r.t. other parameters. UNCONSTRAIN Removes a constraint. DISPLAY Shows the fit results on the softcopy device. DUMP Dumps the point by point fit values. EXCLUDE Excludes part of histogram for fitting. NO_EXCLUDE Removes exclusions. FCN_DRAW Draws the FCN vs. a variable on the terminal. FCN_PLOT Plots the chi**2 or likelihood vs. a variable. FIT_INFO Gets information on the fit. INCLUDE Includes part of a histogram for fitting. NO_INCLUDE Removes inclusions. ITERATIONS Draws fit iterations. NO_ITERATIONS Stops drawing fit iterations. PROB_PLOT Plots the probability vs. a variable (replaces FCN_DRAW). +DECK,COMMAND_SYNTAX. 2 Command_syntax Commands are input as 1 line consisting of a keyword followed by parameters. The keyword may be shortened if still unique. Parameters are separated by (multiple) blanks and/or tabs. No embedded blanks are permitted. `!' means end-of-card, and you can follow it by comments. Empty cards will be ignored (or cards which have only blanks and/or a comment field). (That's why, e.g. `CALL FCN' has been changed into `CALL_FCN'). Lower case commands are permitted! Trailing parameters that are not given but expected, are assumed to be zero. Numbers can be given in any shape or form (integers, reals, exponents, whatever you like), as long as no blanks are embedded. NOTE ---- MINOS does not take packed parameter words any longer. Instead, you supply up to 15 numbers on 1 card. +DECK,ERRORS. 2 Errors MINUIT gives two different errors from its fitting routines: parabolic errors and MINOS errors. For functions which have no correlations between the parameters or the variations are linear, the parabolic error and the MINOS errors should be the same. If there are correlations or the errors are asymmetric, you should always use the MINOS errors to be sure. Occasionally MINUIT will claim to have converged and the parabolic errors are ridiculously small. This often happens if you fit with functions having correlated parameters (like Gaussians!). The usual fix to this is to give the command `HESSE', which recalculates the covariance matrix, and then `MINIMIZE' again or run `MINOS'. A good check is that the parabolic error should lie between the MINOS errors if the problem is linear and be smaller than the MINOS errors if there are correlations. Note that in the CERN version of MINUIT the parabolic error includes the correlations between the parameters. I believe that was not the case for the C. Rippich version. If you want to have 90% confidence level upper limits for example, it is possible to get these directly by changing the chi**2 change used to calculate the error (command `ERROR_DEF 1.69'). Note that the likelihood is scaled by a factor of 2, so that 1 sigma errors also correspond to a likelihood change of 1. +DECK,BACK_SUB. 2 BACK_SUB Syntax: BACK_SUB [&]idb [[&]idb2 ...] nmode where: idb is the secondary identifier for the background subtracted plot nmode = 1 means just subtract the background = 2 means divide by it also Makes a background subtracted histogram from the last fit. You must use the `SET BACKGROUND' command beforehand to specify which functions are the background. You will be prompted for which mode you want to use, and what secondary identifier you wish to give the result. If you are fitting more than 1 histogram simultaneously, you should give a secondary identifier for each of them. +DECK,CALLS. 2 CALLS Command has been renamed to MAX_CALLS. +DECK,chi_plot. 2 CHI_PLOT Syntax: CHI_PLOT name|number xlo xhi ylo yhi where: name is the name of the variable you want to plot number is the parameter number xlo is the minimum value xhi is the maximum value ylo is the minimum value of the chi**2 yhi is the maximum value of the chi**2 Draws the chi**2 as a function of one of the fit parameters. If you are doing a likelihood fit the proper chi**2 is calculated using the square root of the value of the function as the error. NO check is done on exceeding limits on variable `x' (if any), so be careful! You can give either the parameter number or its name. See HELP MINUIT FCN_PLOT and HELP MINUIT PROB_PLOT for other ways to plot the fit probability as a function of the value of a variable. See HELP MINUIT MNCONTOUR for contour plots. +DECK,CONSTRAIN. 2 CONSTRAIN Syntax: CONSTRAIN par expression where: par is a MINUIT parameter number expression is an arithmetic expression Constrains the value of a parameter that is being fit. The parameter is fixed and its value is calculated every iteration from the constraint. The constraint can be any arithmetic expression (see HELP Expressions for details). The most common use is to fix 2 parameters relative to each other. You can remove a constraint using the `UNCONSTRAIN' command. You can list the current constraints using the `SHOW CONSTRAINT' command. You can specify other parameters that are being fit using the syntax `Pn' (where `n' is the MINUIT parameter number), or `Pn(m)' (where `n' is the function number and `m' is the parameter number in the function). WARNING: The constraint is parsed at the time it is defined and is calculated before the loop over the points being fit is done. Thus if you use registers in the constraint their contents at the time of minimization (i.e. when you give the `MINIMIZE' command) will be used. This command is only available in the CERN version of MINUIT. 3 Examples !\begin{enumerate} !\item !^ Example 1: Constrain the mean and sigma of 1 Gaussian with respect to a second: fun add gaus sig !Add 2 Gaussians 1000 1 0.5 fun add gaus sig 1000 2 0.5 fit 1 0 !Constrain the mean of the second Gaussian to be 1 > the first !Use the MINUIT parameter number constrain 5 p2+1 !Constrain the sigma of the second Gaussian to be 2x that of the first !Use the Mn_Fit parameter number constrain 6 2*p1(3) minimize show constrain unconstr 5 !Remove the constraint on parameter 5 minimize !\end{enumerate} +DECK,UNCONSTRAIN. 2 UNCONSTRAIN Syntax: UNCONSTRAIN npar where: npar is the MINUIT parameter number Removes the constraint on a parameter. See HELP MINUIT CONSTRAIN for details on the use of constraints. This command is only available in the CERN version of MINUIT. +DECK,CONTOUR. 2 CONTOUR Syntax: CONTOUR i1 i2 [devs] [ngrid] or CONTOUR i1 i2 xlo xhi ylo yhi Defaults: devs=2.5, ngrid=25 In the CERN version of MINUIT only the first syntax is available. The `ngrid' parameter is not in the C. Rippich version of MINUIT. Use the `MNCONTOUR' command to get a graphical contour. Makes a 2-D plot of FCN in the 2 variables, ranging in: VAR1 = CURRENT-VAR1 +- DEVS*CURRENT-ERROR VAR2 = CURRENT-VAR2 +- DEVS*CURRENT-ERROR (or uses explicit range `xlo...xhi', `ylo...yhi' if given). Plotted are characters `1, 2, ... A, ... Z, *, ...' That means that `1' stands for `AMIN+1*UP', `2' for `AMIN+4*UP', `3' for `AMIN+9*UP', etc. +DECK,COVARIANCE. 2 COVARIANCE Syntax: COVARIANCE Writes the covariance matrix to the current output unit. +DECK,DATACARDS. 2 Datacards Syntax: number name value error lolim hilim where: number is any number, but in the end, no holes may exist in the list of parameter names/numbers. If there is one, you will be asked to fill it in. name any name you like (10 characters will be kept). value is the starting value for the parameter error is the starting uncertainty in the parameter which will be updated during the fit lolim is the lower limit on the parameter hilim is the upper limit on the parameter If `lolim',`hilim' are given, make sure that value +/- error lies well within `lolim...hilim', or else MINUIT gets very angry! If you give `lolim=hilim=0.0', the parameter is unbounded. Otherwise the parameter is restricted to range from `lolim' to `hilim'. It is recommended that the expected final fitted parameter should lie close to the midpoint of the limit interval, otherwise MINUIT performs poorly. At least, number name value must be supplied. `error, lolim, hilim' will be set to zero if not supplied. A card saying 'END' ends the dialog, and fitting can start. Datacards are written for you in Mn_Fit, so you do not have to worry about them. +DECK,DISPLAY. 2 DISPLAY Syntax: DISPLAY [&idb] Displays the fit results on the current graphics device. In all that follows `id' are the primary identifier(s) of the plot(s) you are fitting. You can change what is displayed using the `SET DISPLAY MODE' command (options include showing the fit, background subtracted fit or both). If you are fitting a 1-dimensional plot, the part of the function which is included in the fit is stored in plot `id&981', and that which is excluded is stored in `id&982'. Parameters that are fixed are prefixed by a `*' and those that are constrained are prefixed by a `#'. If you are using display mode -2, 2, -3 or 3 you must give the secondary identifiers of the background subtracted plots. You must also have given the `SET BACKGROUND' command beforehand to specify which function(s) are the background. If you are fitting a 2-D plot, the part of the function which which is included in the fit is stored in plot `id&981', while `id&982' contains the signed chi**2 contribution of each point. A positive value means that the data was higher then the function for that point. Positive values are displayed as filled squares, while negative values are displayed as open squares (unless you change the symbol). Plot `id&982' is the one that is drawn in the display for 2-D plots, so if, for example, you want to change the limits, you must use the syntax `SET PLOT id&982 X LIMIT' etc. +DECK,DUMP. 2 DUMP Syntax: DUMP Gives the data and fit values for each point and their contribution to the chi**2 or likelihood. +DECK,END. 2 END Syntax: END [par] This command has been eliminated in the Mn_Fit version of MINUIT. Restarts with a new set of datacards. Giving a non-zero parameter means do not enforce a `CALL_FCN 3' if it has not been done yet. +DECK,ERROR_DEF. 2 ERROR_DEF Syntax: ERROR_DEF up where: up is the change in the chi**2/likelihood Sets the change in the chi**2 or likelihood that is used to define the error on a parameter. +DECK,EXCLUDE. 2 EXCLUDE Syntax: EXCLUDE xlo xhi or EXCLUDE axis xlo xhi where: axis is the axis name (defaults are x and y) xlo is the lower limit of the exclusion xhi is the upper limit of the exclusion Excludes a region of the histogram from the fit. If you are fitting a 2-D histogram, you must specify which axis the exclusion applies to. If you omit the axis name the default is the x-axis. If you are fitting more than one histogram simultaneously, you will be prompted for which histogram the exclusion applies to. If you just give the command `EXCLUDE', you can give several regions to exclude, then hit `' to exit `EXCLUDE'. +DECK,NO_EXCLUDE. 2 NO_EXCLUDE Syntax: NO_EXCLUDE Removes any exclusions. +DECK,EXIT. 2 EXIT Syntax: EXIT [par] Returns to program that called MINUIT. Giving a non-zero parameter means do not enforce a `CALL_FCN 3' if it has not been done yet. +DECK,FCN_DRAW. 2 FCN_DRAW Syntax: FCN_DRAW k xlo xhi ylo yhi Defaults: xlo = ALIM, xhi = BLIM, ylo = AMIN-20*UP, yhi=AMIN+20*UP. (If x has no limits, defaults are x +/- parabolic error) Draws FCN as a function of 1 parameter. This command is superceded by `FCN_PLOT' and `PROB_PLOT' if you have a graphics device. You can give either the parameter number or its name. Scans `xlo' to `xhi' in 50 steps and bins the FCN value from `ylo' to `yhi' in 30 steps (so as to fit on 1 page). NO check is done on exceeding limits on variable `x' (if any), so be careful! +DECK,fcn_plot. 2 FCN_PLOT Syntax: FCN_PLOT name|number xlo xhi ylo yhi where: name is the name of the variable you want to plot number is the parameter number xlo is the minimum value xhi is the maximum value ylo is the minimum value of the chi**2 or likelihood yhi is the maximum value of the chi**2 or likelihood Plots the chi**2 or likelihood as a function of one of the fit parameters. NO check is done on exceeding limits on variable `x' (if any), so be careful! You can give either the parameter number or its name. See HELP MINUIT PROB_PLOT and HELP MINUIT CHI_PLOT for other ways to plot the fit probability as a function of the value of a variable. See HELP MINUIT MNCONTOUR for contour plots. +DECK,FIT_INFO. 2 FIT_INFO Syntax: FIT_INFO Gives information on the value of the parameters, etc. Parameters that are fixed are prefixed by a `*' and those that are constrained are prefixed by a `#'. Both the MINUIT and the Mn_Fit parameter numbers are given. +DECK,FIX. 2 FIX Syntax: FIX var1 [var2 ...] Fixes the list of variables you give. You can specify up to 7. +DECK,FLOAT. 2 FLOAT Syntax: FLOAT var1 [var2 ...] Restores up to 7 parameters (reverse of `FIX'). +DECK,GRADIENT. 2 GRADIENT Syntax: GRADIENT This command should not be used inside Mn_Fit. Indicates that your FCN routine is capable of calculating first derivatives. (Means `IFLAG=2' will also be used in addition to the standard `IFLAG=4'). They will then be used by `MIGRAD' (instead of by-hand finite difference quotients which may be inaccurate). Mind you, it really does not pay off. Probably you will boil off a lot of c.p.u. time without getting your money's worth back. Difference quotients are usually quite good (except maybe when calculating the error matrix, but you'll run `MINOS' anyway, won't you???) NO_GRADIENT turns it off again. +DECK,NO_GRADIENT. 2 NO_GRADIENT Syntax: NO_GRADIENT Turns off GRADIENT. +DECK,HELP_SYNTAX. 2 Help_syntax This following syntax only applies if you are running MINUIT stand alone. From within Mn_Fit you say `HELP command_name'. If you invoke help via `MINUIT> help name' then you will get help from `NAME//HELPMIN.HLB' rather than the default help from MN_FIT_HELP:MN_FIT.HLB'. This definition then stays valid until changed again. Note (1) ... That if `name' ends in `.hlb' then the library name is taken to be `name' rather than `NAME'//HELPMIN.HLB. You have to supply only directories and/or filenames, the disk will always be assumed to be `USER$DISK' (unless you specify it yourself). Note (2) ... That if you issue `MINUIT> help =name', the new help library will be defined, but will get no help until you issue `MINUIT> help'. +DECK,HESSE. 2 HESSE Syntax: HESSE Recalculates the covariance matrix. This is very useful if the errors get too small for some reason. Note that when the matrix gets printed the off-diagonal elements are the correlation coefficients, not the elements of the matrix: C(i,j) = V(i,j) / sqrt(V(i,i)*V(j,j)). The diagonal elements are the parabolic errors. If the `PRINTOUT' level is 0 or greater the covariance matrix is also shown. +DECK,IMPROVE. 2 IMPROVE Syntax: IMPROVE nloop where: nloop is the number of tries to make (default = number of variables) Tries to improve the current fit. Be careful that your parameters do not go wild using this routine. It has a nasty habit of giving floating overflows, so you should protect your function against going negative, by setting limits on parameters if necessary. +DECK,INCLUDE. 2 INCLUDE Syntax: INCLUDE xlo xhi or INCLUDE axis xlo xhi where: axis is the axis name (defaults are x and y) xlo is the lower limit of the inclusion xhi is the upper limit of the inclusion Includes a region of the histogram to be fit. If you are fitting a 2-D histogram, you must specify which axis the inclusion applies to. If you omit the axis name the default is the x-axis. If you are fitting more than one histogram simultaneously, you will be prompted for which histogram the inclusion applies to. If you just give the command `INCLUDE', you can give several regions to include, then hit `' to exit `INCLUDE'. +DECK,NO_INCLUDE. 2 NO_INCLUDE Syntax: NO_INCLUDE Removes any inclusions. +DECK,INFO. 2 INFO Syntax: INFO Provides full info of current fit status. The value of FCN is the current value of the chi**2 or likelihood. +DECK,ITERATIONS. 2 ITERATIONS Syntax: ITERATIONS [niter] (default = 1) Shows the current fit every `niter' calls to FCN. WARNING: This command has not been tested for a long time -- use with care! +DECK,NO_ITERATIONS. 2 NO_ITERATIONS Syntax: NO_ITERATIONS Turns off showing of fit iterations. +DECK,MATOUT. 2 MATOUT Syntax: MATOUT Writes the covariance matrix to the current output unit. +DECK,MAX_CALLS. 2 MAX_CALLS Syntax: MAX_CALLS ncall where: ncall is the maximum number of calls Sets the maximum number of calls for `SIMPLEX', `MIGRAD' and `MINOS'. +DECK,MIGRAD. 2 MIGRAD Syntax: MIGRAD [vtest] where: vtest is the convergence criterion (default = 0.04) Invokes the MIGRAD minimizer which is the best one to use for almost all cases. The maximum number of calls can be set with the `MAX_CALLS' command. +DECK,MINIMIZE. 2 MINIMIZE Syntax: MINIMIZE This command does `SIMPLEX' followed by a standard `MIGRAD' (`VTEST=0.04') +DECK,MINOS. 2 MINOS Syntax: MINOS [pars] where: pars is a list of parameters Calculates the MINOS errors for the list of parameters given. If you omit the list of parameters, the errors are calculated for all floating parameters. The maximum number of calls can be set with the `MAX_CALLS' command. Note that when the external covariance matrix gets printed the off-diagonal elements are the correlation coefficients, not the elements of the matrix: C(i,j) = V(i,j) / sqrt(V(i,i)*V(j,j)). The diagonal elements are the parabolic errors. If you make a plot of your fit parameter with MINOS errors and then you want to store the histogram, you should not use the `STORE' command, as HBOOK does not know about asymmetric errors in its normal histograms. Instead use the `DAT_STORE' or `MN_STORE' commands that write the plots out in an ascii file or in Mn_Fit format. +DECK,MNCONTOUR. 2 MNCONTOUR Syntax: MNCONTOUR par1 par2 [npnt] where: par1 is the first MINUIT parameter number par2 is the second MINUIT parameter number npnt is the number of points Defaults: npnt = 40 Makes a graphical contour plot of 2 parameters. For each point the function is minimized with respect to all the other parameters. You can set the contour level using the ERROR_DEF command, which determines the change in chi**2 or likelihood that the contour represents. If the print level is >-1 the contour will also be printed on the terminal. Note that if you change the error definition to get a 2 sigma contour for example you should re-minimize before giving the `MNCONTOUR' again. The contour is stored in a scatter plot 98765&999 which you can `COPY' or `RENAME' before giving another contour command if you want to keep it. This command is only available in the CERN version of MINUIT. +DECK,MODIFY. 2 MODIFY Syntax: MODIFY K UK WK AK BK where: K is the MINUIT parameter number you want to modify. UK is its value. WK is its starting error. AK is its lower limit (if any). BK is its upper limit (if any). Modify, fixes and/or restores MINUIT parameters. In addition, a parameter with(out) limits can be changed to have not (have) limits. !\index{limits} Each of last 4 parameters can be specified as a (floating) number or a register, parameter etc. or as the character `=' which means keep the present value. `MODIFY' will reset `ISW(2)' to zero, meaning that all fits start from rock bottom (i.e. `SIMPLEX'). The covariance matrix is also killed. In the CERN version `MODIFY' completely redefines the parameter. Thus if you set the error to 0, the parameter is constant and can only be made variable again by using the `MODIFY' command - `FLOAT' does not work. In the C. Rippich version a parameter that was fixed in the input dialogue stays fixed for all eternity! +DECK,PAGE. 2 PAGE Syntax: PAGE Starts a new page on unit 6 [ISYSWR]. +DECK,PRECISION. 2 PRECISION Syntax: PRECISION edm (default = 0.1) where: edm is the convergence criterium for the minimizers Sets the convergence criterium for SIMPLEX and MIGRAD. +DECK,PRINTOUT. 2 PRINTOUT Syntax: PRINTOUT level where: level is the printout level (default = 0) Changes the level of printout. Suggest `PRINTOUT -4' if you want to suppress all printout. In that case, `MINOS' still gives a full analysis, and `INFO' still works, but all that other junk is cut off. Error/warning messages still get through! +DECK,PROB_PLOT. 2 PROB_PLOT Syntax: PROB_PLOT name|number xlo xhi ylo yhi where: name is the name of the variable you want to plot number is the parameter number xlo is the minimum value xhi is the maximum value ylo is the minimum value of the probability to plot yhi is the maximum value of the probability to plot Draws the fit probability as a function of one of the fit parameters. Note that the probability is relative to that at the current minimum, i.e. the probability should always be 1 at the present parameter values. If a new minimum is found, an error message will be printed and the probability set to 1 there also. NO check is done on exceeding limits on variable `x' (if any), so be careful! You can give either the parameter number or its name. See HELP MINUIT FCN_PLOT and HELP MINUIT CHI_PLOT for other ways to plot the fit probability as a function of the value of a variable. See HELP MINUIT MNCONTOUR for contour plots. +DECK,punch. 2 PUNCH Syntax: PUNCH Saves the current MINUIT parameter values in a file. Inside Mn_Fit the `FUNCTION STORE' commmand is much more useful (see HELP FUNCTION STORE for more details). +DECK,RELEASE. 2 RELEASE Syntax: RELEASE var1 [var2 ...] Standard `MINUIT' command for `FLOAT'. Restores up to 7 parameters (reverse of `FIX'). +DECK,RESTORE. 2 RESTORE Syntax: RESTORE n where: n = 0 means restore all previously fixed variables = 1 means restore the last variable fixed Restores a parameter. In Mn_Fit use the `FLOAT' command. See HELP MINUIT FLOAT. +DECK,save. 2 SAVE Syntax: SAVE Saves the current MINUIT parameter values in a file. Inside Mn_Fit the `FUNCTION STORE' commmand is much more useful (see HELP FUNCTION STORE for more details). +DECK,SCAN. 2 SCAN Syntax: SCAN [npar] [numpts] [from] [to] where: npar is the MINUIT parameter number numpts is the number of points in the scan from is the lower limit of the scan to is the upper limit of the scan Defaults: npar = 0 Scans one or all parameters leaving the others fixed. This command is only available in the CERN version of MINUIT. +DECK,SEEK. 2 SEEK Syntax: SEEK nloop [devs] where: nloop is the number of calls made in the search devs is the number of deviations each side of the parameter Defaults: devs = 3 Make a random search in all variable parameters for the function minimum. `SEEK' does a uniform search within `devs' times the current step size for each parameter. Each new minimum found shifts the parameters and the centre of the search. +DECK,SIMPLEX. 2 SIMPLEX Syntax: SIMPLEX Invokes the fairly crude SIMPLEX minimizer. +DECK,STANDARD. 2 STANDARD Syntax: STANDARD Calls routine `STAND' (without argument list) whose default version sits in the library as a simple `RETURN+END'. To get your own, include it in the LINK command. +DECK,STOP. 2 STOP Syntax: STOP Executes a `STOP' right now. +DECK,STRATEGY. 2 STRATEGY Syntax: STRATEGY num where: num is the strategy number Defaults: num = 1 Specifies the strategy for fitting. Higher values mean more FCN calls and more reliable minimization, but more CPU time. Command only valid in CERN MINUIT. +DECK,UNIT. 2 UNIT Syntax: UNIT lun where: lun is a new input unit WARNING: Do not use this command in Mn_Fit. Use the EXEC command to read in commands from a file. Redefines the input unit 5 [ISYSRD]. You get a prompt `MINUIT>' or `OPER>' as long as ISYSRD=5. When you switch to `ISYSRD.NE.5' (for which you have to make an `ASSIGN' statement before running your job). You will no longer get a prompt. Unit 5 is understood to be a terminal (also in batch mode). +PATCH,CHANGES,T=TEXT. +DECK,CHANGES. 1 Changes The following subtopics list the changes made for the version indicated. The top name Vn_mm corresponds to the CMZ version number Vn.mm/ll which is given when you start up Mn_Fit. Note that all changes before 01/12/89 are under topic V2_00_00. The manual only includes changes made in version 4.01 and later. +DECK,v4_07. 2 V4_07 17/09/2003 The following version numbers apply to this version of Mn_Fit: Mn_Fit 4.07/35 Mn_Util 1.12/34 TYPSCN 1.02/18 CGR_MINUIT 1.00/15 DBASE 1.05/06 L3_DSP 1.02/16 ZEUS_DSP 1.00/05 This section lists the changes that have been made since Mn_Fit version 4.06/14. Check `HELP CHANGES V4_06' for a list of changes made in version 4.06, some of which you may have missed if you have been running a version earlier than 4.06/14. This release has been tested with the 99 and 2000 releases of the CERN libraries. Versions earlier than 98 are known to have date/time problems. +++ Known Bugs or Problems: ___________________________ `DRAW' commands with the mouse on only work in CM. You cannnot give a range of array elements to use in a `CUT' command. This only works in the variables to be projected. If you need to do something fancy like this you have to use a COMIS function for the cut. You can only access a variable in a CWN using the `DEPOSIT/EXAMINE' commands. It is not possible to access array elements this way. +++ New Features: _________________ Cernlib version 2000 is now the default. This version of Mn_Fit is Y2K compatible. CWN variable names of up to 32 characters are now supported. `CUT' expressions can now be up to 255 characters long. The colour of symbols, hatchs and patterns can be given with the `PLOT' command and for the `FUNCTION PLOT' and `OVERLAY' commands. You can also define your own colour names for up to 20 different colours. `DRAW SEGMENT' draws the segment of a circle using the endpoints and sagitta (useful in Feynman graphs etc.). `SET IGARC' turns on/off using HIGZ IGARC routine for circles, as it appears to have a bug that cause it to ignore what you set for colour and thickness. Font -1004 is default for all sites and platforms. This means that the text stays as it was on the screen, but uses Helvetica Poscript fonts when you print the pictures - see HELP Text for more information. The underflows and overflows for the default plot are now also stored in registers >230. 200 user variable names are now available. You can use `..' instead of backslash to go up 1 HBOOK directory level. Multiple `..' will not work. HBOOK directory names can contain spaces. Enclose the name in quotes. You can use the syntax `SET DUMP SCREEN' to direct dump output to the screen and `SET DUMP > [filename]' to direct dump output to a file (alternatives to `TTY' and `LPT', as these terms are no longer in common use). The command `HMERGE' has been introduced to allow the merging of CWN's and complete RZ files. You can set the paper size using the `SET PAPER' command. The `HELP' text (and therefore also the manual) has been proofread and many corrections and improvements have been included. +++ New Commands: _________________ DRAW SEGMENT Draws a circle segment using endpoints and sagitta. HMERGE Merge one or more HBOOK RZ files into a single file. HPRINT Calls HPRINT for an HBOOK histogram. TEXT Same as `COMMENT' command without specifying the plot identifier (planned, but not yet implemented). SET COLOUR DEFAULT Set the colours to the default HIGZ colour scheme. SET COLOUR BACKGROUND Give a background colour for plots. SET DUMP SCREEN Alias for `SET DUMP TTY'. SET DUMP > Alias for `SET DUMP LPT' with optional filename. SET IGARC Uses HIGZ IGARC routine for circles or Mn_Fit code. SET PAPER Set the paper size. +++ Modified Commands: ______________________ CUT Expressions can now be up to 255 characters long. PLOT Allow colour to be given with the symbol, hatch and pattern. OVERLAY Allow colour to be given with the symbol, hatch and pattern. FUNCTION PLOT Allow colour to be given with the symbol. FUNCTION OVERLAY Allow colour to be given with the symbol. SET COLOUR ON Turns back on colour, but does not change the colour map. SET PLOT id DEFAULT Also fills registers with underflows and overflows. +++ Improvements and Bug Fixes: _______________________________ Cernlib version 2000 is now the default. A serious bug was found when combining simple cuts (numbers or registers used for cut values) with more complicated expressions. The cut values could be overwritten - see HELP CUT for more details. This has been fixed in version 4.07/30. Thanks to Ahren Sadoff for spotting this and providing an example. You can given the symbol, hatch and pattern colours with the `PLOT' and `OVERLAY' commands. You can give the symbol colour with the `FUNCTION PLOT' and `FUNCTION OVERLAY' commands. Colour handling has been improved. You can name your additional colours and up to a total of 20 colours are allowed. From version 4.07/29 onwards 50 colours are allowed. Polygons can have up to 200 points (used to be 50). You can draw up to 2000 items now. Gluon drawing in plot coordinates should now be correct (the endpoint was drawn in slightly the wrong place. Drawing of first/last items should now be much improved. There were bugs in the old handling of items that should be drawn first in `PLOT' coordinates. User variable lengths of 8 characters are properly enforced and a warning is given if you try to make one that is longer. As a result of the above, the function `DATE_TIME' has been renamed to be `DATE_TIM'. Added MNSTAT to the list of known routines, so that one can find out how many parameters are being fit etc in COMIS routines. Along with the support for variable names of up to 32 characters in CWNs, the checking of the variable name has been improved, so that abbreviations do not work anymore. Length of many character variables increased to cope with long filenames etc. HBOOK subdirectories can be up to 16 characters. This is an RZ restriction. The `SET PLOT id DEFAULT' commands now also fills registers with underflows and overflows. Before version 4.07/20 it also overwrote registers 1 to 27. `SET HIST' did not recognise correclty that a command line was finished. The number of user variables names has been increased to 200. HBOOK and Mn_Fit commons increased in size for CLEO. Opening of an RZ filename with uppercase letters and the wrong record length should now work. It should now be possible to open and close many HBOOK RZ files. The command `HCLOSE' should close all files properly. It was not clear if it was really doing its job before. You can use variable numbers instead of the name for CWNs in the `NTUPLE PROJECT' command. However, this only works for single variables and not arrays, so is not recommended. Dumping of row-wise Ntuples gave screwed up numbers. Up to 100 subdirectories are shown with the `LDIR' command. Previous limit was 20. Help for polynomial function corrected. Help for ARGUS background function also corrected. Spurious lines drawn in overlays should no longer happen. Internal names of GETLUN routines have CLEO_ added as a prefix to avoid conflicts with ADAMO. +DECK,v4_06. 2 V4_06 06/04/2000 The following version numbers apply to this version of Mn_Fit: Mn_Fit 4.06/14 Mn_Util 1.11/14 TYPSCN 1.02/16 CGR_MINUIT 1.00/15 DBASE 1.05/06 L3_DSP 1.02/16 ZEUS_DSP 1.00/05 This section lists the changes that have been made since Mn_Fit version 4.05/34. This release has been tested with the 99 and 2000 releases of the CERN libraries. Versions earlier than 98 are known to have date/time problems. It will only work with versions 94b or later. +++ Known Bugs or Problems: ___________________________ `DRAW' commands with the mouse on only work in CM. You cannnot give a range of array elements to use in a `CUT' command. This only works in the variables to be projected. If you need to do something fancy like this you have to use a COMIS function for the cut. You can only access a variable in a CWN using the `DEPOSIT/EXAMINE' commands. +++ New Features: _________________ Cernlib version 99 is now the default. Version 2000 is recommended. This version of Mn_Fit should be Y2K compatible. Font -1004 is default for all sites and platforms. This means that the text stays as it was on the screen, but uses Helvetica Poscript fonts when you print the pictures - see HELP Text for more information. The axis labels are now aligned with the left (bottom), centre or right (top) of the plot as well as being appropriately adjusted. This makes it easy to make them the same as default PAW position. Symbols 50-79 added which put a small line (symbol size) at the end of an error bar. The ZEUS display for FTD has been improved significantly and new options have been added. +++ New Commands: _________________ SET TKTCL Turns on/off the TK/TCL interface. HELP Y2K Explains how years from 2000 onwards are implemented. +++ Modified Commands: ______________________ DATABASE DB_SNAP Can now handle years from 2000 onwards. DATABASE DB_HISTORY Can now handle years from 2000 onwards. SET X|Y|Z LABEL Alignment option implemented fully. SET SYMBOL New symbols added to put cross-bars on errors. SET PAR FTD More options added. +++ Improvements and Bug Fixes: _______________________________ Cernlib version 99 is now the default. 2000 is recommended. This version of Mn_Fit should be Y2K compatible. The axis labels are now aligned with the left (bottom), centre or right (top) of the plot as well as being appropriately adjusted. This makes it easy to make them the same as default PAW position. Symbols 50-79 added which put a small line (symbol size) at the end of an error bar. Trimming of the last number on the y-axis was done whatever the window spacing. `CUT LIST' crashed if a cut filename was longer than 55 characters. Added TOPDRAW smoothing routines (SMCTRL) to the list of routines known by COMIS. Select options structured better. New experiments DESYAFS and CERNAFS introduced. @ removed from experiment name. BONNCIP added instead of CIP being an extra option. L3 and ZEUS displays can be explicitly selected instead of being implicit in ZEUS and L3. The flags L3DSP and ZEUSDSP in the Mn_Fit code have been renamed to L3DSP_SRC and ZEUSDSP_SRC, as L3DSP and ZEUSDSP are used in the scripts. Several bug fixes to allow Mn_Fit to be compiled and run with bounds checking and debug. L3 database interface did not work with 99, 2000 versions of the CERN libraries. Call to MZDIV now added, I/O is now with CIO and some other minor fixes. A bug in the making of the test histograms meant that the test script for `DAT_STORE' also had to be corrected. +DECK,v4_05. 2 V4_05 16/06/99 The following version numbers apply to this version of Mn_Fit: Mn_Fit 4.05/34 Mn_Util 1.10/42 TYPSCN 1.02/15 CGR_MINUIT 1.00/15 DBASE 1.05/04 L3_DSP 1.02/16 ZEUS_DSP 1.00/04 This section lists the changes that have been made since Mn_Fit version 4.04/15. This release has been tested with the 96a and 97a releases of the CERN libraries. It will only work with versions 94b or later. With version 96a and earlier you cannot use the routines FUNLUX and FUNLXP in COMIS functions, as these are new routines in the CERN libraries. +++ Known Bugs or Problems: ___________________________ `DRAW' commands with the mouse on only work in CM. You cannnot give a range of array elements to use in a `CUT' command. This only works in the variables to be projected. If you need to do something fancy like this you have to use a COMIS function for the cut. You can only access a variable in a CWN using the `DEPOSIT/EXAMINE' commands. +++ New Features: _________________ Cernlib version 97a is now the default. You can access histograms directly from an HBOOK histogram file provided you have already opened the file using the `OPEN' or `HB_OPEN' command. You can use the command `SET AUTOFETCH OFF' to suppress the automatic fetching of histograms or refetching of Ntuples when you project or scan them. While this is normally not necessary, it can take a long time for very big Ntuples. `CUT's with names can now be defined and the names can be used in the `CUT USE' command. This should simplify the writing of macros and defining which cuts to use. All Mn_Fit functions now include the bin width. This was always the case for Gaussians, Breit-Wigners etc. However polynomials did not include the bin width. This gives problems when trying to integrate the functions. Where appropriate, the names of `NORM' parameters have been changed to `AREA' to reflect this. The `FUNCTION PLOT' and `FUNCTION HISTOGRAM' etc. commands now also work for 2-D functions (only Gaussian is available directly - for other 2-D functions you have to write them yourself). It is now possible to specify more resonances for the dipion invariant mass spectra (`FUNCTION ADD DIPION'). It is also possible for the user to give his/her own masses. More help has been added on a number of the functions. For functions that include extra parameters, such as resonance masses, these are now shown in the `FUNCTION INFO' command. Some function names have been modified, so it is now possible to add all functions by name as well as number. In order to add a 2-D Gaussian you now have to give the command `FUNCTION ADD 2DIM GAUSS' (`FUNCTION ADD 2DIM' used to be sufficient). See HELP FUNCTION LIST for the latest list of functions. `ELIF' is now allowed in `IF' blocks. See HELP IF for more details. You can also use the command `FI' instead of `ENDIF'. In earlier 4.05 versions of Mn_Fit `ELIF' and `ELSE' do not work together properly. This has been fixed from version 4.05/29 onwards. You can give the default value of a parameter after the prompt in the `INQUIRE' command. You can add directories to the path using the form `SET PATH +dir'. CWN variables can now be accessed in expressions. However, this does not yet work for arrays. `DEPOSIT IRn' works. !^ German characters with umlauts can now be given with the syntax `\"a' !German characters with umlauts can now be given with the syntax \texttt{\\"a} etc. Extra information has been added to HELP Text. The global/user title size and positions can now be set separately from the normal histogram titles. See HELP SET TITLE and HELP SET GSIZE for more details. The global/user title size is not automatically scaled when windowing. The automatic scaling of sizes set a maximum rather than a minimum size. The title offset is now also scaled. The making of an inserted plot with `PLOT/NOCLEAR' only worked if you were windowing at the same time. It is now possible to use it also when not windowing. This also enables you to put a frame around a plot in a different place than the plot boundaries set by `SET X|Y LIMITS'. See HELP HISTOGRAM PLOT for more details. 2-D histogram plotting has ben improved. The `AUTOTRIM' option is no longer used in lego and surface plots, as the scales do not overlap. The labels and scales should now get drawn in the right place and at the right angle for phi rotations outside the 0 to 90 degree range. It is now possible to make filled colour contour plots using the `2DIM SURFACE' command. See HELP 2DIM SURFACE for more details. The colours for coloured surface and lego plots can now be specified on the command line. Contour and surface plots usually start in the centre of the first bin rather than at the edge of the bin. With the help of one of the examples I show how one can put the frame at the centre of the bin (thanks to Jim Smith for the suggestion). `SET Z MODE LOG' also works for 2-D histograms which are shown with the area proportional to the number of entries. `CLEAR' also deletes any existing comments and keys. With the option `SET BOX ON' a box will also be drawn around a picture that does not include any `PLOT' commands. You can use `SET NTUPLE NAME' to specify the names of Ntuple variables to be used if you book an Ntuple inside Mn_Fit with the `HISTOGRAM BOOK' commmand. The `SET FOOTER USER' command has been extended to allow the user to put in the date, time and hardcopy filename. You can also split the footer between the bottom left and bottom right of the page. If you create many histograms in a COMIS function you can now give `HB_MN_FIT' a range of identifiers to convert. The maximum number of histograms that can be converted has been increased from 100 to 200. The new CERNLIB random number generators have been added to the list of routines that can be called from COMIS functions. These include `RANLUX, RANMAR, RANECU, RNORML, FUNLUX'. See HELP Using_COMIS for more details on which routines are available. You can now use the secondary identifier to specify which cycle to fetch from HBOOK RZ files. The cycle number will be added to the current setting for the secondary identifier. This is useful if you store a series of Mn_Fit histogram which have the same primary identifier, but different secondary identifiers, as they then get stored in an HBOOK RZ file with the same identifier, but different cycles. Use the `ZDIR' command to see which cycle numbers exist. It may be that you do not want to have to tell Mn_Fit to continue if there is an error when executing a macro or defined command. Use the `SET ABORT' command to set this option. You now have to type at least `QUI' to quit Mn_Fit. Event display for ZEUS Forward Tracking Detector and Transition Radiation Detector added. +++ New Commands: _________________ OPEN Synonymous with `HB_OPEN'. CUT NAME Defines or modifies a `CUT' with a name. ELIF `ELIF' can now be used in `IF' blocks. FI Alias for `ENDIF'. SET TITLE GPOSITION Sets the position and size of the global/user title. SET GSIZE Sets the size of the global/user title. SET AUTOFETCH Turns on/off the automatic fetching of histograms or refetching of Ntuples. SET NTUPLE NAME Sets the names of Ntuples variables that are then used with the `HISTOGRAM BOOK' command. SET ABORT Turns on/off the aborting of macros when an error occurs. +++ Modified Commands: ______________________ CUT USE Either CUT names or numbers can be used. HB_MN_FIT You can optionally specify which histograms to convert. FETCH You can use the secondary identifier to specify the cycle to fetch. HB_FETCH You can use the secondary identifier to specify the cycle to fetch. 2DIM LEGO Colours can be given on the command line. 2DIM SURFACE Colours can be given on the command line. Can be used to make a filled contour plot. PLOT/NOCLEAR The window size and margin (`WSIZE' and `WMARGIN') can be used even when not windowing. FUNCTION PLOT Works for 2-D functions also. FUNCTION HIST Works for 2-D functions also. INQUIRE Default values for parameters can be given. WAIT Works for Unix machines also. DEPOSIT Expression can now access CWN variables. CLEAR Also deletes any existing comments and keys. SET PATH Directories can be added to the path. SET FOOTER More control over user format, including hardcopy filename. QUIT You must now type at least `QUI' to quit Mn_Fit. Functions All Mn_Fit functions now include the bin width. +++ Improvements and Bug Fixes: _______________________________ Cernlib version 97a is now the default. Linux version now available. `NTUPLE EPROF' made a profile plot with the wrong errors. `SET NTUPLE VARIABLE' should work properly for CWNs. Use of a CWN variable as a weight works. Ntuple skeleton for logicals in CWNs fixed. Ntuple skeleton was wrong if it had more than 30 lines. The limit is now 80 lines. CWNs with only a one or two variables or arrays should now be correctly recognised. The trigonometric and Crystal ball lineshape functions were missing RETURNs. This caused unpredictable behaviour. Improved scales when the scale includes zero. Small improvements to `DUMP'. HPRINT removed from `DUMP' as it causes crashes on the ZEUS FDET DQM history Ntuple (also in PAW). There are still some strange problems that appear to be associated with `DUMP' and CWN's that have to be investigated more. `CAPTURE DISPLAY' caused a segmentation violation if the DISPLAY was :0.0. For other reasons it also caused a segmentation violation on Decstations. There were some problems when combining `IF' blocks and `DO' loops. These should now be fixed. The modification of the `higz_windows.dat' file that controls the size of your display now conforms to the HIGZ specifications again. Improved cleaning up of Ntuples before reading a new file. Caused strange problems on Alphas and Decstations. The automatic scaling of sizes set a maximum rather than a minimum size. The title offset is now also scaled. Up to 100 cuts are now allowed (used to be 40). Up to 5000 histograms can now be stored in Mn_Fit memory for Unix machines for CLEO and 2000 for others/ There was an error when opening the 10th EPS file. The mean and RMS for scatter plots was not stored in the right place, so always appeared to be zero. The mean and average calculation was skipped for 4.05 versions earlier than 4.05/21, if you had already fetched a Columnwise Ntuple. Space for integers and reals in CWNs increased to 50000 words. `HB_MN_FIT' can now fetch up to 200 histograms at once (used to be 100). You can now plot 200 histograms and still `HARDCOPY' or `REDRAW' them. The maximum length for macro arguments was 40 characters. This has been increased to 80. The length of commands in `DEFINE' blocks has been increased to 255 characters (including continuation lines). Using FORTRAN `INQUIRE' to find out if a file exists did not always work on Decstations (Alphas also?). Changed to use `ACCESSF' from the CERN libraries for Unix machines. Should mean that the Mn_Fit help files no longer need to be world writeable. Some further checking on whether `INQUIRE' returned something sensible added. One too few characters was passed to shell command (only appears to have affected Linux). There was a bug in the setting of options for 3-D plots. The z scale size on `2DIM COL/Z' plots can now be set properly. A number of local variables that should be saved were not saved (only affected machines for which the static option was not default or not set - probably only Linux). The font for 2-D plots for symbols -1 and -2 was not set properly. The COMIS user function number was not initialised to zero properly. Too many histogram operations required entries in a histogram before the operation would be performed. If the same histogram is plotted twice the header will only be printed once. Better error handling when accessing CWN variables in expressions. A `' after an `ALIAS' command was not properly protected. CWN only read in once when projecting. It used to be read in twice. A number of bugs connected with CWN's not being initialized properly fixed. The error message about 'Run out of room to store plots for hardcopy' will only be printed once, and also only printed if the active device is a screen device. The HELP subtopics were sometimes not listed if the last subtopic was a level lower than those that were being listed. STRATEGY command did not work. The font setting for individual plots for scales and labels did not work properly. Some more information added to SHOW LABEL and SCALE. Error returns from shell commands are now caught. The correct shell was not used for single command. The Cernlib functions GAMMA and DGAMMA have been added to the list of functions that can be used in COMIS. Bug when adding a dipion invariant mass function, could cause a segmentation violation. The server number can be set in the VMS version (-SERVER). The flag @CERN has been replaced by @CERNLIB as it is only used to say if the cernlib command is available. SOLARIS and Linux added as machine types. @ZEUS, @CIP added as flags. ZEUSDSP added as flag. $L3_ONL renamed as L3DSP. Cleanup/fixing of the libraries needed for Solaris. Some modifcations had to be made to the flags for compiling under IRIX 6.2 and system IRIX64. IRIX verison should now also be able to use cc. +DECK,v4_04. 2 V4_04 12/06/96 The following version numbers apply to this version of Mn_Fit: Mn_Fit 4.04/15 Mn_Util 1.09/24 TYPSCN 1.02/12 CGR_MINUIT 1.00/15 DBASE 1.05/04 L3_DSP 1.02/14 This section lists the changes that have been made since Mn_Fit version 4.03/49. This release has been tested with the 95a release of the CERN libraries. It will only work with versions 94b or later. +++ Known Bugs or Problems: ___________________________ `DRAW' commands with the mouse on only work in CM. The `IGTABL' scale is not always drawn on the right axes, or exactly in the right place if rotations of more than 90 degrees are used. +++ New Features: _________________ Plotting with a date or time as axis labels is now implemented. New functions for expressions - DATE, TIME, TIME_MIN, DATE_TIME and DATE_MIN. These are mainly to be used for plots vs date or time and can be used to convert dates in the form YYMMDD etc. See HELP Time and HELP Expressions for more details. New help topics on time and vectors added. You can now `DRAW' in plot coordinates, even if you have not plotted anything! To do this you must set the x and y limits. See HELP DRAW for more details. The functions which evaluate functions at a particular point, FPOS, FNEG, etc. have been tested and now work properly. See HELP Expressions for more details. A cut can have an expression on both sides of the condition. `IF' statements allow arithmetical expressions. Projections of 1-D histograms now work. This is useful if you want to calculate an expression of the x-axis variable, e.g. cos(x). 2-D histogram plotting has many new options easily available and documented. All IGTABLE options are now built into Mn_Fit. The command `2DIM' can be used as a simple interface, or the old method using `SET IGTABLE' followed by `IGTABLE' also works. `LEGO' and `SURFACE' plots, including `IGTABLE', work properly with log scales. A list of directory names, similar to the Unix PATH, can now be given using the `SET PATH' command. These directories are used when trying to open existing files. A footer can be added to a picture, either with default text that gives the date and time that the plot was made, or with user text. The key for symbols 5->8 now works correctly and the line segment size can also be set. Hatched histogram symbols are also available. The automatic rescaling of text sizes when windowing, the dropping of the last scale value when windowing and in lego plots can now be controlled. See HELP SET AUTOSWITCH and HELP SET AUTOTRIM for more details. You can plot the chi**2 vs. a variable even if you are doing a likelihood fit using the `CHI_PLOT' command. Otherwise the command is the same as `FCN_PLOT'. The `COPY' and `RENAME' commands copy the associated HBOOK histogram, only if it is not an Nutple. The `HELP' and `HISTOGRAM|NTUPLE DUMP' commands now invoke a pager by default. This means the help will not scroll off your screen. See HELP SET PAGER for more details on how to control the paging. New options have been added to the ECAL display. It is now possible to draw single boxes, rescale the picture easily, overlay displays and make a display directly from an Ntuples. See HELP SET PARAMETER ECAL for more details. +++ New Commands: _________________ HISTOGRAM 2DIM 2-D histogram plotting using IGTABL. 2DIM 2-D histogram plotting using IGTABL. CHI_PLOT Plot the chi**2 vs. a variable. SET IGTABLE Alias/replacement for SET HIGZ TABLE. SET FOOTER Turns on or off footer and user text. SET FSIZE Change the text size for the footer. SET AUTOSCALE Turns on or off the auotmatic resclaing of text sizes when windowing. SET AUTOTRIM Turns on or off the automatic dropping of the last scale value when windowing or in lego plots. SET COLOR Alias for SET COLOUR for Americans! SET PAGER Sets the paging command used by `HELP' and `DUMP'. SET PATH Sets list of directories used in file search.. SHOW FRAME Alias for `SHOW SCALE'. SHOW LIMIT Alias for `SHOW SCALE'. SHOW MODE Alias for `SHOW SCALE'. SIGN Now allowed in expressions. +++ Modified Commands: ______________________ LEGO Qualifiers allowed for IGTABL options. SURFACE Qualifiers allowed for IGTABL options. KEY Hatched histogram symbols now possible. KEY Line segment size and the text colour can now be set. DEPOSIT Date/time functions added. SET HIGZ TABLE Some options renamed and better prompts added. SET MODE Date and time modes added. SET PARAMETER ECAL New options and mode for L3 ECAL display. FCN_DRAW The parameter name or number can now be given FCN_PLOT The parameter name or number can now be given PROB_PLOT The parameter name or number can now be given +++ Improvements and Bug Fixes: _______________________________ Cernlib version 95a is now the default. Bug in calculation for `AVERAGE' command fixed. Filled and unfilled symbols for 2-D histograms did not work as advertised. If both of the limits were not zero, the entries outside the range still got drawn. `SHOW FRAME', `SHOW LIMIT' and `SHOW MODE' commands added as aliases for `SHOW SCALE', because `SHOW SCALE' really shows all 4 settings. Evaluation of function with FPOS, FNEG, etc. functions now works. If you were projecting a histogram with an expression things could get confused and you got error messages from `AMNE'. Dumping of Ntuples improved further. The contents of a series of points are filled properly, including underflows and overflows if they are outside the set limits. The default spline and smooth options for NAGLIB and IMSL were not set properly. Histograms with no entries should now get drawn completely straight away. Copying and renaming of projections of Ntuples should work properly. The associated HBOOK histograms no longer get copied or renamed if the histogram is an Ntuple. If you tried to fetch a range of HBOOK histograms the range had be given as the last of a list of histogram numbers. This is now fixed. Associated functions etc. of HBOOK histgorams get the filename attached. The filename of projections is that of the original histogram with a `*' prepended. Either the parameter number or name can be given for the `FCN_DRAW', `FCN_PLOT' and `PROB_PLOT' commands. Plot coordinates work properly for L3 Lumi BGO and SLUM displays. Commands for font setting modified slightly. Plotting of L3 Lumi BGO sectors 15 -> 1 did not show any energy in sector 1. +DECK,V4_03. 2 V4_03 15/09/95 The following version numbers apply to this version of Mn_Fit: Mn_Fit 4.03/49 Mn_Util 1.08/60 TYPSCN 1.02/12 CGR_MINUIT 1.00/15 DBASE 1.05/03 L3_DSP 1.02/09 This section lists the changes that have been made since Mn_Fit version 4.02/19. This release has been tested with the 94a, 94b and 95a releases of the CERN libraries. However the CWN interface only works with 94b or later. +++ Known Bugs or Problems: ___________________________ `DRAW' commands with the mouse on only work in CM. The `IGTABL' scale is not always drawn on the right axes, or exactly in the right place if rotations of more than 90 degrees are used. Naglib smoothing and spline fitting is not available on Apollo DN10000's. There is an error in the calculation of the `AVERAGE' command. +++ New Features: _________________ ColumnWise Ntuples are now supported. `NTUPLE FILTER' and `MERGE' do not work yet with CWN's. Suggestions on improvements to the CWN interface are very welcome. See HELP ColumnWise_Ntuples and NTUPLE for more details. If you need to pass the contents of registers, parameters etc. to another macro or defined command you can use the `PARSE' command. See HELP PARSE for more details and an example. Plots in radians can now be displayed with the scale in fractions of pi. Continuation lines are allowed. The maximum line length is a total of 255 characters. The comment and continuation line characters can be set. Note that comments are now removed immediately after reading a command line. If you have to include a comment character in a command (e.g. an `!' in a text string), the text string must be in single or double quotes. `STAT' command does an RZSTAT on the current input file. You can set the limits for a scatter plot when projecting from an Ntuple in the command line. Character information, such as Ntuple title and tags, is now available in COMIS functions. Gluon lines can be drawn. Amplitude and period of sine waves and gluons can be given. Polyline and ellipse drawing is available. `SET NTUPLE' command has new options and a modified syntax. You have to use `SET NTUPLE PLOT' to specify Ntuple variables to plot. You can show underflows and overflows in a plot with the new `SET HEADER COMPLETE' command. `SET HEADER FULL' has been renamed to `SET HEADER DEFAULT' (although `FULL' still works). `DUMMY' is allowed as a variable name for Ntuples read in with `DAT_FETCH' allowing columns to be ignored. COMIS memory, defined subroutines and common blocks can be listed using the `SHOW COMIS' command. FORTRAN units that have been opened or reserved can be listed using the `SHOW UNITS' command. The segment length for drawing lines can now be set (SET LSIZE). For the database interface options to plot the results and/or to subtract pedestals can be given. Database history the the L3 ECAL is available. Various parameters, such as the year, can be set for database access. For database history limits on acceptable values for including in the average can be set. In database history you can now give a negative 2nd time to ask for number of days, months or years that you want to see before the first time. L3 ECAL display can cope with histograms of half and whole detector. New plotting modes are available. Some installation flags have changed - should only affect installers. +++ New Commands: _________________ PARSE Parses and executes a command line. STAT Gives the statistics on the current HBOOK input file. DRAW ELLIPSE Draws an ellipse. DRAW POLYLINE Draws a polyline. SET PI Turns on or off using pi as a scale symbol. SET NTUPLE PLOT List of variables to plot (was `SET NTUPLE'). SET NTUPLE VARIABLE List of variables to fetch for a CWN. SET CHARACTER Sets the command and continuation line characters. SET DBASE Sets parameters for database access. SET FONT SYMBOL Sets the font for symbols. SET LSIZE Sets the segment length for lines. SHOW COMIS Lists COMIS memory, routines and common blocks. SHOW UNITS Lists FORTRAN units and who has grabbed them. MOD Can be used in expressions. +++ Modified Commands: ______________________ DRAW GLUON Really draws a gluon now. DRAW SINE Amplitude and period can be given. DUMP Points to dump can be given. HISTOGRAM DUMP Points to dump can be given. HISTOGRAM ERROR New mode which allows error on all points to be set. COMMENT Command must always be given. KEY Command must always be given. SET HEADER New option, `COMPLETE', `DEFAULT' is new name for `FULL'. SET NTUPLE Options added. NTUPLE PROJECT Setting limits for a scatter plot works. DATABASE Qualifiers added and new options. SET PAR ECAL New options. +++ Improvements and Bug Fixes: _______________________________ Cernlib version 94b is now the default. The X11 version of Mn_Fit is the default for all platforms. Any other version can be selected at install time. Readline is now the default for Unix versions. Readline can now be taken from /usr/local/lib or wherever it happens to be. For plots in degrees the scale should be improved. `NTUPLE MERGE' was always putting zeroes for the 1st file. Fetching of variable bin width histograms had a bug. Fetching of big Ntuples was not working sometimes. Standard Chebyshev, with overall normalization, did not give reproducible results. The Landau function now includes the bin width. Setting of x and y limits when projecting onto a scatter plot now works. If you project an Ntuple onto a 1-dimensional histogram, it will default to automatic binning. An expression for the projection of an Ntuple can now be longer than 80 characters. The full expression for a cut is shown if you use the `CUT LIST' command. You must always give the command for `COMMENT' and `KEY'. If you were adding a comment or key interactively and no comment or key existed, then the command `NEW' used to be assumed. Now you have to give the command. `DRAW SYMBOL' drew a symbol a factor of 2 smaller than the size asked for. Better checking is made of whether a file atually exists. This should reduce the number of inadvertently overwritten files with COMIS functions. Filenames can be upto 80 characters. Dumping of Ntuples and listing of cuts improved. Expressions for projections can be longer than 80 characters. COMIS functions gave intermittent problems on Alpha VMS. Fixed by using a special load option. However comis converts all filenames to lowercase, so you cannot have uppercase characters in your filename. `FIT/SLIKE' command caused a format mismatch error. Tick positions should be somewhat better for strange scales. Adding of a leading 0 to scales was not correct. Points at the limit of a plot were not drawn. This meant that bins with no entries were not drawn, even if the `SHOW_ZERO' option was on. Underflows and overflows for plots of dimension -1 (a series of data points) are now kept. This is mainly useful for variable binned histograms. If you asked for a 2nd help topic after the 1st topic had no sub-topics you used to get an error. This is now fixed. Comments are now stripped immediately after the command is read. Thus if you need a comment character in a command it must be in single or double quotes. Improved checking inside loops. A `RETURN' inside a `DO' loop that was not being executed was not ignored. Help files opened with readonly if possible on non-VMS machines. They should now be accessible by everyone, without having to give write permission. Length of shell string increased (/usr/local/bin/bash should now be OK). Number of drawn items can be up to 100 and is now checked. User and global titles should no longer be overwritten by the header. Use of backslash to quote an `!' did not work properly on some machines - Decstations, IBM RS6000. This has been fixed in TYPSCN. `FUNCTION STORE' did not free its unit, leading eventually to a crash of Mn_Fit if you gave this command many times. If you tried to `EXECUTE' a non-existing macro the unit number was not released. The units used for `DRAW STORE' and `DRAW FETCH' had the same problem. Error return when adding COMIS functions improved. VAX Help replaced by VMS Help. Lego y label positioning was controlled by the x label. The file for the C. Rippich version of MINUIT, minuit.cmz (or .car), has been renamed to cgr_minuit.cmz to avoid confusion with the CERN library version of MINUIT. Installation of Mn_Fit can now be done using patchy instead of cmz. A new flag VMS has been added. ALPHAOSF and ALPHAVMS have been removed. AIX370 has been replaced by IBMAIX. IBMRT has been added as a flag, but is not yet in install. All flags for OS and MACHINE should now be the same as for the CERN libraries. The XGKS graphics option has been completely dropped. VAXGKS has been replaced by DECGKS. RS6000 installation and readline fixed. Some fixups for CLEO, expecially for the ALPHA. +DECK,v4_02. 2 V4_02 25/07/94 The following version numbers apply to this version of Mn_Fit: Mn_Fit 4.02/19 Mn_Util 1.07/14 MINUIT 1.00/13 TYPSCN 1.02/06 L3_DSP 1.02/02 DBASE 1.04/04 This section lists the changes that have been made since Mn_Fit version 4.01/21. This release has been tested with the 93d and 94a releases of the CERN libraries. +++ Known Bugs or Problems: ___________________________ `DRAW' commands with the mouse on only work in CM. The `IGTABL' scale is not always drawn on the right axes, or exactly in the right place if rotations of more than 90 degrees are used. `NTUPLE MERGE' may fill the first files entries with 0 if you get an RZOUT not authorized message. Fetching of variable bin width histograms is wrong. Standard Chebyshev doe not give reproducible parameters. Naglib smoothing and spline fitting is not available on Apollo DN10000's. +++ New Features: _________________ The `FIT' command syntax has been improved to allow immediate specification of the fit type. It is also possible to likelihood fit taking into account the limited function statistics. A new function type `Smoothed Histogram' has been added. It has 2 parameters: the `NORMALIZATION' and the `OFFSET' and can also have multiply the ordinate by a `SCALE' factor. A directory name can be specified, which is then used for all files if you do not give a directory specification. However this means that filename completion does not work for such files. The command is `WDIR' or `SET WORKING_DIR'. Points with no entries and zero error only have the error replaced by 1 when doing operations involving more than 1 histogram (`ADD, SUBTRACT, MULTIPLY, DIVIDE, EFFICIENCY, AVERAGE'), provided that `ERR_ZERO' is `.TRUE.'. New spline fitting and smoothing routines have been added. HBOOK routines HSMOOF and HSPLI1 can be called (`SMOOTH/HBOOK' and `SPLINE/HBOOK' commands). A smoothing routine from Topdrawer is available (`SMOOTH/TOP') and Naglib spline fitting and smoothing (`SPLINE/NAG' and `SMOOTH/NAG') are available. Smooth curves through a series of points can be drawn using the command `PLOT/SMOOTH'. The interface to `IGTABL' has been improved substantially. All options are now available and axis ticks, scales and labels are controlled in the normal Mn_Fit way. The positioning of the scale in 3-d plots (`LEGO' and `SURFACE') still needs some improvement and the scale and label are sometimes drawn on the wrong axis if you rotate by more than 90 degrees. All options also work with windows. A global title is available (`SET TITLE GLOBAL title'). Interface to ECAL database and a new display for the L3 BGO added. +++ New Commands: _________________ FUN ADD SMOOTH Smoothed histogram used as a function. PLOT/SMOOTH Plots a histogram as a smooth curve. PLOT/EMPTY Plots an empty histogram without giving an error. SET BIN Specfies an offset or scale factor for histograms. WDIRECTORY Sets the working directory. SET WORKING_DIR Sets the workinh directory. SET FUNCTION POINTS Specifies the number of points to use when drawing a function. SET FUNCTION INTEGRATE Specifies the number of intervals to use when integrating a function. SET FUNCTION STEP Specifies the step size to use when differentiating a function. SET COLOUR ON|OFF Turns on or off use of colour. SET TITLE GLOBAL Adds a global title to each picture. DATABASE DBN_SNAP Database snapshot without a picture. DATABASE DBN_HISTORY Database history without a picture. +++ Modified Commands: ______________________ FIT Qualifiers added and new options. HIST ERROR New mode (-1) to delete errors, rather than just setting to 0 (mode 0). SPLINE HBOOK and Naglib spline fitting added. SMOOTH HBOOK, Naglib and Topdraw smoothing added. IGTABLE Interface much improved - HELP added. SET HIGZ Interface much improved. DRAW New option for whether items should be at front or back. DB_SNAP Differences between database entries can be plotted. COVARIANCE The CERN version shows the covariance matrix. DATABASE DB_SNAP Options to to differences between entries. +++ Improvements and Bug Fixes: _______________________________ You can now delete a list of functions. `DAT_STORE' can now store Ntuples. `HISTOGRAM ERROR id -1' deletes the errors on a histogram, so `DAT_STORE' will only store `X,Y' values. The spurious lines in `DISPLAY' when using the `INCLUDE' command are now fixed. `FIT_INFO' and `DISPLAY' sometimes gave floating point errors on the hp. This is fixed. Wrong frames when making lego or surface plots should be fixed. After a `HARDCOPY' command an xterm did not switch back from the Tektronix to the VT100 window properly. The return status from `lib$spawn' on VMS is printed. An attempt is made to unlock locked histogram files if they cannot be opened properly. `mn_fit filename' did not work on Unix machines. `INQUIRE' statements inside ``Here Documents'' caused problems with the readline version. The automatic switching between Ntuples on disk did not work properly. The `HESSE' command shows the covariance matrix if the `PRINTOUT' level is 0 or greater. There was no protection on defining more than the maximum number of cuts. If you aborted a macro inside an `IF' block things were not reset properly. If you try to draw more plots than the buffer, you get a warning message, but are not asked for a , nor is the window number reset. The macro name is also given when the file is closed. The `PRECISION' command did not show you the current precision properly. Protection added to histogram operations if I run out of space. ALPHAVMS, ALPHAOSF and ALPHA added as flags. The C. Rippich version of MINUIT should also work on HP's. +DECK,V4_01. 2 V4_01 17/12/93 The following version numbers apply to this version of Mn_Fit: Mn_Fit 4.01/21 Mn_Util 1.06/25 MINUIT 1.00/11 TYPSCN 1.02/02 L3_DSP 1.01/00 DBASE 1.03/00 This section lists the changes that have been made since Mn_Fit version 3.03/05. +++ Known Bugs or Problems: ___________________________ SEEK gives underflows in some of my test fits on HP's. `NTUPLE MERGE' only allows you to put 1 Ntuple in the merged file. Ntuples will always be stored in the top level directory. Other plot types should be stored in the correct directories. `SQUEEZE' sometimes gives errors. As `!' is used for command line history in Unix versions, you must quote the `!' with a backslash if you want a `!' interactively. This release works only with version 93 or later of the CERN libraries. If you use the mouse with the DECGKS version you get error message 51 from GINLC. This is not a problem, so you can ignore it. The `SHOW' command calls the corresponding `SET' command if the `SHOW' does not exist. If you are asked to set a value you wanted to show, just hit `'. +++ New Features: _________________ Command recall and history are available on all Unix machines using GNU readline and history routines. The `history' command is available on versions that include GNU readline. `DRAW' has `CIRCLE, ARC, SINE, SYMBOL' and `GLUON' added. It is possible to fetch and store items made with `DRAW'. `DRAW BOX' only needs 2 points. You can use `DRAW' and `COMMENT' after a clear, without plotting a histogram first. `CDIR' now changes the HBOOK directory immediately rather than waiting until the next `LDIR, ZDIR, FETCH' etc. command. This means that sequential `CDIR' commands will work. `SET DIRECTORY' works as before, so should be used before a `FETCH' command. `MIN, MAX' are allowed in expressions. `SET COLOUR' can now use the colour name and you can set the colour of the overlayed fit. The colour name can also be used in `DRAW'. Symbols 11,21,31,41 are now real circles instead of octogons. The octogons are symbols 19,29,39,49. Chebyshev and Legendres now have the overall normalization as the first parameter. The previous forms are called `OChebyshev' and `OLegendre'. A threshold function has been added. Interface to `IGTABL' and `IGSET' added for contour plots etc. +++ New Commands: _________________ DRAW CIRCLE Draws a circle DRAW ARC Draws an arc DRAW SINE Draws a sine function DRAW GLUON Command built in, but draws a straight line! DRAW SYMBOL Draws a symbol DRAW STORE Store drawn items DRAW FETCH Fetch drawn items MIN Can use in expressions e.g min(r1,r2) MAX Can use in expressions e.g max(r3,r4) AVERAGE Weighted average of the contents of 2 histograms FUN ADD THRESHOLD Threshold function FUN ADD OCHEBYSHEV Old form of Chebyshev FUN ADD OLEGENDRE Old form of Legendre HISTOGRAM IGTABLE Direct interface to the HIGZ IGTABL routine IGTABLE Direct interface to HIGZ IGTABL routine SET HIGZ Direct interface to HIGZ IGSET routine or IGTABL parameters DUMP Short form for HISTOGRAM DUMP history History of commands for Unix versions +++ Modified Commands: ______________________ CDIRECTORY Changes the HBOOK directory immediately SET COLOUR You can use the colour name FUN ADD CHEBYSHEV The first parameter is now the overall normalization FUN ADD LEGENDRE The first parameter is now the overall normalization +++ Improvements and Bug Fixes: _______________________________ Fetch of a range of HBOOK histograms only reads in those that are needed. The histograms (and profile plots) are now fetched using hunpak and hunpke rather than hi and hie. This should be faster. `STORE' is much improved and can now handle series of points and scatter plots. They are stored as Ntuples. `DUMP' can be used instead of `HISTOGRAM DUMP' at the `MN_CMD>' level. Several fixes to improve `IF' statements. The users SHELL and EDITOR should now be picked up properly. Setting of HBOOK directories improved. You should no longer get error messages just before the creation of a new directory. After a `FETCH' the default directory will be the input file for commands such as `LDIR'. `MDIR' did not recognize correctly if a directory already existed. `FILL' put entries 1 bin below the lower limit in the first bin. A scale `-2.5, -1.25, 0, 1.25, 2.5' will now be written correctly and not with `1.25' as `1.3'. You now always get a 0 in front of the decimal point (was not the case on the HP before). `RETURN' statements inside `IF' blocks that are not being executed should now work OK. They used to always be executed. `DISPLAY' sometimes gave a floating point error on the HP. This is now fixed. `DISPLAY' and `FIT_INFO' also caused a divide by 0 in 1000 bin histograms. If you `HARDCOPY' and then try to plot another histogram while windowing the normalization transformation was not correct. This is fixed. Fetching profile plots sometimes caused a divide by 0. This was because I was fetching the errors on the underflows and overflows. The bug is fixed. If you had `SET X LIMIT' and then used hatches or patterns the results were not always correct. There was an error in the error calculation in the `AVERAGE' command. Initialization of the resonances for dipion mass functions just after adding the function was not correct. The Falco interface for DECGKS has been dropped as it is available in the X Windows version. All Unix scripts are now written in Bourne shell. The main Mn_Fit routines are now written in C and use the latest version of KUIP condition handling. All flags (except a few special L3 ones) have been renamed to remove the `$' at the front. This is because the latest version of cmz tries to interpret `$XXXX' as an environment variable, symbol or logical name. +DECK,V3_03_05. 2 V3_03_05 22.12.92 12:00 The following version numbers apply to this version of Mn_Fit: Mn_Fit 3.03/05 Mn_Util 1.04/03 MINUIT 1.00/11 TYPSCN 1.00/16 L3_DSP 1.00/06 This section lists the changes that have been made since Mn_Fit version 3.02/16. +++ Known Bugs or Problems: ___________________________ `NTUPLE MERGE' only allows you to put 1 Ntuple in the merged file. Storing of plots in anything other than the top HBOOK directory does not work properly. `SQUEEZE' sometimes gives errors. This release does not work with CERNLIB release v92b on Unix machines. It has been fully tested with CERNLIB release v92a. If you use the mouse with the DECGKS version you get error message 51 from GINLC. This is not a problem, so you can ignore it. The Falco interface to DECGKS does not work perfectly. Pictures get drawn twice sometimes, and the alphanumeric screen is cleared after each picture. The `SHOW' command calls the corresponding `SET' command if the `SHOW' does not exist. If you are asked to set a value you wanted to show, just hit `'. +++ New Features: _________________ Startup in X Windows much improved. If you have the DISPLAY variable defined, then you can just hit when asked for the screen device. X Windows version on the Vax works properly. You can give the display name and transport mechanism in the command to run Mn_Fit. New options in `PLOT/OVERLAY', `PLOT/NEXT' to draw the next plot in memory. You can include the symbol number with the `PLOT' command. You can now convolute a fitting function with a Gaussian resolution. See HELP SET FIT CONVOLUTE for more details. The proper area of fragmentation and dipion invariant mass functions can be calculated. You can specify whether a dipion function is for a charged or a neutral pion. It is possible to produce profile plots from Ntuples. See HELP NTUPLE EPROFILE and NTUPLE SPROFILE for more details. Once you have fetched an Ntuple that is stored with the disk option, it is no longer necessary to fetch it again before you can project it etc., even if you have fetched histograms or Ntuples from another file. This is because the HBOOK directory name is remembered by Mn_Fit. Ntuples can be stored in HBOOK files. You can use `IF' statements inside macros. You can reduce the size of an Ntuple, using the `PROJECT' command. Mn_Fit works fully on SGI, Decstations, SUN and IBM RISC machines. Implementation of other Unix machines should be very simple. An environment variable (MN_FIT) rather than links is now used and you can also use environment variables in filenames. On Decstations and SGI machines VMS like command line editing and recall works, e.g. up arrow to get back last command. Editing and shelling out of Mn_Fit should work properly on all machines. On the Apollo you can also use editors other than dm. New commands for shifting and scaling axes (`XSHIFT', `XSCALE', `YSHIFT', `YSCALE', `ZSHIFT', `ZSCALE'). Superscripts, subscripts and Greek letters are available with Postscript fonts, e.g. font -2013 with X-windows. See HELP Text for more details. The simulated VMS Help (used on Unix machines) has been improved and can now show lists of commands (`?'), ambiguous commands, and all subcommands (`*'). Motif added as a screen device for DECGKS and DEC GKS3D. You can get nice Postscript circles (also filled) as symbols by using symbol 10 (or 20, 30, 40) and the `SET DSIZE' command. See HELP SYMBOLS for more details. +++ New Commands: _________________ IF If statements in macros. HCLOSE Close all open histogram files. HELP SET FUNCTION Help for `SET FUNCTION'. NTUPLE EPROFILE Make a profile plot from an Ntuple - errors are error on mean. NTUPLE SPROFILE Make a profile plot from an Ntuple - errors are r.m.s. of y-axis variable. SET FIT CONVOLUTE Convolute the fitting function with a Gaussian. SET FIT AREA Calculate the area of fragmentation and dipion invariant mass functions properly. XSHIFT Shifts the x-axis for a plot. XSCALE Scales the x-axis for a plot. YSHIFT Shifts the y-axis or bin contents for a plot. YSCALE Scales the y-axis or bin contents for a plot. ZSHIFT Shifts the z-axis or bin contents for a plot. ZSCALE Scales the z-axis or bin contents for a plot. FUN ADD NCHEBYSHEV Chebyshev with parameter 1 as overall normalizatiion FUN ADD NLEGENDRE Legendre with parameter 1 as overall normalization FUN ADD FERMI Fermi function +++ Modified Commands: ______________________ SET WINDOW The next window number is set to 1,1 if you change windowing. HB_STORE Can now store Ntuples. STORE Can now store Ntuples. HELP Has extra options on non-VMS machines. +++ Improvements and Bug Fixes: _______________________________ Mouse handling of comments and keys much improved. The comment or key is shown immediately after you click on the mouse and the mouse gives the centre of the comment position. Ntuples can now be stored in HBOOK files. However this is currently restricted to Ntuples that are stored in memory. The number of words for HBOOK has been increased to 800 000 and for Mn_Fit is now set to 750 000 on Vax and 1 000 000 for both on Unix machines. In Unix, Mn_Fit looks for `mn_logon.mnf' in the current directory. If it cannot find this file it now looks for `$HOME/.mn_fitrc' instead of `$HOME/user_data/mn_logon.mnf'. Asymmetric errors were used upside down when fitting a plot with them. Vax editors are always spawned, because of a problem with v92b of the CERN libraries. This will be fixed. `IF' did not always work properly. The buffer was not being cleared out correctly. A CDE was missing when parsing `IF' also. Histograms of functions did not have the axis labels or contents assigned correctly. CERN routines are used for getting the time, so Mn_Fit times should be correct and available on all machines. User variables were not always parsed correctly, particularly when inside parentheses. If you try to add a COMIS function that has an error when compiling, it will not be added. The first underflow bin was being projected into the first bin of an Ntuple projection. `CENTRE' and `CENTER' are both valid for comment postioning, although `C' is adequate. `DRAW LIST' now shows the correct item name. `DRAW CHANGE' allows to you change items other than the last one. The Unix version now uses a single environment variable (MN_FIT) rather than symbolic links. This means that you can delete any links that you have in your home directory (e.g. ~/mn_fit_dir, ~/mn_fit_exe, ...). Bugs were fixed in the `INCLUDE' command. Output conversion errors in MN_DMP fixed. If they happen they should no longer kill Mn_Fit. Plot positioning in windows should be correct for all X-window shapes. `HARDCOPY -111' etc. should work fine with GKSGRAL, DECGKS etc. Bug fixes when projecting a table of numbers stored in an Ntuple. The error was not done correctly or could have been the square root of the correct value. `INTEGRATE' has been improved to use Simpson integration. It should also give the correct answer, even when integrating a mixture of functions such as Gaussians and Chebyshevs. The symbol number is passed correctly, even when plotting a range or histograms or when you are asked if you want to keep comments and/or keys. All versions of Mn_Fit now get the date and time correctly. Changing the title position when windowing with 0 separation between the plots affected the number of header lines. The number of header lines was not always calculated correctly. Improved calculation of the minimum number of ticks, also when windowing. The default shell is set to `$SHELL' and also works for 8 letter shells such as `/bin/tcsh'. `FUN FETCH' should work properly even when fetching plots stored with a different function number with `FUN STORE' in an older version of Mn_Fit. Error bars should no longer be drawn outside the plot. User variables were sometimes not recognized properly, for example when used as histogram identifiers. Multiple //PAWC/TMP directories should no longer be created when merging Ntuples. Minor fixes to C. Rippich version of MINUIT for Decstations. +DECK,V3_02_16. 2 V3_02_16 19.11.91 09:00 The following version numbers apply to this version of Mn_Fit: Mn_Fit 3.02/16 Mn_Util 1.03/13 MINUIT 1.00/09 TYPSCN 1.00/13 L3_DSP 1.00/06 This section lists the changes that have been made since Mn_Fit version 3.01/03. +++ Known Bugs or Problems: ___________________________ `NTUPLE MERGE' only allows you to put 1 Ntuple in the merged file. `HARDCOPY -111' etc. may not work properly with GKS versions. The DEC GKS3D version on Decstations apparently dies if you try to close the hardcopy files. This is being worked on at Cornell. +++ New Features: _________________ New options in `PLOT/OVERLAY'. `PLOT/NEXT' to draw the next plot in memory. You can include the symbol number with the `PLOT' command. You can use the mouse to specify comment/key positions. `NTUPLE SCAN' now uses a function rather than a subroutine and you can give the number of events to scan. Number of Ntuple dimensions increased from 100 to 256. Extra Ntuple command, `NTUPLE FILTER', and possibility to specify how many events should be scanned. You can specify that an Ntuple variable can be ised as a weight or the error on the weight when projecting Ntuples. Automatic log scaling introduced. This is a first attempt. Comments are appreciated. New option `SET FUNCTION BIN' to turn on or off the use of the bin width in calculating functions. Power law function added. The default plotting mode is now set to `INTEGER'. If you change the number of windows the next window number is set to 1,1. `OVERLAY' now has a default symbol number. `ADD, SUBTRACT, MULTIPLY, DIVIDE, SCALE' now proceed when even when there are 0 entries. Various `SET' options added for fitting and functions. X Windows interface now available. DI3000 interface available. Decstation version available for DEC GKS-3D and X Windows. Falco terminals work properly with DECGKS. Standard KUIP condition handler now used on Vax, Apollo, Decstations. The condition handler can be turned on and off. +++ New Commands: _________________ DIRECTORY Alias for `INDEX'. PLOT/NEXT Draw the next plot in memory. PLOT/NTUPLE Direct plotting of variables from an Ntuple. OVERLAY/NEXT Overlay the next plot in memory. OVERLAY/NTUPLE Direct overlay of variables from an Ntuple. NTUPLE FILTER Scans an Ntuple applying the current cuts and writes the accepted events to a new Ntuple. SET BREAK Turns on or off the break handler. SET FIT DEFAULT Sets all fit and function options to default values. SET FUNC BIN_WIDTH Turns on or off using the bin width in function values. SET MOUSE Turns on or off using the mouse for comments/keys. HELP SET NTUPLE Help for `SET NTUPLE'. HELP SET FIT Help for `SET FIT'. HELP SET FUNCTION Help for `SET FUNCTION'. +++ Modified Commands: ______________________ PLOT You can specify the symbol, hatch and pattern in the command. NTUPLE PROJECT You can specify the first event and the number of events to scan. NTUPLE PLOT You can specify the first event and the number of events to scan. NTUPLE SCAN You can specify the first event and the number of events to scan. The COMIS routine is now a function and not a subroutine. DAT_STORE You can now give a range of plot number. OVERLAY You can just hit to get a default symbol. QUIT Emergency exit of Mn_Fit - no files are closed. SET MODE LOG No longer requires the limits or number of decades. SET WINDOW The next window number is set to 1,1 if you change windowing. +++ Improvements and Bug Fixes: _______________________________ The default plotting mode in now `INTEGER'. PLOT/NTUPLE and OVERLAY/NTUPLE were not documented in previous version. Projecting onto a binned histogram, with values too far outside the histogram limits could cause a crash of Mn_Fit. The condition handler has been changed to the standard KUIP condition handler. The break handler is no longer turned on and off. It is always on. An option will be added to turn it off in the next release. Cut expressions of the form `cut.lt. 3.0' gave errors, if the condition was given in lowercase. `cut< 3.0' worked fine. Protection added against equal plot limits. This often caused Mn_Fit to crash if trying to `DISPLAY' with a log scale set outside MINUIT. `FUN FETCH' now works even if I change the internal Mn_Fit function numbers. Mn_Fit no longer crashes if plot limits are identical. More protection added against screwy limits. Protection added against log scales not being valid. Automatic log scaling introduced also. `SET X LIM' for 2-D plots with symbol 12 etc. caused a screwy picture if the limits were inside the plot boundaries. Dump of long keys sometimes crashed Mn_Fit. The answer in `EXAMINE' is printed with more precision. `EXAMINE Y1&5(3)' only used to print `Y1&5'. Listing of dipion invariant mass functions corrected. Error handling when scanning Ntuples improved. Automatic binning of Ntuple projections improved. Using `PLOT/NOCLEAR' for the last window in a picture did not work properly with `REDRAW' or `HARDCOPY'. `WAIT' was defined twice, so was always ambiguous. `CAPTURE UNKNOWN' should work properly for VT1200's with DECGKS. Starting up Decwindow displays on the local node should be faster. When doing `NTUPLE PLOT, PROJECT' or `FILTER' and you are making a new Ntuple or scatter plot, I now book space in blocks of 100 events. This makes it less likely that Mn_Fit will run out of space. An early 3.02 version used Dave Brown's method of calculating the plot limits when projecting an Ntuple onto an expression. This method had bugs and has now been changed back to the old method. Extra checking on whether you type something when asked for a variable name added. Raising a negative number to a real power was not protected against. Fetching of histograms from HBOOK subdirectories created multiple subdirectories in memory. `DRAW LINE' etc. was not exiting as it should after the line was defined. After `MN_STORE filename 0', all subsequent stores were treated as if the id's to store were 0. Expressions of the type `exp(4-2), sin(pi/4)' could give errors. Delimiters were not reset properly after aborting a macro. +DECK,V3_01_03. 2 V3_01_03 25.03.91 The following version numbers apply to this version of Mn_Fit: Mn_Fit 3.01/03 Mn_Util 1.02/05 MINUIT 1.00/09 (C. Rippich), 90.10 or 89.12j (CERN) TYPSCN 1.00/12 L3_DSP 1.00/06 This section lists the changes made since Mn_Fit version 2.05/13. +++ Known Bugs or Problems: ___________________________ You should not try to rename histograms which have the same primary identifier as an Ntuple which is stored with the disk option. The user function number sometimes does not get passed properly to COMIS functions. Be careful using it. If you get an error when adding a COMIS function, you get several questions asking you whether you want to abort this command. If you get an error in some `SET' commands, you again get several questions asking you whether you want to abort this command. Not all `SET' commands have a `SHOW' equivalent. Therefore sometimes if you give `SHOW parameter' you will get into `SET'. Just hit to exit. SET X|Y LIMITS do not work for lego/surface plots - use PARTITION. Sometimes you only get one big tick on an axis. +++ New Features: _________________ The latest CERN version of MINUIT has been added (89.12j). This seems to be significantly better than the old version. The old version is still available, but must be compiled at your site. NOTE: You should check that you get the same or better results from fitting compared with the previous MINUIT version. This is the first release using the CERN MINUIT. New possibilities in fitting include constraints on parameters, contour plots and graphical contour plots. It is also possible to integrate functions across each bin to improve precision, as well as including and excluding regions from the fit (see HELP FIT and HELP SET FIT for details). The DISPLAY and FIT_INFO output has been modified to give the MINUIT and Mn_Fit parameter numbers and also to indicate which parameters are constrained (a # sign). There has been a lot of development and new commands for Ntuple manipulation. In addition the `CUT' mechanism has been substantially improved and cuts can now include arithmetic expressions and COMIS functions. You can use `>,<' etc. instead of `.GT.,.LT.' etc. in cuts and `&' and `|' instead of `.AND.' and `.OR.' in `CUT USE'. It is also possible to project into arithmetic expressions. Ntuples can be merged. It is possible to plot projections of Ntuples directly and to use automatic binning for the projections. You can also specify if an Ntuple variable should be used as the weight or error on the weight. See HELP NTUPLE for full details. If you store tables in Ntuples, you can plot them directly using the PLOT/NTUPLE command. It is possible to define user variables and use them in arithmetic expressions. It is possible to define aliases for character strings. The COMIS interface has been expanded to include cuts, scanning of Ntuples and calling a COMIS subroutine. Information on histograms and Ntuples is now available inside the functions or subroutine and skeleton subroutines get made automatically if the filename does not exist. All the Cernlib routines that are available inside PAW are now also available, plus Mn_Fit functions and some extra useful Cernlib routines (see HELP Using_COMIS for full details). You can now access the overall normalization, Ntuple contents and 2-D histogram contents when you are allowed to use registers, parameters etc. You can also `DEPOSIT' into the same places. Deposit on parameters when fitting now updates the MINUIT parameter values also, so this is an alternative to the `MODIFY' command (see HELP Numbers and HELP DEPOSIT for details). You can also use the MINUIT parameter number rather than the Mn_Fit ones when you are fitting. Default symbols now depend on the type of plot being made and new symbols for scatter plots are available. This is the first release that almost works fully on the Apollo. However `SMOOTH' and `SPLINE' do not work on the Apollo at present. New command `SET FONT' which makes changing fonts much easier. New command MDIRECTORY to make a new HBOOK directory in memory. This is most useful in connection with STORE. You can now store histograms in an existing HBOOK RZ file, `STORE/UPDATE'. In addition you can store histograms in directories other than the top level using the CDIR and MDIR commands. Automatic logging of all commands typed is available (`SET LOG'). A debug flag is available in common for COMIS and user functions and can be set using the command `SET DEBUG'. Device `None' has been added. This enables Mn_Fit to go through the motions of making a picture without actually doing so. Useful to do `FUNCTION HIST' for example if you do not want to look at the plot. Landscape and Encapsulated Postscript devices are available for most graphics packages. New line modes 5,6,7,8 corresponding to HIGZ line modes 12,13,14,15 added. When you get asked to hit for the next plot you can type `q' to quit the macro altogether. Typing any other character will skip that plot command. You can now use `?' instead of `HELP' to get help. Indeed when you want help in the middle of a command (CUT for example), you must use `?' instead of `Help'. This is indicated in the prompt. +++ New Commands: _________________ ? Replacement or alternative for HELP. ALIAS Defines an alias for a string. UNALIAS Undefines one or all aliases. NTUPLE MERGE Merges several Ntuples into one. NTUPLE PLOT Projects and plot an Ntuple or n-dimensional histogram. NTUPLE PROJECT Projects an Ntuple or n-dimensional histogram. NTUPLE SCAN Calls a subroutine for every Ntuple event. CUT FILE Defines a COMIS function as a cut. CUT COMPILE Compiles a COMIS function which is defined as a cut. CUT EDIT Edits and compiles a COMIS cut function. STORE/NEW Stores plots in a new HBOOK RZ file. STORE/UPDATE Stores plots in an existing HBOOK RZ file. HB_MN_FIT Converts HBOOK to Mn_Fit histograms. REMOVE Deletes a user variable. CALL_COMIS Calls a COMIS subroutine. MDIRECTORY Makes a new HBOOK directory in memory. SET ALIAS Turns on or off alias translation. SET DEBUG Turns on or off the debug flag for COMIS and user functions. SET FIT Sets parameters for fitting. SET FONT Changes the fonts for various parts of the picture. SET LOG Turns on or off automatic logging of commands. SET NTUPLE Specifies the Ntuple variables to plot with PLOT/NTUPLE. SET SHELL Specifies the shell command on the Apollo. SET STATISTICS Specifies whether to use HBOOK or Mn_Fit means and sigmas. SHOW ALIAS Shows the definitions of one or all aliases. SHOW FIT Shows flags and parameters used when fitting. SHOW CONSTRAIN Shows the current constraints on fit parameters. SHOW VARIABLE Shows the values of one or all user variables. INQUIRE Gets the value of a macro parameter. CONSTRAIN Constrains a parameter being fitted. UNCONSTRAIN Removes a constraint on a parameter. INCLUDE Include a region in a fit. SCAN Scan the fitting function with one or all parameters. MNCONTOUR Make a graphical contour. MAX_CALLS Replaces the CALLS command. HELP EXPRESSION New help on arithmetic expressions. HELP Using_COMIS New help on COMIS interface to Mn_Fit. +++ Modified Commands: ______________________ DEPOSIT Can create user variables and deposit into Ntuples and 2-d histograms. UNDEFINE Can now undefine all defined commands. PROJECT Alias for `NTUPLE PROJECT' - many new possibilities. CUT NEW Only 1 cut per line is now allowed. CUT CHANGE Keeping current condition now needs ==. CUT USE Allow `&' and `|' and COMIS function cuts. SET COLOUR REPRESENT Changes the colour representation. SET FONT Can now be used to set fonts for all parts of a picture. Precision can also be given - this means font numbers are not necessarily backwards compatible. SET HATCH Portable HIGZ hatches are available. SET SYMBOL Symbol 0 is plot type dependent. New symbols for scatter plots. SHOW REGISTER Can now show a range or all user registers. CALLS Renamed to `MAX_CALLS'. FIT_INFO Shows the Mn_Fit and MINUIT parameter numbers. Indicates which parameters are constrained. DISPLAY Same changes as in FIT_INFO. HARDCOPY TEKFILE Replaces HARDCOPY TEKTRONIX. HELP MINUIT Substantially updated. +++ Improvements and Bug Fixes: _______________________________ `CUT NEW' can only define one cut per line. `CUT CHANGE' needs `==' on the condition instead of `=' to keep the current condition. It is not possible to use the form `=*5' to change the value of a cut. Cuts are now parsed when they are used, not when they are defined. This means that if a cut includes a register for example, the value of the register at the time the cut is used will be taken. `SET SYMBOL 0' now defines a default symbol which depends on the plot type. Symbols -1 -> -4 exist for scatter plots and join the dots using lines 1 -> 4. HBOOK statistics rather than Mn_Fit ones are now available on request (`SET STATISTICS HBOOK|MN_FIT'). `CUT, COMMENT, SET' and `DRAW' exit after the completion of the first command if you include something on the line with the command. If you do not you must give an `END' (or `' when not in a macro or defined command). This behaviour should now be consistent. It was not always before. On the VAX the edit commands `EDIT/TPU' and `EDF' now use CALLABLE_TPU instead of spawning a subprocess. Background subtraction works properly for variable sized binning plots. 2-D functions were not declared `DOUBLE PRECISION'. If you are plotting with error bars and the point, but not the point +/- error is outside the plot, the error bar will now be drawn. The command sequence `FETCH filename id; CDIR dirname; FETCH id' did not work. That is now fixed. The Vax condition handler has been improved. There is no condition handler on the Apollo at present. `SHOW ORDER' and `SHOW ORTHOGONAL' have been fixed. `SET Z OPT_ZERO' now works. The y axis label is now at the correct angle for lego/surface plots. The offset of lego/surface plots from the bottom left corner of a plot has been reduced to 0, so the scales are now in the margins as they are for all other sorts of plots. PARTITION Only worked properly for monotonically increasing x values. It now works for monotonically increasing or decreasing values. Tektronix devices now work for GKSGRAL if they are the same device. They also now work for DECGKS and DEC GKS3D. Registers, parameters etc. can now be used for overlay symbols hatches and patterns and also for lego/surface plot angles. They can also be used for secondary identifiers in `PROJECT' etc. If the prompt indicates you can get extra help when giving a command (terminates in `or ?:'), this should now always work. The direct access file length is checked using RZFILE for HBOOK histogram files. This should avoid Mn_Fit bombing if the record length is wrong. Occasionally _ was no longer recognized in commands. This has been fixed. You have to type at least `EXI' to exit otherwise the command gets passed onto the standard command list without further checking. All code and files needed for linking, running and testing Mn_Fit as well as producing the manual is now in 4 CMZ files (5 for L3). This makes keeping up-to-date much easier and will enable me to produce updates to the manual. The HELP Changes has been modified somewhat and is now keyed on version number rather than date. All institutions should now be able to produce a working version of Mn_Fit directly from these files without introducing any local fixes except to define the necessary logical names or links. See the deck //mn_util/docs/code for details. The number of entries and underflows and overflows were not being fetched properly for M_BOOK histograms. There were a couple of bugs if you switched many times between hardcopy and screen devices. These have hopefully been fixed. The `SET X|Y|Z OPT_ZERO' command also changed whether the fit function was shown on excluded regions of a display. Ntuples were not read in properly in `DAT_FETCH'. There was a format error in one of the error messages in `DAT_FETCH'. Bug fixed in recovery from failure to open a hardcopy file. Empty command lines are now echoed properly. Number of plots fetched when secondary identifiers were used in `DAT_FETCH' was wrong. The news system now reads the file `mn_fit_dir:mn_news.fil' which is made from the deck //mn_util/news/news every time a final version of Mn_Fit is linked. The help library has been renamed to mn_fit.hlb. The demonstration and manual files (including symbol.mnf) have been moved to the mn_fit_help: directory. The flag `$GTSGRAL' has been renamed to `$GKSGRAL' in all the code. +DECK,V2_05_13. 2 V2_05_13 10/09/90 15.24.18 +++ New Features: _________________ Decstation now available in PLTSUB version. MESSAGE will go to output device specified by SET DUMP and can include registers, parameters etc. +++ Bug fixes and General Improvements: _______________________________________ CUT always requires a command even if you do not have any defined. SET X|Y GRID ON BIG now works as advertized. Default symbol number for the grid is 3. MIGRAD typeout of error definition corrected. TYPSCN works on Decstations. CB lineshape function corrected. +DECK,V2_05_12. 2 V2_05_12 10/08/90 06.04.29 +++ New Features: _________________ New condition handler built in, that should catch floating underflows, overflows and divide by 0 everywhere. New command FUNCTION HOVERLAY to overlay a function as a histogram. FUNCTION PLOT and FUNCTION HISTOGRAM now always make a new plot. Register 102 contains the number of points summed over with a SUM command. 2D Gaussian is now a built-in function (normalization must still be checked properly). Comments and Keys can now be associated by overlays which are on a different scale so that you can use their plot co-ordinates. +++ New Commands: _________________ FUNCTION HOVERLAY to overlay a function as a histogram FUNCTION ADD 2D GAUSSIAN to add a 2D Gaussian +++ Bug fixes and General Improvements: _______________________________________ Overlay when the plot had a different x scale use the new plot's scale. Dep dx... was wrong. Registers, parameters etc. now work properly as histgoram id's. Using errors on parameters is now OK again (TYPSCN bug), e.g. `FILL 1 r1 p2(3) r2 err2(3)'. Aborting plotting is improved, but still not perfect. You will no longer be asked if you want to keep commants and keys when reading commands from a file. Plot units now work properly in DRAW even when windowing. After a CLOSE, if you had captured a hadrcopy device, you are required to give a CAPTURE command. Improved handling of turning on/off ticks when overlaying on different scales. Improved r.m.s. calculation. +/- is replaced by correct symbol properly. +DECK,V2_05_11. 2 V2_05_11 29/06/90 16.39.30 +++ New Features: _________________ There is a new option for fitting several plots. You can now use the area under each function for each plot rather than the ratio of the areas (see HELP FIT and HELP SET RATIO for more details). +++ New commands: _________________ SET RATIO Turn on/off whether function areas or ratios of areas are used when fitting many plots DRAW POLYGON Draw a polygon on the picture +++ Bug fixes and General Improvements: _______________________________________ Negative scales are correct again. They were sometimes too small. DRAW with plot units now remembers the plot number they are associated with and so when windowing `REDRAW' and `HARDCOPY' will now work properly. There is a new option in the L3 luminosity monitor BGO display. There was an error if you used registers, etc. for the bin number in expressions such as DEP R51 = Y1&1(R50) - DY1&1(R49). It complained about the plot number in the DY statement. This is now fixed. +DECK,V2_05_10. 2 V2_05_10 12/06/90 03.56.43 +++ New Features: _________________ DAT_FETCH now recognizes several forms of time and can store plots which are vs. time. There is also a TIME card and SET TIME command to specify in what form the time is given. It is possible to plot L3 database contents and the facility should be easily extendable to anyone who has an RZ based database. There is an option so that the lower limit of the contents need not be 0 and can be automatically calculated (SET OPT_ZERO). Most sizes you can SET can be registers, parameters etc. You can turn off the request for a for a new plot (SET WAIT_CR). This is most useful when running in batch or directly to a hardcopy file. ARGUS background function has a new parameter and help is corrected +++ New Commands: _________________ MESSAGE Writes a message to the current output device SET WAIT_CR Turn on/off asking for a before the next picture SET OPT_ZERO Turn on./off whether 0 is lower limit for entries SET TIME Specifies time mode and start time for DAT_FETCH DATABASE Database plotting interface for L3 DB_HISTORY Make a database history plot DB_SNAP Plot the contents of a database directory +++ Bug fixes and General Improvements: _______________________________________ Ticks should be somewhat better, particularly for strange scales or small numbers of bins. FUNCTION PLOT will no longer give a divide by 0, if you are plotting a Chebyshev or Legendre and have not given a SET ORTHO command. Projection of 1-d plots works again. STORE 0&IDB only stores the plots with IDB as secondary id instead of all. The Peterson and Bowler fragmentation functions had an error. The Argus function had an error. DEFINE now checks on the number of commands defined and the total number of lines, to avoid overwriting things it should not. FUN OVER/HIST scales area properly also when not in MINUIT mode. DO loops work properly even if a previous one has been aborted. Ticks on lego and surface plots should no longer be off scale Aborting of plotting, particularly DISPLAY improved MIGRAD better protected against overflows (hopefully) MINOS separate condition handler removed Parameters which got fixed for unknown reasons should no longer be fixed. This happened for parameters with limits that were at the limit after a fit. +DECK,V2_04_02. 2 V2_04_02 08/02/90 11.21.28 +++ New features: _________________ FUNCTION PLOT now always draws a new picture, even after a DISPLAY. It will also now draw functions which depend on the bin width (such as Gaussians) properly. FUNCTION OVERLAY should also now also scale properly. Please report any problems. Text format for titles, comments, keys, axis labels is now compatible with version 2.03 again. See HELP TEXT for details. +++ New commands: _________________ SHOW DEFINITION Alias for SHOW COMMANDS to list defined commands SHOW SEGMENTS Mainly for experts. Lists segments in use +++ Modified commands: ______________________ FUNCTION PLOT Now always makes a new plot, even if the last one was a DISPLAY. +++ Bug fixes and General Improvements: _______________________________________ HBOOK histogram numbers are now identical to the Mn_Fit primary id. They used to be 1000*idb + ida. This gave problems with Ntuples which were not stored in memory. Comments, keys and lines, arrows etc. are now stored in segments immediately. They used to be stored only after a REDRAW. LOLIM and HILIM did not work when you were asked for numbers. Hitting set text to blank, instead of keeping current text (since version 2.04). HBOOK slices, bands projections and functions should now work again. It is now possible to start a DEPOSIT calculation with a parentheses. e.g. dep r1 = (2-r0)*3. +DECK,V2_04_01. 2 V2_04_01 06/02/90 08.00.00 +++ New features: _________________ There is a backwards incompatible change in the way you give text for titles, comments, labels etc. Text of more than one word must be included in quotes. See HELP TEXT for more details. Ntuples of longer than 50000 words which have been stored with the CHDIR not ' ' in the HBOOKN command will not be read into memory. This means there is no longer a limit on the number of points that can be read in. Ntuples of up to 100 dimensions can be handled. The last 20 commands can now be recalled. This functionality has been added to TYPSCN. Surface plots are now available and both surface plots and lego plots can have z-axis or vertical scales. A grid is now also available on the x, y, and z axes. It is possible to fit using 2-d histograms. +++ New commands: _________________ FUNCTION ADD CB line shape Crystal Ball line shape for photons ZDIR Give an RZ directory list NTUPLE DUMP Same as HIST DUMP. NTUPLE will be expanded in the future SET GRID Put a grid on the plot (see HELP SET GRID) SURFACE Make a surface plot HIST SURFACE Make a surface plot +++ Modified commands: ______________________ LDIR Just gives an HLDIR directory listing HISTOGRAM DUMP Asks if you want to continue every 100 entries. Can also dump Ntuples. SET HIST id is now an alias for PLOT id DEFAULT. LEGO Now also shows a z scale on the vertical axis. SET SCALE, TICK, LABEL, FRAME can also apply to the z axis and the vertical axis for lego and surface plot. SET Z LIMIT now also works for lego and surface plots +++ Bug fixes and General Improvements: _______________________________________ HELP has been updated and lots of minor errors fixed. It is now possible to fit with 1-d and 2-d histograms. Some bug fixes to histogram fitting. 2-d fitting now makes chi**2 plot properly again. New TYPSCN routine added, IQSTYP, to get a quoted string. New functions INT, NINT, and ABS added to DEPOSIT command. HELP DEPOSIT has been improved. Polynomial*Exponential function now works properly. FORTRAN error number is now given if Mn_Fit cannot open a file. It is no longer necessary to have a blank before the & if you are using registers etc. for histogram identifers (e.g. PLOT R1&R2 is now OK). PROJECT now requires the full variable name; therefore names such as EM1 and EM10 will no longer be ambiguous. Histogram filling with weights is now OK. MINUIT help is more complete. The list of ambiguous commands is now correct. Ticks for strange scales and when windowing should be better. The was an error in the number of records counted when reading from a file, if you had an error in the file and continued. This meant that in subsequent DO loops the first command line after the DO statement was ignored on the second and subsequent times through the loop. You can now abort the request to hit for the next plot by typing any character, rather than having to CTRL_C. In interactive mode if part or all of the CUT command is given on the same line you will exit CUT after the command has been executed. CUT DEL 0 when there are no cuts should not exit CUT immediately. Files that cannot be opened with the HARDCOPY command should no longer bomb the program. +DECK,V2_03_01. 2 V2_03_01 18/12/89 11.32.38 +++ New features: _________________ MODIFY and all other MINUIT commands that need numbers can now use registers, parameters etc. First version of Mn_Fit that runs on Decstations is now available with simulated VMS Help. Fixed bug in error messages from EXCLUSIONS which caused Mn_Fit to crash Fixed bug in COPY if you read a histogram in with MN_FETCH which was created with MN_STORE many months ago. Fixed bug in CLOSE. If you switched many times between screen and hardcopy and issued lots of CLOSE commands Mn_Fit would eventually bomb as it ran out of unit numbers. HELP is now consistent in telling you where the chi**2 and confidence level are stored in registers 111 and 112. +DECK,V2_00_00. 2 V2_00_00 06/11/89 08.00.00 06-Nov-1989 If you define commands inside a macro then use the form @@1 in DEFINE to be prompted for the parameter value only when you execute the command. There are now 4 lines available for the header. This necessitated changing the default picture size to 19.5 x 20.5 cm. You can now give the font to use for the scale. The scale colour should be set with the SET COLOUR SCALE command and not in SET SCALE. Where you can give = to keep a parameter value (COMMENT, KEY, SET LABEL, SCALE, TICK etc.) you can now use the form =+0.2 to increase its value etc. See HELP NUMBERS for more details. HELP in SET X LABEL, SCAL etc. now works properly. The mean and sigma are now calculated properly for a series of points and scatter plots. Asymmetric x errors are handled properly in fitting. Log scales should be OK even if overlayed plots go negative. Index no longer bombs for long file names. FUN OVER also no longer bombs after a display if the plot being fit is a series of points (DAT_FETCH'ed) Improved output for the LDIR command. There is no longer a default file extension for histogram files. This is because you could not use a logical name for the complete file. It is now possible to use registers, parameters etc as histogram identifiers. However note that if you do it is necessary to put a space before the & delimiting the secondary id. It is also possible to use registers, parameters etc. for positions in the DRAW command. Bug in filling histograms fixed - the AREA was just the number of entries and the weight was not taken into account. Rebin checks the bin numbers properly. Bug in CUT USE with multiple parenthese at the end of the line fixed. Segment errors fixed in HARDCOPY - thank to Jon Lewis. HARDCOPY sped up by a large factor for VAXGKS and DGKS3D - again thanks to Jon. Grinnell picture should be back to the proper spot. Return to 1 column format to list current values of variables if there are less than 6 variables. Otherwise use 2 column format. Does anyone have any better ideas? Line thickness in text should work properly - a la IGTEXT! Compact AVEHST files can now be read i.e. blank in first column is not required. New commands: WAIT Stop Mn_Fit for a time - useful in macros if you loop 04-Oct-1989 Date and time plots were made now available in HEADER and DUMP. They are shown in the full header (default). Scale and normalization in histogram operations (ADD etc.) can now be a register, parameter etc. Colour in text works properly. Variable names are now X and Y for AVEHST scatter plots. Title is not stored with AVEHST scatter plots, so gets set to "No Name" in Mn_Fit. Bug in fitting using histograms fixed. After CTRL-C while inside MINUIT you can now restart MINUIT. New commands: QUIT Exits the program (replacement/alias for EXIT). CDIR Changes the current HBOOK directory (alias for SET DIR) 04-Sep-1989 New option in SET HEADER/IDSHOW to display area, mean and sigma of plots. Bug fixed in SET LABEL if the label started with the sequence M(. New information added to the header to give the mean and ssigma of each plot. Line thickness for text should now work. Variable width AVEHST histograms should now be read in OK. More minor and tedious modifcations so that the code can run on the Apollo. Decwindows added as a device in VAXGKS (thanks to Jon Lewis) L3 BGO luminosity monitor and BGO displays built in. Error and message routine built in, so that Mn_Fit menu package can run on a different Vaxstation from the display. New commands: DISPLAY/xxxx to get an L3 online display SET PAR xxxx to change parameters for L3 online displays SET KEY xxxx to set up the key for L3 online displays Modified commands: SET HEADER Possible options are now FULL, BRIEF, ON and OFF SET IDSHOW Possible options are now FULL, BRIEF, ON and OFF 20-May-1989 Note that the fitting parameters when fitting more than one plot simultaneously have changed to improve convergence and avoid some overflows in MIGRAD. (see HELP FIT for more details). The order of errors in DISPLAY, FIT_INFO, HIST DUMP and DAT_STORE has been changed to have negative followed by positive. It is now possible to write the contents of registers, parameters etc. in COMMENTS, axis labels etc. (see HELP TEXT and HELP NUMBERS) for more details. It is now possible to store multiple plots in the same file with the DAT_STORE command. DISPLAY and FIT_INFO now give the total and fitted areas for both the plot and the function. MINUIT code is now all in FORTRAN and BYTE statements have been removed, in preparation for running on Apollos. Should be transparent to the user. MIGRAD is a bit better protected against overflows. A bug in REBIN which meant that if you did not start rebinning at bin 1, things were not correct has been fixed. DISPLAY modes 2 and 3 now work properly. If a hardcopy file cannot be opened an error will be given rather than Mn_Fit crashing (in the GKS version). DEFINE now checks if a defined command already exists. SET ORTHOGONAL now works. FUNCTION OVERLAY now works properly outside of DISPLAY as well. DO loops which should not be executed now work properly. The next command after the end of the DO loop was being ignored. Y, DY, DNY and DPY are returned properly for 1-dimensional histograms. It was possible to get an error complaining about the bin number before which was not correct. New commands: HB_OPEN to open an HBOOK4 histogram file LDIRECTORY to list the contents of the current HBOOK directory SET DIRECTORY to set the current HBOOK directory SHOW DIRECTORY to list the contents of the current HBOOK directory Modified commands: SET ORDER has new variable names DNX, DNY, DPX and DPY to replace DXN, DYN, DXP and DYP. 23-Mar-1989 More registers have been added so that the user has access to useful information. The chi**2/likelihood and confidence level are now put into registers 111 and 112. Registers 121 onwards are used to store information on the current default plot. It is now possible to change parameter limits, plot limits, plot errors (including asymmetric errors), the contents or position of any point etc. See HELP NUMBERS or HELP DEPOSIT/EXAMINE for details. Fixed bug in labels for top and right-hand axes (weren't drawn in the right place). Fixed bug in DIVIDE for plots with asymmetric errors. The positive error was being computed wrongly. The x error was being computed wrongly if you used the HIST ERROR command for a series of points. Protection added in DEPOSIT and CALC against dividing by zero and taking the square root of a negative number. Modified commands: SET PLOT id DEFAULT This command now puts informnation on the plot given into register 121 onwards (see HELP NUMBERS or HELP SET DEFAULT). 12-Jan-1989 Please read the warning in HELP FIT or the write-up section on fitting on recommended fitting procedures. Bug fixed using DEFINED commands without parameters where the first command was ignored. Date and time are now printed in the FIT_INFO command if DUMP is set to LPT. Version number is now gotten directly from CMZ and the news is also kept in the same routine, eliminating files MN_VRS.FIL and MN_NWS.FIL. Bug fixed in DRAW command when using PLOT co-ordinates. 05-Jan-1989 The EXIT command must be at least EXI, otherwise you will be prompted to ask if you really want to EXIT. There are now extra registers 100-110 which are used by Mn_Fit to store useful numbers. Register 100 contains the chi**2 or likelihood of the fit and register 101 contains the result of a SUM or INTEGRATE command. The PLTSUB version has a new screen device FALCO (also works for a Pericom Graphic terminal) which enables me to check out the PLTSUB version at CERN. New commands: SHOW FILES to list the current hardcopy and dump files and the currently open units 21-Dec-1988 The syntax of the CUT command was changed to make it easier to use and to improve it. The DO command is now called EXECUTE to bring it in line with PAW and KUIP and to release DO for DO loops inside Macros which have been implemented. Parameters including imbedded blanks shoudl be enclosed in single rather than double quotes. The command LINE has been changed and improved. The syntax is now DRAW LINE and arrows, boxes triangles etc. are also available. A login macro can now be executed. First the file MN_LOGON.MNF is searched for in the local area and then the logical name MN$LOGON. If either of them is found they are executed. Registers, parameters etc can now be used in the PART, REBIN, COMMENT, KEY, and the SET LABEL, SCALE, LIMITS, FRAME, and TICKS commands etc. See HELP NUMBERS for details of the syntax. The EXAMINE command can be used to look at the contents of registers, parameter values, bin contents etc. Colours and fonts are now integrated in a better and more uniform fashion. It is now possible to specify the hardcopy filename (GKS version only) and to specify the dump file name. HELP has been updated. All commands should be in and their description correct. Please let me know of any errors or if anything is unclear. New commands: EXECUTE Replaces the Do command DO, ENDDO DO loops - only available inside Macros (see HELP DO) DRAW Draw various shapes and lines on a picture EXAMINE Examine the contents of registers, parameters, bins etc. SET COLOUR Set the colour of parts of a picture SET THICKNESS Set the line thickness of parts of a picture SET HARDCOPY Set the filename for hardcopies SET DUMP FILE Set the filename for dumping SET WMARGIN Change the margin inside a window SET WSIZE Change the size of plot inside a window Modified commands: CUT no longer has a plot number and syntax has changed LINE is now DRAW LINE with changed syntax 02-Jul-1988 The bin contents, errors, and data points are now accessible in the DEPOSIT, CALCULATE and FILL commands. See HELP DEPOSIT for details of how to access them. Modified commands: DEPOSIT and FILL Parameters are now referenced as Pn(m) where n is the function number and m is the parameter number. (This is the opposite of the orginal and the MULFIT order, but the author thinks it is more logical and easier to remember!!). 23-Jun-1988 Help on Fit improved, with description on how to simultaneously fit plots with the same or different background functions. Up to 30 dimension Ntuples can be read in. Switching hardcopy devices now works properly. Limits on data read in with the DAT_FET command are calculated properly. Bug in getting variable names and in INDEX when using Ntuples fixed. Comis functions can now be stored and fetched. Modified commands: ADD, SUBTRACT, MULTIPLY, DIVIDE, SCALE, NORMALIZE, EFFICIENCY You can now give a range of plots to add etc. KEY Now gives a key for hatching and patterns also HARDCOPY LN03 added as a hardcopy device - Tektronix mode 13-Jun-1988 BOOK and FILL commands added (see HELP HISTOGRAM BOOK and HISTOGRAM FILL). Use in conjunction with the DEPOSIT command to fill plots with fit results for example. Histograms with more than 1000 bins can now be plotted. Bug fixes in DISPLAY for 2-D fitting, plot operations for plots with different limits, SQUEEZE command, HELP when changing scale, limits etc. New commands: HIST BOOK Books a new plot inside Mn_Fit (see HELP HISTOGRAM BOOK) HIST FILL Fills a new plot inside Mn_Fit (see HELP HISTOGRAM FILL) BOOK Alias for HIST BOOK FILL Alias for HIST FILL 02-Jun-1988 CUT was not working properly from 25th May - 2nd June. DISPLAY MODE 2 and 3 now work properly. Functions can now be overlayed within DISPLAY MODE 3 properly also. Bin width for variable bin width AVEHST plots now correct. 27-May-1988 HBOOK variable bin width plots are now read in properly. Bug fixes for fixed parameters in MINUIT being permanently fixed after you exit MINUIT, plots with no errors being displayed with errors, operations on data points with errors, HARDCOPY when a comment ws on same line and filled symbols in GKS version. Scale improved for lego plots. Modified commands: BACK_SUB Must give SET BACKGROUND command beforehand to make syntax more predictable DISPLAY Must give SET BACKGROUND command beforehand to make syntax more predictable if using modes -2, 2, -3 or 3. 24-May-1988 When doing ADD, SUBTRACT, MULTIPLY, DIVIDE, SCALE or NORMALIZE the default is now to give an error of 1 to zero points. This also applies when doing a chi**2 fit to plots with zero points. To use an error of zero use the SET ERR_ZERO command. Zero points with zero errors are now shown. Use the SET SHOW_ZERO command to suppress the points again. Bug in calculation of errors for efficiencies with small numbers of events fixed (now the MULFIT calculation is used). New prompts MN_CMD> when in plotting mode, MINUIT> when inside MINUIT. DEFINE and UNDEFINE commands to replace OPER. Ntuples written in ASCII format can be read in using the DAT_FETCH command (see HELP DAT_FETCH for more details). Lego plot now has scale drawn in for x and y axes The default overall size of the picture has been changed to 19.5x20.0cm (used to be 20x20cm) so that it is smaller than the default Postscript page size for VAXGKS. The size of the plots has not changed - the right margin will be 0.5cm smaller). COMAND routine for MINUIT rewritten (should be transparent except for error messages). Bugs fixed in MN_STORE, CUT and PROJECT, COMMENT and KEY. Hatching and patterns should work properly with limits set. Pattern drawing improved. In the GKS version the symbol filling is now done with the fill area routine, instead of drawing lots of lines. New commands: DEFINE Defines a new command as a series of existing ones. UNDEFINE Gets rid of an internally defined command. SHOW COMMAND Lists the internally defined commands. FCN_PLOT Plots the chi**2 or likelihood as a function of a variable. PROB_PLOT Plots the probablility of a variable having that value as a function of the variable. SET ERR_ZERO Sets the error on zero points to 1 or not. SET SHOW_ZERO Shows zero points which have zero errors or not. Modified commands: HIST ERROR New mode added to give error of 1 to zero points. COMMENT Syntax made more predictable when reading from a file. KEY Syntax made more predictable when reading from a file. CUT Syntax made more predictable when reading from a file. LINE Syntax made more predictable when reading from a file. Deleted MINUIT commands: OPER Replaced by DEFINE. END_OPER Replaced by ENDDEF. END Eliminated as a MINUIT command to avoid confusion. 15-Apr-1988 GKS version only: New commands: SET HATCH to define hatching symbol SET PATTERN to define pattern Modified command: OVERLAY You can now give a hatch and or pattern after the symbol number. See HELP OVERLAY for more details 07-Apr-1988 COMIS interface improved - functions are now referenced by their address rather than their name, so execution should be faster. Function names can be anything you like. Bug in new Landau function fixed. Example files added - see HELP EXAMPLES The commands DEPOSIT and CALCULATE have been added, which use the calculator from MULFIT - but they have not been fully tested yet, so use at your own risk!! New commands: COMIS to invoke COMIS directly. FUNCTION COMPILE to compile a COMIS function you have already added FUNCTION EDIT to edit and compile a COMIS function you have already added. DEPOSIT to change the values of function parameters CALCULATE to CALCULATE expressions 28-Mar-1988 CERN COMIS package added. Fixed bug in DISPLAY command. If you were fitting with histograms and had no exclusions, DISPLAY used to blow up. Fixed bug in MN_STORE - plot titles were not always stored properly New commands: FUN ADD COMIS uses the CERN Compiler and Interpretation System (COMIS) to interactively define functions without the need to relink your program (see HELP FUNCTION LIST COMIS for more details on how to use it). SET RECL to set the record length for HBOOK version 4 files. 24-Mar-1988 The default version of HBOOK is now HBOOK4. To fetch HBOOK3 plots use the HB3_FETCH command. Use FETCH or HB_FETCH to fetch HBOOK4 plots. Histograms written out using Chris Rippich's HYBRID can now be fetched using the HY_FETCH command Mn_Fit can also run with GKS instead of PLTSUB, giving shading options (see HELP SET SYMBOL) and more GKS features in the future. SET FONT command for changing the text font The STORE command will now use the HROUT routine to write out the plots. New commands: HB3_FETCH to fetch HBOOK version 3 plots HB_FETCH alias for FETCH to fetch HBOOK version 4 plots HY_FETCH to fetch Chris Rippich's HYBRID plots SET FONT to set the text font Modified commands: FETCH Now fetches HBOOK version 4 plots STORE Now stores HBOOK version 4 plots 05-Jan-1988 New screen devices inside the program (Versaterm, VAXstation and VT240). Use the MN_FIT.COM file to run Mn_Fit for all devices. New commands: SUM to sum the contents of a plot over a given range INTEGRATE to integrate one or more functions over a given range 22-Dec-1987 Major changes in SET for plots you have already made (see HELP SET) PLOT 0 and PLOT id1:id2 now work New commands: SET ORDER to specify the order of the arguments in DAT_FETCH and READ DATA files SET PLOT ... to change something for a particular plot (see HELP SET and HELP SET PLOT) SET DISPLAY ... to change the sizes etc. used in DISPLAY SET PSIZE to set the overall size of the picture (used to be SET SIZE) SET FRAME to set where you want a frame round the plot SET AXIS to label an axis and specify where you want it SET LABEL to label an axis and specify where you want it SET X|Y ZERO draw a line at x or y=0 (alias for SET X|Y NULL) SET TICKS to specify numbers of ticks and which axes you want them on SET SCALE to specify position and size of scale and which axes you want it on SET NO_WINDOW turn off windowing (alias for NO_WINDOW) SET NEXT_WINDOW to set the window for the next plot (instead of SET WINDOW) Modified commands: PLOT now has qualifiers /CLEAR and /NOCLEAR. See HELP HISTOGRAM PLOT OVERLAY now has qualifiers /SAME and /DIFFERENT. See HELP HISTOGRAM OVER SET SIZE is now SET PSIZE SET HSIZE and SET SIZE do the same thing SET WINDOW is now an alias for WINDOW SET DEFAULT when preceded by SET PLOT is the same as SET HIST PARTITION now works for 2-dimensional histograms REBIN now works for 2-dimensional histograms CUT calls PROJECT automatically after you have set up the cuts SPAWN is now the same as SHELL MN_STORE works with a range of histograms MN_FETCH works with a range of histograms DAT_FETCH has new data cards and you can have more than one dataset in a file. PRINT can now print all or a range of histograms 09-Nov-1987 A range of histograms can now be specified for the INDEX, DELETE, PLOT and all the FETCH and STORE commands. The range is delimited by a ":" (see HELP IDENTIFIERS for more details). All functions plotted are now available in plots for further manipulation if required. To specify secondary ID's on the same line as function or variable numbers (e.g. in the FUN PLOT and PROJECT commands) precede them by an "&". Versaterm and Tektronix handling further improved. Syntax for text strings changed slightly (see HELP CHARACTERS) The argument list for XMNUSR (user function) has expanded. See HELP FUNCTION USER for details. Functions which are histograms now get plotted as histograms New commands: FUNCTION OVERLAY overlays a function on a plot SET BACKGROUND defines which functions are background SET HISTOGRAM defines a default histogram for the CALCULATE command etc SET NORMALIZE turns on and off an overall normalization factor for the functions you are fitting SET ORTHOGONAL defines the orthogonality limits for Chebyshevs etc SET SIGNAL defines which functions are signal Modifed commands: BACK_SUB see HELP MINUIT BACK_SUB DISPLAY (if the display mode is not 1) see HELP MINUIT DISPLAY FUNCTION PLOT and HIST now work in the MN_CMD stage LINE see HELP LINE 26-Oct-1987 FUN FETCH and FUN STORE now work properly 10 bit Tektronix resolution now supported (see HELP SCREEN_DEVICE) New commands: SET ECHO to turn on and off echoing commands when reading from a file SET AUTOSWITCH to switch automatically from Tektronix plotting mode to alphanumeric mode. If AUTOSWITCH is off you must give the next command or hit to get back to alphanumeric mode after making a plot. Changed commands: COMMENT, LINE, CUT, EXCLUDE now work like SET: If you just give the command then you will stay in COMMENT etc. until you hit a or give the command END. If you give a command like COMMENT CHANGE then you will exit COMMENT after changing one comment. 01-Oct-1987 CTRL-C handler implemented, courtesy of Rohit Namjoshi and HTV Be aware CTRL_C during FORTRAN I/O can give problems. Protection has been built in in heavily used areas, but not everywhere. Please report any problems. See HELP CONDITION_HANDLER for more details. New command PRINT to print a histogram on the terminal or a file PROJECT works on real scatter plots and n-dimensional histograms and can be used to convert a scatter plot to an n-dimensional histogram HARDCOPY devices are now TEKTRONIX (PLOT.T12), TALARIS (PLOT.QMS), POSTSCRIPT (PLOT.PS), IMAGEN and VERSATEC. Command ERRORS has been renamed to HIST ERROR to avoid conflict with the MINUIT command ERROR_DEF. HELP should now be complete. Please notify me of any omissions or errors, or anything that is unclear. 01-Sep-1987 Postscript implemented - use HARD POSTSCRIPT HARD LN03 will also produce postscript, but in the near future this will be changed to be Tektronix as it used to be. 03-Aug-1987 New commands: LEGO and HIST LEGO to make lego plots ARGUS background function for B decays added (FUN ADD ARGUS) Files can now be aborted if an error is found Modified commands: SET UNIT is now SET DUMP and you can specify TTY or LPT or CLOSE 27-Jul-1987 The syntax for specifying secondary identifiers has changed. If you want to give the histograms secondary ID precede it by a &. e.g. PLOT 300&1 or COPY 150&0 320 If you omit the secondary ID the default will be taken. You can now pass parameters when you execute a file (see HELP EXECUTE for more details) New commands: ERRORS to change the errors for a histogram HMAKE to make an HBOOK histogram from a Mn_Fit histogram HRENAME to rename just an HBOOK histogram HDELETE to delete just an HBOOK histogram REDRAW is also a valid command within SET SET UNIT to change the output unit for DUMP commands changed to SET DUMP - 3rd August 1987 Mofified commands: SET NULL is now SET X|Y NULL so that you can draw a line at x=0 or y=0 EXEC filename parameter_list to pass parameters to a file SET If you specify the command on the same line as SET you exit SET automatically AVE_FETCH now works for 2-dimensional AVEHST histograms 20-Jun-1987 Major modification and complete reorganization of the internal data structure: Secondary identifiers introduced Scatter plots (HBOOK, AVEHST) can now be fetched and plot Multi-dimensional histograms intoduced (see HELP NDIMENSIONS) Histograms can be used as functions when fitting (FUN ADD HIST) Many new commands: REBIN EXEC (alias for READ COMMAND) to read a file with commands DAT_FETCH read an ADCII file with data points (alias for READ DATA) DAT_STORE store a plot in an ASCII file MN_FETCH to fetch a multi-dimensional histogram MN_STORE to store a multi-dimensional histogram SCT_FETCH to fetch an AVEHST true scatter plot PLOT n part to plot and extract part of an HBOOK histogram such as an associated function or a BAND (see HELP PLOT) FUN ADD HIST to use a histogram as the function to fit to FUN STORE to store the parameters of a function FUN FETCH to fetch the parameters of a function previously stored CUT to apply cuts to a multi-dimensional histogram NO_CUT to turn off the cuts on a multi-dimensional histogram PROJECTION to make a projection of a multi-dimensional histogram SMOOTH to smooth a histogram SPLINE to spline fit a histogram SPAWN to execute a single DCL command SHELL to spawn a subprocess EDIT to edit a file from with Mn_Fit ATTACH to attach to another process SQUEEZE to get back unused space for Mn_Fit SET DEFAULT to set all plotting parameters back to their default values SET IDB to change the default secondary identifier SET EDIT to change the default editor (TPU) to your favourite SET NULL instead of SET ZERO because of ambiguity with SET Z SET Z to set the limits on the number of entries for scatter plots SHOW COMMENT to show the currently booked comments SHOW KEY to show the currently booked key descriptions SHOW CUT to show the cuts on a multi-dimensional histogram COMMENT DELETE to delete a comment KEY DELETE to delete a key description COMMENT MOVE no longer exists (use COMMENT CHANGE) KEY MOVE no longer exists (use KEY CHANGE) Commands with modified syntax (see HELP for more details): FETCH AVE_FETCH PLOT OVERLAY FUN PLOT FUN HIST PARTITION ADD, SUBTRACT, MULTIPLY, DIVIDE, EFFICIENCY, SCALE, NORMALIZE COPY RENAME DELETE SET SYMBOL - new symbols introduced plus symbols for scatter plots 29-May-1987 Can now multiply the scale by a scale factor (see SET X|Y SCALE) 22-May-1987 Log scaling now available SET X|Y MODE 2 to get log scale OVERLAY command is equivalent to HIST OVERLAY DUMP of histogram contents is now HIST DUMP to avoid conflict with DUMP command inside MINUIT COMMENTS, KEYS and LINE positions can be defined in cm or in terms of co-ordinates of last plot (Mode flag) 13-May-1987 SET_CALLS is now CALLS (MINUIT command) SET_PRECISION is now PRECISION (MINUIT command) PLOT is now DRAW (MINUIT command) DRAW is now ITERATIONS (MINUIT command) NO_DRAW is now NO_ITERATIONS (MINUIT command) SET_PLOT is now SET everywhere PLOT can now be used instead of HIST PLOT everywhere Virtually all commands are valid in MN_CMD and MINUIT +PATCH,MANUAL,T=TEXT. +DECK,MN_HEADER. \documentclass[a4paper,twoside,11pt,dvips]{mnreport} %\usepackage{psmath,times} \usepackage{graphicx} \usepackage{makeidx} %\usepackage{drafthead} \setlength{\oddsidemargin}{0.0cm} \setlength{\evensidemargin}{0.0cm} % % European page sizes - should also be OK in USA % \setlength{\topmargin}{0.0cm} \setlength{\textwidth}{16.0cm} \setlength{\textheight}{23.5cm} % %\descriptionmargin=10em % \newcommand{\chisq}{\ensuremath{\chi^2}} % % Menu making environment % \newenvironment{menu}[2]% {\begin{list}{}% {\setlength{\leftmargin}{#1} \setlength{\labelwidth}{#2} \setlength{\labelsep}{0.2cm} \setlength{\itemsep}{0.0cm} \renewcommand{\makelabel}[1]{\bf ##1 \hfill}} }{\end{list}} % % \chardef\til=126 % \newcommand{\bb}[1]{{\bf #1}} \makeindex %----------------------------------------------------------------------------- % Path for plots in the manual- this has to be a complete path % \graphicspath{{/home/brock/mn_fit/help/}} % %----------------------------------------------------------------------------- % %\font\VB=ptmb at 25mm \begin{document} \bibliographystyle{unsrt} \begin{titlepage} \begin{center} \begin{tabular}{lcl} \includegraphics[height=6.0cm]{demo03} & \makebox[2.0cm]{} & \includegraphics[height=6.0cm]{demo05a} \end{tabular} % \includegraphics[height=3.0cm]{mn_fit_big}\\[0.6cm] % {\VB Mn\_Fit} \\[1.0cm] \textbf{\LARGE A Fitting and Plotting Package Using MINUIT} \\[0.7cm] \textbf{\LARGE Version 4.07}\\[0.3cm] \textbf{\LARGE \today} \\[0.5cm] \textbf{\Large BONN-MS-99-02} \\[0.4cm] % \bf Ian C. Brock\\[0.3cm] Physikalisches Institut der Universit\"at Bonn\\ Nu\ss allee 12\\ D-53115 Bonn\\[0.3cm] Electronic Mail: Ian.Brock@cern.ch or brock@physik.uni-bonn.de\\[0.3cm] % \begin{tabular}{lcl} \includegraphics[height=6.0cm]{demo06} & \makebox[2.0cm]{} & \includegraphics[height=6.0cm]{demo07} \end{tabular} \end{center} \end{titlepage} \pagenumbering{roman} \section*{Preliminary Remarks} In this manual \texttt{commands} that you type are in a typewriter font, optional elements of a command are enclosed in [\ ]. In the index the main reference to a command is indicated in {\bf boldface}. The figures on the cover page are made using the macros given in Appendix C. \par\noindent Mn\_Fit can be obtained via my homepage in Bonn:\\ \texttt{http://www-zeus.physik.uni-bonn.de/\til{}brock/mn\_fit.html}.\\ The CERN page that used to be the default, now switches you to the Bonn page. For several types of Unix machine, you should be able to download the Mn\_Fit executable and the other files that are necessary to run Mn\_Fit directly. Copy the tar file to your top-level Mn\_Fit directory. Then unpack it into this directory tree. Define the environment variable \texttt{MN\_FIT} in \texttt{bin/mn\_fit}. You should then be able to run Mn\_Fit by giving the command \texttt{\$MN\_FIT/bin/mn\_fit}, where \texttt{MN\_FIT} is an environment variable defined as the top-level Mn\_Fit directory, or should be replaced with the explicit directory name. If you cannot fnd a ready-made executable or have problems with it, you can make a Mn\_Fit executable and all other necessary files by dowloading the source tar file and unpacking it into the Mn\_Fit dirctory tree. Then copy the \texttt{install.unix} file from the \texttt{pro} directory into the top-level Mn\_Fit directory. Define the environment variable \texttt{MN\_FIT}: \begin{tabular}{ll} \texttt{setenv MN\_FIT xxx} & csh, tcsh etc.\\ \texttt{MN\_FIT=xxx; export MN\_FIT} & sh, ksh, zsh, bash etc. \end{tabular} \par\noindent Give the command \texttt{./install.unix} and answer the questions. The car files are in the \texttt{pro} directory. If you want to install Mn\_Fit from the compressed tar files on a VMS machine you should probably get the compressed files onto a Unix machine and unpack them there. Then copy the files in the pro directory onto your VMS machine and run \texttt{install.vms} there. The release notes \texttt{rel\_vnnn.txt} contain information that may be useful for trying to install Mn\_Fit on different machines. If you still have problems or need to modify the installation scripts contact the author to see if the modifications can be included in the next release. The manual is in the form of a Postscript file, which you should be able to print on most Postscript printers and/or look at using ghostview/gv. There are 2 versions of the manual, \texttt{mn\_fit.ps} which is 1 side per page, and \texttt{mn\_fit\_2ppp.ps} which is 2 sides per page, saving some trees, but requiring somewhat better eyesight! The file \texttt{mn\_fit\_figs.ps} contains the figures from Appendix B, which show the Mn\_Fit symbols, hatches, patterns and examples of fonts. \texttt{mn\_fit\_cover.ps} contains the Mn\_Fit cover page in colour! Some printers do not work with Postscript fonts -14 onwards. To test this print \texttt{mn\_fit\_font.ps} first -- 2 pages should be printed. If this works OK, then you can print the normal files, otherwise print the file \texttt{mn\_fit0.ps} or \texttt{mn\_fit0\_2ppp.ps}. The manual should fit on both A4 paper and American 8.5x11 in. Please let me know if it does not. An HTML version of the manual is also available via the Mn\_Fit homepage. \tableofcontents \listoffigures % % List of index entries see ... % \index{Variables|see{Numbers}} \index{shift|see{XSHIFT}} +DECK,MN_INTRO. \pagestyle{headings} \chapter{Introduction} \pagenumbering{arabic} Mn\_Fit is an interactive fitting and plotting package, that uses MINUIT~\cite{minuit} to fit histograms or data read in from a file and displays the fit results on a screen. Hardcopies of pictures can easily be made with a quality suitable for publication. Mn\_Fit can also be used purely as a plotting package without using the fitting. In this manual I will first give a brief introduction to what you can do with Mn\_Fit, how to run it and where to find more information. A selection of the most commonly used commands sorted into categories is given, to help you get started if you are a new Mn\_Fit user. This is followed by a description of some of the concepts and a list of the examples to demonstrate various features. A brief list of all the commands is given, followed by a detailed description of each command. In the appendices you can find examples of the symbols, fonts and hatchings. There is also a series of demonstration macros ranging from simple plotting and fitting to the use of colours, fonts, overlays and inserts and simultaneous fitting of 2 plots. By its very nature a manual is not completely up-to-date by the time you get it. Interactively you can find out what has changed by giving the command `HELP CHANGES'. The version number n.mm/ll has the following meaning: Major changes result in n being increased; addition of new commands or modification of existing commands result in mm being increased; ll is for bug fixes. \section{What Mn\_Fit Can Do} \label{INTRODUCTION} Features of the plotting include user specification of all the plotting variables, overlaying of one or more histograms or functions and the trivial changing of symbols used in plotting. There are also secondary histogram identifiers so that you can keep track of data and Monte Carlo plots for example by giving them different secondary identifiers. If you make projections or slices of a plot, they are stored with the same primary identifier, but are given a different secondary identifier. Similarly the functions used in fitting and projections of Ntuples are given the same primary identifier and a different secondary identifier (see HELP Secondary\_Identifiers for more information). It is easy to change the parameters for one plot in a picture and then `REDRAW' the whole picture without having to re-enter all the plotting commands (see HELP SET for details). It is possible to interactively specify cuts on a plot and then make projections of the plot using the cuts (see HELP CUT and HELP NTUPLE PROJECT). Cuts can be in standard FORTRAN syntax or using symbols ($<,>$ etc.). The cut can be either a simple expression (variable condition value), a more complicated expression (expression condition expression), or a COMIS function. It is also possible to project onto a variable or an expression and you can use a variable or expression as a weight for each point. For suitable commands you can give a range of either primary or secondary identifiers for the command (e.g. `FET 1:300' will fetch all histograms with identifiers between 1 and 300); see HELP Identifiers. For details on the implementation of the MINUIT package see HELP MINUIT. There are 2 versions of MINUIT available: the standard CERN version and a much older version extensively modified by C. Rippich. All of the standard MINUIT commands are available, with a few minor modifications. Several new commands have also been added to give you more control on what you fit and to permit a graphical display of the fit results. There are many predefined functions available such as Gaussians in many variations, Breit-Wigner, Polynomials etc. (see HELP FUNCTION LIST for details). If you need a more specialized function you can either define it interactively using the CERN COMIS package~\cite{comis}, meaning you can write your own functions without relinking Mn\_Fit (see HELP Using\_COMIS and HELP FUNCTION LIST COMIS for more details), or you can relink Mn\_Fit with a user function (see HELP FUNCTION LIST User for more details). It is also possible to apply constaints between the parameters of the functions you are fitting (see HELP MINUIT CONSTRAIN), and you can convolute a Gaussian resolution function with your function to include the effect of experimental resolution (see HELP SET FIT CONVOLUTE). Likelihood fitting is a built-in option and it is also possible to fit using a histogram as a function taking into account the statistical errors on each bin (see HELP FIT). Mn\_Fit can be run either interactively, or from a file, or you can execute a series of commands in a file. To read from a file while running interactively issue the command `EXECUTE' (or `READ COMMAND') `filename'. You can also define your own commands within Mn\_Fit using the `DEFINE' command. Within macros there are `DO' loops and `IF' blocks and you can pass parameters to the macro as well as setting them within the macro. You can give a list of directories that Mn\_Fit will search (see HELP SET PATH) when it is looking for a file. The working directory for output files can also be set (`WDIRECTORY' or `SET WORKING\_DIR'). On Unix machines filename completion and command line editing are available using the GNU readline package. All commands can be abbreviated to the point of ambiguity, and commands are read in using the TYPSCN package. You can define aliases for any commands or strings and specify whether alias translation is turned on or off (see HELP ALIAS for more details). Most of the time that you should give a value you can give a number, register, function parameter, histogram parameter or a variable (see HELP Numbers for more details). Mn\_Fit is designed so that you do not have to know the complete command syntax before starting to give a command. Just give the first word of a command and you should be prompted for everything else needed. Within a command you can often get more help by typing `?'. The prompt will indicate if this is possible. Interactive help is always available. Just give the command `HELP'. The help is standard VMS Help on VMS machines and a simulated version on all other machines. \section{How To Run Mn\_Fit}% \index{Running Mn\_Fit|textbf} At present Mn\_Fit is implemented on Vax, Alpha, Decstation, Apollo, HP, SunOS, SGI, Linux and IBM RS6000 computers. However, the latest version has only been compiled and tested on Linux, Alpha/OSF1, SunOS and HP-UX. Getting it running on other Unix machines should be very easy. The VMS implementation is frozen, as most experiments have or are going to turn off their VMS machines in the near future. If you are on a Unix machine and Mn\_Fit is installed in a standard area (e.g. {\tt /usr/local/bin}), then you can just give the command: {\small \begin{verbatim} mn_fit [arguments] \end{verbatim}} % \par\noindent If you are on a DESY Unix machine with access to AFS give the command: {\small \begin{verbatim} /afs/desy.de/user/b/brock/bin/mn_fit [arguments] \end{verbatim}} % \par\noindent If you are on a CERN Unix machine with access to AFS give the command: {\small \begin{verbatim} /afs/cern.ch/user/b/brock/bin/mn_fit [arguments] \end{verbatim}} % \par\noindent Not all flavours of Mn\_Fit are available at both CERN and DESY. Let me know if you cannot find a version for your system. \par\noindent Versions for Apollo DN10000 and 3000 type cpu's were available and the correct one should be automatically selected (using the {\tt ISP} environment variable). The last version of Mn\_Fit that I have tested on an Apollo is 4.02/19. On Unix machines where Mn\_Fit is not installed in a standard area you should set the {\tt MN\_FIT} environment variable to the top level directory of the Mn\_Fit tree. and then you can say: {\small \begin{verbatim} $MN_FIT/bin/mn_fit [arguments] \end{verbatim}} \par\noindent or include {\tt \$MN\_FIT/bin} in your {\tt PATH}. Preferably the system manager should edit the file {\tt \$MN\_FIT/bin/mn\_fit} so that the {\tt MN\_FIT} environment variable is defined correctly. He/she can also put the script in a "normal" directory such as {\tt /usr/local/bin}. % \par\noindent You can give arguments with the command to specify which version to run: {\small \begin{verbatim} filename Read all the Mn_Fit commands from the given filename. -x X Windows version (default) -g GKSGRAL version -dec DECGKS version (same as VAXGKS) -v VAXGKS version (same as DECGKS) -dgks Dec GKS-3D version -di3 DI3000 version -p PLTSUB version -n Host name for the X windows version -t Transport mode for X windows version (VMS only) -s Server number for X windows version (VMS only) -te Test version -disp Display version (only implemented for L3 and ZEUS) -dbg Run Mn_Fit in debug -u User version (mn_user_x.exe, if available) -te Test version (mn_test_x.exe, if available) -dev Development version (mn_dev_x.exe, if available) -old Old version (mn_old_x.exe, if available) \end{verbatim}} \par\noindent Note that if you specify a `filename' with the Mn\_Fit command, the first line of the file should be blank, or should specify the screen device. For the X windows version you can define the DISPLAY variable\index{DISPLAY environment variable} before you start Mn\_Fit or in the command line (using `-n hostname -t transport'). The transport is usuallly either decnet or tcpip (for Multinet tcpip). The host name is either the decnet name or the tcp/ip name. If you specify the display in one of these ways just hit {\tt $<$CR$>$} when prompted for the screen device. Line 10 of `higz\_windows.dat' will be used to set the display size. If you start the X windows version and the logical `decw\$display' (VMS) or environment variable `DISPLAY' (Unix) is not defined, then the display will be set to `sys\$node' (VMS) or ``hostname`' (Unix), if the `hostname' is not given. When you start up Mn\_Fit it will look for the file `mn\_logon.mnf' in your local directory and if that does not exist it will look for the logical name `mn\$logon'\index{Startup files} on VMS or the file `\~{ }/.mn\_fitrc' on Unix machines. A warning will be given if neither file is found. Mn\_Fit is interfaced to graphics devices using either HIGZ~\cite{higz} or PLTSUB. Within HIGZ the following flavours have been implemented: GKSGRAL, DECGKS (VAXGKS), DEC GKS-3D, X Windows and DI3000. The default interface for all machines (except Apollos) is X windows, but you also link with any other supported version. Support for graphics packages other than X will probably be removed in the near future. \section{Getting Started}% \index{Newcomers|textbf} The number of commands available in Mn\_Fit is probably a bit overwhelming for a newcomer. The following lists some of the most commonly used commands sorted into different categories. For more details on these commands look in the relevant section in the reference manual or use the online help. Look at the Table of Contents or the Menu of Commands (chapter~\ref{MENU} on page~\pageref{MENU}) to get an overview of all the commands. \begin{description} \item[General] \mbox{} \begin{menu}{7.0cm}{6.5cm} \item[shell shell\_command] Get back to the command level. \item[help] Help for Mn\_Fit. \item[exec] Execute a series of Mn\_Fit commands in a file. \item[define] Define a new command that is a collection of other Mn\_Fit commands. \end{menu} \item[Histogramming] \mbox{} \begin{menu}{7.0cm}{6.5cm} \item[fetch filename hist\_number] Fetch some histograms from a file. \item[open filename] Open an RZ file with histograms. \item[index] List the histograms fetched. \item[index hist\_number] \item[plot hist\_number] Plot a histogram. \item[overlay hist\_number] Overlay a histogram on one that has already been plotted. \item[2dim option hist\_number] Extra options for plotting 2-D histograms, e.g.\ 2DIM LEGO \item[add hist1 hist2 hist3] Add histograms together. \item[subtract, multiply, divide, efficiency] Alternatives for add. \item[dump hist\_number] Dump a histogram's content \item[rebin hist\_number low\_bin high\_bin new\_number\_of\_bins] \item[store/new filename hist\_number] Save some histograms in a new file. \item[store/update filename hist\_number] Save some histograms in an existing file. \end{menu} Hist\_number can be 0 for all, or \texttt{number1:number2} for a range of histograms. In Mn\_Fit a histogram is identified by two numbers, \texttt{id} and \texttt{idb}. \texttt{id} is the number the user booked with HBOOK, for example, in the analysis fortran code, idb is a secondary identifier. The following example shows how to use it. Use data ON the $\Upsilon(\mathrm{4S})$ and OFF the peak to obtain the net $\mathrm{B\bar{B}}$ contribution for many histograms with identifiers between 100 to 400: \begin{verbatim} set idb 1 fetch ON_data.hst 100:400 set idb 2 fet OFF_dat.hst 100:400 sub 0&1 0&2 0&3 1.0 2.0 store/new BBbar.hst 0&3 \end{verbatim} Here, it is assumed that files {\tt ON\_data.hst} and {\tt OFF\_data.hst} are obtained by runing the same program on two datasets so that the histogram identifers are the same for both datasets. It is also assumed that twice as much luminosity was taken on the peak as in the continuum, hence the scale factors of 1.0 and 2.0. Note that commands can always be abbreviated to the point of ambiguity. \item[Booking and filling new histograms] \mbox{} \begin{menu}{7.0cm}{6.5cm} \item[book hist\_number ...] Book a new histogram. \item[fill hist\_number ...] Fill the new histogram. \end{menu} \item[Ntuples] \mbox{} \begin{menu}{7.0cm}{6.5cm} \item[fetch filename hist\_number] Here hist\_number is an ntuple. \item[ntuple/project hist\_number] Project an ntuple with cuts. \item[ntuple/plot hist\_number] Project an ntuple with cuts and plot the projection. \item[cut new a + b $>$ c + d] Cut expression -- fortran style. \item[cut list] \item[cut use 1 \& 2 $|$ 3 \& 4] Logical combination of cuts to use. \item[cut delete cut\_number] Remove a cut. \item[cut name cut\_name ...] Give a cut a name to be used in \texttt{cut use} command. \end{menu} \item[Fitting] \mbox{} \begin{menu}{7.0cm}{6.5cm} \item[function list] List more than 40 predefined functions. \item[function add] Add a function for fitting. \item[function info] List the added functions. \item[function use] Function(s) to use when fitting \item[fit hist\_number] Command to get into MINUIT, where and one can do the usual MINUIT stuff such as \texttt{migrad, minimize}, constrained fit, simultaneous fits, ... Use the \texttt{exit} command to get back to the normal command level. \item[display] Show the fit results. \end{menu} \item[Cosmetic] \mbox{} \begin{menu}{7.0cm}{6.5cm} \item[set font item font\_number] Change the font. \item[set colour item colour] Change the colour of parts of a plot. \item[comment] Add some text to a picture. \item[key] Add a legend for a figure. \item[hardcopy] Write the current picture to a file (by default Postscript). \item[set window ...] Make multiple windows (zones) in one picture. \item[set ...] Sets lots of things - see section~\ref{SET} on page~\pageref{SET} (SET). \end{menu} \end{description} \section{Giving Commands}% \index{Commands|textbf}\index{Recalling Commands} On most Unix machines Mn\_Fit is linked with the GNU readline package \index{readline|textbf}% that allows command recall, command line editing and filename completion. The command line editor follows emacs conventions. You can use the left and right arrow keys to edit the command line and also control keys. Useful control keys are: % \begin{description} \item[CTRL/A] Go to the beginning of the line. \item[CTRL/D] Delete the character that the cursor is on. \item[CTRL/E] Go to the end of the line. \item[CTRL/H] Delete the character before the cursor. \item[CTRL/K] Delete from the cursor to the end of the line. \item[CTRL/R] Search for the last command containing the string you give. \item[CTRL/T] Toggle the position of the character the cursor is on and the character before. \item[CTRL/U] Delete from the beginning of the line to the cursor. \end{description} % The history mechanism is very similar to that of the c-shell. You can either use the up and down arrows to recall commands or `!'. You can use filename completion by typing part of the filename and then hitting `'. The filename will complete until it finds more than 1 option. If you hit `' again it will give a list of the possible completions. Filename completion does not work when you include environment variables in the filename, but they do get interpreted properly. On VMS machines you can also edit the command line in the usual way. Command recall is available using the up and down arrow keys. Useful control keys for command line editing are: \begin{description} \item[CTRL/A] Toggle between insert and overstrike mode. \item[CTRL/E] Go to the end of the line. \item[CTRL/H] Go to the beginning of the line. \item[CTRL/U] Delete from the beginning of the line to the cursor. \end{description} The list of control characters for both machines is not complete, but these are the ones I most commonly use. For more details see the GNU readline manual (or man readline if the man pages are installed on your machine) on Unix machines and HELP Line\_editing on VMS machines. \section{Fitting With Mn\_Fit}% \index{Fitting|textbf} The usual way to fit is using MINUIT. However spline fitting and histogram smoothing are also available for one dimensional plots. There are 2 versions of MINUIT implemented. Up to October 1990 a version modified by C. Rippich was used. Since then the standard CERN version is the default as it contains all the extra options added in the C. Rippich version. The older version is still available, but has to be linked at your institute. There is great flexibility in what you can fit and the functions used to fit with. The usual procedure is to select the function(s) you want to fit with using the `FUNCTION ADD' and `FUNCTION USE' commands and then to invoke MINUIT using the `FIT' command. You can specify whether you want to do likelihood or chi**2 fitting, and whether the Monte Carlo statistics should be taken into account when calculating the likelihood. If you just want to do a simple fit of a Gaussian, flat line or a line with a slope you can use the `FIT/qual' syntax. This form will add the correct function(s), disable all others and start fitting. A default list of commands is executed, that can also be changed by the user. It is possible to fit 1 or 2 dimensional histograms or a series of data points. It is not possible to fit to a true scatter plot. Use the `PROJECT' command to make a binned 2-d histogram out of the scatter plot if you want to fit it. You can, however, fit surfaces where the x,y,z,dz values are variables in an Ntuple or a file containing an Ntuple card. You use the `SET NTUPLE PLOT' command to assign the variables to the axes. You can, of course, use the same mechanism to do a 1-dimensional fit to 2 variables of an Ntuple. You can simultaneously fit 2 or more plots by giving both their identifiers with the fit command. If you want to use different background functions for each plot, but the same signal, e.g. when you fit a mass peak from 2 different decay modes, you should give the function numbers NOT to be used for a plot after you give its identifier. If you are using the option `SET RATIO ON' (see below), you can only use different background functions for 2 plots as Mn\_Fit could not constrain the sum of a set of parameters to be 1 in MINUIT. (As of Mn\_Fit version 3.00 constraints are possible, so I could add this feature if anyone needs it). There are 2 options on how the parameters are specified. In the first (`SET RATIO ON' - default) the parameters will be modified so that the first one for each function is the total area, the second one is the ratio of the area under the function in the first plot to the total, etc. This form is more linear than using the ratio of the areas in each plot as a parameter. If you use the option `SET RATIO OFF' then each plot has an independent area. The `FIT' command defines the MINUIT parameters or writes the necessary MINUIT datacards and checks that the histograms you want to fit actually exist. The histogram(s) are copied to a separate storage space so that you cannot accidently delete or modify them while fitting. MINUIT is invoked and after the parameters are listed in the standard format, you can give MINUIT commands for fitting. It is possible to constrain parameters. For example, you may wish to fix the relationship between 2 means in 2 Gaussians (see HELP MINUIT CONSTRAIN for more details). You can convolute the fitting functions with a Gaussian resolution in order to include detector effects (see HELP SET FIT CONVOLUTE for more details). The resolution has to be given with the `SET FIT CONVOLUTE' command at present. I intend to make it a free parameter in a future release. It is possible to exclude regions from a fit or include regions, dump the chi**2 or likelihood for each point, display the fit, either as an overlayed function, or background subtracted or both ways (see HELP SET DISPLAY MODE). Note that the chi**2 or the likelihood is stored in register 111 (access it using the syntax `R111'), and the confidence level is stored in register 112, so that you can use it to put in a plot for example. There are a large number of built-in functions (see HELP FUNCTION LIST), which are sufficient for most purposes. However you can write your own functions and either invoke COMIS or relink Mn\_Fit depending on the amount of CPU time the fitting takes. The form for the COMIS and USER functions is virtually interchangeable (usually only the function name is different), so you can start with a COMIS function and then relink if you have a lot of fitting to do. You can also use a 1 or 2-dimensional histogram as a function. Use the `FUNCTION ADD HISTOGRAM id' syntax, and you will be asked if the histogram errors should be included in the chi**2 calculation or not. If you want to be able to shift or scale the histogram that is used as a function use the `SMOOTHED HISTOGRAM' function. When fitting with histograms you often want to know the fractional contribution of each histogram. The `FIT/FRACTION' command sets an overall normalization and the fraction of each function as free parameters. The only built-in functions for 2-dimensional histograms are a 2-D Gaussian and fitting to another 2-dimensional histogram. For any other form you must write your own USER or COMIS function (see HELP FUNCTION LIST User or HELP FUNCTION LIST COMIS for more details). If your function changes a lot across a bin you can integrate it across the bin for each data point. Use the command `SET FIT INTEGRATE ON ninterval', where `ninterval' is the number of intervals for the integration. Note that the cpu time used is directly proportional to the number of intervals. You can also fit with several functions and include an overall normalization factor using the command `SET NORM ON' or `FIT/NORM'. This turns on an overall normalization factor for the function(s) you are fitting with. The parameter will be called `NORM00' and will be the first parameter. This is useful if you want to fit to functions of the form: {\small \begin{verbatim} NORM00 * (HIST1 + ALPHA*HIST2) \end{verbatim}} \par\noindent where `HIST1' and `HIST2' are 2 histograms and `ALPHA' is the relative contribution of each. To get the fraction and its error directly use the `FIT/FRACTION' command. Always check that the results of the fit are reasonable - that the errors are reasonable (see HELP Errors) and that it looks as if the fit has converged properly. WARNING: A standard procedure is to fit the background either side of a peak; then remove the peak exclusion, fix the background and fit the peak; and finally to float everything and fit again. While it is possible to do this without exiting MINUIT, in the C. Rippich version, for some unknown reason, the latter 2 fits often do not converge properly and so I recommend exiting MINUIT and restarting it after each of the 3 fits. This seems to give better results. I believe that this problem does not occur with the new CERN version of MINUIT. \subsection{MINUIT Errors}% \index{Errors!MINUIT}\label{ERRORS} MINUIT gives two different errors from its fitting routines: parabolic errors and MINOS errors. For functions which have no correlations between the parameters or the variations are linear, the parabolic error and the MINOS errors should be almost the same. However if there are correlations, or the errors are asymmetric you should always use the MINOS errors to be sure. There is a nice discussion of the meaning of the MINUIT errors and what you should be careful about in the MINUIT manual. You should read this for more information. Occasionally MINUIT will claim to have converged and the parabolic errors are ridiculously small. This often happens if you fit with functions having correlated parameters (like Gaussians!). The usual fix to this is to give the command `HESSE', which recalculates the covariance matrix, and then `MINIMIZE' again or run `MINOS'. A good check is that the parabolic error should lie between the MINOS errors if the problem is linear and be smaller than the MINOS errors if there are correlations. Again, this problem is much reduced with the CERN version of MINUIT. Note that in the CERN version of MINUIT the parabolic error includes the correlations between the parameters. I believe that was not the case for the C. Rippich version. If you want to have 90\% confidence level upper limits for example, it is possible to get these directly by changing the chi**2 change used to calculate the error (command `ERROR\_DEF 1.69'). Note that the likelihood is scaled by a factor of 2, so that 1 sigma errors also correspond to a likelihood change of 1. You can get a contour plot on the terminal using the `CONTOUR' command and a graphical contour plot using the `MNCONTOUR' command. Note that `CONTOUR' just scans the 2-dimensional space of the 2 variables, whereas `MNCONTOUR' minimizes the FCN at each point on the contour. If you make a plot of your fit parameter with MINOS errors and then you want to store the histogram, you should not use the `STORE' command, as HBOOK does not know about asymmetric errors in its normal histograms. Instead use the `DAT\_STORE' or `MN\_STORE' commands that write the plots out in an ascii file or in Mn\_Fit format. \subsection{Fitting With Small Numbers of Events}% \index{Errors!Small Numbers of Events} To start with, DO NOT fit with small numbers of events if you can avoid it! If you have to fit with small numbers of events, then DO NOT do a chi**2 fit with small numbers of entries per bin (the nominal value is less than 10). You should be doing a likelihood fit. If you cannot likelihood fit, for example if you have small numbers of events and have done a continuum subtraction, or if for some reason your errors are not the square root of the number of entries, you have a problem! In general, the Gaussian error on a low fluctuation is too small, so that a chi**2 fit will tend to give a total area under the function you are fitting with which is smaller than the area of the plot you are fitting to. The previous policy in Mn\_Fit was to ignore bins with no entries for a chi**2 fit (they are included in a likelihood fit properly). This has now been changed to give these bins an error of 1. This is obviously not strictly correct, but may be better than before. As an experiment I created a plot with 10 bins, 2 of them with 1 entry and the others with zero: {\small \begin{verbatim} With a likelihood fit to a flat spectrum the result was 0.2 +/- 0.03 With a chi**2 fit and errors of 1 on all points it was 0.2 +/- 0.3!! With a chi**2 fit and errors of 0 on zero points it was 1.0 +/- ?? \end{verbatim}} \par\noindent Clearly the likelihood fit gave the correct answer and is what should be used if you can. While the chi**2 fit also gave the right value, the error is way wrong! The third result is as expected because all the zero points were ignored. Closely connected with the above comments is, what to do if you want to do a continuum or background subtraction, when some of the bins in either the signal or background plot are zero. As I said for chi**2 fitting with small numbers of entries per bin, if you can possibly avoid it, DO NOT do it! The preferable way, if you know the background shape, is to fit it and then subtract the fitted form from the signal (including the error from the fit). Mn\_Fit used to assign an error of zero to bins with zero entries. The default has now been changed to assign an error of 1 when using the plot in the commands `ADD, SUBTRACT, MULTIPLY, DIVIDE, EFFICIENCY', and `AVERAGE'. I do not assign an error of 1 for `SCALE' and `NORMALIZE' as this can give strange effects when plotting with empty bins and large scale factors. Thus if you had 0 entries in an $\Upsilon$(4S) bin and 1 in the corresponding continuum bin and scaled the continuum by a factor 2, you used to get an error of 2 for that bin, while now you will get an error of 2.24. Neither of these errors is strictly statistically correct, but until someone tells me a better way to do it that's the way it's going to be. To get the old error use the command `SET ERR\_ZERO OFF' before fetching the histograms. If you want to `SCALE' or `NORMALIZE' a histogram that has bins with 0 entries you should give the command `HIST ERR id 2' to set the errors on these bins to 1. When calculating an efficiency by dividing 2 plots, the error was underestimated for small numbers of entries. I use the same form of the error calculation as Paul Avery derived for MULFIT. This form is still not completely statistically correct and will be the subject of a later note. The form is: \begin{displaymath} \sigma_{\alpha} = \sqrt{ \frac{(n+1)(N-n+1)}{(N+3)(N+2)^2} } \end{displaymath} Finally I will give a brief summary of some of the commands relating to how errors are treated and displayed:\index{Errors!Special Commands} \begin{menu}{4.8cm}{4.3cm} \item[\tt SET ERR\_ZERO ON\hfill] Sets errors on zero bins to 1 for `ADD' etc. and `FIT'. \item[\tt SET ERR\_ZERO OFF\hfill]Sets errors on zero bins to 0 for `ADD' etc. and `FIT'. \item[\tt HIST ERROR id nmode\hfill] Recalculates the errors for a plot. There are 5 modes: \item[\tt \hfill nmode = -1] Removes errors on all points, \item[\tt \hfill nmode = 0] Zero errors on all points, \item[\tt \hfill nmode = 1] Errors are square root of the number of entries, \item[\tt \hfill nmode = 2] Same as 1 except error on zero entries is 1, \item[\tt \hfill nmode = 3] Set the error on all points to the same value. \item[\tt SET SHOW\_ZERO ON\hfill] Zero points with zero errors are shown (now default). \item[\tt SET SHOW\_ZERO OFF\hfill] Zero points with zero errors are not shown (used to be default). \item[\tt HIST DUMP id\hfill] Dumps the contents of a plot, so you can see what the errors are. \item[\tt DUMP] A MINUIT command that dumps each point and its chi**2 or likelihood contribution to the overall chi**2 or likelihood. \end{menu} % \subsection{Including Monte Carlo Statistical Errors}% \index{Errors!Including Monte Carlo} With the large data samples available at many experiments, Monte Carlo statistics are often a significant error. For measurements such as $\tau$ polarisation at LEP one usually fits a distribution to 2 components which are both represented by histograms with limited statistics. There are a number of approaches on how to include this error -- the one that is included in Mn\_Fit version 4.02 is from Ian Scott~\cite{scott}, which assumes Poisson errors for both Monte Carlo and data and calculates a joint probability, $P$, to observe $m$ Monte Carlo events and $n$ data events, given a factor $r$ more Monte Carlo events than data events. Using $\Gamma(p+1) = p!$ he obtains: \begin{displaymath} P = \frac{\Gamma(n+m+1)}{\Gamma(n+1)\Gamma(m+1)} \frac{r^{m+1}}{(1+r)^{n+m+1}} \end{displaymath} There is a more recent paper by Barlow and Beeston~\cite{barlow} that allows reweighting of events also that I will look into implementing. These approaches can probably also be used for the problem above of subtracting a continuum background with limited statistics. Instead it may be better to just fit the data to the sum of the signal and continuum background. \section{Command Files or Macros}% \index{Macros} Any Mn\_Fit commands can be put into a file and executed instead of being typed in. Files are run using the `EXECUTE' command. You can also `DEFINE' new commands to be a list of existing Mn\_Fit commands. These definitions are stored in memory and so should execute quicker than files. The same facilities exist for `DEFINE'd commands as for macros. There are a number of extra facilities available in macros. Parameters can be passed to the macro either on the command line or the first time a parameter is encountered in a file you will be prompted for its value. Up to 9 parameters can be passed and you refer to them in the file by preceding the number with an `@'. The `INQUIRE' command is also available so that you can prompt for the value of parameters. With this command you can also give the default value for a parameter, if you want to avoid beng prompted for it. Direct string substitution takes place as each line is executed, therefore you can even construct histogram numbers in a macro or pass the name of another macro to be executed. It also means that you can put in alternative returns from a macro by giving a parameter as a command and waiting for the prompt before deciding if you want to continue executing the file. See HELP EXECUTE for examples. It is possible to construct `DO' loops inside a macro. The `DO' loop variable must be a single letter and it can be used inside the loop by preceding the letter by a `@'. `DO' loops are terminated by an `ENDDO' command. Please note that there has been no attempt to make the `DO' loops execute quickly; each line is interpreted in every iteration and the file is rewound for each iteration. However they are extremely useful if you do not try to do too much with them! `DO' loops should execute faster in `DEFINE'd commands as the file does not have to be rewound and read again every iteration. `IF' statements are available in macros and defined commands. Simple statements with up to four conditions are possible at present (see HELP IF). If you need to put a number into a character string as part of a command you can use the `PARSE' command. This is particularly useful if you want to pass a histogram identifier that is in a register as a text parameter to another macro, or if you have a series of histogram identifiers in registers and you want to loop over them, constructing commands that use the identifiers. Note that the last 100 commands are logged (see HELP SHOW LOG) and can be written to a file with the `WRITE LOG' command. You can also turn on logging of all commands to the file `mn\_fit.log' using the command `SET LOG ON'. This is particularly useful for recording sessions if you have problems and want to report them. WARNING: In Mn\_Fit versions before 4.07/32 you should not include comment lines inside `DEFINE' commands, if there is a `DO' loop inside the same file. Inline comments are OK. Mn\_Fit keeps track of which line is being read for future use in `IF' blocks and `DO' loops. If you have comment lines inside the `DEFINE' command, the counting of the line number gets out of sync. As a result any `DO' loops that are executed after the definitions (within the same macro) will not work properly. After the first run through the loop Mn\_Fit will rewind the file and then jump to the wrong line for the second and future runs through the loop. \section{Numbers in Mn\_Fit} \index{Numbers|textbf}\label{NUMBERS} In most places when Mn\_Fit asks for a number, such as a cut, or the bin limits for a new plot, or the axis label parameters, you can give either a number or a register, parameter, etc. You can also define new variable names using the syntax `DEPOSIT name = value'. The variable names must be alphanumeric expressions of maximum length 8 characters and can also include `\$' and `\_'. Variable names which match one of the names below (e.g. R, ERR), or a FORTRAN intrinsic function are not allowed nor is the name `ALL'. The names are converted to upper case. The new variables can be deleted using the `REMOVE' command. See HELP DEPOSIT for more details: {\small \begin{verbatim} e.g. dep pi = 3.14159 dep r2 = sin(pi/2) \end{verbatim}} % \par\noindent These extra variables are stored in registers $>300$. You can look at the values of registers, parameters, bin contents etc. using the `EXAMINE' command or the `SHOW REGISTER' command for registers only. Note that numbers are always floating, with the exception of `IR'. In general if you want to keep the current value of a number use the `=' sign. You can also add, subtract, multiply or divide the current value by using the syntax `=+1.0, =*R2', etc. The following lists the possibilities for giving a number: \begin{itemize} \item A number, e.g. 4, -5.2, 3.2E+02. It is not necessary to give the decimal point for real numbers. \item A register\index{registers} \begin{description} \item[Rn or IRn] where n can be from 0 to 500. Note that you are allowed to fill registers 0-99 with whatever you wish using the `DEPOSIT' command. All register contents are stored as real numbers. The integer format `IR' is used when you want to convert the contents to an integer to put them in a text string (see HELP Text). Registers 100 and above contain the following information: \begin{description} \item[101] The result of a `SUM' or `INTEGRATE' command \item[102] The number of points summed over in `SUM' \item[111] The chi**2 or likelihood from the fit \item[112] The confidence level of a fit \end{description} Registers 201-204 contain the positions of the corners of the current plot in cm: \begin{description} \item[201] x position left \item[202] x position right \item[203] y position bottom \item[204] y position top \end{description} Registers 205-210 contain the limits used for the drawing of each of the axes in plot co-ordinates: \begin{description} \item[205] x minimum \item[206] x maximum \item[207] y minimum \item[208] y maximum \item[209] z minimum \item[210] z maximum \end{description} Registers 121 to 200 and 231 to 267 are filled if you give the command `SET PLOT id [\&idb] DEFAULT': \begin{description} \item[121] The plot identifier \item[122] The secondary plot identifier \item[123] The number of entries (histograms) or points \item[124] The dimension of the plot (positive for histograms, negative for Ntuples and a series of points). \item[125] The area under the plot (i.e. sum of weights) \item[126] The minimum number of entries (weight) \item[127] The maximum number of entries (weight) \item[128] The creation date of the histogram (yymmdd) \item[129] The creation time of the histogram (hhmm) \item[131] The number of bins on x-axis (0 for Ntuples and points) \item[132] The lower limit of the x-axis \item[133] The upper limit of the x-axis \item[134] The mean value for the x-axis \item[135] The sigma for the x-axis \item[136] The number of bins on y-axis (0 for Ntuples and points) \item[137] The lower limit of the y-axis \item[138] The upper limit of the y-axis \item[139] The mean value for the y-axis \item[140] The sigma for the y-axis \end{description} etc. up to 14th dimension of an Ntuple. Registers 231-257 contain total contents, as well as underflows and overflows of the default histogram: \begin{description} \item[231] Underflows x-axis \item[232] Contents x-axis \item[233] Overflows x-axis \end{description} For 2-dimensional histograms 9 registers are filled contents in register 235), while for 3-dimensional histograms 27 registers are filled (contents in register 244). Registers $>300$ contain extra variable names that you have defined. Up to 200 variables are allowed. \end{description} \item A parameter, its parabolic error, its positive or negative error, or its limits.\index{Function parameters} The syntax to use is: \begin{description} \item[Pn(m)] for the parameter \item[ERRn(m)] for the parabolic error on the parameter \item[ERNn(m)] for the negative MINOS error on the parameter \item[ERPn(m)] for the positive MINOS error on the parameter \item[LOLIMn(m)] for the lower limit on the parameter value \item[HILIMn(m)] for the upper limit on the parameter value \end{description} where n is the function number and m is the parameter number. If you are fitting you can also use just the MINUIT parameter number e.g. Pn. \item The centre of a bin, the bin width, the contents or the error on the contents (including asymmetric errors).\index{Histogram contents} The syntax to use is: \begin{description} \item[Xn(m)] for the bin centre or the x value of a point \item[DXn(m)] for half the bin width or the error on the x value \item[Yn(m)] for the bin contents or the y value of a point \item[DYn(m)] for the error on the y value \item[DNXn(m)] for half the bin width or the negative error on the x value \item[DNYn(m)] for the negative error on the y value \item[DPXn(m)] for half the bin width or the positive error on the x value \item[DPYn(m)] for the positive error on the y value \end{description} where n is the plot number (including the optional secondary identifier if needed) and m is the bin number. For 2-dimensional histograms give both bin numbers. e.g. \texttt{Xn(l,m)}. However note that it is not possible to use the Y value of a bin, as Y {\bf ALWAYS} means the bin contents for histograms. You can calculate the y value of a particular bin or the y bin width using registers 134, 135 and 136. For plots with asymmetric errors \texttt{DX} and \texttt{DY} are interpreted as the negative errors if you want to get the value and as both errors if you are using the \texttt{DEPOSIT} command. If the plot identifier is stored in a register, use the \texttt{PARSE} command to convert it into a number. \item The value of an Ntuple variable. The syntax to use is: \begin{description} \item[Xn(m,nvar)] or \item[Xn(m,tvar)] where n is the plot number, m is the event number, nvar is the variable number and tvar is the variable name. Within the `DEPOSIT' command you can access CWN variables, but not arrays. \end{description} For cuts and expressions for projections you can just give the variable name. \end{itemize} %\end{document} +DECK,MIN_INTRO. \chapter{MINUIT} \label{MINUIT} \section{Introduction} \label{MINUIT:INTRODUCTION} There are 2 versions of the MINUIT package interfaced to Mn\_Fit. The default is now the CERN library MINUIT and the previous version was based on a much older version of MINUIT and was extensively modified by Chris Rippich. To get this old version, which was the one used in all versions of Mn\_Fit up to 3.00, you have to link it at your institute and run Mn\_Fit with the option `-c' (short for `cgr\_minuit'). In both versions a number of new commands have been added to give you a graphical display of the fit results and to control which parts of the plots are being fit. All MINUIT commands have the standard syntax, except `MIGRAD, SIMPLEX' and `MINOS' where the maximum number of calls is not part of the command, but can be set using the `MAX\_CALLS' command. The following extra commands are defined when you are running MINUIT: `MODIFY', `DISPLAY', `EXCLUDE', `INCLUDE', `NO\_EXCLUDE', `NO\_INCLUDE', `DUMP', `ITERATIONS', `MAX\_CALLS', `PRECISION', `FLOAT', `INFO', `FIT\_INFO' and `BACK\_SUB'. In addition there are a few commands in the CERN version which are not available in the C.~Rippich version: `CONSTRAIN, SCAN, STRATEGY, RELEASE'. In the CERN version of MINUIT you can give any standard MINUIT command with the standard syntax by prefixing the command with `MINUIT'. e.g. `MINUIT SHOW COV'. Note that in all MINUIT commands a number can passed as a register, parameter etc. (see HELP Numbers for the syntax). The default printout level when you startup MINUIT is 0. This gives quite a lot of information about what is going on. If you are doing repetitive fitting I recommend reducing the printout level to -1 (command `PRINTOUT -1') +DECK,MN_APPENDIX. \appendix \chapter{Acknowledgements} Many of the improvements and bug fixes have been prompted by my CLEO colleagues at Cornell. Dave Brown has tested the new versions that I sent him, fixed a number of bugs and implemented some new features. Jon Lewis has implemented new commands and is always a source of new ideas. He has also read through an older version of the manual several times and made a number of suggestions. Bijan Nemati used to support Mn\_Fit at Cornell and was always ready to try out new versions and try to get them to work! Dan Bliss then took over that responsibility. The current Mn\_Fit tsar for CLEO is Horst Severini. Roy Wang suggested the list of commands to help newcomers get started. While Mn\_Fit can probably be seen as competition for PAW, I have made use of a number of features built into PAW, particularly COMIS and the lego plotting code. I also use HIGZ for the graphics interface, to minimize the numbeers of changes I have to make when I want to implement a new interface. The TYPSCN package, originally written by D.G.~Cassel and T.J.~Killian, later updated by Chris Bebek, is straightforward to use and relieves the programmer of many of the usual chores associated with deciding which command has been given, or interpreting numbers. Most of the code for calculating expressions and also the use of registers, parameters etc. came from Paul Avery's MULFIT package. Jon Lewis has implemented the DI3000 interface using HIGZ/DI3000. Many other Mn\_Fit users have sent in their comments and bug reports. The list of good ideas for new features to implement never seems to get shorter! \chapter{Examples of Symbols, Fonts, Hatching and Keys} \label{APPENDIX:SYMBOLS} The complete set of Mn\_Fit symbols is shown in Fig.~\ref{fig:symbol} and the standard Mn\_Fit registers are given in Table~\ref{tab:registers}. The same fonts are available in Mn\_Fit as in PAW. For some examples see Fig.~\ref{fig:font}. Note that the font and precision are specified with the form `spfff', where `s' is the sign of the font, `p' is the precision and `fff' is the font, e.g. -1013 to get font -13 with precision 1. The fonts available depend on the version of the graphics package used. In Fig.~\ref{fig:font} HIGZ Postscript fonts are shown. In Fig.~\ref{fig:font_gksgral} those for GKSGRAL and GKSGRAL Postscript are shown. The complete character set for the device independent HIGZ font (font 0) is shown in Fig.~\ref{fig:igtext1}, while that for HIGZ Postscript font -13 is shown in Fig.~\ref{fig:igtext2}. Note that you only see the Zapfdingbats fonts when you look at or print the Postscript file. Use the `HARDCOPY' or `CAPTURE' command to make such a file. HIGZ Postscript fonts can be obtained using precision 0,1, or 2. They are identical when you make a hardcopy. The differences are how they appear on the screen. If you use Postscript fonts and precision 2 you get the hardware default font on the screen. If you use precision 1 then the standard IGTEXT font (font 2000) is used on the screen and the Postscript font is used when printing. If you use precision 0, you get the Postscript fonts on the screen, but not superscripts, subscripts, Greek characters etc. The default font everywhere is now (Version 4.06) -1004 i.e. IGTEXT on the screen and Helvetica Postscript font when printing. Note that there is an offset between the HIGZ/Postscript font numbers and those in GKSGRAL. Times-Roman is -1 in GKSGRAL and -13 in HIGZ/Postscript, Times-Italic is -2 and -1 respectively. Device independent hatchings are available in all HIGZ interfaces and these are shown in Fig. \ref{fig:hatch}. Each graphics package usually has its own hatchings and patterns (DECGKS) and these are often different for screen and hardcopy devices. Some examples for GKSGRAL are shown in Fig.~\ref{fig:hatch_gksgral}. Consult the relevant graphics package documentation for more details. Hatch -3 is often used, because it gives a nice shaded overlay. However note that this is really a pattern (because you cannot see through it) and if you use it in an overlay it obscures the ticks. The solution is to do a `plot/noclear' on the 1st id again to get the scale redrawn. The solid fill patterns (100) and examples of hatch -3 are shown in Fig.~\ref{fig:pattern}. The \texttt{KEY} command can be used to provide a legend of the different symbols and shading used in a plot. Some examples are given in Fig.~\ref{fig:key}. See Section~\ref{KEY} on page~\pageref{KEY} for more details. A picture showing the standard Mn\_Fit sizes and the appropriate commands is shown in Fig.~\ref{fig:sizes}. A complete list of the Postscript characters that are available is shown in Fig.~\ref{fig:pschar}. The first column shows the character code. The second shows what you get if you give the character code using the form \verb+\nnn+. The other columns show what you get in Greek (\verb+[\nnn]+), Special (\verb+"\nnn#+) and Zapfdingbats (\verb+~\nnn#+) modes respectively. \verb+nnn+ indicates the character code given in the first column. \clearpage \newlength{\apptabwidth} \setlength{\apptabwidth}{\textwidth} \addtolength{\apptabwidth}{-3.0cm} \begin{table}[htbp] \begin{center} \begin{tabular}{|l|p{\apptabwidth}|} \hline 101 & The result of a `SUM' or `INTEGRATE' command \\ 111 & The chi**2 or likelihood from the fit \\ 112 & The confidence level of a fit \\ \hline \multicolumn{2}{|l|}{Registers 121 to 200 and 231 to 257 are filled if you give the command}\\ \multicolumn{2}{|l|}{`SET PLOT id [\&idb] DEFAULT'} \\ \hline 121 & The plot identifier \\ 122 & The secondary plot identifier \\ 123 & The number of entries (histograms) or points \\ 124 & The dimension of the plot (positive for histograms, negative for Ntuples and a series of points). \\ 125 & The area under the plot (i.e. sum of weights) \\ 126 & The minimum number of entries (weight) \\ 127 & The maximum number of entries (weight) \\ 128 & The creation date of the histogram (yymmdd) \\ 129 & The creation time of the histogram (hhmm) \\ 131 & The number of bins on x-axis (0 for Ntuples and points) \\ 132 & The lower limit of the x-axis \\ 133 & The upper limit of the x-axis \\ 134 & The mean value for the x-axis \\ 135 & The sigma for the x-axis \\ 136 & The number of bins on y-axis (0 for Ntuples and points) \\ 137 & The lower limit of the y-axis \\ 138 & The upper limit of the y-axis \\ 139 & The mean value for the y-axis \\ 140 & The sigma for the y-axis \\ & etc. up to 14th dimension of an Ntuple. \\ \hline 231 & Underflows x-axis \\ 232 & Contents x-axis \\ 233 & Overflows x-axis \\ \multicolumn{2}{|l|}{For 2 dimensional histograms 9 registers are filled (contents in register 235),}\\ \multicolumn{2}{|l|}{while for 3-dimensional histograms 27 registers are filled (contents in register 244).} \\ \hline \multicolumn{2}{|l|}{Registers 201-204 contain the positions of the corners of the current plot in cm} \\ \hline 201 & x position left \\ 202 & x position right \\ 203 & y position bottom \\ 204 & y position top \\ \hline \multicolumn{2}{|l|}{Registers 205-210 contain the limits used for the drawing of each of the axes} \\ \multicolumn{2}{|l|}{They are in plot co-ordinates} \\ \hline 205 & x minimum \\ 206 & x maximum \\ 207 & y minimum \\ 208 & y maximum \\ 209 & z minimum \\ 210 & z maximum \\ \hline \multicolumn{2}{|l|}{Registers $>300$ contain extra variable names that you have defined.} \\ \multicolumn{2}{|l|}{Up to 200 variables are allowed.} \\ \hline \end{tabular} \end{center} \caption[Mn_Fit Registers]{The list of standard Mn\_Fit registers. See Section~\ref{NUMBERS} for more details on what you can give when Mn\_Fit asks for a number.} \label{tab:registers} \end{table} % % Mn_Fit symbols plot % \begin{figure}[hbp] \includegraphics[height=16cm]{symbol} \caption{Mn\_Fit Symbols} \label{fig:symbol} \end{figure} % % IGTEXT plot % \begin{figure}[hbp] \begin{center} \includegraphics[height=16cm]{igtext1} \begin{tabular}{|l|l|l|l|} \hline \verb+[+ & Switch to Greek & \verb+]+ & Switch back from Greek \\ \verb+"+ & Switch to special & \verb+#+ & Switch back from special \\ \verb+?+ & Switch to subscript & \verb+!+ & Switch back from subscript \\ \verb+^+ & Switch to superscript & \verb+!+ & Switch back from superscript \\ \verb+&+ & Backspace one character& \verb+@+ & Print an escape character \\ \hline \end{tabular} \caption[HIGZ Portable Software Characters]% {HIGZ Portable Software Characters and the escape characters to switch modes.} \label{fig:igtext1} \end{center} \end{figure} % % Postscript font -1004 % \begin{figure}[hbp] \begin{center} \includegraphics[height=16cm]{igtext2} \begin{tabular}{|l|l|l|l|} \hline \verb+[+ & Switch to Greek & \verb+]+ & Switch back from Greek \\ \verb+"+ & Switch to special & \verb+#+ & Switch back from special \\ \verb+?+ & Switch to subscript & \verb+!+ & Switch back from subscript \\ \verb+^+ & Switch to superscript & \verb+!+ & Switch back from superscript \\ \verb+~+ & Switch to Zapf Dingbats& \verb+#+ & Switch back from Zapf Dingbats\\ \verb+&+ & Backspace one character& \verb+@+ & Print an escape character \\ \hline \end{tabular} \caption[Postscript Version of HIGZ Portable Software Characters]% {Postscript Version of HIGZ Portable Software Characters and the escape characters to switch modes.} \label{fig:igtext2} \end{center} \end{figure} % % HIGZ Postscript Fonts plot % \begin{figure}[hbp] \includegraphics[height=16cm]{font} \caption{Examples of HIGZ Postscript Fonts} \label{fig:font} \end{figure} % % GKSGRAL Postscript Fonts plot % \begin{figure}[hbp] %\mbox{Free space for GKS GRAL font figure} \includegraphics[height=16cm]{font_gksgral} \caption{Examples of GKSGRAL Fonts} \label{fig:font_gksgral} \end{figure} % % Hatching plots % \begin{figure}[hbp] \includegraphics[height=16cm]{hatch} \caption{Examples of HIGZ Hatching} \label{fig:hatch} \end{figure} % % Hatching plots % \begin{figure}[hbp] \includegraphics[height=16cm]{hatch_gksgral} %\mbox{Free space for GKS GRAL font figure} \caption{Examples of GKSGRAL Hatching} \label{fig:hatch_gksgral} \end{figure} % % Pattern plots % \begin{figure}[hbp] \includegraphics[height=16cm]{pattern} \caption{Examples of Patterns} \label{fig:pattern} \end{figure} % % Examples of keys % \begin{figure}[hbp] \includegraphics[height=16cm]{key} \caption{Examples of Keys} \label{fig:key} \end{figure} % % Picture sizes and commands % \begin{figure}[hbp] \includegraphics[height=16cm]{sizes} \caption{Picture sizes and the commands to set them} \label{fig:sizes} \end{figure} % % The complete set of Postscript characters % \begin{figure}[hbp] \begin{center} \includegraphics[height=20cm]{ps_char.eps} \end{center} \caption{Postscript characters - Codes 0 to 75} \label{fig:pschar} \end{figure} % \begin{figure}[hbp] \begin{center} \includegraphics[height=20cm]{ps_char.eps_1} \end{center} \caption{Postscript characters - Codes 75 to 149} \end{figure} % \begin{figure}[hbp] \begin{center} \includegraphics[height=20cm]{ps_char.eps_2} \end{center} \caption{Postscript characters - Codes 150 to 224} \end{figure} % \begin{figure}[hbp] \begin{center} \includegraphics[height=20cm]{ps_char.eps_3} \end{center} \caption{Postscript characters - Codes 225 to 299} \end{figure} % \begin{figure}[hbp] \begin{center} \includegraphics[height=20cm]{ps_char.eps_4} \end{center} \caption{Postscript characters - Codes 300 to 374} \end{figure} % \begin{figure}[hbp] \begin{center} \includegraphics[height=20cm]{ps_char.eps_5} \end{center} \caption{Postscript characters - Codes 375 to 449} \end{figure} \clearpage +DECK,MN_DEMOS. \chapter{Mn\_Fit Examples} This chapter contains a series of examples of Mn\_Fit command files. These files were used to produce the figures included here. They start from simple plotting and fitting examples and then add more complicated possibilities. The demonstration files can be found in the directory `mn\_fit\_help:' (VMS) or `\$MN\_FIT/help' (Unix). They are called `demo01, demo02, ...' These files can also be found in the CMZ file `mn\_fit\_cmz:mn\_util.cmz' (VMS) or `\$MN\_FIT/cmz/mn\_util.cmz' (Unix) in the directory `//mn\_util/demo'. In the same directories you can find the command files used to produce the figures in Appendix B. All the demonstration files except \texttt{demo07.mnf} were run on a Linux PC using the X Windows version of Mn\_Fit. \texttt{demo07} was run on an L3 HP workstation. On VMS you have to replace any `\$MN\_FIT/test/' by `mn\_fit\_test:'. You can make these files from the CMZ file by starting up CMZ and giving the commands: {\small \begin{verbatim} * VMS file mn_fit_cmz:mn_util -r sel VMS * Unix file $MN_FIT/cmz/mn_util -r sel UNIX * set *.mnf -d ctot -y demo \end{verbatim}} The following demonstration files exist: \begin{menu}{5.0cm}{4.5cm} \item[\tt demo01\hfill] Simple fetch and plot of an HBOOK 4 histogram. \item[\tt demo02\hfill] Gaussian fit to the same histogram and display of the result. \item[\tt demo03\hfill] Fancy plotting of 1-dimensional histograms using colour and hatching. Use of \texttt{COMMENT} and \texttt{KEY} and control of axes. \item[\tt demo04\hfill] 2-dimensional histogram plotting and direct plotting of Ntuples. \item[\tt demo05\hfill] Simultaneous fit to 2 histograms and overlay of functions. \item[\tt demo06\hfill] Drawing possibilities. \item[\tt demo07\hfill] Display of an L3 Luminosity Monitor Event. \end{menu} In the following examples the prompt is shown in {\bf boldface}, user typin is {\tt\underline{underlined}}, and comments are shown in {\it italics}. Font -1004 (i.e.\ Helevetica) is the default on all machines. +DECK,MN_BIB. @article{barlow, author = "R. Barlow and C. Beeston", year = 1993, journal = "Comp. Phys. Comm.", volume = "77:219", title = "{Fitting using Finite Monte Carlo Samples}" } @PhdThesis{scott, author = "I.J. Scott", title = "{A Measurement of the Polarization $\tau$ Leptons in Z Decays with the L3 Detector at LEP}", school = "Harvard University", year = 1993, month = "May" } @unpublished{minuit, author = "CERN Program Library", note = "D506", title = "{MINUIT -- Function Minimization and Error Analysis}" } @unpublished{comis, author = "CERN Program Library", note = "L210", title = "{COMIS -- Compilation and Interpretation System}" } @unpublished{higz, author = "CERN Program Library", note = "Q120", title = "{HIGZ -- High level Interface to Graphics and Zebra}" } @unpublished{hbook, author = "CERN Program Library", note = "Y250", title = "{HBOOK - Reference Manual}" } @unpublished{zebra, author = "CERN Program Library", note = "Q100/Q101", title = "{ZEBRA -- Overview of the ZEBRA System}" } +PATCH,JOBS,T=TEXT. +DECK,helpmke. +SELF,IF=VMS. $! $! File to link the program to make the VMS Help simulation files $! and make the help files $! $ dirsav = f$environment("default") $! +SEQ,MN_LOGIC. +SEQ,CERNLIB. $! $! Make the VMS Help library $! $ lib/create=(blocks:300,keysize:21)/help mn_fit_help:mn_fit.hlb $ lib/insert/help mn_fit_help:mn_fit mn_fit_help:mn_fit_help.fil $ lib/insert/help mn_fit_help:mn_fit mn_fit_help:minuit_help.fil $! $! Link the program for the simultaed help library $! $ if f$type(architecture).nes."STRING" then $architecture = "VAX" $ if f$getsyi("NODE_HWTYPE").eqs."ALPH" then $architecture = "ALPHA" $ if architecture.eqs."ALPHA" $ then $ tlink_cmd = "link/nonative" $ else $ tlink_cmd = "link" $ endif $! $ set def mn_fit_dir: $ versav = f$verify(1) $ 'tlink_cmd'/nodeb/exe=mn_fit_exe:helpmke helpmke,- mn_fit_lib:mn_fit/lib,- mn_fit_lib:typscn/lib,- 'tcernlib' $ pur helpmke.* $ pur mn_fit_exe:helpmke.* $! $! Make the simulated version of the library $! $ set def mn_fit_help: $ run/nodeb mn_fit_exe:helpmke $! $ versav = f$verify('versav') $ set def 'dirsav' $ exit +SELF,IF=UNIX. #!/bin/sh # # File to link the program to make the VMS Help simulation files # Also makes the help files # +SEQ,MN_LOGIC. # cd $MN_FIT/mgr +SELF,IF=UNIX,IF=APOLLO. dirlib="$MN_FIT/lib/$ISP" direxe="$MN_FIT/exe/$ISP" +SELF,IF=UNIX,IF=-APOLLO. dirlib="$MN_FIT/lib" direxe="$MN_FIT/exe" +SELF,IF=UNIX. # test -f $direxe/helpmke.exe && rm -f $direxe/helpmke.exe # # set verbose +SELF,IF=APOLLO. ld -o $direxe/helpmke.exe helpmke.o \ +SELF,IF=UNIX,IF=HPUX. fort77 -v +T -o $direxe/helpmke.exe helpmke.o \ +SELF,IF=UNIX,IF=LINUX. g77 -o $direxe/helpmke.exe helpmke.o \ +SELF,IF=UNIX,IF=DECS,IF=CMU. fort -o $direxe/helpmke.exe helpmke.o \ +SELF,IF=UNIX,IF=-APOLLO,IF=-HPUX,IF=-LINUX,IF=-DECS,-CMU. f77 -o $direxe/helpmke.exe helpmke.o \ +SELF,IF=UNIX. -L$dirlib -lmn_fit -ltypscn \ -L$CERN/$TVCERN/lib -lpacklib -lkernlib \ +SELF,IF=UNIX,IF=LINUX,IF=97a,98,IF=BONN. -L/usr/lib -lc -lf2c -lm -L/usr/local/lib -lc_libc5 \ +SELF,IF=UNIX,IF=LINUX,IF=97a,98,IF=ZEUS. -L/usr/lib -lc -lf2c -lm -L/zentaur/opt/lib -lc_libc5 \ +SELF,IF=UNIX. # chmod a+x $direxe/helpmke.exe # cd $MN_FIT/help $direxe/helpmke.exe +DECK,histmke. +SELF,IF=VMS. $ job = f$mode() $ if job.eqs."batch" then $set noverify $!+SEQ,PAWLIB. +SELF,IF=VMS,IF=@CERNNEW. $ tvcern = "new" +SELF,IF=VMS,IF=@CERNOLD. $ tvcern = "old" +SELF,IF=VMS,IF=-@CERNNEW,IF=-@CERNOLD. $ tvcern = "pro" +SELF,IF=VMS. $ tgks = "x" +SEQ,GRAFLIB. $! $ TEXE = "HISTMKE" $! $ dirsav = f$environment("default") $ if f$type(architecture).nes."STRING" then $architecture = "VAX" $ if f$getsyi("NODE_HWTYPE").eqs."ALPH" then $architecture = "ALPHA" $ if architecture.eqs."ALPHA" $ then $ tlink_cmd = "link/nonative" $ else $ tlink_cmd = "link" $ endif $! +SEQ,MN_LOGIC. $! $ set def mn_fit_dir: $! $ versav = f$verify(1) $ if architecture.eqs."ALPHA" $ then $ 'tlink_cmd'/nodeb/exe=mn_fit_exe:'texe' histmke,- mn_fit_lib:mn_fit/lib,- mn_fit_lib:typscn/lib,- +SELF,IF=VMS,IF=VAX,IF=l3,CLEO. cllib:avehst/lib,- cllib:utilib/lib,- +SELF,IF=VMS. mn_fit_lib:mn_dummy, - 'tcernlib' $ else $ 'tlink_cmd'/nodeb/exe=mn_fit_exe:'texe' histmke,- mn_fit_lib:mn_fit/lib,- mn_fit_lib:typscn/lib,- +SELF,IF=VMS,IF=VAX,IF=l3,CLEO. cllib:avehst/lib,- cllib:utilib/lib,- +SELF,IF=VMS. mn_fit_lib:mn_dummy, - 'tcernlib', - sys$input/options isd_max=512 $ endif $ pur histmke.* $ pur mn_fit_exe:'texe'.* $! $! Make the histogram files $! $ set def mn_fit_test: $ run/nodeb mn_fit_exe:'texe' $! $ versav = f$verify('versav') $ set def 'dirsav' +SELF,IF=UNIX. #!/bin/sh # # File to link the program to make the test histograms # +SEQ,MN_LOGIC. # cd $MN_FIT/mgr +SELF,IF=UNIX,IF=APOLLO. dirlib="$MN_FIT/lib/$ISP" direxe="$MN_FIT/exe/$ISP" +SELF,IF=UNIX,IF=-APOLLO. dirlib="$MN_FIT/lib" direxe="$MN_FIT/exe" +SELF,IF=UNIX. # tgks="x" +SEQ,GRAFLIB. # test -f $direxe/histmke.exe && rm -f $direxe/histmke.exe # # set verbose +SELF,IF=APOLLO. ld -o $direxe/histmke.exe $MN_FIT/mgr/histmke.o \ +SELF,IF=UNIX,IF=HPUX. fort77 -v +T -o $direxe/histmke.exe histmke.o \ +SELF,IF=UNIX,IF=LINUX. g77 -o $direxe/histmke.exe histmke.o \ +SELF,IF=UNIX,IF=DECS,IF=CMU. fort -o $direxe/histmke.exe histmke.o \ +SELF,IF=UNIX,IF=-APOLLO,IF=-HPUX,IF=-LINUX,IF=-DECS,-CMU. f77 -o $direxe/histmke.exe histmke.o \ +SELF,IF=UNIX. -L$dirlib -lmn_fit -ltypscn \ $dirlib/mn_dummy.o \ +SELF,IF=UNIX,IF=SOLARIS. $tcernlib -lXm -lXt \ +SELF,IF=UNIX,IF=-SOLARIS. $tcernlib \ +SELF,IF=UNIX,IF=LINUX,IF=97a,98,IF=BONN. -L/usr/lib -lc -lf2c -lm -L/usr/local/lib -lc_libc5 \ +SELF,IF=UNIX,IF=LINUX,IF=97a,98,IF=ZEUS. -L/usr/lib -lc -lf2c -lm -L/zentaur/opt/lib -lc_libc5 \ +SELF,IF=UNIX,IF=LINUX,IF=-97a,IF=-98. -lXt -lXm \ +SELF,IF=UNIX. # chmod a+x $direxe/histmke.exe # cd $MN_FIT/test $direxe/histmke.exe +DECK,igtext_exam. +SELF,IF=VMS. $ dirsav = f$environment("default") $ ww = "write sys$output" $ set def mn_fit_dir: +SEQ,GRAFPACK. +SEQ,GRAFLIB. $! $ if f$type(architecture).nes."STRING" then $architecture = "VAX" $ if f$getsyi("NODE_HWTYPE").eqs."ALPH" then $architecture = "ALPHA" $ if architecture.eqs."ALPHA" $ then $ tlink_cmd = "link/nonative" $ else $ tlink_cmd = "link" $ endif $! $ versav = f$verify(1) $ 'tlink__cmd'/exe=mn_fit_exe:igtext_exam igtext_exam,- 'tcernlib' $ pur igtext_exam*.* $ pur mn_fit_exe:igtext_exam.* $! $! Run the program $! $ set def mn_fit_help: $ def/user sys$input sys$command +SELF,IF=VMS,IF=VAX,IF=l3. $ def/user for092 sys$login +SELF,IF=VMS. $ run/nodeb mn_fit_exe:igtext_exam $! $exit: $ versav = f$verify('versav') $ set def 'dirsav' +SELF,IF=UNIX. #!/bin/sh # # File to link and run the prgoram which makes the IGTEXT example file # +SEQ,MN_LOGIC. # cd $MN_FIT/mgr +SELF,IF=UNIX,IF=APOLLO. dirlib="$MN_FIT/lib/$ISP" direxe="$MN_FIT/exe/$ISP" +SELF,IF=UNIX,IF=-APOLLO. dirlib="$MN_FIT/lib" direxe="$MN_FIT/exe" +SELF,IF=UNIX. # test "$CERN_LEVEL" && TVCERN="$CERN_LEVEL" || TVCERN="pro" +SELF,IF=UNIX,IF=GKSGRAL. tgks="g" +SELF,IF=UNIX,IF=DECGKS. tgks="v" +SELF,IF=UNIX,IF=X11. tgks="x" +SELF,IF=UNIX. +SEQ,GRAFLIB. # test -f $direxe/igtext_exam.exe && rm -f $direxe/igtext_exam.exe echo "Starting link of igtext_exam" # +SELF,IF=UNIX,IF=$GKSGRAL. source $GKS_ROOT/mgr/gksstart inlib $GKS_INLIB +SELF. # set -v +SELF,IF=APOLLO. ld -o $direxe/igtext_exam.exe igtext_exam.o \ +SELF,IF=HPUX. fort77 -v +T -o $direxe/igtext_exam.exe igtext_exam.o \ +SELF,IF=UNIX,IF=LINUX. g77 -o $direxe/igtext_exam.exe igtext_exam.o \ +SELF,IF=UNIX,IF=-APOLLO,IF=-HPUX,IF=-LINUX. f77 -o $direxe/igtext_exam.exe igtext_exam.o \ +SELF,IF=HPUX. $tcernlib -lm +SELF,IF=UNIX,IF=-HPUX. $tcernlib +SELF,IF=UNIX. # echo "Finished link of igtext_exam" chmod a+x $direxe/igtext_exam.exe # cd $MN_FIT/help echo "Starting run of igtext_exam.exe" $direxe/igtext_exam.exe echo "Finished run of igtext_exam.exe" +DECK,MAKEREAD1. +SELF,IF=UNIX. #!/bin/sh # # Script for making readline from the tar file # cd $MN_FIT # # Create the readline directory if necessary # +SELF,IF=UNIX,IF=APOLLO. test -d $MN_FIT/lib/$ISP/readline || mkdir $MN_FIT/lib/$ISP/readline +SELF,IF=UNIX,IF=-APOLLO. test -d $MN_FIT/lib/readline || mkdir $MN_FIT/lib/readline +SELF,IF=UNIX. # # First look for the readline file in $MN_FIT/cmz. # If it is not there try $MN_FIT. # Copy the file to $MN_FIT/lib and make everything from there. # gfile="cmz/mn_readline-1.2.tar.gz" if [ ! -f $gfile ]; then gfile="mn_readline-1.2.tar.gz" fi echo "File = $gfile" +SELF,IF=UNIX,IF=APOLLO. cp $gfile $MN_FIT/lib/$ISP/readline cd $MN_FIT/lib/$ISP/readline +SELF,IF=UNIX,IF=-APOLLO. cp $gfile $MN_FIT/lib/readline cd $MN_FIT/lib/readline +SELF,IF=UNIX. gzip -cd mn_readline-1.2.tar.gz | tar xvf - # exit +DECK,MAKEREAD2. +SELF,IF=UNIX. #!/bin/sh # # Script for making readline from the tar file # +SELF,IF=UNIX,IF=APOLLO. cd $MN_FIT/lib/$ISP +SELF,IF=UNIX,IF=-APOLLO. cd $MN_FIT/lib +SELF,IF=UNIX. # cd readline mv Makefile Makefile1 mv Makefile_main Makefile test -d examples || mkdir examples mv examples/Makefile examples/Makefile1 mv Makefile_exam examples/Makefile # +SELF,IF=UNIX,IF=LINUX. make # cd examples make +SELF,IF=UNIX,IF=-LINUX. gmake # cd examples gmake +SELF,IF=UNIX. # exit +DECK,mn_dsp. +SELF,IF=VMS. $! $! COM file for linking the display version of Mn_Fit $! Under VMS only implemented for L3 $! +SEQ,MN_LOGIC. $! +SELF,IF=VMS,IF=L3. $ if p1.eqs."" then $inquire p1 "Link CPC version [Y/N*]" $ if p1.eqs."" then $p1 = "N" $ if p1 .or. f$extract(0,3,f$edit(p1,"upcase")).eqs."CPC" .or. - f$extract(0,4,f$edit(p1,"upcase")).eqs."-CPC" $ then $ fname = "mn_dsp_cpc" $ tuser = "mn_fit_lib:l3_cpc,l3_display" $ else $ fname = "mn_dsp" $ tuser = "mn_fit_lib:l3_display" $ endif +SELF,IF=VMS. $! +SELF,IF=VMS,IF=L3,IF=-@DEV. $! tlib = "mn_fit_lib:l3_dsp/lib,dbase/lib,l3$lib:fllib182/lib," +- $ tlib = "mn_fit_lib:l3_dsp/lib,dbase/lib,flcodea_:[lib]fll3vdev/lib," +- +SELF,IF=VMS,IF=L3,IF=@DEV. $ tlib = "mn_fit_lib:l3_dsp/lib,dbase/lib,flcodea_:[lib]fll3vdev/lib," +- +SELF,IF=VMS,IF=L3. "l3$lib:dblib322/lib,cpc$dev:cpc/lib" +SELF,IF=VMS. $ @mn_fit_dir:mn_fit.lnk -u "''fname'" 'tuser' -l 'tlib' -nd - "''p2'" "''p3'" $ exit +SELF,IF=UNIX. #!/bin/sh # # Script for linking L3 or ZEUS display version of Mn_Fit # echo "Executing $0, Number of arguments: $#" echo "Text of Arguments: $*" # +SEQ,MN_LOGIC. # dirlib="$MN_FIT/lib" direxe="$MN_FIT/exe" # fname="$direxe/mn_dsp" +SELF,IF=UNIX,IF=L3DSP. tuser="$dirlib/l3_display.o" tlib="-L$dirlib -ll3_dsp -ldbase \ -L/l3/pro/lib -ll3 -ldb" +SELF,IF=UNIX,IF=ZEUSDSP. tuser="$dirlib/zeus_display.o" tlib="-L$dirlib -lzeus_dsp" +SELF,IF=UNIX. # $MN_FIT/mgr/mn_fit.lnk -u $fname $tuser -l $tlib $* +DECK,mn_fit. +SELF,IF=VMS. $! $! General file for linking Mn_Fit in all its possible forms! $! The graphics package is assumed when the file is made from CMZ. $! The compile and link options are set by the -f, -t, -u flags, so to override $! them the compile options must follow them. $! $! The following options are valid: $! -? List options available $! -h List options available $! -f Final version (means -c also) $! -t Test version (means -nc also) $! -c Compile all the code $! -nc Do not compile all the code (use after -f if compile not wanted) $! -g Specify the graphics package $! -u User version. Must be followed by the executable name and any $! user functions. $! -p Use patchy to make the code $! -ncmz CMZ not available - just compile the fortran (use after -f, -c etc.) $! -l Extra libraries to link $! -d Link with debug $! -nd Link with nodebug $! -v Cernlib version number (e.g. 93b) $! $ versav = f$verify(0) $ dirsav = f$environment("default") $ ww = "write sys$output" $ wwa = "write aa" $ on control_y then $goto exit $ on error then $goto exit $ job = f$mode() $ if job.eqs."INTERACTIVE" .and. p1.eqs."" $ then $ inquire p1 "Give options (separated by spaces, -? for help)" $ psav = p1 $ npar = 0 $ nelem = -1 $looppar: $ nelem = nelem + 1 $ npar = npar + 1 $ p'npar' = f$element(nelem," ",psav) $ if p'npar'.nes." " then $goto looppar $ endif $! $ UserId = f$edit( f$getjpi(0, "Username"), "Collapse,Upcase") $! +SEQ,MN_LOGIC. $! $! Set up all the defaults $! $ if f$type(architecture).nes."STRING" then $architecture = "VAX" $ if f$getsyi("NODE_HWTYPE").eqs."ALPH" then $architecture = "ALPHA" $ if f$type(use_imsl).eqs."" then $use_imsl = 0 $ if f$type(use_naglib).eqs."" then $use_naglib = 0 $ if f$type(use_cgrmin).eqs."" then $use_cgrmin = 0 $ if f$type(dbg_compile).eqs."" then $dbg_compile = 0 $ if f$type(use_l3dsp).eqs."" then $use_l3dsp = 0 $ if f$type(use_zeusdsp).eqs."" then $use_zeusdsp = 0 $! $ if architecture.eqs."ALPHA" $ then $ tlink_cmd = "link/nonative" $ else $ tlink_cmd = "link" $ endif $ if dbg_compile $ then $ tlink_opt = "/deb" $ else $ tlink_opt = "/nodeb" $ endif $ fname = "mn_fit" $ compile = 1 $ do_cmz = 1 $ do_patchy = 0 $ news = 1 $ tuser = "" $ tlib = "" $ tfcern = "2000" $ tvcern = tfcern $! $! Set up the default graphics package $! +SEQ,GRAFPACK. $! $! Set up the experiment name and who can change Mn_Fit $! +SEQ,EXPNAM. $! $! Extra CMZ command qualifiers $! +SELF,IF=VMS,IF=@CERNLIB. $ tcmzextra = "" +SELF,IF=VMS,IF=@CERNNEW. $ tcmzextra = "/new" +SELF,IF=@CERNOLD. $ tcmzextra = "/old" +SELF,IF=VMS. $! $! Now interpret all the arguments $! $ GoSub Check_Params $! $! Set up the graphics SELECT options $! $ if tgks.eqs."g" $ then $ tgnam = "GKSGRAL HIGZ GKS" $ endif $ if tgks.eqs."v" $ then $ tgnam = "DECGKS HIGZ GKS" $ endif $ if tgks.eqs."d" $ then $ tgnam = "DGKS3D HIGZ GKS" $ endif $ if tgks.eqs."3" $ then $ tlink_cmd = "di3load" $ tgnam = "DI3000 HIGZ" $ endif $ if tgks.eqs."x" $ then $ tgnam = "X11 HIGZ" $ endif $ if tgks.eqs."p" $ then $ tgnam = "PLTSUB" $ endif $! $ SET DEF MN_FIT_DIR: $! $! Set up the CERN libraries $! +SEQ,GRAFLIB. $! $ if tgks.nes."" then fname = fname + "_" + tgks $! $! Check that the options are OK $! $ if .not.Mn_Boss $ then $ if compile .or. - f$locate("MN_FIT_EXE:",f$edit(fname,"upcase")).lt.f$length(fname) $ then $ write sys$output - "You are not a Mn_Fit boss. You have selected a wrong option" $ exit $ endif $ else $ if f$locate(":",fname).ge.f$length(fname) then - $fname = "mn_fit_exe:" + fname $ if UserID.eqs."CLIB" then $tlink_opt = tlink_opt + "/NOTRACEBACK" $ endif $! $! Recompile all the code if requested $! $ if compile $ then $ lib/cre mn_fit_lib:mn_fit $ if use_cgrmin then $lib/cre mn_fit_lib:cgr_minuit $ lib/cre mn_fit_lib:typscn $ if use_l3dsp $ then $ lib/cre mn_fit_lib:l3_dsp $ lib/cre mn_fit_lib:dbase $ endif $ delete/log/noconfirm mn_fit_lib:*.h;* $ endif $! $ if .not.compile then $goto link $ if do_cmz then $goto do_cmz $ if do_patchy then $goto do_patchy $ goto do_fortran $! $! Run cmz to compile everything $! Do everything in mn_fit_lib: $! $do_cmz: $ set def mn_fit_lib: $ cop mn_fit_cmz:mn_fit.cmz mn_fit_lib: $ cop mn_fit_cmz:mn_util.cmz mn_fit_lib: $ if use_cgrmin then $cop mn_fit_cmz:cgr_minuit.cmz mn_fit_lib: $ cop mn_fit_cmz:typscn.cmz mn_fit_lib: +SELF,IF=VMS,IF=l3. $ cop mn_fit_cmz:l3_dsp.cmz mn_fit_lib: $ cop mn_fit_cmz:dbase.cmz mn_fit_lib: +SELF,IF=VMS. $! $! Make all the KUMAC's $! $ open/write aa mn_link_cmz.kumac $ tmn_link_cmz = f$search("mn_link_cmz.kumac.") $ 'wwa' "trace on" $ 'wwa' "file mn_util -r" $ 'wwa' "sel ''txnam'" $ if use_nag then $'wwa' "select naglib" $ if use_imsl then $'wwa' "select imsl" $ if dbg_compile then $'wwa' "select @dbg" $ 'wwa' "set *.kumac -f text" $ 'wwa' "ctot -y $kumacs" $! 'wwa' "exit" $ close aa $ type/nopage 'tmn_link_cmz' $ cmz'tcmzextra'/batch=mn_link_cmz $ delete/noconfirm/nolog 'tmn_link_cmz' $! $! Write the CMZ commands for compiling $! $ open/write aa mn_link_cmz.kumac $ tmn_link_cmz = f$search("mn_link_cmz.kumac.") $! 'wwa' "cmz''tcmzextra'/nolog" $ 'wwa' "trace on" $ 'wwa' "exec cmzlogon ",tfcern $ 'wwa' "exec mn_macro#makelib ",tgnam $ if use_cgrmin then $'wwa' "exec mn_macro#mn_minuit" $ if news $ then $ 'wwa' "exec mn_macro#makenews" +SELF,IF=VMS,IF=GKSGRAL. $ 'wwa' "exec mn_macro#makewind" +SELF,IF=VMS. $ 'wwa' "cd //mn_fit" $ endif $ if use_cgrmin then $'wwa' "exec cgr_minuit#makelib" $ 'wwa' "exec typscn#makelib" $ if use_l3dsp $ then $ 'wwa' "exec l3_dsp#makelib" $ 'wwa' "exec dbase#makelib" $ 'wwa' "exec mn_macro#l3_display" $ 'wwa' "exec mn_macro#l3_cpc" $ endif $ 'wwa' "exit" $ close aa $! $! Run CMZ $! $ type/nopage 'tmn_link_cmz' $! @'tmn_link_cmz' $ cmz'tcmzextra'/batch=mn_link_cmz $! delete/noconfirm/nolog 'tmn_link_cmz' $ goto link $! $!----------------------------------------------------------------------------- $! Use patchy $!----------------------------------------------------------------------------- $! $do_patchy: $ set def mn_fit_lib: $ cop mn_fit_cmz:mn_fit.car mn_fit_lib: $ cop mn_fit_cmz:mn_util.car mn_fit_lib: $ cop mn_fit_cmz:typscn.car mn_fit_lib: $! $ tgnam_p = f$element(0," ",tgnam) + "," + f$element(1," ",tgnam) + "," + - f$element(2," ",tgnam) $ tgnam_p = tgnam_p - ", " - ", " $! $! Fortran code $! $ nloop = 0 $loop_code_f: $ nloop = nloop + 1 $ infile = "mn_fit" $ select = "" $ sequences= "MNCDE" $ if nloop.eq.1 $ then $ outfile = "mn_fit1" $ patches = "mn_fit" $ endif $ if nloop.eq.2 $ then $ outfile = "mn_fit2" $ patches = "minuit,spline,function,ntuple" $ endif $ if nloop.eq.3 $ then $ outfile = "mn_fit3" $ patches = "parser,plot,set,display,dbase,user,machine,handler,util" $ endif $ if nloop.eq.4 $ then $ outfile = "tvbgn_''tgks'" $ select = "graphic" $ patches = "graphics" $ endif $ if nloop.eq.5 $ then $ outfile = "math" $ select = "$math" $ if use_nag then $select="''select',naglib" $ if use_imsl then $select="''select',imsl" $ patches = "math" $ endif $ if nloop.eq.6 $ then $ outfile = "mn_dummy" $ select = "dummy" $ patches = "dummy" $ endif $ if nloop.eq.7 $ then $ outfile = "mn_main_n" $ select = "main_n" $ patches = "main" $ endif $ if nloop.eq.8 $ then $ outfile = "mn_main_k" $ select = "main_k" $ patches = "main" $ endif if nloop.eq.9 $ then $ infile = "typscn" $ outfile = "typscn" $ sequences= "typcde,cluseq" $ patches = "typscn,typsub,typsio,lunmgr" $ endif $ if nloop.ge.10 then $goto end_loop_code_f $! $ open/write aa 'outfile'.cra $ aaopen = 1 $ 'wwa' "+OPTION,FULL,COMPACT." $ 'wwa' "+USE,VMS,''architecture'. Machine" $ 'wwa' "+USE,V93,''TFCERN'. Cernlib version" $ 'wwa' "+USE,''tgnam_p'. Graphics" $ if select.nes."" then $'wwa' "+USE,''select'." $ 'wwa' "+USE,''sequences'. KEEP sequences" $ 'wwa' "+USE,P=''patches',T=EXE. Patches" $ 'wwa' "+PAM,11,T=C,A. ''infile'.car" $ 'wwa' "+QUIT." $ close aa $ aaopen = 0 $! $ 'ww' "************************************************************" $ 'ww' "Making ''outfile'" $ 'ww' "************************************************************" $ if f$search("''outfile'").nes."" then delete/log/noconf 'outfile'. $ if patchy5 $ then $ nypatchy - 'outfile' 'outfile'.cra 'outfile'.ylis .go $ else $ ypatchy - 'outfile' 'outfile'.cra 'outfile'.ylis .go $ endif $ goto loop_code_f $end_loop_code_f: $! $! c code - use nypatchy if available, so that I can split out include files $! $ nloop = 0 $loop_code_c: $ nloop = nloop + 1 $ infile = "mn_fit" $ infil2 = "" $ select = "" $ sequences= "hkuip" $ if nloop.eq.1 $ then $ outfile = "mn_util_cc" $ select = "util_cc" $ patches = "util_cc" $ endif $ if nloop.ge.2 then $goto end_loop_code_c $! $ open/write aa 'outfile'.cra $ aaopen = 1 $ 'wwa' "+OPTION,FULL,COMPACT." $ 'wwa' "+USE,VMS,''architecture'. Machine" $ if patchy5 then $'wwa' "+USE,PATCHY5" $ 'wwa' "+USE,V93,''TFCERN'. Cernlib version" $ 'wwa' "+USE,''tgnam_p'. Graphics" $ if select.nes."" then $'wwa' "+USE,''select'." $ if patchy5 $ then $ 'wwa' "+USE,''sequences',T=EXE. KEEP sequences" $ else $ 'wwa' "+USE,''sequences'. KEEP sequences" $ endif $ 'wwa' "+USE,P=''patches',T=EXE. Patches" $ if patchy5 $ then $ 'wwa' "+ASM, INCL, T=SPLIT." $ else $ 'wwa' "+ASM, 24." $ endif $ if infil2.nes."" then $'wwa' "+PAM,11,T=C,A. ''infil2'.car" $ 'wwa' "+PAM,11,T=C,A. ''infile'.car" $ 'wwa' "+QUIT." $ close aa $ aaopen = 0 $! $ 'ww' "************************************************************" $ 'ww' "Making ''outfile'" $ 'ww' "************************************************************" $ if f$search("''outfile'").nes."" then delete/log/noconf 'outfile'. $ if patchy5 $ then $ nypatchy - - 'outfile'.cra 'outfile'.ylis 'outfile' .go $ else $ ypatchy - - 'outfile'.cra 'outfile'.ylis - - - - - 'outfile' .go $! $! Trim the output file, because of patchy problem $! $ tfile = outfile+".c" $ GoSub filetrim $ endif $ goto loop_code_c $end_loop_code_c: $! $! Compile the Fortran and C code $! $do_fortran: $ set def mn_fit_lib: $ vertmp = f$verify(1) $ 'cc_command' mn_util_cc.c $ 'ftn_command' mn_main_k.for $ 'ftn_command' mn_main_n.for $ 'ftn_command' mn_fit1.for $ 'ftn_command' mn_fit2.for $ 'ftn_command' mn_fit3.for $ 'ftn_command' tvbgn_'tgks'.for $ 'ftn_command' math.for $ 'ftn_command' mn_dummy.for $ 'ftn_command' typscn.for $ library/insert mn_fit mn_fit1 $ library/insert mn_fit mn_fit2 $ library/insert mn_fit mn_fit3 $ library/insert typscn typscn $ vertmp = f$verify('versav') $! $LINK: +SELF,IF=VMS,IF=VAX,IF=l3. $! $! Get the IMSL routines if I have them $! $! cop mn_fit_dir:imsldum.obj mn_fit_lib: $ cop l3daq$pgm:[gra.mn_fit.mgr]imsldum.obj mn_fit_lib: +SELF,IF=VMS. $ WRITE SYS$OUTPUT "***" $ WRITE SYS$OUTPUT "*** Starting link of ''FNAME'" $ WRITE SYS$OUTPUT "***" $ SET DEF 'DIRSAV' $! $! Write the option files for linking. $! GKSGRAL uses a shareable image in tcernlib. Therefore $! the options files has to be split. For all other use $! only one options file. $! $ open/write aa mn_link1.opt $ tmn_link1 = f$search("mn_link1.opt.") $ tmn_link2 = "" $ 'wwa' "mn_fit_lib:mn_main_k,mn_util_cc" $ if tuser.nes."" then $'wwa' "''tuser'" $ if tlib.nes."" then $'wwa' "''tlib'" $ 'wwa' "mn_fit_lib:tvbgn_''tgks'" $! $ 'wwa' "mn_fit_lib:mn_fit/lib" $ 'wwa' "mn_fit_lib:typscn/lib" $! $! Naglib and/or imsl routines $! $ 'wwa' "mn_fit_lib:math" $! $! Dummy routines TCP/IP + CERN library $! $ 'wwa' "mn_fit_lib:mn_dummy" +SELF,IF=VMS,IF=@CERNLIB,@CERNNEW,@CERNOLD. $! $! Open the second options file for GKSGRAL, DECGKS or X11 if CERNLIB command $! has been used $! $ if tgks.eqs."g" .or. tgks.eqs."v" .or. tgks.eqs."x" $ then $ close aa $! $ open/write aa mn_link2.opt $ tmn_link2 = f$search("mn_link2.opt.") $ else $ 'wwa' "''tcernlib'" $ endif +SELF,IF=VMS,IF=-@CERNLIB,IF=-@CERNNEW,IF=-@CERNOLD. $ if f$locate("/opt","''tcernlib'").lt.f$length(tcernlib) $ then $ close aa $! $ open/write aa mn_link2.opt $ tmn_link2 = f$search("mn_link2.opt.") $ else $ 'wwa' "''tcernlib'" $ endif +SELF,IF=VMS. $! $! IMSL stuff $! +SELF,IF=VMS,IF=VAX,IF=l3,IF=IMSL. $ 'wwa' "mn_fit_lib:imsldum" +SELF,IF=VMS,IF=-VAX,-l3,IF=IMSL. $ 'wwa' "sys$library:imsl91s/lib" +SELF,IF=VMS. $! $ 'wwa' "''tsyslib'" $ if tgraflib.nes."" then $'wwa' "''tgraflib'" $ if architecture.nes."ALPHA" then $'wwa' "isd_max=512" $ if tgks.eqs."p" then $'wwa' "psect=unibus,page" $ close aa $! $ set verify $! $! GKSGRAL link with shareable image in tcernlib $! DECGKS link with options file in tcernlib $! X11 link with options file in tcernlib $! $ if tmn_link2.nes."" $ then $ 'tlink_cmd''tlink_opt'/map='fname'/exe='fname' - 'tmn_link1'/opt,- 'tcernlib',- 'tmn_link2'/opt $ delete/noconfirm/nolog 'tmn_link2' $ endif $! $! DI3000 link using di3load $! $ if tgks.eqs."3" $ then $ 'tlink_cmd' 'tmn_link1'/opt share - "''tlink_opt'/map=''fname'/exe=''fname'" $ endif $! $! Normal linking $! $ if tmn_link2.eqs."" .and. tgks.nes."3" $ then $ 'tlink_cmd''tlink_opt'/map='fname'/exe='fname' - 'tmn_link1'/opt $ endif $ delete/noconfirm/nolog 'tmn_link1' $! $END: $ set nover $ write sys$output "***" $ write sys$output "*** Finished link of ''FNAME'" $ write sys$output "***" $ set def mn_fit_dir: $ purge/log 'fname'.map $ pur/log/keep=2 'fname'.exe $ if .not.Mn_Boss then $goto exit $ set def mn_fit_lib: +SELF,IF=VMS,IF=CLEO. $ set protection=(s:re,g:rwed,w:rwed,o:rwed)- tvbgn*.obj;*,mn_minuit.obj;*,math.obj;*,mn_dummy.obj;* +SELF,IF=VMS. $ purge/log *.for,*.obj,*.com,*.cmz,*.olb,*.kumac,*.dat,lastcmz.* +SELF,IF=VMS,IF=CLEO. $ set protection=(s:re,g:re,w:re,o:re)- tvbgn*.obj;*,mn_minuit.obj;*,math.obj;*,mn_dummy.obj;* +SELF,IF=VMS. $! $ if f$search("*.lis").nes."" then $delete/noconfirm/nolog *.lis;* $ delete/noconfirm/nolog- /excl=(mn_main*,tvbgn*,mn_util_cc,mn_minuit,math,mn_dummy,l3_display,l3_cpc) - *.obj;* $EXIT: $ set def 'dirsav' $ vertmp = f$verify('versav') $ exit $! $! Check the parameters $! $Check_Params: $ npar = 0 $Check_Params_Loop: $ npar = npar + 1 $ if npar.ge.9 then $goto Check_Params_End $ puse = f$edit(p'npar',"Lowercase,Trim") $ if puse.eqs."" then $goto Check_Params_End $ nelem = 0 $! $! Interpret the parameter $! $ if f$extract(0,2,puse).eqs."-?" .or. f$extract(0,2,puse).eqs."-h" $ then $ ww = "write sys$output" $ 'ww' "The following options are available:" $ 'ww' "-? This help" $ 'ww' "-h This help" $ 'ww' "-f Make final version - implies -c,-nd" $ 'ww' "-t Make test version - implies -nc,-d" $ 'ww' "-c Compile all the code" $ 'ww' "-nc Do not compile all the code" $ 'ww' "-p Use patchy to make the code" $ 'ww' "-ncmz CMZ is not available - assume Fortran code is available" $ 'ww' "-g Specify the graphics package" $ 'ww' "-u Make a user version" $ 'ww' "-l Extra libraries to use when linking" $ 'ww' "-v Cernlib version (e.g. 2000)" $ 'ww' "-d Link with debug" $ 'ww' "-nd Link with nodebug" $ 'ww' "-imsl Use IMSL routines" $ 'ww' " " $ 'ww' "Default is -f" $ 'ww' "Option -g should be followed by one of: $ 'ww' " GKSGRAL, DECGKS, DGKS3D, DI3000, X11 or PLTSUB" $ 'ww' "Option -c,-nc should follow -f, -t, -u etc. " $ 'ww' "Option -ncmz should follow -f, -c" $ 'ww' "Option -u can be followed by executable name and" $ 'ww' " a list of object files" $ 'ww' "Option -l should be followed by a list of libraries" $ exit $ endif $! $ if f$extract(0,2,puse).eqs."-f" $ then $ fname = "mn_fit" $ compile = 1 $ do_cmz = 1 $ news = 1 $ if architecture.eqs."ALPHA" $ then $ tlink_cmd = "link/nonative" $ else $ tlink_cmd = "link" $ endif $ tlink_opt = "/nomap/nodeb" $ goto Check_Params_Loop $ endif $! $ if f$extract(0,2,puse).eqs."-t" $ then $ fname = "mn_test" $ compile = 0 $ do_cmz = 0 $ news = 0 $ if architecture.eqs."ALPHA" $ then $ tlink_cmd = "link/nonative" $ else $ tlink_cmd = "link" $ endif $ tlink_opt = "/map/deb" $! tlink_opt = "/map/deb/cross_ref" $ goto Check_Params_Loop $ endif $! $ if f$extract(0,5,puse).eqs."-ncmz" $ then $ do_cmz = 0 $ goto Check_Params_Loop $ endif $! $ if f$extract(0,2,puse).eqs."-c" $ then $ compile = 1 $ do_cmz = 1 $ goto Check_Params_Loop $ endif $! $ if f$extract(0,3,puse).eqs."-nc" $ then $ compile = 0 $ do_cmz = 0 $ goto Check_Params_Loop $ endif $! $ if f$extract(0,3,puse).eqs."-p4" $ then $ compile = 1 $ do_cmz = 0 $ do_patchy = 1 $ patchy5 = 0 $ goto Check_Params_Loop $ endif $! $ if f$extract(0,2,puse).eqs."-p" $ then $ compile = 1 $ do_cmz = 0 $ do_patchy = 1 $ goto Check_Params_Loop $ endif $! $ if f$extract(0,2,puse).eqs."-g" $ then $ npar = npar + 1 $ tgraph = f$edit(p'npar',"Lowercase,Trim") $ good_graph = 0 $ if f$extract(0,1,tgraph).eqs."g" $ then $ good_graph = 1 $ tgks = "g" $ endif $ if f$extract(0,1,tgraph).eqs."v" $ then $ good_graph = 1 $ tgks = "v" $ endif $ if f$extract(0,2,tgraph).eqs."de" $ then $ good_graph = 1 $ tgks = "v" $ endif $ if f$extract(0,2,tgraph).eqs."dg" $ then $ good_graph = 1 $ tgks = "d" $ endif $ if f$extract(0,2,tgraph).eqs."di" $ then $ good_graph = 1 $ tgks = "3" $ endif $ if f$extract(0,2,tgraph).eqs."xg" $ then $ good_graph = 1 $ tgks = "y" $ endif $ if f$extract(0,1,tgraph).eqs."x" $ then $ good_graph = 1 $ tgks = "x" $ endif $ if f$extract(0,1,tgraph).eqs."p" $ then $ good_graph = 1 $ tgks = "p" $ endif $ if .not.good_graph $ then $ write sys$output "Unknown graphics package: ''tgraph'. Exiting" $ exit $ endif $ goto Check_Params_Loop $ endif $! $ if f$extract(0,2,puse).eqs."-u" $ then $ fname = "mn_user" $ compile = 0 $ do_cmz = 0 $ news = 0 $ tlink_cmd = "link" $ tlink_opt = "/nomap/deb" $ tuser = "" $ npar = npar + 1 $ if f$extract(0,1,p'npar').nes."-" .and. p'npar'.nes."" $ then $ fname = p'npar' $ npar = npar + 1 $ if f$extract(0,1,p'npar').nes."-" .and. p'npar'.nes."" $ then $ tuser = p'npar' $ else $ npar = npar - 1 $ endif $ else $ npar = npar - 1 $ endif $ goto Check_Params_Loop $ endif $! $ if f$extract(0,2,puse).eqs."-l" $ then $ npar = npar + 1 $ tlib = p'npar' $ goto Check_Params_Loop $ endif $! $ if f$extract(0,2,puse).eqs."-v" $ then $ npar = npar + 1 $ tfcern = f$edit(p'npar',"Lowercase,Trim") $ np = npar + 1 $ if f$extract(0,1,p'np').nes."-" $ then $ npar = npar + 1 $ tvcern = f$edit(p'npar',"Lowercase,Trim") $ else $ tvcern = tfcern $ endif $ goto Check_Params_Loop $ endif $! $ if f$extract(0,2,puse).eqs."-d" $ then $ tlink_cmd = "link $ tlink_opt = "/nomap/deb" $ goto Check_Params_Loop $ endif $! $ if f$extract(0,3,puse).eqs."-nd" $ then $ tlink_cmd = "link $ tlink_opt = "/nomap/nodeb" $ goto Check_Params_Loop $ endif $! $ if f$extract(0,6,puse).eqs."-l3dsp" $ then $ use_l3dsp = 1 $ goto Check_Params_Loop $ endif $! $ if f$extract(0,8,puse).eqs."-zeusdsp" $ then $ use_zeusdsp = 1 $ goto Check_Params_Loop $ endif $ write sys$output "*** Unknown parameter ''puse' - Exiting" $ exit $! $Check_Params_End: $ Return $! $! Trim the leading and trailing blanks and spaces from a file $! $filetrim: $ aaaopen = 0 $ bbbopen = 0 $ errtrim = 0 $ open/read/err=errtrim aaa 'tfile' $ aaaopen = 1 $ open/write/err=errtrim bbb 'tfile'_tmp $ bbbopen = 1 $ 'ww' "+++" $ 'ww' "+++ Triming file: ''tfile'" $ 'ww' "+++" $looptrim: $ read/end=endlooptrim/err=errtrim aaa text $ text = f$edit(text,"trim") $ write bbb text $ goto looptrim $errtrim: $ 'ww' "***" $ 'ww' "*** Error triming file: ''tfile'" $ 'ww' "***" $ errtrim = 1 $endlooptrim: $ if .not.errtrim then $rename 'tfile'_tmp 'tfile' $ if aaaopen then $close aaa $ if bbbopen then $close bbb $ aaaopen = 0 $ bbbopen = 0 $ Return +SELF,IF=UNIX. #!/bin/sh # # General script for linking Mn_Fit including user versions # # Valid options are listed with -h option. # # Set up the default parameters # echo "Executing $0, Number of arguments: $#" echo "Text of Arguments: $*" # dirsav=`pwd` +SELF,IF=UNIX,IF=APOLLO. ispsav=$ISP +SELF,IF=UNIX. # fname=mn_fit compile=1 news=1 tuser='' tlib='' readline='readline' c_readline='compile' lt_readline="termcap" tktcl='tktcl' mnvers='readline' TFCERN='2000' TVCERN="$TFCERN" use_cmz=1 # # Set up the experiment name and who can change Mn_Fit # +SEQ,EXPNAM. # # Default graphics package # +SEQ,GRAFPACK. # # Interpret the arguments # while [ "$#" -gt 0 ]; do case $1 in -h*) echo 'Allowed options are:' echo '-f Final version (implies -c)' echo '-t Test version (implies -nc)' echo '-d Development version (implies -nc)' echo '-c Compile the code (overrides -t)' echo '-nc Do not compile the code (overrides -f)' echo '-ncr Do not make readline version of typscn library' echo '-nct Do not make tktcl version of typscn library' echo '-p Use nypatchy to make and compile the code' echo '-p4 Use patchy to make and compile the code' echo '-gcc Use gcc to compile c code' echo '-ngcc Do not use gcc to compile c code (default)' echo '-v Cernlib version number (e.g. 2000)' echo '-imsl Use imsl routines' echo '-nimsl Do not use imsl routines (default)' echo '-naglib Use naglib routines - assumes NAG_LIB and NAG_LIBDIR' echo '-nnaglib Use naglib routines (default)' echo '-dbg Compile with debug turned on' echo '-ndbg Compile with optimiser turned on (default)' echo '-g g GKSGRAL graphics package' echo ' x X11 graphics package' echo ' d DGKS-3D graphics package' echo '-rcl GNU readline used - library is in /usr/local/lib' echo ' ncurses terminal control library used' echo '-rl GNU readline used - library is in /usr/local/lib' echo '-rc GNU readline used - command line history available' echo ' ncurses terminal control library used' echo '-rt Specify directory for termcap library' echo '-r GNU readline used - command line history available' echo '-nr GNU readline not used - no command history' echo '-tktcl Make tktcl version of Mn_Fit' echo '-u User version (usually set via mn_user.lnk)' echo '-l Extra libraries for user version' echo '-l3dsp Compile code for L3 display version' echo '-zeusdsp Compile code for ZEUS display version' echo '-m68k Compile with m68k switch on Apollo' echo '-a88k Compile with a88k switch on Apollo' echo 'With options -r or -rc you must give the directory containing' echo 'the readline library' exit ;; -d|-dev) fname=mn_dev compile=0 news='' ;; -c) compile=1 ;; -nc) compile=0 ;; -ncr) readline='' ;; -nct) tktcl='' ;; -p4) use_cmz=0 PATCHY5=0 ;; -p*) use_cmz=0 PATCHY5=1 ;; -gcc) USE_GCC=1 ;; -ngcc) USE_GCC= ;; -imsl) USE_IMSL=1 ;; -nimsl) USE_IMSL= ;; -naglib) USE_NAG=1 ;; -nnaglib) USE_NAG= ;; -dbg) DBG_COMPILE=1 ;; -ndbg) DBG_COMPILE= ;; -l3dsp) USE_L3DSP=1 ;; -zeusdsp) USE_ZEUSDSP=1 ;; -g*) if [ $# -gt 1 ]; then case $2 in -*) ;; *) tgks=$2 shift ;; esac fi ;; -rcl) readline="readline" readline_lib="/usr/local/lib" c_readline='' lt_readline="ncurses" ;; -rl) readline="readline" readline_lib="/usr/local/lib" c_readline='' ;; -rt) if [ $# -gt 1 ]; then case $2 in -*) ;; *) termcap_lib=$2 shift ;; esac fi ;; -rc) readline="readline" lt_readline="ncurses" if [ $# -gt 1 ]; then case $2 in -*) ;; *) c_readline='' readline_lib=$2 shift ;; esac fi ;; -r) readline="readline" if [ $# -gt 1 ]; then case $2 in -*) ;; *) c_readline='' readline_lib=$2 shift ;; esac fi ;; -nr) mnvers='' ;; -tktcl) mnvers='tktcl' ;; -f*) fname=mn_fit compile=1 news=1 ;; -t*) fname=mn_test compile=0 news='' ;; -v*) if [ $# -gt 1 ]; then case $2 in -*) ;; *) TFCERN=$2 TVCERN=$2 shift if [ $# -gt 1 ]; then case $2 in -*) ;; *) TVCERN=$2 shift ;; esac fi ;; esac fi ;; -u*) uservsn=0 compile=0 news='' if [ $# -gt 1 ]; then case $2 in -*) ;; *) fname=$2 shift case $fname in mn_dsp*) ;; esac while [ "$#" -gt 1 ]; do case $2 in -*) break ;; *) tuser="$tuser $2" shift ;; esac done ;; esac fi ;; -l*) while [ $# -gt 1 ]; do case $2 in -l*|-L*) tlib="$tlib $2" shift ;; -*) break ;; *) tlib="$tlib $2" shift ;; esac done ;; +SELF,IF=APOLLO. -a88k) export ISP; ISP=a88k ;; -m68k) export ISP; ISP=m68k ;; +SELF,IF=UNIX. *) echo "Unknown argument: $1" exit ;; esac shift done # +SEQ,MN_LOGIC. echo "MN_FIT=$MN_FIT, CERN=$CERN, CERN_ROOT=$CERN_ROOT" # # Executable and libraries directory # +SELF,IF=UNIX,IF=APOLLO. dirlib="$MN_FIT/lib/$ISP" direxe="$MN_FIT/exe/$ISP" +SELF,IF=UNIX,IF=-APOLLO. dirlib="$MN_FIT/lib" direxe="$MN_FIT/exe" +SELF,IF=UNIX. # # Mn_Fit libraries # test "$tmn_fit_lib" || tmn_fit_lib="-L$dirlib" # # Readline libraries # test "$readline_lib" || readline_lib="$dirlib/readline" test "$termcap_lib" || termcap_lib="$readline_lib" # # Add $MN_FIT/exe to executable name if this is not a user version # test "$uservsn" || fname=$direxe/$fname # # Setup the graphics package # case $tgks in g*|G*) tgks=g tgnam='GKSGRAL HIGZ GKS' ;; x*|X*) tgks=x tgnam='X11 HIGZ' ;; d*|D*) tgks=d tgnam='DGKS3D HIGZ GKS' ;; esac # test "$mnvers" = "tktcl" && fname=${fname}_tktcl fname=${fname}_${tgks} # if [ $tgks = g ]; then # # gksstart bombs in batch jobs - do it explicitly until it is fixed # # source $GKS_ROOT/mgr/gksstart if [ $ISP = m68k ]; then version_ext=".v10" cputype="3000" else version_ext='' cputype="10000" fi export GKS_INLIB; GKS_INLIB=$GKS_ROOT/lib/gkslib_$cputype.inlib$version_ext fi # # Setup the CERN libraries # +SEQ,GRAFLIB. # # Remove all the old libraries and .o files # if [ "$compile" -eq 1 ]; then cd $dirlib touch temp.a rm -f *.a touch fsub/temp.o rm -f fsub/*.o touch fsub/temp.f rm -f fsub/*.f fi # #------------------------------------------------------------------------------ # Recompile all the code using cmz #------------------------------------------------------------------------------ # if [ "$compile" -eq 1 -a "$use_cmz" -eq 1 ]; then cd $MN_FIT/cmz pwd # # Copy all the changed CMZ files to mn_fit_lib # for i in mn_fit.cmz mn_util.cmz typscn.cmz cgr_minuit.cmz \ l3_dsp.cmz dbase.cmz zeus_dsp.cmz do if [ -f $i ]; then echo $i cmp -s $i $dirlib/$i tmp=$? if [ "$tmp" -ne 0 ]; then echo "Copying $i to $dirlib" cp $i $dirlib/$i fi fi done cd $dirlib pwd # # Make all the kumac's # test -f mn_link_cmz.kumac && rm -f mn_link_cmz.kumac echo 'trace on' > mn_link_cmz.kumac echo 'file mn_util -r' >> mn_link_cmz.kumac echo 'sel ' $txnam >> mn_link_cmz.kumac test "$USE_NAG" && echo "select naglib" >> mn_link_cmz.kumac test "$USE_IMSL" && echo "select imsl" >> mn_link_cmz.kumac test "$DBG_COMPILE" && echo "select @dbg" >> mn_link_cmz.kumac test "$USE_GCC" && echo "select @gcc" >> mn_link_cmz.kumac echo 'set *.kumac -f text' >> mn_link_cmz.kumac echo 'ctot -y $kumacs' >> mn_link_cmz.kumac # chmod a+x mn_link_cmz.kumac cat mn_link_cmz.kumac cmz -b mn_link_cmz.kumac rm mn_link_cmz.kumac # test -f mn_link_cmz.kumac && rm -f mn_link_cmz.kumac echo 'trace on' > mn_link_cmz.kumac +SELF,IF=UNIX,IF=APOLLO. echo 'exec cmzlogon ' $TFCERN $ISP >> mn_link_cmz.kumac if [ $ISP = "a88k" ]; then echo "select -naglib" >> mn_link_cmz.kumac fi +SELF,IF=UNIX,IF=-APOLLO. echo 'exec cmzlogon ' $TFCERN >> mn_link_cmz.kumac +SELF,IF=UNIX. echo 'exec mn_macro#makelib ' $tgnam >> mn_link_cmz.kumac [ "$use_cgrmin" ] && echo 'exec mn_macro#mn_minuit' >> mn_link_cmz.kumac [ "$news" ] && echo 'exec mn_macro#makenews' >> mn_link_cmz.kumac [ "$use_cgrmin" ] && echo 'exec cgr_minuit#makelib' >> mn_link_cmz.kumac [ "$c_readline" ] && echo 'exec typscn#makeread' >> mn_link_cmz.kumac echo 'exec typscn#makelib' $readline $tktcl >> mn_link_cmz.kumac [ "$USE_L3DSP" ] && echo 'exec l3_dsp#makelib' >> mn_link_cmz.kumac [ "$USE_L3DSP" ] && echo 'exec dbase#makelib' >> mn_link_cmz.kumac [ "$USE_L3DSP" ] && echo 'exec mn_macro#l3_display' >> mn_link_cmz.kumac [ "$USE_ZEUSDSP" ] && echo 'exec zeus_dsp#makelib' >> mn_link_cmz.kumac [ "$USE_ZEUSDSP" ] && echo 'exec mn_macro#zeus_display' >> mn_link_cmz.kumac +SELF,IF=UNIX. # chmod a+x mn_link_cmz.kumac cat mn_link_cmz.kumac cmz -b mn_link_cmz.kumac # rm mn_link_cmz.kumac # cd $MN_FIT/mgr # #------------------------------------------------------------------------------ # Recompile all the code using patchy #------------------------------------------------------------------------------ # elif [ "$compile" -eq 1 -a "$use_cmz" -eq 0 ]; then # # cd $MN_FIT/cmz pwd # # Copy all car files to mn_fit_lib # for i in mn_fit.car mn_util.car typscn.car do echo "Copying $i to $dirlib" cp $i $dirlib/$i done for i in l3_dsp.car zeus_dsp.car do test -f $i && cp $i $dirlib/$i done cd $dirlib pwd #! tgnam_p=`echo $tgnam | tr -s ' ' ','` # # Make the cradles for Mn_Fit fortran # i=mn_fit infile="mn_fit" outfile="$i" sequences="MNCDE" # patches='mn_fit,minuit,spline,function,ntuple' patch2='parser,plot,set,display,dbase,user,machine,handler,util' # # Make the cradle # echo "+OPTION,FULL,COMPACT." >$i.cra echo "+USE,UNIX,$COMPUTER. Machine" >>$i.cra echo "+USE,V93,$TFCERN. SELF control" >>$i.cra echo "+USE,$tgnam_p." >>$i.cra echo "+USE,$sequences. KEEP sequences" >>$i.cra echo "+USE,P=$patches,T=EXE. Patches" >>$i.cra echo "+USE,P=$patch2,T=EXE." >>$i.cra if [ $PATCHY5 -eq 1 ]; then echo "+ASM, FORT, T=SPLIT, PREFIX .fsub/" >>$i.cra fi echo "+PAM,11,T=C,A. $infile.car" >>$i.cra echo "+QUIT." >>$i.cra # if [ $PATCHY5 -eq 1 ]; then nypatchy - - $i $i.ylis .go else ypatchy - $outfile $i $i.ylis .go fi # # Add extra car files if this is ZEUS or L3 # extracar= [ "$USE_L3DSP" ] && extracar="l3_dsp dbase l3_display" [ "$USE_ZEUSDSP" ] && extracar="zeus_dsp zeus_display" # # Make the cradles for all other fortran # for i in tvbgn_$tgks math mn_dummy mn_main_n mn_main_k \ typscn typscn_read typscn_tktcl $extracar do infile="mn_fit" outfile="$i" select='' sequences="MNCDE" # # Graphics # if [ $i = "tvbgn_$tgks" ]; then select='graphic' patches="graphics" # # Math routines - dummies in case imsl or naglib are not available # elif [ $i = "math" ]; then select='$math' test "$USE_NAG" && select="$select,naglib" test "$USE_IMSL" && select="$select,imsl" patches="math" # # Dummy routines # elif [ $i = "mn_dummy" ]; then select='dummy' patches="dummy" # # Main program - no break handling # elif [ $i = "mn_main_n" ]; then select='main_n' patches="main" # # Main program - break handling # elif [ $i = "mn_main_k" ]; then select='main_k' patches="main" # # Typscn # elif [ $i = "typscn" ]; then infile="typscn" sequences="TYPCDE,CLUSEQ" patches="typscn,typsub,typsio,lunmgr" # # Typscn readline # elif [ $i = "typscn_read" ]; then infile="typscn" select="readline" sequences="TYPCDE,CLUSEQ" patches="typscn,typsub,typsio,lunmgr" test "$readline" || continue # # Typscn tktcl # elif [ $i = "typscn_tktcl" ]; then infile="typscn" select="tktcl" sequences="TYPCDE,CLUSEQ" patches="typscn,typsub,typsio,lunmgr" test "$tktcl" || continue # # L3 display # elif [ $i = "l3_dsp" ]; then infile="l3_dsp" select="l3dsp_src" sequences="mncde,flumcde,ecalcde,techcde" patches="flum,ecal,tech" # # L3 database # elif [ $i = "dbase" ]; then infile="dbase" select= sequences="cdes" patches="inspect,util" # # L3 display Mn_Fit interface # elif [ $i = "l3_display" ]; then infile="mn_fit" select="l3dsp_src" sequences="mncde" patches="display,dbase" # # ZEUS display code # elif [ $i = "zeus_dsp" ]; then infile="zeus_dsp" select="zeusdsp_src" sequences="mncde,ftdcde,trdcde" patches="ftd,tfrecon,trd,trrecon" # # ZEUS display Mn_Fit interface # elif [ $i = "zeus_display" ]; then infile="mn_fit" select="zeusdsp_src" sequences="mncde" patches="display" fi # # Make the cradle # echo "+OPTION,FULL,COMPACT." >$i.cra echo "+USE,UNIX,$COMPUTER. Machine" >>$i.cra test $PATCHY5 -eq 1 && echo "+USE,PATCHY5." >>$i.cra echo "+USE,V93,$TFCERN. SELF control" >>$i.cra echo "+USE,$tgnam_p." >>$i.cra test "$select" && echo "+USE,$select." >>$i.cra echo "+USE,$sequences. KEEP sequences" >>$i.cra echo "+USE,P=$patches,T=EXE. Patches" >>$i.cra test "$i" = "l3_dsp" -o "$i" = "zeus_dsp" && \ echo "+PAM,12,T=C,A. mn_fit.car" >>$i.cra echo "+PAM,11,T=C,A. $infile.car" >>$i.cra echo "+QUIT." >>$i.cra # if [ $PATCHY5 -eq 1 ]; then nypatchy - $outfile $i $i.ylis .go else ypatchy - $outfile $i $i.ylis .go fi done # # Make the cradles for c # for i in mn_util_cc \ typscn_cc do infile="mn_fit" outfile="$i" select='' sequences="MNCDE" patch2='' infil2='' # # Utility routines in c # if [ $i = "mn_util_cc" ]; then select='util_cc' sequences="hkuip" patches="util_cc" # # Typscn readline c code # elif [ $i = "typscn_cc" ]; then infile="typscn" infil2="mn_fit" select="readline" sequences="hkuip" patches="typsio_c" test "$readline" || continue fi # # Make the cradle # echo "+OPTION,FULL,COMPACT." >$i.cra echo "+USE,UNIX,$COMPUTER. Machine" >>$i.cra test $PATCHY5 -eq 1 && echo "+USE,PATCHY5." >>$i.cra echo "+USE,V93,$TFCERN. SELF control" >>$i.cra echo "+USE,$tgnam_p." >>$i.cra test "$select" && echo "+USE,$select." >>$i.cra if [ $PATCHY5 -eq 1 ]; then echo "+USE,$sequences,T=EXE. KEEP sequences" >>$i.cra else echo "+USE,$sequences. KEEP sequences" >>$i.cra fi echo "+USE,P=$patches,T=EXE. Patches" >>$i.cra if [ $PATCHY5 -eq 1 ]; then echo "+ASM, INCL, T=SPLIT." >>$i.cra else echo "+ASM, 24." >>$i.cra fi test "$infil2" && echo "+PAM,11,T=C,A. $infil2.car" >>$i.cra echo "+PAM,11,T=C,A. $infile.car" >>$i.cra echo "+QUIT." >>$i.cra # if [ $PATCHY5 -eq 1 ]; then nypatchy - - $i $i.ylis $outfile .go else ypatchy - - $i $i.ylis - - - - - $outfile .go fi done # # Split the Mn_Fit fortran code and make all routines lowercase # if [ ! $PATCHY5 -eq 1 ]; then echo "***" echo "*** Splitting Mn_Fit code" echo "***" mv mn_fit.f fsub/mn_fit_all.f cd fsub fsplit mn_fit_all.f rm mn_fit_all.f for i in *.f do echo $i | grep '[A-Z]' >/dev/null && mv $i `echo $i | tr '[A-Z]' '[a-z]'` done cd .. fi # # Compile the Mn_Fit code # cd fsub echo "Compiling Mn_Fit code - be patient" for i in *.f do $FTN_COMMAND -c $i done # # Compile all the other code # cd $dirlib for i in mn_main_n mn_main_k tvbgn_$tgks math mn_dummy \ typscn typscn_read $extracar do echo "Compiling $i.f" $FTN_COMMAND -c $i.f # # Put the l3_dsp, dbase and zeus_dsp code into a library # if [ "$i" = "l3_dsp" -o "$i" = "dbase" -o "$i" = "zeus_dsp" ]; then ar rv lib$i.a $i.o fi done # # Compile the c code # for i in mn_util_cc typscn_cc do echo "Compiling $i.c" $CC_COMMAND -c $i.c done # # Make the libraries # ar rv libmn_fit.a fsub/*.o rm fsub/*.o ar rv libtypscn.a typscn.o rm typscn.o ar rv libtypscn_read.a typscn_read.o typscn_cc.o rm typscn_read.o typscn_cc.o +SELF,IF=UNIX,IF=DECS. ranlib libmn_fit.a ranlib libtypscn.a ranlib libtypscn_read.a +SELF,IF=UNIX. # cd $MN_FIT/mgr fi # tmn_fit_lib="$tmn_fit_lib -lmn_fit" # # Set the typscn library # if [ "$mnvers" = "tktcl" ]; then ttypscn_lib="-ltypscn_tktcl" elif [ "$mnvers" = "$readline" ]; then ttypscn_lib="-ltypscn_read -L$readline_lib -lreadline \ -L$termcap_lib -l$lt_readline" +SELF,IF=UNIX,IF=HPUX. ttypscn_lib="$ttypscn_lib -lPW -lBSD" +SELF,IF=UNIX. else ttypscn_lib="-ltypscn" fi +SELF,IF=UNIX,IF=HPUX,IF=NAGLIB. # # Fixup Naglib on hp's # if [ "$compile" -eq 1 ]; then cd $dirlib cat >nagfix.f <" test "$tlib" && echo "User libraries: <$tlib>" echo "Mn_Fit library: $tmn_fit_lib" echo "Typscn library: $ttypscn_lib" # if [ -r $fname.exe ]; then rm -f $fname.exe tmp=$? if [ "$tmp" -ne 0 ]; then echo "*** Renaming current executable to $fname.tmp" mv $fname.exe $fname.tmp fi fi # # if [ "$tgks" = "g" ]; then echo "Using $GKS_INLIB as inlib for GKS" inlib $GKS_INLIB fi echo Cernlib: $tcernlib # # Get the gcc library name # if [ "$USE_GCC" ]; then gcclib=`gcc -print-libgcc-file-name` else gcclib='' fi # # Debug version # if [ "$DBG_COMPILE" ]; then +SELF,IF=UNIX,IF=LINUX. DBG_OPTIONS="-g -fdebug-kludge" +SELF,IF=UNIX,IF=-LINUX. DBG_OPTIONS="-g" +SELF,IF=UNIX. else DBG_OPTIONS= fi # echo pwd: `pwd` set -x +SELF,IF=APOLLO. ld $DBG_OPTIONS -o $fname.exe \ +SELF,IF=UNIX,IF=HPUX. fort77 $DBG_OPTIONS -v +T -o $fname.exe \ +SELF,IF=UNIX,IF=LINUX. g77 $DBG_OPTIONS -o $fname.exe \ +SELF,IF=UNIX,IF=SGI. f77 $DBG_OPTIONS -mips3 -o $fname.exe \ +SELF,IF=UNIX,IF=DECS,IF=CMU. fort $DBG_OPTIONS -o $fname.exe \ +SELF,IF=UNIX,IF=-APOLLO,IF=-HPUX,IF=-LINUX,IF=-SGI,IF=-DECS,-CMU. f77 $DBG_OPTIONS -o $fname.exe \ +SELF,IF=UNIX,IF=SUN. -Bstatic \ +SELF,IF=UNIX,IF=ALPHA. -non_shared -D 40000000 -T 20000000 -taso \ +SELF,IF=UNIX. $dirlib/mn_main_k.o \ $dirlib/mn_util_cc.o \ $tuser \ $dirlib/tvbgn_${tgks}.o \ $tlib \ $tmn_fit_lib \ -L$dirlib $ttypscn_lib \ $dirlib/math.o \ $dirlib/mn_dummy.o \ $tcernlib \ $gcclib \ +SELF,IF=UNIX,IF=SOLARIS. -lXt -lXm +SELF,IF=UNIX,IF=LINUX,IF=97a,98,IF=BONN. -L/usr/lib -lc -lf2c -lm -L/usr/local/lib -lc_libc5 \ +SELF,IF=UNIX,IF=LINUX,IF=97a,98,IF=ZEUS. -L/usr/lib -lc -lf2c -lm -L/zentaur/opt/lib -lc_libc5 \ +SELF,IF=UNIX,IF=LINUX,IF=-97a,IF=-98. -lXt -lXm \ +SELF,IF=UNIX,IF=DECS. #-Wl,-m >mn_fit.map \ +SELF,IF=UNIX,IF=LINUX. #-Xlinker -Map -Xlinker $fname.map \ +SELF,IF=UNIX. # chmod a+x $fname.exe # exit +SELF. +DECK,mn_fit_all. +SELF,IF=VMS. $! $! Links all the versions of Mn_Fit needed for official areas $! +SEQ,MN_LOGIC. $ on error then $goto end $! $ @mn_fit_dir:mn_fit.lnk -f $! @mn_fit_dir:mn_fit_cgr.lnk +SELF,IF=VMS,IF=l3. $ @mn_fit_dir:mn_dsp.lnk $ @mn_fit_dir:mn_dsp.lnk CPC +SELF,IF=VMS. $! $end: $ exit +SELF,IF=UNIX. #!/bin/sh # # Links all the versions of Mn_Fit needed for official areas # +SEQ,MN_LOGIC. # $MN_FIT/mgr/mn_fit.lnk -g x +SELF,IF=APOLLO,IF=l3. $MN_FIT/mgr/mn_fit.lnk -g x # $MN_FIT/mgr/mn_fit_cgr.lnk $MN_FIT/mgr/mn_dsp.lnk $MN_FIT/mgr/mn_dsp.lnk -g x +SELF,IF=UNIX. +DECK,mn_fit_cgr. +SELF,IF=VMS. $! $! COM file for linking C. Rippich MINUIT version of Mn_Fit $! +CDE,MN_LOGIC. $! $ fname = "mn_fit_cgr" $ tuser = "mn_fit_lib:mn_minuit" $ tlib = "mn_fit_lib:cgr_minuit/lib" $! $ @mn_fit_dir:mn_fit.lnk -u "''fname'" 'tuser' -l 'tlib' -nd "''p1'" "''p2'" $ exit +SELF,IF=UNIX. #!/bin/sh # # Script for linking C. Rippich MINUIT version of Mn_Fit # Note that ISP must be set before this script if you want to link on an # Apollo of a different type. # +SEQ,MN_LOGIC. # +SELF,IF=UNIX,IF=APOLLO. dirlib="$MN_FIT/lib/$ISP" direxe="$MN_FIT/exe/$ISP" +SELF,IF=UNIX,IF=-APOLLO. dirlib="$MN_FIT/lib" direxe="$MN_FIT/exe" +SELF,IF=UNIX. # fname="$direxe/mn_fit_cgr" tuser="$dirlib/mn_minuit.o" tlib="-L$dirlib -lcgr_minuit" # $MN_FIT/mgr/mn_fit.lnk -u $fname $tuser -l $tlib $* +DECK,mn_latex. +SELF,IF=VMS. $! $! File to link and run Mn_LaTex, the program that converts the Mn_Fit $! help files to a LaTeX manual. $! +SEQ,MN_LOGIC. $! +SEQ,CERNLIB. $! $ if f$type(architecture).nes."STRING" then $architecture = "VAX" $ if f$getsyi("NODE_HWTYPE").eqs."ALPH" then $architecture = "ALPHA" $ if architecture.eqs."ALPHA" $ then $ tlink_cmd = "link/nonative" $ else $ tlink_cmd = "link" $ endif $! $ set def mn_fit_dir: $ 'tlink_cmd'/nodeb/exe=mn_fit_exe: mn_latex,- mn_fit_lib:mn_fit/lib,- mn_fit_lib:typscn/lib,- 'tcernlib' $end: $ pur mn_latex.* $ pur mn_fit_exe:mn_latex.* $! $ set def mn_fit_help: $ delete/noconfirm/nolog mn_fit.tex;* $ def/user sys$input sys$command $ run/nodeb mn_fit_exe:mn_latex $! $ EXIT +SELF,IF=UNIX. #!/bin/sh # +SEQ,MN_LOGIC. # cd $MN_FIT/mgr +SELF,IF=UNIX,IF=APOLLO. dirlib="$MN_FIT/lib/$ISP" direxe="$MN_FIT/exe/$ISP" +SELF,IF=UNIX,IF=-APOLLO. dirlib="$MN_FIT/lib" direxe="$MN_FIT/exe" +SELF,IF=UNIX. # test -f $direxe/mn_latex.exe && rm -f $direxe/mn_latex.exe #set verbose +SELF,IF=UNIX,IF=ALPHA. f77 -assume backslash -o $direxe/mn_latex.exe \ +SELF,IF=APOLLO. ld -o $direxe/mn_latex.exe \ +SELF,IF=UNIX,IF=HPUX. fort77 -K +ppu -o $direxe/mn_latex.exe \ +SELF,IF=UNIX,IF=LINUX. g77 -o $direxe/mn_latex.exe \ +SELF,IF=UNIX,IF=-ALPHA,IF=-APOLLO,IF=-HPUX,IF=-LINUX. f77 -o $direxe/mn_latex.exe \ +SELF,IF=UNIX. mn_latex.o \ -L$dirlib -lmn_fit -ltypscn \ -L$CERN_ROOT/lib -lkernlib # chmod a+x $direxe/mn_latex.exe # # set verbose # cd $MN_FIT/help rm -f mn_fit.tex $direxe/mn_latex.exe +DECK,mn_user. +SELF,IF=VMS. $! $! COM file for linking a user version of Mn_Fit $! $ if p1.eqs."" then $inquire p1 "Give executable name ( = mn_user.exe)" $ if p2.eqs."" then $inquire p2 "Give user routine(s)" $ if p3.eqs."" then $inquire p3 "Give extra libraries" $ tlib = "" $ if p3.nes."" then $tlib = "-l ''p3'" $! +CDE,MN_LOGIC. $! $ @mn_fit_dir:mn_fit.lnk -u "''p1'" "''p2'" 'tlib' 'p4' 'p5' 'p6' $! $ exit +SELF,IF=UNIX. #!/bin/sh # # Script for linking a user version of Mn_Fit # If you have more than 1 user routine wait for # the prompt or add them to the libraries # +CDE,MN_LOGIC. # fname=mn_user tuser='' tlib='' if [ $# -lt 1 ]; then echo -n 'Give executable name ( = .exe will be added): ' read fname echo "<$fname>" [ -z "$fname" ] && fname="mn_user" else fname=$1 shift fi echo "fname = $fname" # if [ $# -lt 1 ]; then echo -n 'Give user routine(s): ' read tuser else tuser=$1 shift fi echo "tuser = $tuser" # if [ $# -lt 1 ]; then echo -n 'Give any extra libraries: ' read tlib else tlib=$1 shift fi [ -n "$tlib" ] && tlib=-l $tlib # $MN_FIT/mgr/mn_fit.lnk -u $fname $tuser $tlib $* +PATCH,UTIL. +DECK,HELPMKE. PROGRAM HELPMKE C C Takes the sequential HELP file used to make VMS Help, reads it C in and converts it to a sequential file with pointers and C a direct access file which has the Help in it C +CDE,MNDIR. C CHARACTER*80 TEXT,TXT2 CHARACTER*30 TJUNK(1),TOPIC LOGICAL QEND DATA TJUNK/' '/ C CALL TYPINI CALL ICMSYM('_$[]{}()') C CALL M_HOME C LENH = LENOCC(TMNHLP) OPEN(UNIT=1,FILE=TMNHLP(1:LENH) // 'mn_fit_help.fil' + ,ACCESS='SEQUENTIAL',FORM='FORMATTED',STATUS='OLD') OPEN(UNIT=2,FILE=TMNHLP(1:LENH) // 'minuit_help.fil' + ,ACCESS='SEQUENTIAL',FORM='FORMATTED',STATUS='OLD') OPEN(UNIT=11,FILE=TMNHLP(1:LENH) // 'mn_hdir.fil' + ,ACCESS='SEQUENTIAL',FORM='FORMATTED',STATUS='UNKNOWN') OPEN(UNIT=12,FILE=TMNHLP(1:LENH) // 'mn_help.fil' + ,ACCESS='DIRECT',FORM='FORMATTED',STATUS='UNKNOWN',RECL=80) C NHELP = 0 NREC = 0 LUN = 0 900 CONTINUE QEND = .FALSE. LUN = LUN + 1 1000 CONTINUE READ(LUN,'(A)',END=1100) TEXT C IF(TEXT(1:1).EQ.'!') GOTO 1000 C IF(TEXT(1:1).EQ.' ') GOTO 1200 C IF(ICHAR(TEXT(1:1)).LT.ICHAR('0') .OR. + ICHAR(TEXT(1:1)).GT.ICHAR('9')) GOTO 1200 C READ(TEXT(1:1),'(I1)',ERR=1100) NTREE NHELP = NHELP + 1 GOTO 1150 C C Terminate last topic C 1100 CONTINUE QEND = .TRUE. IF(LUN.EQ.1) GOTO 900 1150 CONTINUE NSTOP = NREC IF(QEND .OR. NHELP.GT.1) THEN WRITE(11,'(1X,I4,1X,A,I6,I6)') LEVEL,TOPIC,NSTART,NSTOP IF(LEVEL.EQ.1) THEN WRITE(6,'(1X,I4,1X,A,T50,I6,I6)') LEVEL,TOPIC,NSTART,NSTOP ELSEIF(LEVEL.EQ.2) THEN WRITE(6,'(1X,I4,5X,A,T50,I6,I6)') LEVEL,TOPIC,NSTART,NSTOP ELSEIF(LEVEL.EQ.3) THEN WRITE(6,'(1X,I4,9X,A,T50,I6,I6)') LEVEL,TOPIC,NSTART,NSTOP ELSEIF(LEVEL.EQ.4) THEN WRITE(6,'(1X,I4,13X,A,T50,I6,I6)') LEVEL,TOPIC,NSTART,NSTOP ELSEIF(LEVEL.EQ.5) THEN WRITE(6,'(1X,I4,17X,A,T50,I6,I6)') LEVEL,TOPIC,NSTART,NSTOP ENDIF ENDIF C IF(QEND) THEN IF(LUN.EQ.1) THEN GOTO 900 ELSE GOTO 9000 ENDIF ENDIF C CALL QUOTYP(TEXT) LEVEL = INTTYP(.TRUE.,IDELIM) IF(LEVEL.NE.NTREE) THEN WRITE(6,*) 'Screw up somewhere interpreting HELP file' WRITE(6,*) 'Record is: ',TEXT GOTO 999 ENDIF C ISTR = ISTRNG(.TRUE.,TOPIC,NCHAR) IND = INDEX(TOPIC,' ') IF(IND.GT.0) THEN TXT2 = TOPIC(1:IND-1) TOPIC = TXT2 ENDIF C NSTART = NREC + 1 GOTO 1000 C 1200 CONTINUE NREC = NREC + 1 WRITE(12,REC=NREC,FMT='(A)') TEXT GOTO 1000 C 9000 CONTINUE CLOSE(1) CLOSE(2) CLOSE(11) CLOSE(12) C WRITE(6,'( + /,'' Found'',I6,'' HELP topics'' + ,/,'' Wrote'',I6,'' records to direct access file'')') + NHELP,NREC C STOP 999 END +DECK,HISTMKE. PROGRAM HISTMKE * implicit none C +CDE,MNLUN. C real hlim integer ilim COMMON //HLIM(300000) COMMON /PAWC/ILIM(300000) C REAL XDAT(1000),YDAT(1000),DXDAT(1000),DYDAT(1000) C real gaus1,gaus2,flat common /m8cwn1/ gaus1,gaus2,flat integer mvalmx parameter (mvalmx = 10) integer nval2 real rval1,rval2,rval3,rval4,rtest1,rtest2 double precision zval1,zval2 logical qval1,qtest2 common /m8cwn2/ rval1,qval1,rtest1(8),qtest2,rtest2(8,3) + ,nval2,rval2(mvalmx) + ,rval3(3,mvalmx),rval4(4,3,mvalmx) character cval1*20,cval2*12 common /m8cwn3/ zval1,zval2(mvalmx) common /m8cwn4/ cval1,cval2(mvalmx) real GaussianDistribution1,GaussianDistribution2 + ,Flattish_Distribution1,Flattish_Distribution2 + ,Flat3 common /m8cwn5/ GaussianDistribution1,GaussianDistribution2 + ,Flattish_Distribution1,Flattish_Distribution2 + ,Flat3 C INTEGER IDBIN(10) REAL ADLO(10),ADHI(10),ADAT(10) CHARACTER*32 TNAME(10),tnamen(10) + ,TAGS(10),TAG2(25),TAG3(4),TAG4(2) C C List of histograms that are stored in the example file used in C the Mn_Fit tutorial and demos C integer midlist,midntpl parameter (midlist = 7, midntpl = 1) integer idlist(midlist),idntpl(midntpl) C CHARACTER*80 TITLE,tmp1 integer i,j,ii,jj,k,lunhb4,lunhbe,lunhb5,lun_dt,ierr,idn,nidn + ,idum,jdum,kdum + ,nbinx,nbiny,nwt,iad,icycle,nh,npnt,ndim + ,nchar,ind,nevt,lent real pi,rdeg,x,y,z,wt,weight,sx,sy,dx,dy,xx,dxl,dxh,dyl,dyh + ,xlo,xhi,ylo,yhi C real rndm,gaus_ib,hij integer lnblnk external rndm,gaus_ib,hij,lnblnk C +SELF,IF=VMS,IF=VAX,IF=l3,CLEO. integer lunjnk,npower,iword +SELF. C DATA TNAME/'X','Y','Z',7*' '/ DATA TAGS/'Gaus1','Gaus2','Flat',2*' ' + ,'GaussianDistribution1' + ,'GaussianDistribution2' + ,'Flattish_Distribution1' + ,'Flattish_Distribution2' + ,'Flattish_Distribution3'/ DATA TAG2/ + 'N1', 'N2', 'N3', 'N4', 'N5', 'N6', 'N7', 'N8', 'N9','N10' + ,'N11','N12','N13','N14','N15','N16','N17','N18','N19','N20' + ,'N21','N22','N23','N24','N25'/ DATA TAG3/'VAR1','VAR2','WEIGHT','DWEIGHT'/ DATA TAG4/'X','Y'/ C DATA IDUM/1234567/ C data idlist/1,2,5,6,7,9,10/ data idntpl/31/ C pi = 2.0*asin(1.0) rdeg = 180.0 / pi C CALL CTINUN CALL CLEO_GETLUN(LUNHB4,'HISTMKE') CALL TYPINI C C INITIALIZE MNBOOK C CALL M_INIT(0) C C Open the log file C +SELF,IF=VMS. OPEN(UNIT=LUNLPT,FILE='mn_tem:hist_make.dat',STATUS='UNKNOWN' 1 ,FORM='FORMATTED',ERR=100) GOTO 150 100 CONTINUE OPEN(UNIT=LUNLPT,FILE='hist_make.dat',STATUS='UNKNOWN' 1 ,FORM='FORMATTED') 150 CONTINUE +SELF,IF=UNIX. OPEN(UNIT=LUNLPT,FILE='/tmp/hist_make.dat',STATUS='UNKNOWN' 1 ,FORM='FORMATTED') +SELF. C C INITIALIZE HBOOK C CALL HLIMIT(300000) CALL HOUTPU(LUNLPT) C CALL HERMES(LUNLPT) C C Open the output file for the Ntuple C CALL HROPEN(LUNHB4,'MNHB4','hbook4_test.his','N',1024,IERR) IF(IERR.NE.0) GOTO 9000 CALL HCDIR('//MNHB4',' ') CALL HMDIR('NTUPLE','S') CALL HCDIR('//PAWC',' ') CALL HMDIR('NTUPLE','S') CALL HCDIR('//PAWC',' ') +SELF,IF=VMS,IF=VAX,IF=l3,CLEO. C C INITIALIZE AVEHST C CALL CLEO_GETLUN(LUNJNK,'TEST') CALL HSTINT('ave_test.def',LUNJNK,20) CALL CLEO_FRELUN(LUNJNK,'TEST') +SELF. C C BOOK THE HBOOK HISTOGRAMS C CALL HBOOK1(1,'HBOOK: Simple Gaussian Histogram$',40,-2.0,2.0,0.0) CALL HBOOK1(2,'HBOOK: Simple Gaussian Histogram$',40,-2.5,2.5,0.0) CALL HBOOK1(3,'HBOOK: Weighted Histogram$',40,-2.0,2.0,0.0) CALL HBOOK1(4,'HBOOK: 2 Gaussians + Exponential Background$' 1 ,25,0.0,5.0,0.0) CALL HBOOK1(5,'HBOOK: Gaussian Signal$' 1 ,25,0.0,5.0,0.0) CALL HBOOK1(6,'HBOOK: Exponential Background$' 1 ,25,0.0,5.0,0.0) CALL HBOOK1(7,'HBOOK: Gaussian Signal + Exponential Background$' 1 ,25,0.0,5.0,0.0) CALL HBOOK1(8,'HBOOK: Straight Line Background$' 1 ,25,0.0,5.0,0.0) CALL HBOOK1(9,'HBOOK: High Statistics Gaussian for Fitting$' 1 ,25,0.0,5.0,0.0) CALL HBOOK2(10,'HBOOK: 2 Gaussians$',20,-2.0,2.0,15,-3.0,3.0,0.0) CALL HBOOK2(11,'HBOOK: High statistics 2 Gaussians$' 1 ,20,-2.0,2.0,15,-3.0,3.0,0.0) CALL HBOOK2(13,'HBOOK: Surface for 2-D Plots' + ,15,-15.0,15.0,20,-5.0,15.0,0.0) CALL HBOOK1(14,'HBOOK: sin(x)/x to smooth' + ,20,-5.0,15.0,0.0) CALL HBOOK1(15,'HBOOK: Random weights around zero' + ,20,0.0,20.0,0.0) CALL HBOOK2(16,'HBOOK: Random weights around zero' + ,20,0.0,20.0,20,0.0,20.0,0.0) CALL HBOOK1(17,'HBOOK: sine wave in radians' 1 ,16,0.0,pi,0.0) CALL HBOOK1(18,'HBOOK: sine wave in degrees' 1 ,16,0.0,360.0,0.0) CALL HBOOK1(19,'HBOOK: Gaussian Signal + Exponential Background' 1 ,25,0.0,5.0,0.0) CALL HBOOKN(20,'HBOOK: 2 Gaussians',2,' ',1000,TNAME) CALL HBOOKN(21,'HBOOK: 2 Gaussians',2,' ',1000,TNAME) CALL HBOOK2(22,'HBOOK: Exponential vs Flat Background$' 1 ,40,0.0,4.0,60,0.0,3.0,0.0) C C Make an Exponetial convoluted with a Gaussian C call hbook1(26,'HBOOK: Exponential convoluted with Gaussian' + ,30,-1.0,5.0,0.0) C C Book some slices for the Gaussian C CALL HBPROX(10,0.0) CALL HBPROY(10,0.0) CALL HBSLIX(10,4,0.0) CALL HBSLIY(10,3,0.0) C CALL HBPROF(61,'HBOOK: Profile plot (RMS)' + ,20,0.0,10.0,-100.0,100.0,'S') CALL HBPROF(62,'HBOOK: Profile plot (Error)' + ,20,0.0,10.0,-100.0,100.0,' ') CALL HBPROF(63,'HBOOK: Profile plot (Error) - First 1/3' + ,20,0.0,10.0,-100.0,100.0,' ') CALL HBPROF(64,'HBOOK: Profile plot (Error) - Last 2/3' + ,20,0.0,10.0,-100.0,100.0,' ') IDN = 32 CALL HCDIR('NTUPLE',' ') CALL HBOOKN(31,'HBOOK: Ntuple - 2 Gaussians + flat',3 1 ,'//MNHB4/NTUPLE',500,TAGS) CALL HBOOKN(32,'HBOOK: Ntuple - 2 Gaussians + flat',3 1 ,'//MNHB4/NTUPLE',500,TAGS) CALL HBOOKN(35,'HBOOK: Ntuple - 2 Gaussians + 3 flat - Long',5 1 ,'//MNHB4/NTUPLE',500,TAGS(6)) call hprntu(31) call hprntu(32) call hprntu(35) * * CWN's * call hcdir('//PAWC/NTUPLE',' ') call hcdir('//MNHB4/NTUPLE',' ') call hbnt(33,'HBOOK: CWN - 2 Gaussians + flat',' ') call hbname(33,'GAUSS',gaus1,'gaus1, gaus2') call hbname(33,'FLAT',FLAT,'FLAT') call hprnt(33) call hbnt(36,'HBOOK: CWN - 2 Gaussians + 3 flat - Long',' ') call hbname(36,'GAUSS',GaussianDistribution1 + ,'GaussianDistribution1, GaussianDistribution2') call hbname(36,'FLAT',Flattish_Distribution1 + ,'Flattish_Distribution1, Flattish_Distribution2, FLAT') call hprnt(36) * call hbnt(34,'HBOOK: CWN - Full test',' ') call hbname(34,'SINGLE',rval1,'rval1:r*4:20:[-10,10],qval1:l') call hbname(34,'DOUBLE',zval1,'zval1:r*8') call hbnamc(34,'CHAR1',cval1,'cval1:c*20') call hbname(34,'TEST',rtest1,'rtest1(8),qtest2:l,rtest2(8,3)') call hbname(34,'ARRAY',nval2,'nval2[0,10]'// + ',rval2(nval2)::24:[-5.0,10.0]') call hbname(34,'ARRAY',zval2,'zval2(nval2):r*8') call hbnamc(34,'ARRAY',cval2,'cval2(nval2):c*12') call hbname(34,'ARRAY',rval4,'rval4(4,3,nval2)') call hbname(34,'ARRAY',rval3,'rval3(3,nval2)') call hprnt(34) * * Book the projections * call hbook1(34410,'HBOOK: rval2',75,-5.0,10.0,0.0) call hbook2(34420,'HBOOK: abs(rval4(1,2,1:nval2)) vs rval3(1)' + ,75,-5.0,10.0,75,-5.0,10.0,0.0) * CALL HBOOKN(41,'HBOOK: Ntuple - 1st 20 random numbers',20 + ,'//MNHB4/NTUPLE',500,TAG2(1)) CALL HBOOKN(42,'HBOOK: Ntuple - 2nd 20 random numbers',20 + ,'//MNHB4/NTUPLE',500,TAG2(6)) CALL HBOOKN(51,'HBOOK: 2-D Gaussian stored as an Ntuple',4 + ,'//MNHB4/NTUPLE',500,TAG3) CALL HBOOK2(52,'HBOOK: Y vs. X stored as a 2-D histogram' + ,50,-10.0,10.0,60,0.0,60.0,0.0) CALL HBOOKN(53,'HBOOK: Y vs. X stored as an Ntuple',2 + ,'//MNHB4/NTUPLE',500,TAG4) CALL HBOOKN(54,'HBOOK: X only stored as an Ntuple',1 + ,'//MNHB4/NTUPLE',500,TAG4) C C BOOK THE MNBOOK HISTOGRAMS C IDBIN(1) = 40 ADLO(1) = -2.0 ADHI(1) = 2.0 CALL M_BOOK(1,'MNBOOK: Simple Gaussian Histogram',1 1 ,IDBIN,ADLO,ADHI,0) ADLO(1) = -2.5 ADHI(1) = 2.5 CALL M_BOOK(2,'MNBOOK: Simple Gaussian Histogram',1 1 ,IDBIN,ADLO,ADHI,0) IDBIN(1) = 25 ADLO(1) = 0.0 ADHI(1) = 5.0 CALL M_BOOK(4,'MNBOOK: 2 Gaussians + Exponential Background',1 1 ,IDBIN,ADLO,ADHI,0) CALL M_BOOK(5,'MNBOOK: Gaussian Signal',1 1 ,IDBIN,ADLO,ADHI,0) CALL M_BOOK(6,'MNBOOK: Exponential Background',1 1 ,IDBIN,ADLO,ADHI,0) CALL M_BOOK(7,'MNBOOK: Gaussian Signal + Exponential Background',1 1 ,IDBIN,ADLO,ADHI,0) CALL M_BOOK(8,'MNBOOK: Straight Line Background',1 1 ,IDBIN,ADLO,ADHI,0) CALL M_BOOK(9,'MNBOOK: High Statistics Gaussian for Fitting',1 1 ,IDBIN,ADLO,ADHI,0) CALL M_BOOK(19,'MNBOOK: Gaussian Signal + Exponential Background' 1 ,1,IDBIN,ADLO,ADHI,0) C 2-DIMENSIONAL HISTOGRAM IDBIN(1) = 20 ADLO(1) = -2.0 ADHI(1) = 2.0 IDBIN(2) = 15 ADLO(2) = -3.0 ADHI(2) = 3.0 CALL M_BOOK(10,'MNBOOK: 2 Gaussians',2 1 ,IDBIN,ADLO,ADHI,0) CALL M_BOOK(11,'MNBOOK: High statistics 2 Gaussians',2 1 ,IDBIN,ADLO,ADHI,0) IDBIN(1) = 15 ADLO(1) = -15.0 ADHI(1) = 15.0 IDBIN(2) = 20 ADLO(2) = -5.0 ADHI(2) = 15.0 CALL M_BOOK(13,'MNBOOK: Surface for 2-D Plots',2 + ,IDBIN,ADLO,ADHI,0) CALL M_BOOK(14,'MNBOOK: sin(x)/x to smooth',1 + ,IDBIN(2),ADLO(2),ADHI(2),0) IDBIN(1) = 20 ADLO(1) = 0.0 ADHI(1) = 20.0 IDBIN(2) = 20 ADLO(2) = 0.0 ADHI(2) = 20.0 CALL M_BOOK(15,'MNBOOK: Random weights around zero',1 + ,IDBIN,ADLO,ADHI,0) CALL M_BOOK(16,'MNBOOK: Random weights around zero',2 + ,IDBIN,ADLO,ADHI,0) IDBIN(1) = 16 ADLO(1) = 0.0 ADHI(1) = pi CALL M_BOOK(17,'MNBOOK: sine wave in radians',1 + ,IDBIN,ADLO,ADHI,0) ADHI(1) = 360.0 CALL M_BOOK(18,'MNBOOK: sine wave in degrees',1 + ,IDBIN,ADLO,ADHI,0) C SCATTER PLOTS IDBIN(1) = 0 IDBIN(2) = 0 IDBIN(3) = 0 CALL M_BOOK(20,'MNBOOK: 2 Gaussians',2 1 ,IDBIN,ADLO,ADHI,1000) CALL M_BOOK(21,'MNBOOK: 2 Gaussians',2 1 ,IDBIN,ADLO,ADHI,1000) CALL M_BOOK(22,'MNBOOK: Exponential vs Flat Background',2 1 ,IDBIN,ADLO,ADHI,1000) CALL M_BOOK(31,'MNBOOK: Ntuple - 2 Gaussians + flat',3 1 ,IDBIN,ADLO,ADHI,950) C DO 1000 I=1,1000 CALL HCDIR('//PAWC',' ') CALL HCDIR('//MNHB4',' ') C C HIST 1 A GAUSSIAN C X = GAUS_IB(IDUM) CALL HFILL(1,X,1.0,1.0) +SELF,IF=VMS,IF=VAX,IF=l3,CLEO. CALL HIST(1,X,1.0) +SELF. CALL M_FIL1(1,X,1.0) C C HIST 1 A GAUSSIAN C X = GAUS_IB(IDUM) CALL HFILL(2,X,1.0,1.0) +SELF,IF=VMS,IF=VAX,IF=l3,CLEO. CALL HIST(2,X,1.0) +SELF. CALL M_FIL1(2,X,1.0) C C HIST 3 A WEIGHTED HISTOGRAM C WT = 4.0*(RNDM(IDUM)-0.5) WEIGHT = EXP(-WT**2/2.0) CALL HFILL(3,X,1.0,WEIGHT) +SELF,IF=VMS,IF=VAX,IF=l3,CLEO. CALL HIST(3,X,WEIGHT) +SELF. C C HISTS 5 AND 7, SIGNAL AND SIGNAL + BACKGROUND C X = 2.0 + 0.25*GAUS_IB(IDUM) CALL HFILL(5,X,1.0,1.0) CALL HFILL(7,X,1.0,1.0) +SELF,IF=VMS,IF=VAX,IF=l3,CLEO. CALL HIST(5,X,1.0) CALL HIST(7,X,1.0) +SELF. CALL M_FIL1(5,X,1.0) CALL M_FIL1(7,X,1.0) C C Hist 19 is the same again, but with half the statistics and C a new random number C if(mod(i,2).eq.1) then x = 2.0 + 0.25*gaus_ib(idum) call hfill(19,x,1.0,1.0) +SELF,IF=VMS,IF=VAX,IF=l3,CLEO. CALL HIST(19,X,1.0) +SELF. CALL M_FIL1(19,X,1.0) endif C C HIST 4 CONTAINS 2 GAUSSIANS C X = 1.5 + 0.25*GAUS_IB(IDUM) CALL HFILL(4,X,1.0,1.0) +SELF,IF=VMS,IF=VAX,IF=l3,CLEO. CALL HIST(4,X,1.0) +SELF. CALL M_FIL1(4,X,1.0) C X = 2.5 + 0.50*GAUS_IB(IDUM) CALL HFILL(4,X,1.0,1.0) +SELF,IF=VMS,IF=VAX,IF=l3,CLEO. CALL HIST(4,X,1.0) +SELF. CALL M_FIL1(4,X,1.0) C C HISTS 10 AND 12, 2 DIMENSIONAL HISTS OF 2 GAUSSIANS C X = 1.0*GAUS_IB(IDUM) Y = 1.5*GAUS_IB(IDUM) CALL HFILL(10,X,Y,1.0) +SELF,IF=VMS,IF=VAX,IF=l3,CLEO. CALL DIM2(10,X,Y) CALL DIM2(12,X,Y) +SELF. CALL M_FIL2(10,X,Y,1.0) C C HIST 19 A BIT HISTOGRAM C +SELF,IF=VMS,IF=VAX,IF=l3,CLEO. NPOWER = IFIX(RNDM(IDUM)*20.0) IWORD = 2**NPOWER CALL HIST(19,FLOAT(IWORD)) +SELF. C C HIST 20, A REAL SCATTER PLOT OF THE 2 GAUSSIANS C +SELF,IF=VMS,IF=VAX,IF=l3,CLEO. CALL SCAT(20,X,Y) +SELF. ADAT(1) = X ADAT(2) = Y CALL M_FILN(20,ADAT) C CALL HFN(20,ADAT) C C HIST 21, A REAL SCATTER PLOT OF 2 OTHER GAUSSIANS C X = 1.0 + 2.0*GAUS_IB(IDUM) Y = 5.0 + GAUS_IB(IDUM) ADAT(1) = X ADAT(2) = Y +SELF,IF=VMS,IF=VAX,IF=l3,CLEO. CALL SCAT(21,X,Y) +SELF. CALL M_FILN(21,ADAT) C CALL HFN(21,ADAT) C C HIST 22, EXPONENTIAL DECAY VS A FLAT BACKGROUND C X = 4.0*RNDM(IDUM) 900 CONTINUE Y = RNDM(IDUM) Z = EXP(-3.0*Y) IF(RNDM(IDUM).GT.Z) GOTO 900 Y = 2.0*Y + 1.0 CALL HFILL(22,X,Y,1.0) +SELF,IF=VMS,IF=VAX,IF=l3,CLEO. CALL SCAT(22,X,Y) +SELF. ADAT(1) = X ADAT(2) = Y CALL M_FILN(22,ADAT) C C Histograms 61 to 64 are Profile plots - HBOOK4 only C X = 8.0 * RNDM(IDUM) Y = X + 5.0*GAUS_IB(IDUM) CALL HFILL(61,X,Y,1.0) CALL HFILL(62,X,Y,1.0) IF(I.LE.333) THEN CALL HFILL(63,X,Y,1.0) ELSE CALL HFILL(64,X,Y,1.0) ENDIF C C HIST 31, A REAL SCATTER PLOT OF 2 OTHER GAUSSIANS C X = 1.0 + 2.0*GAUS_IB(IDUM) Y = 5.0 + GAUS_IB(IDUM) Z = 4.0*RNDM(IDUM) YDAT(1) = X YDAT(2) = Y YDAT(3) = Z ydat(4) = 5.0*rndm(idum) ydat(5) = 6.0*rndm(idum) CALL HCDIR('//PAWC/NTUPLE',' ') CALL HCDIR('//MNHB4/NTUPLE',' ') CALL HFN(31,YDAT) CALL HFN(32,YDAT) call hfn(35,ydat) CALL M_FILN(31,YDAT) C gaus1 = x gaus2 = y flat = z call hfnt(33) C GaussianDistribution1 = x GaussianDistribution2 = y Flattish_Distribution1 = ydat(3) Flattish_Distribution2 = ydat(4) Flat3 = ydat(5) call hfnt(36) C 1000 CONTINUE * CALL HCDIR('//PAWC',' ') CALL HCDIR('//MNHB4',' ') C C HISTS 4, 6 AND 7 ARE AN EXPONENTIALLY FALLING BACKGROUND C AND 7 HAS A GAUSSIAN SIGNAL ON IT C DO 2000 I=1,2000 1200 CONTINUE X = 4.0*RNDM(IDUM) Y = EXP(-0.5*X) IF(RNDM(IDUM).GT.Y) GOTO 1200 C CALL HFILL(4,X,1.0,1.0) CALL HFILL(6,X,1.0,1.0) CALL HFILL(7,X,1.0,1.0) +SELF,IF=VMS,IF=VAX,IF=l3,CLEO. CALL HIST(4,X,1.0) CALL HIST(6,X,1.0) CALL HIST(7,X,1.0) +SELF. CALL M_FIL1(4,X,1.0) CALL M_FIL1(6,X,1.0) CALL M_FIL1(7,X,1.0) C C Smear the exponential with a Gaussian of width 0.5 C x = x + 0.5*gaus_ib(i) call hfill(26,x,1.0,1.0) C C Hist 19 is the same again, but with 1/3 the statistics and C a new random number C if(mod(i,3).eq.1) then 1300 continue x = 4.0*rndm(idum) y = exp(-0.5*x) if(rndm(idum).gt.y) goto 1300 call hfill(19,x,1.0,1.0) +SELF,IF=VMS,IF=VAX,IF=l3,CLEO. CALL HIST(19,X,1.0) +SELF. CALL M_FIL1(19,X,1.0) endif C C HIST 8 IS A STRAIGHT LINE BACKGROUND C 1400 CONTINUE X = 5.0*RNDM(IDUM) Y = 0.1 * (10.0 - 2.0*X) IF(RNDM(IDUM).GT.Y) GOTO 1400 C CALL HFILL(8,X,1.0,1.0) +SELF,IF=VMS,IF=VAX,IF=l3,CLEO. CALL HIST(8,X,1.0) +SELF. CALL M_FIL1(8,X,1.0) 2000 CONTINUE C DO 3000 I=1,5000 C C HIST 9 A HIGH STATISTICS GAUSSIAN C X = 2.0 + 0.25*GAUS_IB(IDUM) CALL HFILL(9,X,1.0,1.0) +SELF,IF=VMS,IF=VAX,IF=l3,CLEO. CALL HIST(9,X,1.0) +SELF. CALL M_FIL1(9,X,1.0) C C HIST 11 A HIGH STATISTICS DOUBLE GAUSSIAN C X = 1.0*GAUS_IB(IDUM) Y = 1.5*GAUS_IB(IDUM) CALL HFILL(11,X,Y,1.0) +SELF,IF=VMS,IF=VAX,IF=l3,CLEO. CALL DIM2(11,X,Y,1.0) +SELF. CALL M_FILL(11,X,Y,1.0) 3000 CONTINUE C C HIST 13, A surface for IGTABL C sx = 30.0/15.0 sy = 20.0/20.0 x = -15.0 + 0.5*sx y = -5.0 + 0.5*sy do i=1,20 do j=1,15 if(x.ne.0.0 .and. y.ne.0.0) then weight = 100.0*sin(x)/x*sin(y)/y elseif(x.ne.0.0) then weight = 100.0*sin(x)/x elseif(y.ne.0.0) then weight = 100.0*sin(y)/y else weight = 100.0 endif call hfill(13,x,y,weight) +SELF,IF=VMS,IF=VAX,IF=l3,CLEO. call dim2(13,x,y,weight) +SELF. call m_fill(13,x,y,weight) x = x + sx enddo y = y + sy x = -15.0 + 0.5*sx enddo C C Fill 14 as a histogram to smooth C do i=1,5000 idum = 10*j + i jdum = nint(rndm(idum)) kdum = nint(rndm(jdum)) x = -5.0 + 20.0*rndm(idum) y = 100.0*rndm(jdum) if(x.ne.0.0) then weight = 100.0*sin(x)/x + 1.0*(x+5.0)*rndm(kdum) else weight = 100.0 endif if(y.lt.weight) then call hfill(14,x,1.0,1.0) call m_fil1(14,x,1.0) +SELF,IF=VMS,IF=VAX,IF=l3,CLEO. call hist(14,x,1.0) +SELF. endif enddo C C HIST 15, Random weights around zero C DO 3200 I=1,20 X = FLOAT(I) - 0.5 WEIGHT = 10.0 * (RNDM(IDUM) - 0.5) IF(MOD(I,6).EQ.0) WEIGHT = 0.0 CALL HFILL(15,X,1.0,WEIGHT) +SELF,IF=VMS,IF=VAX,IF=l3,CLEO. CALL HIST(15,X,WEIGHT) +SELF. CALL M_FIL1(15,X,WEIGHT) DO 3190 J=1,20 Y = FLOAT(J) - 0.5 WEIGHT = 10.0 * (RNDM(IDUM) - 0.5) IF(MOD(I+J,6).EQ.0) WEIGHT = 0.0 CALL HFILL(16,X,Y,WEIGHT) +SELF,IF=VMS,IF=VAX,IF=l3,CLEO. CALL HIST(16,X,Y,WEIGHT) +SELF. CALL M_FIL2(16,X,Y,WEIGHT) 3190 CONTINUE 3200 CONTINUE C C HISTS 17, 18 are sine waves in radians and degrees C DO 3300 I=1,2000 3250 continue X = 2.0 * pi * RNDM(IDUM) Y = sin(x) IF(RNDM(IDUM).GT.abs(Y)) GOTO 3250 C CALL HFILL(17,X,1.0,1.0) CALL HFILL(18,X*rdeg,1.0,1.0) +SELF,IF=VMS,IF=VAX,IF=l3,CLEO. CALL HIST(17,X,1.0) CALL HIST(18,X*rdeg,1.0) +SELF. CALL M_FIL1(17,X,1.0) CALL M_FIL1(18,X*rdeg,1.0) 3300 CONTINUE C C HIST 41, A BIGGISH Ntuple C CALL HCDIR('//PAWC/NTUPLE',' ') CALL HCDIR('//MNHB4/NTUPLE',' ') DO 4000 I=1,3000 DO 3500 J=1,25 IF(J.EQ.1) THEN X = FLOAT(I) ELSEIF(J.LE.5) THEN X = FLOAT(I/J) ELSEIF(J.LE.10) THEN X = (FLOAT(J)-0.5)*RNDM(IDUM) + FLOAT(10*(J-1)) ELSE X = FLOAT(J-11) + FLOAT(J-10)*GAUS_IB(IDUM) ENDIF YDAT(J) = X 3500 CONTINUE CALL HFN(41,YDAT(1)) CALL HFN(42,YDAT(6)) 4000 CONTINUE C C Make a y vs. x plot and put a smear on y. C x runs from -10 to 10, y from 0 to 50 C DO 4100 I=1,2000 X = -10.0 + 20.0*RNDM(IDUM) Y = 0.5*X**2 + ABS(X)*(RNDM(IDUM)-1.0) CALL HFILL(52,X,Y,1.0) YDAT(1) = X YDAT(2) = Y CALL HFN(53,YDAT) YDAT(1) = 10.0*GAUS_IB(IDUM) CALL HFN(54,YDAT) 4100 CONTINUE C C CWN C do i=1,200 do j=1,7 rtest1(j) = float(i) + float(1000*j) rtest2(j,1) = -rtest1(j) rtest2(j,2) = rtest1(j) rtest2(j,3) = float(j) enddo qtest2 = j.gt.4 rtest1(8) = 1.0/rtest1(1) rtest2(8,1) = 1.0/rtest2(1,1) rtest2(8,2) = 2.0/rtest2(3,2) rtest2(8,3) = 3.0/rtest2(5,3) * rval1 = gaus_ib(idum) zval1 = dble(2.0*gaus_ib(i)) qval1 = rval1.gt.0.0 nval2 = nint(10.0*rndm(i)) cval1 = ' ' nchar = 20 - nint(10.0*rndm(i)) do j=1,nchar cval1(j:j) = char(ichar('A')+nval2+j) enddo call vzero(rval2,mvalmx) call vzero(rval3,3*mvalmx) call vzero(rval4,4*3*mvalmx) rval2(1) = rval1 rval3(1,1) = rval1 rval3(2,1) = sngl(zval1) rval3(3,1) = float(nval2) do j=2,nval2 rval2(j) = float(j-2) + 0.1*float(j)*gaus_ib(j) rval3(1,j) = rval2(j) - 1.0 rval3(2,j) = rval2(j) rval3(3,j) = 2.0 * rval2(j) do k=1,4 rval4(k,1,j) = float(k + (i-1)/10) if(k.le.3) then rval4(k,2,j) = rval3(k,j) else rval4(k,2,j) = float(nval2) endif if(mod(k,2).eq.1) then rval4(k,3,j) = float(j) + 0.5*gaus_ib(k) else rval4(k,3,j) = -rval4(k-1,3,j) endif enddo enddo if(nval2.gt.0) then zval2(nval2) = zval1 cval2(nval2) = cval1 endif do j=1,nval2-1 zval2(j) = dble(rval2(nval2-j+1)) cval2(j) = ' ' do k=1,nval2,2 cval2(j)(k:k+1) = char(ichar('A')+nval2+j) // + char(ichar('a')+nval2+k) enddo enddo call hfnt(34) * * Fill the projections * do j=1,nval2 call hfill(34410,rval2(j),1.0,1.0) if(j.gt.1) then call hfill(34420,rval3(1,j),abs(rval4(1,2,j)),1.0) endif enddo enddo C C Fill an Ntuple with the contents on 2-d Gaussian C CALL HCDIR('//PAWC',' ') CALL HCDIR('//MNHB4',' ') CALL HGIVE(10,TITLE,NBINX,XLO,XHI,NBINY,YLO,YHI 1 ,NWT,IAD) DX = (XHI - XLO) / FLOAT(NBINX) DY = (YHI - YLO) / FLOAT(NBINY) DO 4200 I=1,20 DO 4190 J=1,15 CALL HIJXY(10,I,J,YDAT(1),YDAT(2)) YDAT(1) = YDAT(1) + 0.5*DX YDAT(2) = YDAT(2) + 0.5*DY YDAT(3) = HIJ(10,I,J) YDAT(4) = 0.5*SQRT(YDAT(3)) CALL HCDIR('//PAWC/NTUPLE',' ') CALL HCDIR('//MNHB4/NTUPLE',' ') CALL HFN(51,YDAT) CALL HCDIR('//PAWC',' ') CALL HCDIR('//MNHB4',' ') 4190 CONTINUE 4200 CONTINUE C C PRINT AND STORE HBOOK HISTOGRAMS C CALL HISTDO CALL HCDIR('//PAWC',' ') CALL HCDIR('//MNHB4',' ') CALL HROUT(0,ICYCLE,'NT') c c Wait for 2 minutes to get another time c *icb WRITE(LUNTTO,'('' +++ Waiting for 2 minutes !! +++'')') WRITE(LUNTTO,'('' +++ Waiting for 2 seconds !! +++'')') *icb call sleepf(120) call sleepf(2) CALL HCDIR('//PAWC',' ') CALL HCDIR('//MNHB4',' ') CALL HROUT(1,ICYCLE,' ') CALL HROUT(9,ICYCLE,' ') C C Also write a selection of the histograms into the example file C call hrput(idlist(1),'hbook_example.his','N') do i=2,midlist call hrput(idlist(i),'hbook_example.his','U') enddo C C Also write a selection of the histograms into a file with different C record length C call cleo_getlun(lunhb5,'HISTMKE') call hropen(lunhb5,'MNHB5','hbook5_test.his','N',4096,ierr) if(ierr.ne.0) goto 9000 do i=1,midlist call hrout(idlist(i),icycle,' ') enddo call hrendc('MNHB5') *ICB close(unit=lunhb5) *ICB call cleo_frelun(lunhb5,'HISTMKE') C C Write Ntuple(s) to the example file C icycle = 999999 call cleo_getlun(lunhbe,'test') call hropen(lunhbe,'MNHBE','hbook_example.his','U',1024,ierr) do i=1,midntpl call hcdir('//PAWC',' ') call hcdir('//MNHB4/NTUPLE',' ') call hrin(idntpl(i),icycle,1000) call hcdir('//MNHBE',' ') call hntdup(1000+idntpl(i),idntpl(i),-1,' ',' ') call hgnpar(1000+idntpl(i),'test') nevt = 0 4300 continue nevt = nevt + 1 call hcdir('//PAWC',' ') call hcdir('//MNHB4/NTUPLE',' ') call hgnf(1000+idntpl(i),nevt,ydat,ierr) if(ierr.ne.0) then nevt = nevt - 1 goto 4350 endif call hcdir('//MNHBE',' ') call hfn(idntpl(i),ydat) if(nevt.ge.1000) goto 4350 goto 4300 4350 continue write(6,'('' Ntuple'',I6,'': Read in'',I5,'' events'')') + idntpl(i),nevt call hrout(idntpl(i),icycle,' ') enddo call hrendc('MNHBE') *ICB close(unit=lunhbe) *ICB call cleo_frelun(lunhbe,'test') call hcdir('//PAWC',' ') C C OPEN THE FILE FOR DATA CARDS C CALL CLEO_GETLUN(LUN_DT,'TEST') OPEN(UNIT=LUN_DT,FILE='dat_test.mnd',STATUS='UNKNOWN' 1 ,FORM='FORMATTED') C DO 5500 NH=1,3 C C GET THE HBOOK HISTOGRAM TO USE FOR DATA CARDS C IF(NH.EQ.1 .OR. NH.EQ.2) THEN CALL HGIVE(1,TITLE,NBINX,XLO,XHI,NBINY,YLO,YHI 1 ,NWT,IAD) CALL HUNPAK(1,YDAT,'HIST',1) IF(NBINX.GT.0) DX = (XHI - XLO) / FLOAT(NBINX) DO 5100 II=1,NBINX XDAT(II) = XLO + FLOAT(II-1)*DX + 0.5*DX DXDAT(II) = 0.5*DX DYDAT(II) = SQRT(YDAT(II)) 5100 CONTINUE NPNT = NBINX ELSE write(6,'('' Reading in Ntuple'',I4)') idn icycle = 999999 CALL HCDIR('//PAWC/NTUPLE',' ') CALL HCDIR('//MNHB4/NTUPLE',' ') call hdelet(idn) call hrin(idn,icycle,0) ndim = 10 CALL HGIVEN(IDN,TITLE,NDIM,TNAMEn,ADLO,ADHI) CALL HNOENT(IDN,NPNT) NIDN = 0 END IF WRITE(LUN_DT,'(''ID '',I8)') NH IF(NH.EQ.1) THEN WRITE(LUN_DT,*) 'TITLE A Gaussian without errors' ELSE IF(NH.EQ.2) THEN WRITE(LUN_DT,*) 1 'TIT A Gaussian with asymmetric errors junk and order' WRITE(LUN_DT,*) 'LIMIT -2 2' WRITE(LUN_DT,*) 'ORDER DUMMY X DXN DXP Y DYN DYP' ELSE IF(NH.EQ.3) THEN IND = INDEX(TITLE,':') Tmp1 = TITLE(IND+1:) title = tmp1 lent = lnblnk(title) WRITE(LUN_DT,'(''TIT '',A)') TITLE(:lent) WRITE(LUN_DT,'(''NTUPLE '',I4,10(1X,A))') NDIM 1 ,(TNAMEn(JJ),JJ=1,NDIM) END IF WRITE(LUN_DT,'(''DATA'')') C DO 5200 II=1,NBINX IF(NH.EQ.1) THEN WRITE(LUN_DT,'(1X,F8.4,F10.4)') XDAT(II),YDAT(II) ELSE IF(NH.EQ.2) THEN XX = XDAT(II) - 0.5*DXDAT(II) DXL = 0.5*DXDAT(II) DXH = 1.5*DXDAT(II) DYL = 0.8*DYDAT(II) DYH = 1.2*DYDAT(II) WRITE(LUN_DT,'(1X,I6,3F8.4,3F10.4)') II,XX,DXL,DXH 1 ,YDAT(II),DYL,DYH ELSE c CALL HGNf(IDN,II,ADAT,IERR) CALL HGN(IDN,NIDN,II,ADAT,IERR) IF(IERR.NE.0) THEN WRITE(LUNTTO,'('' Error getting Ntuple '',I8 + ,'' Event'',I6)') idn,II WRITE(LUNTTO,'('' Data: '',5(1PG12.5) + ,/,(7X,5(1PG12.5)))') (ADAT(JJ),JJ=1,NDIM) ENDIF WRITE(LUN_DT,'(1X,10G13.5)') (ADAT(JJ),JJ=1,NDIM) END IF 5200 CONTINUE IF(NH.NE.2) WRITE(LUN_DT,*) 'END' 5500 CONTINUE C C Dump a CWN C call hcdir('//PAWC/NTUPLE',' ') call hcdir('//MNHB4/NTUPLE',' ') call hrin(33,99999,0) call hrin(34,99999,0) * call hprnt(33) do i=1,10 call hgnt(33,i,ierr) if(ierr.ne.0) then write(6,'('' Error'',I6,'' reading CWN 33'')') ierr endif write(6,'('' Event'',I4,'' Gaus1,Gaus2,Flat'',3f8.4)') + i,gaus1,gaus2,flat enddo call hprnt(34) do i=1,10 call hgnt(34,i,ierr) if(ierr.ne.0) then write(6,'('' Error'',I6,'' reading CWN 34'')') ierr endif write(6,'('' Event'',I4 + ,'' rval1,zval1,qval1,cval1'',2f9.4,l4,1x,a + ,'' nval2'',i3)') + i,rval1,zval1,qval1,cval1 + ,nval2 write(6,'('' rval2:'',10f7.3)') (rval2(jj),jj=1,nval2) write(6,'('' zval2:'',10f7.3)') (zval2(jj),jj=1,nval2) write(6,'('' cval2:'',5(2x,a),/,7x,5(2x,a))') + (cval2(jj),jj=1,nval2) do j=1,nval2 write(6,'('' rval3:'',3f9.4)') (rval3(ii,j),ii=1,3) enddo enddo C CALL HCDIR('//PAWC',' ') CLOSE(UNIT=LUN_DT) CALL CLEO_FRELUN(LUN_DT,'TEST') C +SELF,IF=VMS,IF=VAX,IF=l3,CLEO. C C PRINT AND STORE AVEHST HISTOGRAMS C CALL HSTDMP(20,.TRUE.,.TRUE.,'ave_test.hst',.true.) +SELF. C C PRINT AND STORE MNBOOK HISTOGRAMS C CALL M_INDX CALL M_PRNT(0) CALL M_STOR(0,'mnbook_test.mnh') C CALL HRENDc('MNHB4') *ICB CLOSE(UNIT=LUNHB4) C 9000 CONTINUE CLOSE(UNIT=LUNLPT) C 9900 CONTINUE STOP END C FUNCTION GAUS_IB(IDUM) C VAL = 0.0 DO II=1,12 VAL = VAL + RNDM(IDUM) ENDDO GAUS_IB = VAL - 6.0 C RETURN END C SUBROUTINE CTINUN C----- C INITIALIZE LUN MANAGER WITH STANDARD CLEO LOGICAL UNITS C C ROHIT NAMJOSHI 18-AUG-86 C C 28-Aug-88 : Modifications for new version of LUN manager C----- C C INCLUDE 'CLINC:CLUNS.INC' C NBM:1/19/83:ADDED /CLUNS/STAFLG FOR PRINTOUT OF STATUS C C 27-AUG-86 RMN ADDED LUNMTI, LUNMTO FOR MTIN, MTOUT C LOGICAL DRFLG , IZFLG , ESFLG , OZFLG , TRFLG , DXFLG , TFFLG , 1 RSFLG , CSFLG , LMFLG , MUFLG , ONLF1 , WTFLG , MTAFLG, 2 AUTOUT, DETFLG, MAFLG , STAFLG C INTEGER LUNIN , LUNOUT, LUNLPT, LUNTTY, LUNTMP, LUNTTI, LUNTTO, 1 LUNMTI, LUNMTO C COMMON /CLUNS/ LUNIN , LUNOUT, LUNLPT, LUNTTY, LUNTMP, DRFLG , 1 IZFLG , ESFLG , OZFLG , TRFLG , DXFLG , TFFLG , 2 RSFLG , CSFLG , LMFLG , MUFLG , ONLF1 , WTFLG , 3 MTAFLG, AUTOUT, DETFLG, MAFLG , STAFLG, 4 LUNTTI, LUNTTO, LUNMTI, LUNMTO * CHARACTER*(*) CRNAME PARAMETER( CRNAME = 'CTINUN' ) * C C== HARDWIRED UNITS C LUNMTI = 1 LUNMTO = 2 LUNTTI = 5 LUNTTO = 6 LUNTTY = 6 LUNPUN = 7 LUNLPT = 20 LUNTMP = 61 C C== INITIALIZE LUN MANAGER C CALL CLEO_INILUN C C== LOCK ALL THE RESERVED LUNS C CALL CLEO_LOKLUN( LUNMTI, CRNAME ) CALL CLEO_LOKLUN( LUNMTO, CRNAME ) CALL CLEO_LOKLUN( LUNTTI, CRNAME ) CALL CLEO_LOKLUN( LUNTTO, CRNAME ) CALL CLEO_LOKLUN( LUNPUN, CRNAME ) CALL CLEO_LOKLUN( LUNLPT, CRNAME ) CALL CLEO_LOKLUN( LUNTMP, CRNAME ) C RETURN END +DECK,igtext_exam. PROGRAM IGTEXT_EXAM C C----------------------------------------------------------------------- C C Makes the standard picture of IGTEXT characters C C----------------------------------------------------------------------- C COMMON/PAWC/H(20000) CHARACTER*80 FILENAME CHARACTER*10 TQUAL * integer nloop,lenf,lnblnk *.___________________________________________ * CALL MZPAW(20000,'M') CALL IGINIT(0) * KWTYPE = 10002 KWTYPE = 0 +SELF,IF=X11. KWTYPE = 1 +SELF. IF(KWTYPE.EQ.0) CALL IGWKTY(KWTYPE) * KWPOST = -113 TQUAL = 'eps' LQUAL = LENOCC(TQUAL) CALL CUTOL(TQUAL) IF(LQUAL.EQ.0) THEN TQUAL = 'eps' LQUAL = LENOCC(TQUAL) ENDIF * CALL IGSSE(6,KWTYPE) * nloop = 0 1000 CONTINUE NLOOP = NLOOP + 1 +SELF,IF=UNIX. write(filename,'(''igtext'',i1,''.'',a)') + nloop,tqual(:lqual) lenf = lnblnk(filename) OPEN(UNIT=10,FILE=filename(:lenf),FORM='FORMATTED' + ,STATUS='UNKNOWN') +SELF,IF=IBM. write(filename,'(''IGTEXT'',i1,'' '',a)') + nloop,tqual(:lqual) lenf = lnblnk(filename) CALL VMCMS('FILEDEF 10 DISK ' // filename(:lenf),IRET) OPEN(UNIT=10,FORM='FORMATTED' + ,STATUS='UNKNOWN') +SELF,IF=VMS. write(filename,'(''igtext'',i1,''.'',a)') + nloop,tqual(:lqual) lenf = lnblnk(filename) OPEN(UNIT=10,FILE=filename(:lenf),FORM='FORMATTED' + ,SHARED,CARRIAGECONTROL='LIST',STATUS='UNKNOWN') +SELF. NCONID = 10 +SELF,IF=HIGZ,IF=GKSGRAL. C IF(KWPOST.EQ.-113) THEN IF(TQUAL(1:LQUAL).EQ.'eps' .AND. KWPOST.EQ.12201) THEN NCONID = NCONID + 200 ELSE NCONID = NCONID + 100 ENDIF +SELF. CALL IOPWK(2,NCONID,KWPOST) CALL IACWK(2) * * I want the picture to be 16x18cm. Set up the normalization transformation * accordingly. * ITNR = 2 difx = 16.0 dify = 18.0 CICB CALL ISWKWN(1,0.0,DIFX/DIFY,0.0,1.0) CICB CALL ISWKWN(2,0.0,DIFX/DIFY,0.0,1.0) C x1 = 0.0 x2 = 0.01*difx y1 = 0.0 y2 = 0.01*dify CICB CALL ISWKVP(1,X1,X2,Y1,Y2) CICB CALL ISWKVP(2,X1,X2,Y1,Y2) C CICB CALL ISWN(ITNR,0.0,DIFX,0.0,DIFY) CICB CALL ISVP(ITNR,0.0,DIFX/DIFY,0.0,1.0) C call igrng(difx,dify) C CICB CALL ISELNT(ITNR) * CALL ICLRWK(0,0) * IF(NLOOP.EQ.1) THEN CALL HIEX2(0,2,difx,dify) ELSE CALL HIEX2(-13,1,difx,dify) ENDIF * call iuwk(0,1) * * write(6,'('' Hit to continue: '',$)') * read(5,*) * CALL IACWK(2) CALL ICLWK(2) CLOSE(UNIT=10) if(nloop.lt.2) goto 1000 * 20 CALL IGEND STOP END * SUBROUTINE HIEX2(NFONT,NPREC,difx,dify) *.==========> *. Example to plot the table of HIGZ software characters *..=========> ( R.Brun ) * implicit none * INTEGER NFONT,NPREC real difx,dify * character*60 title CHARACTER*8 KD1,KD2 CHARACTER*45 KDG CHARACTER*3 KTEXT CHARACTER*1 CHOPT CHARACTER*5 TESC(8) real XPOS(8),X(5),Y(5) * real xlong,ytop,ybot,xmarg,angle,xw,size,ylong,y1,y2,yp + ,tsize,xmid,ytit integer i,j,lent,lnblnk integer ncol,nhead,nchar * DATA KD1/' < < < <'/ DATA KD2/' [[""~~'/ DATA KDG/'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,+-*/=()'/ DATA TESC/'ABC','abc','[ABC]','[abc]','"ABC#','"abc#' + ,'~ABC#','~abc#'/ C DATA XLONG,YTOP,YBOT,xmarg/12.,18.,0.5,0.5/ DATA ANGLE/0./ C c CALL IGRNG(20.,24.) CALL ICLRWK(0,0) * xlong = difx ytop = dify C x(1) = 0.0 y(1) = 0.0 x(2) = 0.0 y(2) = ytop x(3) = 16.0 y(3) = ytop x(4) = 16.0 y(4) = 0.0 x(5) = 0.0 y(5) = 0.0 * call ipl(5,x,y) * if(nfont.eq.0 .and. nprec.eq.2) then title = 'Font 2000, i.e. IGTEXT' ncol = 6 else title = 'Font -1004, i.e. Postscript - Helvetica' ncol = 8 endif tsize = 0.4 xmid = 0.5*xlong ytit = ytop - 1.5*tsize CALL ISTXFP(NFONT,NPREC) CALL ISTXAL(2,0) CALL ISCHH(TSIZE) lent = lnblnk(title) call itx(xmid,ytit,title(:lent)) * ytop = ytop - 2.0*tsize nhead = 5 nchar = 45 * XW = (XLONG-2.0*xmarg)/(2.0*float(ncol)) DO 10 I = 1,ncol XPOS(I) = (2*I-1)*XW + xmarg 10 CONTINUE C C DRAW THE FRAME C SIZE = (YTOP-YBOT) / ((nhead+nchar)*1.5) YLONG = nchar*1.5*SIZE + nhead*1.5*SIZE X(1) = XPOS(1) - XW X(2) = XPOS(ncol) + XW X(3) = X(2) X(4) = X(1) X(5) = X(1) Y(1) = YTOP Y(2) = Y(1) Y(3) = Y(1) - YLONG Y(4) = Y(3) Y(5) = Y(1) CALL IPL(5,X,Y) DO 20 I = 1,ncol-1 X(1) = XPOS(I) + XW X(2) = X(1) Y(1) = YTOP Y(2) = Y(1) - YLONG CALL IPL(2,X,Y) 20 CONTINUE X(1) = XPOS(1) - XW X(2) = XPOS(ncol) + XW Y(1) = YTOP - float(nhead)*SIZE Y(2) = Y(1) CALL IPL(2,X,Y) C C DRAW BOX TITLES C Y1 = YTOP - 2.*SIZE Y2 = Y1 - 2.*SIZE CHOPT='C' CALL ISTXFP(NFONT,NPREC) CALL ISTXAL(2,0) CALL ISCHH(SIZE) C CALL ITX(XPOS(1),Y1,'Upper') CALL ITX(XPOS(1),Y2,'Roman') CALL ITX(XPOS(2),Y1,'Lower') CALL ITX(XPOS(2),Y2,'Roman') CALL ITX(XPOS(3),Y1,'Upper') CALL ITX(XPOS(3),Y2,'Greek') CALL ITX(XPOS(4),Y1,'L'/ DATA TEXTRA/'^','~'/ C LENI = LNBLNK(TXTI) IF(LENI.EQ.0 .OR. TXTI.EQ.' ') RETURN C C GET RID OF TABS C N1 = 1 500 CONTINUE IND = INDEX(TXTI(N1:),TAB) IF(IND.EQ.0) GOTO 1000 NN = N1 + IND -1 LENT = LNBLNK(TXTI) WRITE(6,'('' *** Tab found in line. Get rid of it ***'',/,1X,A)') 1 TXTI(1:LENT) IF(NN.GT.1 .AND. NN.LT.LENT) THEN TXTO = TXTI(1:NN-1) // ' ' // TXTI(NN+1:) ELSE IF(NN.GT.1) THEN TXTO = TXTI(1:NN-1) // ' ' ELSE TXTO = ' ' // TXTI(NN+1:) END IF TXTI = TXTO N1 = NN + 8 GOTO 500 1000 CONTINUE C C DON'T MESS AROUND IN VERBATIM C IF(QVERB) RETURN C C If we are in introduction or somewhere special do not do C special character conversion C IF(NMODE.NE.0) GOTO 5000 C DO 2000 I=1,MSPEC N1 = 1 1500 CONTINUE IND = INDEX(TXTI(N1:),TSPEC(I)) IF(IND.EQ.0) GOTO 2000 NN = N1 + IND - 1 IF(NN.GT.1) THEN TXTO = TXTI(1:NN-1) // BSL // TXTI(NN:) ELSE TXTO = BSL // TXTI(NN:) END IF TXTI = TXTO N1 = NN + 2 GOTO 1500 2000 CONTINUE C DO 3000 I=1,MMATH N1 = 1 2500 CONTINUE IND = INDEX(TXTI(N1:),TMATH(I)) IF(IND.EQ.0) GOTO 3000 NN = N1 + IND - 1 IF(NN.GT.1) THEN TXTO = TXTI(1:NN-1) // '$' // TXTI(NN:NN) // '$' // 1 TXTI(NN+1:) ELSE TXTO = '$' // TXTI(NN:NN) // '$' // 1 TXTI(NN+1:) END IF TXTI = TXTO N1 = NN + 3 GOTO 2500 3000 CONTINUE C DO 4000 I=1,MEXTRA N1 = 1 3500 CONTINUE IND = INDEX(TXTI(N1:),TEXTRA(I)) IF(IND.EQ.0) GOTO 4000 NN = N1 + IND - 1 IF(NN.GT.1 .AND. NN.LT.LNBLNK(TXTI)) THEN TXTO = TXTI(1:NN-1) // BSL // TEXTRA(I) // '{ }' // + TXTI(NN+1:) ELSE IF(NN.GT.1) THEN TXTO = TXTI(1:NN-1) // BSL // TEXTRA(I) // '{ }' ELSE TXTO = BSL // TEXTRA(I) // '{ }' // TXTI(NN+1:) END IF TXTI = TXTO N1 = NN + 5 GOTO 3500 4000 CONTINUE C C Replace chi**2 with the proper text C 5000 CONTINUE IND1 = INDEX(TXTI,'chi**2') IND2 = INDEX(TXTI,'Chi**2') IF(IND1.GT.0 .AND. IND2.GT.0) THEN IND = MIN0(IND1,IND2) ELSEIF(IND1.GT.0) THEN IND = IND1 ELSEIF(IND2.GT.0) THEN IND = IND2 ELSE IND = 0 ENDIF LENI = LNBLNK(TXTI) IF(IND.GT.0) THEN IF(TXTI(IND+6:IND+6).EQ.',' .OR. TXTI(IND+6:IND+6).EQ.'.' .OR. + TXTI(IND+6:IND+6).EQ.';' .OR. TXTI(IND+6:IND+6).EQ.':' .OR. + TXTI(IND+6:IND+6).EQ.'!' .OR. TXTI(IND+6:IND+6).EQ.'?')THEN IF(IND.GT.1 .AND. IND+6.LE.LENI) THEN TXTO = TXTI(1:IND-1) // BSL//'chisq ' // TXTI(IND+6:) ELSEIF(IND.GT.1) THEN TXTO = TXTI(1:IND-1) // BSL//'chisq ' ELSEIF(IND+6.LE.LENI) THEN TXTO = BSL//'chisq ' // TXTI(IND+6:) ELSE TXTO = BSL//'chisq ' ENDIF ELSE IF(IND.GT.1 .AND. IND+6.LE.LENI) THEN TXTO = TXTI(1:IND-1) // BSL//'chisq'//BSL//' ' // + TXTI(IND+6:) ELSEIF(IND.GT.1) THEN TXTO = TXTI(1:IND-1) // BSL//'chisq'//BSL//' ' ELSEIF(IND+6.LE.LENI) THEN TXTO = BSL//'chisq'//BSL//' ' // TXTI(IND+6:) ELSE TXTO = BSL//'chisq'//BSL//' ' ENDIF ENDIF TXTI = TXTO GOTO 5000 ENDIF C C Look for ` ' and change the text inside it to \tt C If ` '' is found then chop off one ' and continue C N1 = 1 6000 CONTINUE IND1 = INDEX(TXTI(N1:),'`') IND2 = INDEX(TXTI(N1+IND1:),'''') LENI = LNBLNK(TXTI) IF(IND1.GT.0 .AND. IND2.GT.0) THEN N2 = N1 + IND1 - 1 N3 = N1 + IND1 + IND2 - 1 6100 CONTINUE IF(N3+1.LE.LENI .AND. TXTI(N3+1:N3+1).EQ.'''') THEN TXTO = TXTI(1:N3-1) // TXTI(N3+1:) TXTI = TXTO LENI = LENI - 1 IND2 = INDEX(TXTI(N3+1:),'''') IF(IND2.GT.0) THEN N3 = N3 + IND2 GOTO 6100 ELSE GOTO 6500 ENDIF ENDIF IF(N2.GT.1 .AND. N3+1.LE.LENI) THEN TXTO = TXTI(1:N2-1) // '{'//BSL//'tt ' // + TXTI(N2+1:N3-1) // + '}' // TXTI(N3+1:) ELSEIF(N2.GT.1) THEN TXTO = TXTI(1:N2-1) // '{'//BSL//'tt ' // + TXTI(N2+1:N3-1) // + '}' ELSEIF(N3+1.LE.LENI) THEN TXTO = '{'//BSL//'tt ' // TXTI(N2+1:N3-1) // + '}' // TXTI(N3+1:) ELSE TXTO = '{'//BSL//'tt ' // TXTI(N2+1:N3-1) // + '}' ENDIF TXTI = TXTO N1 = N2 C C Look for \! and replace it by \\! C ind1 = index(txti(n1:),BSL//'!') if(ind1.gt.1) then n3 = n1 + ind1 - 1 if(txti(n3-1:n3-1).ne.BSL) then txto = txti(:n3-1) // BSL // txti(n3:) txti = txto endif endif GOTO 6000 ENDIF 6500 CONTINUE C C Get rid of any $$ which means out of math mode and straight back in C N1 = 1 7000 CONTINUE IND = INDEX(TXTI(N1:),'$$') LENI = LNBLNK(TXTI) IF(IND.GT.0) THEN N2 = N1 + IND - 1 N3 = N1 + IND IF(N2.GT.1 .AND. N3+1.LE.LENI) THEN TXTO = TXTI(1:N2-1) // TXTI(N3+1:) ELSEIF(N2.GT.1) THEN TXTO = TXTI(1:N2-1) ELSEIF(N3+1.LE.LENI) THEN TXTO = TXTI(N3+1:) ELSE TXTO = ' ' ENDIF TXTI = TXTO N1 = N2 GOTO 7000 ENDIF C 9000 CONTINUE END C SUBROUTINE MN_XREF(TXTI) C implicit none C +CDE,MNCHAR. C CHARACTER*(*) TXTI CHARACTER*255 TXTO,TEXT CHARACTER*80 THELP,THLP2,THLPO,TINDX,TIND2 C INTEGER I,N1,N2,N3,NN,NEXTRA,IND,IND1,IND2,N4,N5 INTEGER INDH,indi,LENH,LENHO,LENT,leni INTEGER LNBLNK C N1 = 1 N2 = 1 6400 CONTINUE IF(N1.EQ.1) THEN IND1 = INDEX(TXTI(N1:),'see HELP') IND2 = INDEX(TXTI(N1:),'See HELP') NEXTRA = 9 ELSE IND1 = INDEX(TXTI(N1:),'HELP') IND2 = INDEX(TXTI(N1:),'HELP') NEXTRA = 5 ENDIF IF(IND1.GT.0 .AND. IND2.GT.0) THEN IND = MIN0(IND1,IND2) ELSEIF(IND1.GT.0) THEN IND = IND1 ELSEIF(IND2.GT.0) THEN IND = IND2 ELSE IND = 0 ENDIF IF(IND.GT.0) THEN N2 = N1 + IND - 1 C C Find the help topic name C Require the character after the space to be in lower case to C signal the end of the HELP topic string C Also look for a . or , at the end of the string C Convert the help topic to upper case to agree with the label C N3 = N2 + NEXTRA - 2 6405 CONTINUE LENT = LNBLNK(TXTI) DO 6410 I=N3+2,LENT IF(TXTI(I:I).EQ.' ' .OR. TXTI(I:I).EQ.'.' .OR. + TXTI(I:I).EQ.',' .OR. TXTI(I:I).EQ.')') THEN N3 = I - 1 GOTO 6420 ENDIF 6410 CONTINUE N3 = LNBLNK(TXTI) 6420 CONTINUE IF(N3.LT.LENT+2 .AND. + ICHAR(TXTI(N3+2:N3+2)).GE.ICHAR('A') .AND. + ICHAR(TXTI(N3+2:N3+2)).LE.ICHAR('Z')) THEN GOTO 6405 ENDIF C THELP = TXTI(N2+NEXTRA:N3) THLPO = THELP CALL M_LUPC(THELP,THLP2) THELP = THLP2 C C Replace any blanks in THELP by colons C and check for multiple blanks C 6450 CONTINUE LENH = LNBLNK(THELP) INDH = INDEX(THELP(1:LENH),' ') IF(INDH.GT.0) THEN IF(INDH.GT.1 .AND. THELP(INDH-1:INDH-1).EQ.':') THEN THLP2 = THELP(1:INDH-1) // THELP(INDH+1:) ELSE THLP2 = THELP(1:INDH-1) // ':' // THELP(INDH+1:) ENDIF THELP = THLP2 GOTO 6450 ENDIF C tindx = thlpo leni = lnblnk(tindx) C C Make an index entry also - convert a space to ! C 6500 continue indi = index(tindx(:leni),' ') if(indi.gt.0) then if(indi.gt.1 .and. tindx(indi-1:indi-1).eq.'!') then tind2 = tindx(:indi-1) // tindx(indi+1:) else tind2 = tindx(:indi-1) // '!' // tindx(indi+1:) endif tindx = tind2 goto 6500 endif C C If there is an _ in the title and the next character is an upper case C and the text is not Mn_Fit get rid of the _ C N4 = 1 6510 CONTINUE IND = INDEX(tindx(n4:),BSL//'_') IF(IND.GT.0) THEN N5 = N4 + IND - 1 IF((ICHAR(TINDX(N5+2:N5+2)).GE.ICHAR('A') .AND. + ICHAR(TINDX(N5+2:N5+2)).LE.ICHAR('Z') .AND. + ICHAR(TINDX(N5-1:N5-1)).GE.ICHAR('a') .AND. + ICHAR(TINDX(N5-1:N5-1)).LE.ICHAR('z')) .OR. + (ICHAR(TINDX(N5+2:N5+2)).GE.ICHAR('a') .AND. + ICHAR(TINDX(N5+2:N5+2)).LE.ICHAR('z')) .OR. + (ICHAR(TINDX(N5+2:N5+2)).GE.ICHAR('A') .AND. + ICHAR(TINDX(N5+2:N5+2)).LE.ICHAR('Z') .AND. + ICHAR(TINDX(N5+3:N5+3)).GE.ICHAR('a') .AND. + ICHAR(TINDX(N5+3:N5+3)).LE.ICHAR('z'))) THEN if(tindx(N5-2:N5+4).EQ.'Mn'//BSL//'_Fit' .OR. + tindx(N5-2:N5+4).EQ.'MN'//BSL//'_FIT') THEN ELSE tind2 = tindx(:N5-1) // + ' ' // tindx(N5+2:) tindx = tind2 leni = leni - 1 ENDIF N4 = N5 + 1 IF(N4.LT.LENi) GOTO 6510 ENDIF ENDIF C C Save the title for cross-reference C thlpo = tindx C C Remove any ! from the cross-reference C LENHO = LNBLNK(THLPO) CALL CTRANS('!',' ',thlpo,1,lenho) C C Remove \ from help label C 6520 CONTINUE LENH = LNBLNK(THELP) IND = INDEX(THELP,BSL) IF(IND.GT.0) THEN THLP2 = THELP(1:IND-1) // THELP(IND+1:) THELP = THLP2 GOTO 6520 ENDIF C IF(N1.EQ.1) THEN NN = N2 + 3 ELSE NN = N2 - 1 ENDIF TEXT = TXTI(1:NN) // 'section~'//BSL//'ref{' // + THELP(1:LENH) // '} on page~'//BSL//'pageref{' // + THELP(1:LENH) // '} (' // THLPO(1:LENHO) // ')' // + BSL//'index{' // tindx(:leni) // '}' N1 = LNBLNK(TEXT) IF(N3.LT.LNBLNK(TXTI)) THEN TXTO = TEXT(1:N1) // + TXTI(N3+1:) TXTI = TXTO ELSE TXTI = TEXT ENDIF GOTO 6400 ENDIF C END C SUBROUTINE MN_WRIT(TXTO) C +CDE,MNCHAR. C CHARACTER*(*) TXTO C LENO = MAX0(1,LNBLNK(TXTO)) IF(LENO.LE.80 .or. index(txto(1:leno),BSL//'verb').gt.0) THEN WRITE(10,'(A)') TXTO(1:LENO) ELSEIF(LENO.LE.160) THEN DO 1500 I=80,1,-1 IF(TXTO(I:I).EQ.' ') THEN WRITE(10,'(A)') TXTO(1:I-1) WRITE(10,'(A)') TXTO(I+1:LENO) GOTO 1510 END IF 1500 CONTINUE WRITE(6,'('' No space found in line: '',A)') TXTO(1:LENO) WRITE(10,'(A,''%'')') TXTO(1:80) WRITE(10,'(A)') TXTO(81:LENO) 1510 CONTINUE ELSE DO 1600 I=160,80,-1 IF(TXTO(I:I).EQ.' ') THEN II = I DO 1590 J=80,1,-1 IF(TXTO(J:J).EQ.' ') THEN WRITE(10,'(A)') TXTO(1:J-1) WRITE(10,'(A)') TXTO(J+1:II-1) WRITE(10,'(A)') TXTO(II+1:LENO) GOTO 1610 END IF 1590 CONTINUE END IF 1600 CONTINUE WRITE(6,'('' No space found in line: '',A)') TXTO(1:LENO) WRITE(10,'(A,''%'')') TXTO(1:80) WRITE(10,'(A,''%'')') TXTO(81:160) WRITE(10,'(A)') TXTO(161:LENO) 1610 CONTINUE END IF C END C SUBROUTINE MN_COMMENT(TXTI,QVERB,QIGNORE,QNOSWITCH,IERR) C C Look for a ! in the first column C +CDE,MNCHAR. C CHARACTER*(*) TXTI LOGICAL QVERB,QIGNORE,QNOSWITCH INTEGER IERR C CHARACTER*255 TXTL INTEGER LENL,LNBLNK C IERR = 0 IF(TXTI.EQ.' ') GOTO 9900 C IF(TXTI(1:1).EQ.'!') THEN IF(TXTI(2:2).EQ.' ' .OR. TXTI(2:2).EQ.TAB) THEN GOTO 9100 ELSEIF(TXTI(2:2).EQ.'=') THEN IF(QVERB) THEN QNOSWITCH = .TRUE. GOTO 9100 ELSE LENL = LNBLNK(TXTL) LENL = MAX0(1,MIN0(LENL,60)) WRITE(6,'('' Found a != while not in verbatim'' + ,/,'' Previous text: '',A)') + TXTL(1:LENL) GOTO 9100 ENDIF ELSEIF(TXTI(2:2).EQ.'^') THEN QIGNORE = .TRUE. GOTO 9100 ELSE CALL MN_WRIT(TXTI(2:)) GOTO 9100 ENDIF ENDIF GOTO 9900 C 9100 CONTINUE IERR = 1 9900 CONTINUE TXTL = TXTI END C SUBROUTINE MN_MENU(NMODE,NUNIT,IERR,TXTI) C C Makes a menu list. C End of the menu is triggered by a blank line. C RETURN is triggered by new command in mode 0. C RETURN is triggered by blank line in mode 1 C NMODE = 0 is normal menu 3.6cm wide C NMODE = 1 is changes list 4.0cm wide C +CDE,MNCHAR. C INTEGER NUNIT,IERR CHARACTER*(*) TXTI LOGICAL QDESC,QVERB,QIGNORE,QNOSWITCH CHARACTER*255 TXTO,TEXT CHARACTER*50 COMAND CHARACTER*5 TWID1,TWID2 C IF(NMODE.EQ.0) THEN TWID1 = '3.6cm' TWID2 = '3.2cm' ELSE TWID1 = '4.0cm' TWID2 = '3.6cm' ENDIF C CALL MN_WRIT(BSL//'begin{menu}{' // TWID1 // '}{' // TWID2 // '}') QDESC = .TRUE. QVERB = .FALSE. QIGNORE = .FALSE. QNOSWITCH = .FALSE. NREC = 0 3300 CONTINUE CALL MN_READ(NUNIT,TXTI,IERR) IF(IERR.EQ.2) GOTO 9100 CALL MN_COMMENT(TXTI,QVERB,QIGNORE,QNOSWITCH,IERR) IF(IERR.NE.0) GOTO 3300 CALL MN_INTERP(TXTI,QVERB,0) C C Convert "see HELP ..." into see section nn (...) C CALL MN_XREF(TXTI) C NREC = NREC + 1 C IF(QDESC .AND. NREC.GT.1 .AND. TXTI.EQ.' ') THEN CALL MN_WRIT(BSL//'end{menu}') QDESC = .FALSE. IF(NMODE.EQ.0) THEN GOTO 3300 ELSE GOTO 9900 ENDIF ELSE IF(TXTI(1:1).NE.' ' .AND. TXTI(1:1).NE.TAB) THEN IF(QDESC) THEN CALL MN_WRIT(BSL//'end{menu}') QDESC = .FALSE. END IF GOTO 9900 END IF C IF(QDESC) THEN IF(TXTI(1:5).EQ.' ') THEN IF(NREC.GT.1) THEN LENO = MAX0(1,LNBLNK(TXTI)) CALL MN_WRIT(TXTI(1:LENO)) else nrec = 0 END IF ELSE CALL QUOTYP(TXTI) IF(NMODE.EQ.0) THEN NCH = ISTTYP(.TRUE.,IDELIM,COMAND) IF(IDELIM.EQ.0) THEN ISTR = ISTRNG(.TRUE.,TEXT,LENO) ELSE TEXT = ' ' END IF ELSE ISTR = ISTRNG(.TRUE.,TXTO,LENO) IND = INDEX(TXTO(1:LENO),' ') IF(IND.LE.0) THEN LENI = MAX0(1,LNBLNK(TXTI)) WRITE(6 + ,'('' Error in command description: '')') WRITE(6,*) TXTI(1:LENI) GOTO 3300 ENDIF COMAND = TXTO(1:IND-1) CALL QUOTYP(TXTO(IND+2:)) ISTR = ISTRNG(.TRUE.,TEXT,LENO) ENDIF LENO = MAX0(1,LNBLNK(TEXT)) LENS = LNBLNK(COMAND) C WRITE(TXTO,'(A,''item['',A,''bf '',A,A,''hfill] '',A)') C 1 BSL,BSL,COMAND(1:LENS),BSL,TEXT(1:LENO) WRITE(TXTO,'(A,''item['',A,''] '',A)') 1 BSL,COMAND(1:LENS),TEXT(1:LENO) CALL MN_WRIT(TXTO) END IF ELSE LENO = MAX0(1,LNBLNK(TXTI)) CALL MN_WRIT(TXTI) IF(TXTI(LENO:LENO).EQ.':') THEN CALL MN_WRIT(BSL//'begin{menu}{' // TWID1 // '}{' // + TWID2 // + '}') QDESC = .TRUE. NREC = 0 ENDIF ENDIF GOTO 3300 C 9100 CONTINUE WRITE(6,'('' *** Illegal error on read:'',I4)') C 9900 CONTINUE END C SUBROUTINE MN_ITEM(NMODE,NUNIT,IERR,TXTI) C C Makes a item list. Each item is triggered by a blank line. C End of the item list is triggered by a line with +++ as first non-blank C characters. C +CDE,MNCHAR. C INTEGER NUNIT,IERR CHARACTER*(*) TXTI LOGICAL QITEM,QVERB,QIGNORE,QNOSWITCH CHARACTER*255 TEXT C IERR = 0 CALL MN_WRIT(BSL//'begin{itemize}') QITEM = .TRUE. QVERB = .FALSE. QIGNORE = .FALSE. QNOSWITCH = .FALSE. NREC = 0 3300 CONTINUE CALL MN_READ(NUNIT,TXTI,IERR) IF(IERR.EQ.2) GOTO 9900 IF(TXTI(1:1).GE.'1' .AND. TXTI(1:1).LE.'9') THEN CALL MN_WRIT(BSL//'end{itemize}') CALL MN_INTERP(TXTI,QVERB,0) GOTO 9900 ENDIF C IF(.NOT.QITEM) THEN QITEM = TXTI.EQ.' ' IF(QITEM) GOTO 3300 C C Ignore blank lines if waiting to start an item C ELSE IF(TXTI.EQ.' ') GOTO 3300 ENDIF C IF(QITEM) THEN CALL QUOTYP(TXTI) NCHAR = ISTTYP(.TRUE.,IDELIM,TEXT) IF(NCHAR.GE.3 .AND. TEXT(1:3).EQ.'+++') THEN CALL MN_WRIT(BSL//'end{itemize}') CALL MN_INTERP(TXTI,QVERB,0) GOTO 9900 ENDIF CALL MN_WRIT(BSL//'item') QITEM = .FALSE. ENDIF C CALL MN_COMMENT(TXTI,QVERB,QIGNORE,QNOSWITCH,IERR) IF(IERR.NE.0) GOTO 3300 CALL MN_INTERP(TXTI,QVERB,0) C C Convert "see HELP ..." into see section nn (...) C CALL MN_XREF(TXTI) C LENO = MAX0(1,LNBLNK(TXTI)) CALL MN_WRIT(TXTI(1:LENO)) GOTO 3300 C 9900 CONTINUE END C SUBROUTINE MN_CHANGES C C Writes out the changes in Mn_Fit since the given version. C New title must start with +++ to be recognized. C For now no special processing goes on in here except for C cross-references. C +CDE,MNCHAR. C CHARACTER*255 TXTI,TXTO CHARACTER*50 COMAND CHARACTER*10 TVERS,TVERS2 character*10 TDATE LOGICAL QVERB,QIGNORE,QNOSWITCH,QMENU C IERR = 0 REWIND 2 NUNIT = 2 QVERB = .FALSE. QIGNORE = .FALSE. QNOSWITCH = .FALSE. 1000 CONTINUE CALL MN_READ(NUNIT,TXTI,IERR) IF(IERR.EQ.2) GOTO 9900 CALL MN_INTERP(TXTI,QVERB,0) IF(TXTI(1:1).EQ.' ' .OR. TXTI(1:1).EQ.TAB) GOTO 1000 CALL QUOTYP(TXTI) LEVEL = INTTYP(.TRUE.,IDELIM) NCH = ISTTYP(.TRUE.,IDELIM,COMAND) IF(COMAND.NE.'CHANGES') GOTO 1000 C CALL MN_WRIT(' ') CALL MN_WRIT(BSL//'chapter{List of Changes}') CALL MN_WRIT(BSL//'label{APPENDIX:CHANGES}') C C Write out the changes text until the next header is found C QIGNORE = .FALSE. CALL MN_MEAT(0,NUNIT,QIGNORE,IERR,TXTI) IF(IERR.EQ.2) GOTO 9900 C C Got the next header. Interpret it. C 3000 CONTINUE CALL QUOTYP(TXTI) LEVEL = INTTYP(.TRUE.,IDELIM) NCHV = ISTTYP(.TRUE.,IDELIM,TVERS) NCHD = ISTTYP(.TRUE.,IDELIM,TDATE) C C Make a nice version number C IND = INDEX(TVERS(1:NCHV),BSL//'_') if(tvers(ind+6:ind+7).eq.' ') then TVERS2 = TVERS(2:IND-1) // '.' // TVERS(IND+2:IND+3) else TVERS2 = TVERS(2:IND-1) // '.' // TVERS(IND+2:IND+3) // + '/' // TVERS(IND+6:IND+7) endif C C Ignore all changes before Version 4.01 C IF(TVERS(1:6).LT.'V4'//BSL//'_01') THEN C IF(TVERS(1:2).LT.'V3') THEN C IF(TVERS(1:6).LT.'V2'//BSL//'_05') THEN 3100 CONTINUE CALL MN_READ(NUNIT,TXTI,IERR) IF(IERR.EQ.2) GOTO 9900 IF(TXTI(1:1).GT.'1' .AND. TXTI(1:1).LT.'9') THEN CALL MN_INTERP(TXTI,QVERB,0) GOTO 3000 ELSE GOTO 3100 ENDIF ENDIF C C Got a changes section I want to write out C TXTO = BSL//'section{Version ' // TVERS2 // ' ' // + TDATE(1:NCHD) // '}' CALL MN_WRIT(TXTO) C C Process the text normally up to the next heading that starts with +++ C QIGNORE = .FALSE. CALL MN_MEAT(1,NUNIT,QIGNORE,IERR,TXTI) IF(IERR.EQ.2) GOTO 9900 C C Process the title and then go to item or menu subroutine C 4000 CONTINUE QMENU = .FALSE. QVERB = .FALSE. LENI = LNBLNK(TXTI) C C Get rid of the +++ C IND = INDEX(TXTI(1:LENI),'$+++$') IF(IND.GT.0) THEN N1 = IND + 5 ELSE N1 = 1 ENDIF TXTO = BSL//'subsection*{' // TXTI(N1:LENI) // '}' CALL MN_WRIT(TXTO) C C If this is the new or modified commands topic treat it as a menu C Read in the _____ line C QMENU = INDEX(TXTI,'Command').GT.0 CALL MN_READ(NUNIT,TXTI,IERR) IF(QMENU) THEN CALL MN_MENU(1,NUNIT,IERR,TXTI) ELSE CALL MN_ITEM(0,NUNIT,IERR,TXTI) ENDIF IF(IERR.NE.0) GOTO 9900 C C Keep reading until a non-blank line is found C 4500 CONTINUE IF(TXTI.EQ.' ') THEN CALL MN_READ(NUNIT,TXTI,IERR) IF(IERR.EQ.2) GOTO 9900 CALL MN_INTERP(TXTI,QVERB,0) GOTO 4500 ENDIF IF(TXTI(1:1).GE.'1' .AND. TXTI(1:1).LE.'9') GOTO 3000 GOTO 4000 C 9900 CONTINUE END C SUBROUTINE MN_MEAT(NMODE,NUNIT,QIGNORE,IERR,TXTI) C C Interprets the meat of a help section. C End is triggered by end of file or by a new help section. C For mode=1 end is triggered by text starting with +++ C +CDE,MNCHAR. C INTEGER NUNIT,IERR LOGICAL QIGNORE CHARACTER*(*) TXTI C LOGICAL QVERB,QNOSWITCH CHARACTER*255 TEXT C IERR = 0 QVERB = .FALSE. qnoswitch = .false. 6300 CONTINUE TXTI = ' ' CALL MN_READ(NUNIT,TXTI,IERR) IF(IERR.EQ.2) GOTO 9900 IF(QIGNORE) THEN QIGNORE = .FALSE. GOTO 6300 ENDIF C CALL MN_COMMENT(TXTI,QVERB,QIGNORE,QNOSWITCH,IERR) IF(IERR.NE.0) GOTO 6300 C CALL MN_INTERP(TXTI,QVERB,0) IF(TXTI(1:1).NE.' ' .AND. TXTI(1:1).NE.TAB) GOTO 9900 C C If mode=1 see if first non-blank characters are $+++$ C IF(NMODE.EQ.1) THEN CALL QUOTYP(TXTI) NCHAR = ISTTYP(.TRUE.,IDELIM,TEXT) IF(TEXT(1:5).EQ.'$+++$') GOTO 9900 ENDIF C NREC= NREC + 1 if(QVERB .AND. TXTI.EQ.' ') THEN IF(QNOSWITCH) THEN CALL MN_WRIT(' ') QNOSWITCH = .FALSE. ELSEIF(NREC.GT.1) THEN CALL MN_WRIT(BSL//'end{verbatim}}') CALL MN_WRIT(BSL//'par'//BSL//'noindent') QVERB = .FALSE. END IF GOTO 6300 END IF C C Convert "see HELP ..." into see section nn (...) C CALL MN_XREF(TXTI) C LENO = MAX0(1,LNBLNK(TXTI)) CALL MN_WRIT(TXTI) IF(.NOT.QVERB .AND. LENO.GT.0 .AND. TXTI(LENO:LENO).EQ.':') THEN CALL MN_WRIT(' ') CALL MN_WRIT('{'//BSL//'small') CALL MN_WRIT(BSL//'begin{verbatim}') QVERB = .TRUE. NREC = 0 END IF GOTO 6300 C 9900 CONTINUE END C SUBROUTINE MN_DEMO(TVERS) C C All typeout is done in verbatim and user typin is underlined. C Writes out the Mn_Fit demo macros and the commands for the C resultant pictures in a nice format. C The prompt is recognized by ending in '> ' and being at position < 20 C Otherwise 'Give' followed by ': ' is searched for. C User typin follows a prompt until a ! is found that is not inside single C or double quotation marks. C +CDE,MNDIR. +CDE,MNCHAR. C CHARACTER*(*) TVERS C CHARACTER*255 TXTI,TXTO,TEXT CHARACTER*80 TPRMPT,TTYPIN,TCOMM CHARACTER*60 TFILE CHARACTER*6 TDFILE CHARACTER*1 TQUOTE(2) C INTEGER MDEMO PARAMETER (MDEMO = 7) *ICB PARAMETER (MDEMO = 6) C CHARACTER*60 TDEMO(MDEMO) LOGICAL QVERB C DATA TDEMO/ + 'Simple Fetch and Plot' + ,'Simple Gaussian Fit' + ,'Plotting with overlays, inserts, colours and fonts' + ,'Different ways of displaying 2-D histograms' + ,'Simultaneous fit of 2 plots with function overlays' + ,'Drawing Possibilities' + ,'Display of an L3 Luminosity Monitor Event' + / DATA TQUOTE/'''','"'/ C LENV = LNBLNK(TVERS) LENH = LNBLNK(TMNHLP) LEND = LNBLNK(TMNDOC) C C Write out the examples introduction C nunit = 31 IF(TVERS.EQ.' ') THEN TFILE = TMNDOC(1:LEND) // 'mn_demos.tex' ELSE LENV = LNBLNK(TVERS) TFILE = TMNDOC(1:LEND) // 'mn_demos' // '_' // + TVERS(1:LENV) // '.tex' ENDIF OPEN(UNIT=NUNIT,FILE=TFILE,STATUS='OLD',FORM='FORMATTED') C 1000 CONTINUE C CALL MN_READ(NUNIT,TXTI,IERR) if(ierr.eq.2) goto 1500 CALL MN_INTERP(TXTI,QVERB,1) CALL MN_WRIT(TXTI) goto 1000 1500 continue CLOSE(UNIT=NUNIT) C C Set up the figure sizes C c CALL MN_WRIT(BSL//'newlength{'//BSL//'epsfxsave}') c CALL MN_WRIT(BSL//'setlength{'// * BSL//'epsfxsave}{'//BSL//'epsfxsize}') c CALL MN_WRIT(BSL//'setlength{'// * BSL//epsfxsize}{'//BSL//'textwidth}') C NUNIT = 32 QVERB = .FALSE. DO 5000 NDEMO = 1,MDEMO WRITE(TDFILE,'(''demo'',I2.2)') NDEMO IF(TVERS.EQ.' ') THEN TFILE = TMNHLP(1:LENH) // 'demo_log/' // TDFILE // '.log' ELSE TFILE = TMNHLP(1:LENH) // 'demo_log/' // TDFILE // '_' // + TVERS(1:LENV) // '.log' ENDIF OPEN(UNIT=NUNIT,FILE=TFILE,STATUS='OLD',FORM='FORMATTED') C CALL MN_WRIT(BSL//'clearpage') LDEMO = LNBLNK(TDEMO(NDEMO)) WRITE(TXTO,'(A,''section{Demo '',I2,'': '' + ,A,''}'')') BSL,NDEMO,TDEMO(NDEMO)(1:LDEMO) CALL MN_WRIT(TXTO) CALL MN_WRIT(BSL//'begin{tabbing}') C Define the tab stop CALL MN_WRIT('ABCDEFGHIJKLMNOPQRSTUVWXY '// + BSL//'= '//BSL//'kill') C 2000 CONTINUE CALL MN_READ(NUNIT,TXTI,IERR) IF(IERR.EQ.2) GOTO 4500 IF(TXTI.EQ.' ') GOTO 2000 LENI = LNBLNK(TXTI) C C Look for the prompt. C Next version of Mn_Fit will use ## to signal the end of the prompt C so no gymnastics will be needed. C INDX = 0 TPRMPT = ' ' IND = INDEX(TXTI,'##') IF(IND.GT.0) THEN TPRMPT = TXTI(1:IND-1) INDX = IND + 2 ENDIF LPRMPT = LNBLNK(TPRMPT) C C Get the user typin if there is a prompt C IF(LPRMPT.GT.0) THEN C C Look for a ! that is not inside '' or "" C N1 = INDX 3000 CONTINUE IND1 = INDEX(TXTI(N1:),'!') IF(IND1.GT.0) THEN N2 = N1 + IND1 - 1 C C Count the number of single and double quotes before the ! C NQUOTE = 0 DO 4000 I=1,2 N3 = INDX 3500 CONTINUE IND = INDEX(TXTI(N3:),TQUOTE(I)) IF(IND.LE.0) GOTO 3600 N4 = N3 + IND - 1 IF(N4.GT.N2) GOTO 3600 NQUOTE = NQUOTE + 1 3600 CONTINUE IF(MOD(NQUOTE,2).EQ.1) THEN N1 = N2 + 1 GOTO 3000 ENDIF 4000 CONTINUE C C Found an ! not inside quotes C IF(N2.GT.INDX) THEN TTYPIN = TXTI(INDX:N2-1) ELSE TTYPIN = ' ' ENDIF TCOMM = TXTI(N2:) ELSE TTYPIN = TXTI(INDX:) TCOMM = ' ' ENDIF C C Make and write out the line C CALL MN_INTERP(TPRMPT,QVERB,0) CALL MN_INTERP(TTYPIN,QVERB,0) CALL MN_INTERP(TCOMM,QVERB,0) LPRMPT = LNBLNK(TPRMPT) LTYPIN = LNBLNK(TTYPIN) LCOMM = LNBLNK(TCOMM) C TXTO = BSL//'bf ' // TPRMPT(1:LPRMPT) LENO = LPRMPT + 4 IF(LTYPIN.GT.0) THEN TXTO(LENO+1:) = ' '//BSL//'underline{'//BSL//'tt ' // + TTYPIN(1:LTYPIN) // '}' LENO = LENO + LTYPIN + 17 ENDIF C C If the prompt + typin is too long, move the comment to the C line before. C IF(LCOMM.GT.0) THEN IF(LENO.GT.60) THEN TEXT = BSL//'bf ' // TPRMPT(1:LPRMPT) // + ' {'//BSL//'it ' // TCOMM(1:LCOMM) // '}'// + BSL // BSL CALL MN_WRIT(TEXT) TXTO(LENO+1:) = BSL // BSL ELSEIF(LTYPIN.GT.0) THEN TXTO(LENO+1:) = ' '//BSL//'> {'// + BSL//'it ' // TCOMM(1:LCOMM) // + '}' // BSL // BSL ELSE TXTO(LENO+1:) = ' {'//BSL//'it ' // TCOMM(1:LCOMM) // + '}' // BSL // BSL ENDIF ELSE TXTO(LENO+1:) = BSL // BSL ENDIF CALL MN_WRIT(TXTO) C C See if line is a comment line C ELSEIF(TXTI(1:1).EQ.'!' .OR. TXTI(1:2).EQ.' !') THEN TCOMM = TXTI CALL MN_INTERP(TCOMM,QVERB,0) LCOMM = LNBLNK(TCOMM) TXTO = '{'//BSL//'it ' // TCOMM(1:LCOMM) // '}' // + BSL // BSL C C Just dump the complete line ELSE CICB CALL QUOTYP(TXTI(1:LENI)) CICB ISTR = ISTRNG(.TRUE.,TEXT,LENT) TXTO = '{'//BSL//'small'//BSL//'verb`' // TXTI(1:LENI) // + '`}' // BSL // BSL CALL MN_WRIT(TXTO) ENDIF GOTO 2000 C C Clean up and put in the commands for the picture C Reduce the picture size to the text width C Demo05 has a 2 page picture C 4500 CONTINUE CLOSE(UNIT=NUNIT) CALL MN_WRIT(BSL//'end{tabbing}') CALL MN_WRIT(BSL//'begin{figure}[p]') CALL MN_WRIT(BSL//'begin{center}') IF(NDEMO.EQ.5) THEN CALL MN_WRIT(BSL//'includegraphics[height=18cm]{' // + TDFILE // 'a}') CALL MN_WRIT(BSL//'end{center}') CALL MN_WRIT(BSL//'end{figure}') CALL MN_WRIT(BSL//'begin{figure}[hbp]') CALL MN_WRIT(BSL//'begin{center}') CALL MN_WRIT(BSL//'includegraphics[height=18cm]{' // + TDFILE // 'b}') ELSEIF(NDEMO.EQ.6) THEN CALL MN_WRIT(BSL//'includegraphics[height=15cm]{' // + TDFILE // '}') ELSEIF(NDEMO.EQ.2 .or. ndemo.eq.7) THEN CALL MN_WRIT(BSL//'includegraphics[height=18cm]{' // + TDFILE // '}') ELSE CALL MN_WRIT(BSL//'includegraphics[height=16cm]{' // + TDFILE // '}') ENDIF WRITE(TXTO,'(A,''caption{Demo '',I2,'' --- '' + ,A,''.}'')') BSL,NDEMO,TDEMO(NDEMO)(1:LDEMO) CALL MN_WRIT(TXTO) WRITE(TXTO,'(A,''label{fig:demo'',I2.2,''}'')') BSL,NDEMO CALL MN_WRIT(TXTO) CALL MN_WRIT(BSL//'end{center}') CALL MN_WRIT(BSL//'end{figure}') 5000 CONTINUE C 9900 CONTINUE END +DECK,TEK_SWITCH. PROGRAM TEK_SWITCH C CHARACTER SP/' '/,TWO/'2'/,GS,ESC GS = CHAR(29) ESC = CHAR(27) C C REAL TEKTRONIX C OPEN(UNIT=1,FILE='TEK_INIT_TEK.DAT',FORM='FORMATTED' 1 ,ACCESS='SEQUENTIAL',STATUS='new',carriagecontrol='LIST') CLOSE(UNIT=1) OPEN(UNIT=1,FILE='TEK_LEAVE_TEK.DAT',FORM='FORMATTED' 1 ,ACCESS='SEQUENTIAL',STATUS='new',carriagecontrol='LIST') CLOSE(UNIT=1) C C VERSATERM TEK EMULATION C OPEN(UNIT=1,FILE='TEK_INIT_VERSATERM.DAT',FORM='FORMATTED' 1 ,ACCESS='SEQUENTIAL',STATUS='new',carriagecontrol='LIST') WRITE(1,'(A2)') SP // GS CLOSE(UNIT=1) OPEN(UNIT=1,FILE='TEK_LEAVE_VERSATERM.DAT',FORM='FORMATTED' 1 ,ACCESS='SEQUENTIAL',STATUS='new',carriagecontrol='LIST') WRITE(1,'(A3)') SP // ESC // TWO CLOSE(UNIT=1) C C LN03 PRINTER TEK EMULATION C OPEN(UNIT=1,FILE='TEK_INIT_LN03.DAT',FORM='FORMATTED' 1 ,ACCESS='SEQUENTIAL',STATUS='new',carriagecontrol='LIST') WRITE(1,'(A6)') ESC // '[?38h' CLOSE(UNIT=1) OPEN(UNIT=1,FILE='TEK_LEAVE_LN03.DAT',FORM='FORMATTED' 1 ,ACCESS='SEQUENTIAL',STATUS='new',carriagecontrol='LIST') WRITE(1,'(A6)') ESC // '[?38l' CLOSE(UNIT=1) C C Falco and Pericom Terminals C OPEN(UNIT=1,FILE='TEK_INIT_FALCO.DAT',FORM='FORMATTED' 1 ,ACCESS='SEQUENTIAL',STATUS='new',carriagecontrol='LIST') WRITE(1,'(A6)') ESC // '[?38h' CLOSE(UNIT=1) OPEN(UNIT=1,FILE='TEK_LEAVE_FALCO.DAT',FORM='FORMATTED' 1 ,ACCESS='SEQUENTIAL',STATUS='new',carriagecontrol='LIST') WRITE(1,'(A6)') ESC // '[?38l' CLOSE(UNIT=1) C STOP END +PATCH,$KUMACS,T=TEXT. +DECK,cgr_minuit. * * Collection of KUIP macros for cgr_minuit code * macro cgr_minuit * message '*** You must give the macro name' * return * ******************************************************************************* macro makelib ******************************************************************************* * file cgr_minuit -r * seq . seq //cgr_minuit/mincde * cd //cgr_minuit +SELF,IF=UNIX. set a_mn_fit_lib//fsub/* -f set a_mn_fit_lib//libcgr_minuit.a -l +SELF,IF=-UNIX. set a_mn_fit_lib//cgr_minuit -f set a_mn_fit_lib//cgr_minuit -l +SELF. cfl minuit * cd //mn_fit exec mn_macro#fort_deb exec mn_macro#mn_seq exec mn_macro#mn_set * return +DECK,cmzlogon. +SELF,IF=94A. macro cmzlogon 1='94a' 2='NULL' +SELF,IF=94B. macro cmzlogon 1='94b' 2='NULL' +SELF,IF=95A. macro cmzlogon 1='95a' 2='NULL' +SELF,IF=96A. macro cmzlogon 1='96a' 2='NULL' +SELF,IF=97A. macro cmzlogon 1='97a' 2='NULL' +SELF,IF=98. macro cmzlogon 1='98' 2='NULL' +SELF,IF=99. macro cmzlogon 1='99' 2='NULL' +SELF,IF=2000. macro cmzlogon 1='2000' 2='NULL' +SELF,IF=00. macro cmzlogon 1='00' 2='NULL' +SELF,IF=-94A,IF=-94B,IF=-95A,IF=-96A,IF=-97A,IF=-98,IF=-99,IF=-2000,IF=-00. macro cmzlogon 1='2000' 2='NULL' +SELF. * * Logon file for Mn_Fit code development * AUTHOR 'Ian C. Brock' * +SELF,IF=VMS,IF=l3,CMU. SET/HOST_EDITOR edf +SELF,IF=VMS,IF=-l3,IF=-CMU. SET/HOST_EDITOR edit/tpu +SELF,IF=UNIX,IF=L3,BONNCIP,ZEUS,CERNAFS,DESYAFS. SET/HOST_EDITOR 'emacsclient &' +SELF,IF=UNIX,IF=L3,BONN,BONNCIP,ZEUS,CERNAFS,DESYAFS. * * Some editing commands to get the file type correct * alias/create fe 'set cmedt.f -e ; edit' C alias/create ce 'set cmedt.c -e ; edit' C alias/create te 'set cmedt.txt -e ; edit' C +SELF. * +SELF,IF=UNIX. *filecase keep +SELF. * file mn_fit file mn_util * cd //mn_fit * select . +SELF,IF=VMS. exec mn_macro#mn_alias VMS select vms +SELF,IF=UNIX,IF=-APOLLO. exec mn_macro#mn_alias UNIX select unix +SELF,IF=APOLLO. cpu = 'm68k' if [2] <> 'NULL' goto cpu_given message 'Give cpu type [*m68k/a88k]' read cpu goto set_alias cpu_given: cpu = [2] goto set_alias set_alias: message cpu = [cpu] exec mn_macro#mn_alias APOLLO [cpu] +SELF. select $machine * +SELF,IF=l3. select l3 @SITE +SELF,IF=BONNCIP. select BONNCIP @SITE +SELF,IF=BONN. select BONN @SITE +SELF,IF=CERNAFS. select CERNAFS @SITE +SELF,IF=DESYAFS. select DESYAFS @SITE +SELF,IF=ZEUS. select ZEUS @SITE +SELF,IF=CLEO. select CLEO @SITE +SELF,IF=ALEPH. select ALEPH @SITE +SELF,IF=FNAL. select FNAL @SITE +SELF,IF=CMU. select CMU @SITE +SELF. sel HIGZ X11 +SELF,IF=@CERNLIB. sel @CERNLIB +SELF,IF=@CERNNEW. sel @CERNNEW +SELF,IF=@CERNOLD. sel @CERNOLD +SELF,IF=NAGLIB. sel NAGLIB +SELF,IF=IMSL. sel IMSL +SELF,IF=@DBG. sel @dbg +SELF,IF=@GCC. sel @gcc +SELF,IF=@DEV. sel @dev +SELF,IF=L3DSP. sel l3dsp +SELF,IF=ZEUSDSP. sel zeusdsp +SELF. * * Cernlib version * alias/create a_cernlib [1] sel v93 [1] sel * * exec mn_macro#mn_seq exec mn_macro#fort_deb exec mn_macro#mn_set set * MESSAGE ' ' MESSAGE ' *** This is the Mn_Fit Code Area ***' message ' *** This machine is '//$machine//' running '//$os message ' *** Setup to use Cernlib version '//a_cernlib MESSAGE ' ' +DECK,dbase. * * Collection of KUIP macros for database manipulation * macro dbase * message '*** You must give the macro name' * return * ******************************************************************************* macro makelib ******************************************************************************* * file dbase -r cd //dbase * seq . seq //dbase/cdes * set a_mn_fit_lib//dbase -f +SELF,IF=UNIX. set a_mn_fit_lib//libdbase.a -l +SELF,IF=-UNIX. set a_mn_fit_lib//dbase -l +SELF. * cfl inspect util * cd //mn_fit exec mn_macro#fort_deb exec mn_macro#mn_seq exec mn_macro#mn_set * return +DECK,l3_dsp,if=l3dsp. * * Collection of KUIP macros for L3 online detector displays * macro l3_dsp * message '*** You must give the macro name' * return * ******************************************************************************* macro makelib ******************************************************************************* * file l3_dsp -r * exec mn_macro#fort_opt * * Make sure sequences are OK * sel l3dsp_src * exec l3_dsp#flum_lib exec l3_dsp#ecal_lib exec l3_dsp#tech_lib * cd //mn_fit exec mn_macro#fort_deb * exec mn_macro#mn_set * return * ******************************************************************************* macro flum_lib ******************************************************************************* * * Luminosity Monitor code * * seq . seq //mn_fit/mncde * +SELF,IF=VMS. file flcode:fll3vdev -r seq //fll3vdev/flcdes rel fll3vdev +SELF,IF=APOLLO. file /l3/cmz/fll3v181 -r seq //fll3v181/flcdes rel fll3v181 +SELF,IF=HPUX,SGI. file /l3/v182/cmz/fll3 -r seq //fll3/flcdes rel fll3 +SELF. seq //l3_dsp/flumcde * * cd //l3_dsp set a_mn_fit_lib//fl_dsp -f +SELF,IF=UNIX. set a_mn_fit_lib//libl3_dsp.a -l +SELF,IF=-UNIX. set a_mn_fit_lib//l3_dsp -l +SELF. set cfl flum * exec mn_macro#mn_seq exec mn_macro#mn_set * return * ******************************************************************************* macro ecal_lib ******************************************************************************* * * Electromagnetic calorimeter code * seq . seq //mn_fit/mncde seq //l3_dsp/ecalcde * cd //l3_dsp set a_mn_fit_lib//ec_dsp -f +SELF,IF=UNIX. set a_mn_fit_lib//libl3_dsp.a -l +SELF,IF=-UNIX. set a_mn_fit_lib//l3_dsp -l +SELF. set cfl ecal * exec mn_macro#mn_seq exec mn_macro#mn_set * return * ******************************************************************************* macro tech_lib ******************************************************************************* * * TEC code * seq . seq //mn_fit/mncde seq //l3_dsp/techcde * cd //l3_dsp set a_mn_fit_lib//te_dsp -f +SELF,IF=UNIX. set a_mn_fit_lib//libl3_dsp.a -l +SELF,IF=-UNIX. set a_mn_fit_lib//l3_dsp -l +SELF. set cfl tech * exec mn_macro#mn_seq exec mn_macro#mn_set * return +DECK,MAKECAR. macro makecar * * Makes the car files - history removed to help patchy! * Use ctoy to get cmz sequences expanded. * cd //mn_fit ctoy mn_fit.car -h * cd //mn_util ctoy mn_util.car -h * file typscn -r cd //typscn ctoy typscn.car -h * file cgr_minuit -r cd //cgr_minuit ctoy cgr_minuit.car -h * file dbase -r cd //dbase ctoy dbase.car -h * file l3_dsp -r cd //l3_dsp ctoy l3_dsp.car -h * file zeus_dsp -r cd //zeus_dsp ctoy zeus_dsp.car -h * cd //mn_fit * return +DECK,makeinstall. macro makeinstall * * Makes the install files for all machines * message 'This macro starts everything from scratch' * release * select . seq . * file mn_util cd //mn_util * * VMS * select vms if $OS='VMS' then set MN_FIT_ROOT:install.vms -f text else set $MN_FIT/install.vms -f text endif ctot -y exec/install select . * * L3 VMS with display * select vms l3dsp if $OS='VMS' then set MN_FIT_ROOT:install.l3vms -f text else set $MN_FIT/install.l3vms -f text endif ctot -y exec/install select . * * ZEUS VMS with display * select vms zeusdsp if $OS='VMS' then set MN_FIT_ROOT:install.zeusvms -f text else set $MN_FIT/install.zeusvms -f text endif ctot -y exec/install select . * * Unix * select unix if $OS='VMS' then set MN_FIT_ROOT:install.unix -f text else set $MN_FIT/install.unix -f text endif ctot -y exec/install select . * * L3 Unix with display * select unix l3dsp if $OS='VMS' then set MN_FIT_ROOT:install.l3unix -f text else set $MN_FIT/install.l3unix -f text endif ctot -y exec/install select . * * ZEUS Unix with display * select unix zeusdsp if $OS='VMS' then set MN_FIT_ROOT:install.zeusunix -f text else set $MN_FIT/install.zeusunix -f text endif ctot -y exec/install select . * if $OS='UNIX' then shell chmod a+x $MN_FIT/install.vms shell chmod a+x $MN_FIT/install.l3vms shell chmod a+x $MN_FIT/install.zeusvms shell chmod a+x $MN_FIT/install.unix shell chmod a+x $MN_FIT/install.l3unix shell chmod a+x $MN_FIT/install.zeusunix endif * end: rel * select . seq . message 'Exec cmzlogon again to get the default setup back' return +DECK,makerel. macro makerel 1='407' * * Makes all the file needed for a Mn_Fit release * message Making release notes file for version: [1] cd //mn_util filecase keep set $MN_FIT/mgr/README -f text ctot freehep/readme freehep/install * set $MN_FIT/mgr/mn_fit.dbase -f text ctot freehep/mn_fit_dbase * set $MN_FIT/mgr/rel_v[1].txt0 -f text ctot news/rel_v[1] freehep/carfiles freehep/readme freehep/install * shell rm $MN_FIT/mgr/rel_v[1].txt shell cat $MN_FIT/mgr/rel_v[1].txt0 $MN_FIT/install_log >$MN_FIT/mgr/rel_v[1].txt shell rm $MN_FIT/mgr/rel_v[1].txt0 filecase restore * return +DECK,manual. * ************************************************************************ macro dummy ************************************************************************ * message '***' message '*** Do exec manual#complete to get the text' message '*** Do exec manual#text to get the text' message '*** Do exec manual#pictures to get the figures' message '***' * return * ************************************************************************ macro complete ************************************************************************ * exec manual#pictures y y y exec manual#text y y * return * ************************************************************************ macro text 1='X' 2='X' ************************************************************************ * * Macro to make the complete Mn_Fit Manual * Writes the fortran MN_LATEX, compiles and links it * Runs MN_LATEX and requets if LaTeX should be run * cd //mn_util set a_mn_fit_dir//* -f * * Write out the extra LaTeX files * set a_mn_fit_doc//*.tex -f text ctot -y manual shell mv a_mn_fit_doc//mn_bib.tex a_mn_fit_doc//mn_fit.bib * * Write out the demonstration logfiles * set a_mn_fit_help//demo_log/*.log -f text ctot -y demo_log * * Make the executable for making LaTeX from Help file * if [1] = 'X' then answer = 'N' message 'Make Mn_LaTeX [Y/N*]' read answer else answer = [1] endif if $upper([answer]) <> 'Y' goto make_tex set a_mn_fit_dir//*.run -f text cfor util/mn_latex ctot -y jobs/mn_latex * * Make the LaTeX file * make_tex: if [2] = 'X' then answer = 'N' message 'Run Mn_LaTeX [Y/N*]' read answer else answer = [2] endif if $upper([answer]) <> 'Y' goto latex exec mn_macro#run mn_latex * latex: message '***' message '*** Now you should set your default directory to' a_mn_fit_help message '*** and latex mn_fit.' message '***' * end: exec mn_macro#mn_set return * ************************************************************************ macro pictures 1='X' 2='X' 3='X' ************************************************************************ * * Makes the pictures for the appendices * cd //mn_util * * Appendix B is symbols and fonts and hatches * set a_mn_fit_dir//* -f f77 set a_mn_fit_dir//*.run -f text * * Make the program for the IGTEXT example * if [1] = 'X' then answer = 'N' message 'Make the HIGZ characters plot [Y/N*]' read answer else answer = [1] endif if $upper([answer]) = 'Y' goto higz goto end_higz * higz: cfor util/igtext_exam ctot -y jobs/igtext_exam exec mn_macro#run igtext_exam * * Make the Mn_Fit pictures for the Appendix * end_higz: if [2] = 'X' then answer = 'N' message 'Make the Mn_Fit symbols, hatching etc. plots [Y/N*]' read answer else answer = [2] endif if $upper([answer]) <> 'Y' goto demos * set a_mn_fit_help//*.mnf -f text ctot -y demo * message '***' message '*** Set your default directory to' a_mn_fit_help message '*** Run Mn_Fit and execute pictures.mnf giving the hardcopy device' message '***' * * Write out the Mn_Fit macros for running the demos * demos: if [3] = 'X' then answer = 'N' message 'Make the Mn_Fit demo macros [Y/N*]' read answer else answer = [3] endif if $upper([answer]) <> 'Y' goto end * set a_mn_fit_help//*.mnf -f text ctot -y demo * message '***' message '*** Set your default directory to' a_mn_fit_help message '*** Run Mn_Fit and execute demo_man.mnf' message '***' * end: exec mn_macro#mn_set return +DECK,mn_macro. macro mn_macro * * Collection of KUIP macros for Mn_Fit code * message '*** You must give the macro name' * return * ******************************************************************************* macro makelib ******************************************************************************* * cd //mn_fit seq . seq //mn_fit/mncde seq -f a_mn_fit_lib//mncde.inc * exec mn_macro#mn_seq exec mn_macro#fort_opt * cd //mn_fit * +SELF,IF=VMS. set a_mn_fit_src//* -f set a_mn_fit_lib//mn_fit -l +SELF,IF=UNIX. set a_mn_fit_lib//fsub/* -f +SELF,IF=UNIX,IF=APOLLO. set a_mn_fit_lib//libmn_fit.a -l +SELF,IF=UNIX,IF=-APOLLO. set a_mn_fit_lib//libmn_fit -l +SELF,IF=VMS,UNIX. * cfl mn_fit cfl minuit.ntuple cfl parser.handler cfl util * +SELF,IF=IBM. set mn_fit -l set mn_fit -f cfl mn_fit minuit.ntuple parser.util +SELF. * * Make the main program * exec mn_macro#makemain * exec mn_macro#makecc * * Make the dummy IMSL and/or Naglib routines and TCP/IP routines * and any dummy CERN library routines * exec mn_macro#makemath exec mn_macro#makedummy * * Make the graphics interface code * exec mn_macro#graphics [1] * cd //mn_fit exec mn_macro#fort_deb exec mn_macro#mn_set return * ******************************************************************************* macro graphics 1='X11' ******************************************************************************* * * Now do the graphics interface code * cd //mn_fit sel GRAPHIC sel -GKS -GKSGRAL -DECGKS -DGKS3D -PLTSUB -DI3000 -X11 * if $upper([1]) = 'GKSGRAL' goto GKSGRAL if $upper([1]) = 'DECGKS' goto DECGKS if $upper([1]) = 'DGKS3D' goto DGKS3D if $upper([1]) = 'PLTSUB' goto PLTSUB if $upper([1]) = 'DI3000' goto DI3000 if $upper([1]) = 'X11' goto X11 message 'You must give the patchy flag (e.g. GKSGRAL or DECGKS)' goto end * * GKSGRAL version * GKSGRAL: message 'Making GKSGRAL version of TVBGN' sel HIGZ GKS GKSGRAL set a_mn_fit_lib//tvbgn_g -f goto compile * * DECGKS version * DECGKS: message 'Making DECGKS version of TVBGN' sel HIGZ GKS DECGKS set a_mn_fit_lib//tvbgn_v -f goto compile * * DEC GKS3D version * DGKS3D: message 'Making DGKS3D version of TVBGN' sel HIGZ GKS DGKS3D set a_mn_fit_lib//tvbgn_d -f goto compile * * PLTSUB version needs a few HIGZ routines also * PLTSUB: message 'Making PLTSUB version of TVBGN' sel -HIGZ PLTSUB set a_mn_fit_lib//tvbgn_p -f goto compile * * DI3000 version * DI3000: message 'Making DI3000 version of TVBGN' sel HIGZ DI3000 set a_mn_fit_lib//tvbgn_3 -f goto compile * * X11 version * X11: message 'Making X11 version of TVBGN' sel HIGZ X11 set a_mn_fit_lib//tvbgn_x -f goto compile * compile: sel exec mn_macro#mn_seq cfor graphics plt_higz * end: sel -GRAPHIC exec mn_macro#mn_set return * ******************************************************************************* macro makecc ******************************************************************************* * * Compile the C routines * cd //mn_fit * set c -lan set a_mn_fit_lib//mn_util_cc -f set sel sel UTIL_CC seq . seq hkuip seq cfor util_cc sel -UTIL_CC set f77 -lan * return * ******************************************************************************* macro makemain ******************************************************************************* * * Compile the main program separately * cd //mn_fit * set a_mn_fit_lib//mn_main_n -f sel MAIN_N cfor main sel -MAIN_N * * Compile the c version of the main programs * sel *seq . *seq hkuip *seq * *set c -lan set a_mn_fit_lib//mn_main_k -f sel MAIN_K cfor main sel -MAIN_K *set f77 -lan * return * ******************************************************************************* macro makemath ******************************************************************************* * * Make the dummy IMSL and/or Naglib routines * cd //mn_fit/math set a_mn_fit_lib//math -f sel $MATH cfor * sel -$MATH * return * ******************************************************************************* macro makedummy ******************************************************************************* * * Make the dummy tcp/ip routines - VMS only? * Dummy CERN library routines for old versions * cd //mn_fit/dummy set a_mn_fit_lib//mn_dummy -f sel dummy cfor * sel -dummy * return * ******************************************************************************* macro makeled ******************************************************************************* * * Make the command line editing frontend program for DECS,SGI * cd //mn_util * +SELF,IF=UNIX. ,IF=DECS,SGI. set c -lan set a_mn_fit_lib//ledit -f set a_mn_fit_lib//*.h -d ctot -s ledinc ctof ledit set f77 -lan +SELF,IF=APOLLO. alias/cre a_exe a_mn_fit_exe//ledit alias/cre a_cc a_mn_fit_lib//ledit.c shell '/bin/cc -o '//a_exe' -A cpu,'//a_cpu//' '//a_cc alias/del 'a_exe' alias/del 'a_cc' +SELF,IF=HPUX. shell cc -Aa -o a_mn_fit_exe//ledit a_mn_fit_lib//ledit.c +SELF,IF=-HPUX,IF=-APOLLO. shell cc -o a_mn_fit_exe//ledit a_mn_fit_lib//ledit.c +SELF. exec mn_macro#fort_deb +SELF. * return * ******************************************************************************* macro mn_minuit ******************************************************************************* * * Make the routines needed for Chris Rippich version of MINUIT * file cgr_minuit -r sel MIN_CGR exec mn_macro#mn_seq seq //cgr_minuit/mincde set a_mn_fit_lib//mn_minuit -f cd //mn_fit grep MIN_CGR -i buff cfor -b sel -MIN_CGR * return * ******************************************************************************* macro makeinc ******************************************************************************* * cd //mn_fit seq . seq //mn_fit/mncde seq -f mncde.inc * seq . seq //cgr_minuit/mincde seq -f mincde.inc * exec mn_macro#mn_seq * return * ******************************************************************************* macro l3_display ******************************************************************************* * exec mn_macro#fort_opt cd //mn_fit sel l3dsp_src +SELF,IF=VMS,APOLLO,HPUX,SGI. sel $L3_DB +SELF. sel exec mn_macro#mn_seq set a_mn_fit_lib//l3_display -f * cd //mn_fit cfor display dbase sel -l3dsp_src +SELF,IF=VMS,APOLLO,HPUX,SGI. sel -$L3_DB +SELF. sel * exec mn_macro#fort_deb exec mn_macro#mn_set return * ******************************************************************************* macro l3_cpc ******************************************************************************* * exec mn_macro#fort_opt cd //mn_fit sel L3DSP_SRC $L3_DB $L3_CPC sel exec mn_macro#mn_seq set a_mn_fit_lib//l3_cpc -f grep $L3_CPC buff cfor -b sel -L3DSP_SRC -$L3_DB -$L3_CPC sel * exec mn_macro#fort_deb exec mn_macro#mn_set return * ******************************************************************************* macro l3_inc ******************************************************************************* * cd //mn_fit mdir temp cop mncde/mnpar temp/mnpar cop mncde/mndsp temp/mndsp cop mncde/mnhpj temp/mnhpj * seq . seq //mn_fit/temp seq -f a_mn_fit_lib//l3_onl.inc * cd temp del mnpar del mndsp del mnhpj cd \ * cop mncde/mncpc temp/mncpc cd temp * seq . seq //mn_fit/temp seq -f a_mn_fit_lib//l3_cpc.inc * del mncpc cd \ dlt temp * exec mn_macro#mn_seq * return * ******************************************************************************* macro zeus_display ******************************************************************************* * exec mn_macro#fort_opt cd //mn_fit sel ZEUSDSP_SRC sel exec mn_macro#mn_seq set a_mn_fit_lib//zeus_display -f * cd //mn_fit cfor display sel -ZEUSDSP_SRC sel * exec mn_macro#fort_deb exec mn_macro#mn_set return * ******************************************************************************* macro makenews ******************************************************************************* * * Make the Mn_Fit news file * cd //mn_util/news set a_mn_fit_help//mn_news.fil -f text ctot -s news * cd //mn_fit * return * ******************************************************************************* macro makedoc 1='407' ******************************************************************************* * * Make the Mn_Fit documentation file * dirsav = $cwd() message Making documenation file for version: [1] if $OS = 'VMS' then cd //mn_util set a_mn_fit_dir//mn_fit.doc -f text ctot //mn_util/freehep/header _ //mn_fit/title //mn_util/title _ //mn_util/freehep/fill _ //mn_util/freehep/mn_fit_dbase //mn_util/news/rel_v[1] _ //mn_util/freehep/readme //mn_util/freehep/carfiles _ //mn_util/freehep/install _ //mn_util/doc * * Now try the same thing, but get the titles in properly - UNIX only * else set/host_shell /bin/sh set/host_shell set /tmp/body.txt -f text ctot //mn_util/freehep/mn_fit_dbase //mn_util/news/rel_v[1] _ //mn_util/freehep/readme //mn_util/freehep/carfiles _ //mn_util/freehep/install _ //mn_util/doc set /tmp/header.txt -f text ctot //mn_util/freehep/header set /tmp/fill.txt -f text ctot //mn_util/freehep/fill for name in mn_fit mn_util typscn cgr_minuit dbase l3_dsp zeus_dsp file [name] -r cd //[name] set /tmp/[name].txt -f text car /tmp/[name].car title shell tail +2 /tmp/[name].car > /tmp/[name].txt endfor shell cat /tmp/header.txt _ /tmp/mn_fit.txt /tmp/mn_util.txt /tmp/typscn.txt /tmp/cgr_minuit.txt _ /tmp/dbase.txt /tmp/l3_dsp.txt /tmp/zeus_dsp.txt _ /tmp/fill.txt _ /tmp/body.txt > a_mn_fit_dir//mn_fit.doc * * Cleanup * shell /bin/rm -f /tmp/header.txt _ /tmp/mn_fit.txt /tmp/mn_util.txt /tmp/typscn.txt /tmp/cgr_minuit.txt _ /tmp/dbase.txt /tmp/l3_dsp.txt /tmp/zeus_dsp.txt _ /tmp/fill.txt /tmp/body.txt shell /bin/rm -f _ /tmp/dbase.car /tmp/l3_dsp.car /tmp/zeus_dsp.car _ /tmp/mn_fit.car /tmp/mn_util.car /tmp/typscn.car /tmp/cgr_minuit.car set/host_shell $SHELL set/host_shell endif * cd [dirsav] return * ******************************************************************************* macro makewind ******************************************************************************* * * Make the Mn_Fit window definition file for the Vaxstation * cd //mn_util/exec set a_mn_fit_dir//window.dat -f text ctot -s window * return * ******************************************************************************* macro makehelp ******************************************************************************* * * Get the help code out of CMZ * cd //mn_util set a_mn_fit_help//mn_fit_help.fil -f text ctot -s -d mn_fit_help changes * set a_mn_fit_help//minuit_help.fil -f text ctot -s -d minuit_help * * Make FORTRAN file for simulated VMS Help file creation * cd //mn_util/util set a_mn_fit_dir//helpmke -f cfor helpmke * cd //mn_util/jobs set a_mn_fit_dir//helpmke.run -f text ctot -s helpmke exec mn_macro#run helpmke * exec mn_macro#mn_set return * ******************************************************************************* macro maketest ******************************************************************************* * * Get the test files out of CMZ * cd //mn_util * * Make any extra files that are needed * Rename AVEHST histogram definitions file * message '*** Making extra fortran files needed for testing' set a_mn_fit_test//*.for -f text ctot -s test_files +SELF,IF=VMS. shell rename a_mn_fit_test//ave_test.for *.def +SELF. * message '*** Making extra data files needed for testing' set a_mn_fit_test//*.mnd -f text set a_mn_fit_test//*.mnd -f data ctot -s test_data * message '*** Making test macros' set a_mn_fit_test//*.mnf -f text ctot -s -d test * exec mn_macro#mn_set return * ******************************************************************************* macro makedemo ******************************************************************************* * * Make the demonstration files * cd //mn_util * message '*** Making demonstration files' set a_mn_fit_help//*.mnf -f text ctot -s demo * exec mn_macro#mn_set return * ******************************************************************************* macro makehist ******************************************************************************* * * Make test histograms * cd //mn_util/util set a_mn_fit_dir//histmke -f cfor histmke * cd //mn_util/jobs set a_mn_fit_dir//histmke.run -f text ctot -s histmke exec mn_macro#run histmke * exec mn_macro#mn_set return * ******************************************************************************* macro makekumac ******************************************************************************* * * Make the Mn_Fit kumacs * cd //mn_util set *.kumac -f text ctot -s $kumacs * return * ******************************************************************************* macro makelink ******************************************************************************* * * Make the files for linking Mn_Fit * cd //mn_util/jobs set a_mn_fit_dir//*.lnk -f text ctot -s mn_fit mn_user mn_fit_cgr ctot -s mn_dsp +SELF,IF=UNIX. shell chmod a+x a_mn_fit_dir//*.lnk +SELF. * return * ******************************************************************************* macro makerun ******************************************************************************* * * Make the file for running Mn_Fit * cd //mn_util/exec +SELF,IF=VMS. set a_mn_fit_com//*.com -f text +SELF,IF=UNIX. set a_mn_fit_com//* -f text +SELF. ctot -s mn_fit +SELF,IF=UNIX. shell chmod a+x a_mn_fit_com//mn_fit +SELF. * return * ******************************************************************************* macro makefiles ******************************************************************************* * * Make all the Mn_Fit files needed and runs the help and test kumac's. * Makes the VMS and non-VMS Help files * Makes all the files for linking * * Make the link files * answer := 'N' message 'Do you want to make the link files [Y/N*]' read answer if $upper([answer]) <> 'Y' goto exec exec mn_macro#makelink * * Make the file to run Mn_Fit * exec: answer := 'N' message 'Do you want to make file to run Mn_Fit [Y/N*]' read answer if $upper([answer]) <> 'Y' goto help exec mn_macro#makerun * * Make the help files * help: answer := 'N' message 'Do you want to make the help files [Y/N*]' read answer if $upper([answer]) <> 'Y' goto demo exec mn_macro#makehelp * * Make the demonstration files if wanted * demo: answer := 'N' message 'Do you want to make the demonstration files [Y/N*]' read answer if $upper([answer]) <> 'Y' goto test exec mn_macro#makedemo * * Make the test files if wanted * test: answer := 'N' message 'Do you want to make the test files [Y/N*]' read answer if $upper([answer]) <> 'Y' goto hist exec mn_macro#maketest * * Make the test histograms * hist: answer := 'N' message 'Do you want to make the test histograms [Y/N*]' read answer if $upper([answer]) <> 'Y' goto doc exec mn_macro#makehist 4 * * Make the documentation file * doc: answer := 'N' message 'Do you want to make the documentation [Y/N*]' read answer if $upper([answer]) <> 'Y' goto led exec mn_macro#makedoc * led: +SELF,IF=UNIX,IF=DECS,SGI. * * Make the command line editing files for DECS, SGI, if wanted. * answer := 'N' message 'Do you want to make the files for command line editing [Y/N*]' read answer if $upper([answer]) <> 'Y' goto end exec mn_macro#makeled +SELF. * end: return * * Collection of utility KUIP macros for Mn_Fit code * ******************************************************************************* macro mn_alias 1='VMS' 2='m68k' ******************************************************************************* * if [1] = 'VMS' goto vms if [1] = 'APOLLO' goto apollo if [1] = 'UNIX' goto unix if [1] = 'IBM' goto ibm message 'Unknown computer: ',a_computer goto end vms: alias/cre a_computer VMS alias/cre a_mn_fit_lib 'mn_fit_lib:' alias/cre a_mn_fit_src 'mn_fit_src:' alias/cre a_mn_fit_dir 'mn_fit_dir:' alias/cre a_mn_fit_cmz 'mn_fit_cmz:' alias/cre a_mn_fit_com 'mn_fit_com:' alias/cre a_mn_fit_help 'mn_fit_help:' alias/cre a_mn_fit_doc 'mn_fit_doc:' alias/cre a_mn_fit_test 'mn_fit_test:' alias/cre a_mn_fit_exe 'mn_fit_exe:' goto end * apollo: alias/cre a_cpu [2] alias/cre a_computer UNIX alias/cre a_mn_fit_lib '$MN_FIT/lib/'//a_cpu//'/' alias/cre a_mn_fit_dir '$MN_FIT/mgr/' alias/cre a_mn_fit_cmz '$MN_FIT/cmz/' alias/cre a_mn_fit_com '$MN_FIT/bin/' alias/cre a_mn_fit_help '$MN_FIT/help/' alias/cre a_mn_fit_doc '$MN_FIT/doc/' alias/cre a_mn_fit_test '$MN_FIT/test/' alias/cre a_mn_fit_exe '$MN_FIT/exe/' goto end * unix: alias/cre a_computer UNIX alias/cre a_mn_fit_lib '$MN_FIT/lib/' alias/cre a_mn_fit_dir '$MN_FIT/mgr/' alias/cre a_mn_fit_cmz '$MN_FIT/cmz/' alias/cre a_mn_fit_com '$MN_FIT/bin/' alias/cre a_mn_fit_help '$MN_FIT/help/' alias/cre a_mn_fit_doc '$MN_FIT/doc/' alias/cre a_mn_fit_test '$MN_FIT/test/' alias/cre a_mn_fit_exe '$MN_FIT/exe/' goto end * ibm: alias/cre a_computer IBM alias/cre a_mn_fit_lib ' ' alias/cre a_mn_fit_dir ' ' alias/cre a_mn_fit_cmz ' ' alias/cre a_mn_fit_com ' ' alias/cre a_mn_fit_help ' ' alias/cre a_mn_fit_doc ' ' alias/cre a_mn_fit_test ' ' alias/cre a_mn_fit_exe ' ' goto end * end: alias/list return * ******************************************************************************* macro mn_seq ******************************************************************************* * seq . seq //mn_fit/mncde seq //mn_util/cdes * return * ******************************************************************************* macro mn_set ******************************************************************************* * if a_computer = 'VMS' goto vms if a_computer = 'UNIX' goto unix if a_computer = 'IBM' goto ibm message 'Unknown computer: ',a_computer goto end vms: set_file a_mn_fit_src//* -f set_file a_mn_fit_lib//$cmzfile -l goto end * unix: set_file a_mn_fit_lib//fsub/* -f +SELF,IF=APOLLO. set_file a_mn_fit_lib//libmn_fit.a -l +SELF,IF=-APOLLO. set_file a_mn_fit_lib//lib$cmzfile -l +SELF. goto end * ibm: set_file * -f set_file $cmzfile -l goto end * end: set //mn_util/template/mn_fit -td *set_file return * ******************************************************************************* macro fort_deb ******************************************************************************* * if a_computer = 'VMS' goto vms if a_computer = 'UNIX' goto unix if a_computer = 'IBM' goto ibm message 'Unknown computer: ',a_computer goto end vms: if $env(FTN_COMMAND) = '' then if $machine = 'ALPHA' then set '$fortran/separ/warn=nousage/deb/noopt/obj=$compfile.obj $compfile' -c f77 else set '$fortran/deb/noopt/obj=$compfile.obj $compfile' -c f77 endif else set '$'//$env(FTN_COMMAND)//'/obj=$compfile.obj $compfile' -c f77 endif * if $env(CC_COMMAND) = '' then if $machine = 'ALPHA' then set '$ cc/extern=common/stand=vaxc/deb/noopt/obj=$compfile.obj $compfile' -c c else set '$ cc/deb/noopt/obj=$compfile.obj $compfile' -c c endif else set '$'//$env(CC_COMMAND)//'/obj=$compfile.obj $compfile' -c c endif goto end * unix: * * Fortran compiler * ftn_comm = $env(FTN_COMMAND) if [ftn_comm] = '$env(FTN_COMMAND)' then message '*** $env does not work - old version of cmz' message '*** Default fortran commands will be used' ftn_comm = '' endif if [ftn_comm] = '' then if $machine = 'HPUX' then set 'f77 -g -C -K +ppu +T +E4 +DA1.1 -c $compfile' -c f77 elseif $machine = 'APOLLO' then * set 'ftn $compfile -b $compfile.bin -save -indexl -dbs -cpu '//a_cpu -c f77 set 'f77 -g -W0,-nuc,-save,-indexl -A cpu,'//a_cpu//' -c $compfile' -c f77 elseif $machine = 'SGI' then set 'f77 -n32 -g -C -c $compfile' -c f77 elseif $machine = 'ALPHA' then * set 'f77 -g -static -cpp -G 3 -warn nousage -vms -c $compfile' -c f77 set 'f77 -g -C -warn nousage -c $compfile' -c f77 elseif $machine = 'DECS' then +SELF,IF=DECS,IF=@CMU. set 'fort -g -static -cpp -G 3 -w1 -c $compfile' -c f77 +SELF,IF=-DECS,-@CMU. set 'f77 -g -static -cpp -G 3 -w1 -c $compfile' -c f77 +SELF. * MIPS compiler * set 'f77 -g -static -cpp -G3 -w1 -c $compfile' -c f77 elseif $machine = 'SUN' then set 'f77 -g -C -Nl99 -c $compfile' -c f77 elseif $machine = 'SOLARIS' then set 'f77 -g -C -c $compfile' -c f77 elseif $machine = 'LINUX' then set 'g77 -g -C -fdebug-kludge -c $compfile' -c f77 elseif $machine = 'IBMRT' .or. $machine = 'IBMAIX' then set 'xlf -g -qextname -qrndsngl -qcharlen=32767 -qxlf77=leadzero _ -c $compfile' -c f77 else set 'f77 -g -c $compfile' -c f77 endif else set $env(FTN_COMMAND)//' -c $compfile' -c f77 endif * * C compiler * cc_comm = $env(CC_COMMAND) if [cc_comm] = '$env(CC_COMMAND)' then message '*** $env does not work - old version of cmz' message '*** Default c commands will be used' cc_comm = '' endif if [cc_comm] = '' then +SELF,IF=@GCC. set 'gcc -g -I. -c $compfile' -c c +SELF,IF=APOLLO. set '/bin/cc -c -g -I. -A cpu,'//a_cpu//' $compfile' -c c +SELF,IF=-@GCC. if $machine = 'HPUX' then set 'cc -g -I. -Aa +DA1.1 -c $compfile' -c c elseif $machine = 'DECS' then set 'c89 -g -I. -c $compfile' -c c elseif $machine = 'SGI' then set 'cc -n32 -g -I. -c $compfile' -c c else set 'cc -g -I. -c $compfile' -c c endif +SELF. else set $env(CC_COMMAND)//' -c $compfile' -c c endif goto end * ibm: set 'VFORT $COMPFILE (NOPRINT)' -c goto end * end: return * ******************************************************************************* macro fort_opt ******************************************************************************* * +SELF,IF=@DBG. exec mn_macro#fort_deb exitm * +SELF. if a_computer = 'VMS' goto vms if a_computer = 'UNIX' goto unix if a_computer = 'IBM' goto ibm message 'Unknown computer: ',a_computer goto end vms: if $env(FTN_COMMAND) = '' then if $machine = 'ALPHA' then set '$fortran/separ/warn=nousage/opt/obj=$compfile.obj $compfile' -c f77 else set '$fortran/opt/obj=$compfile.obj $compfile' -c f77 endif else set '$'//$env(FTN_COMMAND)//'/obj=$compfile.obj $compfile' -c f77 endif * if $env(CC_COMMAND) = '' then if $machine = 'ALPHA' then set '$ cc/extern=common/stand=vaxc/opt/obj=$compfile.obj $compfile' -c c else set '$ cc/opt/obj=$compfile.obj $compfile' -c c endif else set '$'//$env(CC_COMMAND)//'/obj=$compfile.obj $compfile' -c c endif goto end * unix: * * Fortran compiler * ftn_comm = $env(FTN_COMMAND) if [ftn_comm] = '$env(FTN_COMMAND)' then message '*** $env does not work - old version of cmz' message '*** Default fortran commands will be used' ftn_comm = '' endif if [ftn_comm] = '' then if $machine = 'HPUX' then set 'f77 +O1 -K +ppu +T +E4 +DA1.1 -c $compfile' -c f77 elseif $machine = 'APOLLO' then * set 'ftn $compfile -b $compfile.bin -save -indexl -dbs -cpu '//a_cpu -c f77 set 'f77 -g -W0,-nuc,-save,-indexl -A cpu,'//a_cpu//' -c $compfile' -c f77 elseif $machine = 'SGI' then set 'f77 -n32 -O -c $compfile' -c f77 elseif $machine = 'ALPHA' then * set 'f77 -O -static -cpp -G 3 -warn nousage -vms -c $compfile' -c f77 set 'f77 -O -warn nousage -c $compfile' -c f77 elseif $machine = 'DECS' then +SELF,IF=DECS,IF=@CMU. set 'fort -O -static -cpp -G 3 -w1 -c $compfile' -c f77 +SELF,IF=-DECS,-@CMU. set 'f77 -O -static -cpp -G 3 -w1 -c $compfile' -c f77 +SELF. * MIPS compiler * set 'f77 -O -static -cpp -G3 -w1 -c $compfile' -c f77 elseif $machine = 'SUN' then set 'f77 -O -Nl99 -c $compfile' -c f77 * set '/usr/lang/f77 -O -Nl99 -c $compfile' -c f77 elseif $machine = 'SOLARIS' then set 'f77 -O -c $compfile' -c f77 elseif $machine = 'LINUX' then set 'g77 -O -c $compfile' -c f77 elseif $machine = 'IBMRT' .or. $machine = 'IBMAIX' then set 'xlf -O -qextname -qrndsngl -qcharlen=32767 -qxlf77=leadzero _ -c $compfile' -c f77 else set 'f77 -O -c $compfile' -c f77 endif else set $env(FTN_COMMAND)//' -c $compfile' -c f77 endif * * C compiler * cc_comm = $env(CC_COMMAND) if [cc_comm] = '$env(CC_COMMAND)' then message '*** $env does not work - old version of cmz' message '*** Default fortran and c commands will be used' cc_comm = '' endif if [cc_comm] = '' then +SELF,IF=@GCC. set 'gcc -O -I. -c $compfile' -c c +SELF,IF=APOLLO. set '/bin/cc -c -O -I. -A cpu,'//a_cpu//' $compfile' -c c +SELF,IF=-@GCC. if $machine = 'HPUX' then set 'cc -O -I. -Aa +DA1.1 -c $compfile' -c c elseif $machine = 'DECS' then set 'c89 -O -I. -c $compfile' -c c else set 'cc -O -I. -c $compfile' -c c endif +SELF. else set $env(CC_COMMAND)//' -c $compfile' -c c endif goto end * ibm: set 'VFORT $COMPFILE (NOPRINT)' -c goto end * end: return +SELF. * ******************************************************************************* macro run 1=' ' 2=' ' ******************************************************************************* * if a_computer = 'VMS' goto vms if a_computer = 'UNIX' goto unix if a_computer = 'IBM' goto ibm message 'Unknown computer: ',a_computer goto end vms: if [2] <> '' then alias/create @command '@mn_fit_dir:'//[1]//'.run '//[2] else alias/create @command '@mn_fit_dir:'//[1]//'.run ' endif shell @command alias/delete '@command' goto end * unix: * set/host_shell 'csh' alias/create @command1 '$MN_FIT/mgr/'//[1]//'.run ' if [2] <> '' then alias/create @command2 '$MN_FIT/mgr/'//[1]//'.run '//[2] else alias/create @command2 '$MN_FIT/mgr/'//[1]//'.run ' endif set/host_shell /bin/sh set/host_shell alias/list shell chmod a+x @command1 shell @command2 alias/delete '@command1' alias/delete '@command2' set/host_shell $SHELL set/host_shell goto end * ibm: alias/create @command [1]//.run shell @command alias/delete '@command' goto end * end: return +DECK,typscn. * * Collection of KUIP macros for TYPSCN code * macro typscn * message '*** You must give the macro name' * return * ******************************************************************************* macro makelib ******************************************************************************* * file typscn -r * seq . seq //typscn/typcde //typscn/cluseq * exec mn_macro#fort_opt * cd //typscn set a_mn_fit_lib//typscn -f +SELF,IF=UNIX. set a_mn_fit_lib//libtypscn.a -l +SELF,IF=-UNIX. set a_mn_fit_lib//typscn -l +SELF. cfl typscn typsub typsio lunmgr +SELF,IF=DECS. exec typscn#makecc +SELF. * * readline gets passed as an argument * if $upper([1]) <> 'READLINE' goto tktcl set a_mn_fit_lib//typscn_read -f +SELF,IF=UNIX. set a_mn_fit_lib//libtypscn_read.a -l +SELF,IF=-UNIX. set a_mn_fit_lib//typscn_read -l +SELF. sel readline cfl typscn typsub typsio lunmgr exec typscn#makecc sel -readline * * tktcl gets passed as an argument * tktcl: if $upper([1]) <> 'TKTCL' .and. $upper([2]) <> 'TKTCL' goto endtyp set a_mn_fit_lib//typscn_tktcl -f +SELF,IF=UNIX. set a_mn_fit_lib//libtypscn_tktcl.a -l +SELF,IF=-UNIX. set a_mn_fit_lib//typscn_tktcl -l +SELF. sel tktcl cfl typscn typsub typsio lunmgr sel -tktcl * endtyp: * cd //mn_fit exec mn_macro#fort_deb exec mn_macro#mn_seq exec mn_macro#mn_set * return * ******************************************************************************* macro makecc ******************************************************************************* * * Compile the C files for asynchronous I/O on Decstations and/or readline * cd //typscn * set c -lan set a_mn_fit_lib//typscn_cc -f seq //mn_fit/hkuip cfl typsio_c set f77 -lan * return * ******************************************************************************* macro makeread ******************************************************************************* * * Makes the readline routines * First unzip and untar the file * then make my Makefiles, copy them to the right place and run them * filecase keep * cd //mn_util/jobs set a_mn_fit_dir//makeread1.run -f text set ctot -y makeread1 * cd //mn_util/jobs set a_mn_fit_dir//makeread2.run -f text set ctot -y makeread2 * exec mn_macro#run makeread1 * cd //mn_util/readline set a_mn_fit_lib//readline/Makefile_main -f text ctot -y Makefile cd //mn_util/readexam set a_mn_fit_lib//readline/Makefile_exam -f text ctot -y Makefile * exec mn_macro#run makeread2 * filecase restore cd //mn_fit * return +DECK,zeus_dsp,if=ZEUSDSP. * * Collection of KUIP macros for ZEUS detector displays * macro zeus_dsp * message '*** You must give the macro name' * return * ******************************************************************************* macro makelib ******************************************************************************* * file zeus_dsp -r * exec mn_macro#fort_opt * * Make sure sequences are OK * sel zeusdsp_src * exec zeus_dsp#ftd_lib exec zeus_dsp#trd_lib * cd //mn_fit exec mn_macro#fort_deb * exec mn_macro#mn_set * return * ******************************************************************************* macro ftd_lib ******************************************************************************* * * FTD code * sel zeusdsp_src seq . seq //mn_fit/mncde seq //zeus_dsp/ftdcde seq //zeus_dsp/trdcde * cd //zeus_dsp set a_mn_fit_lib//ftd_dsp -f +SELF,IF=UNIX. set a_mn_fit_lib//libzeus_dsp.a -l +SELF,IF=-UNIX. set a_mn_fit_lib//zeus_dsp -l +SELF. set cfl ftd tfrecon * exec mn_macro#mn_seq exec mn_macro#mn_set * return * ******************************************************************************* macro trd_lib ******************************************************************************* * * TRD code * sel zeusdsp_src seq . seq //mn_fit/mncde seq //zeus_dsp/ftdcde seq //zeus_dsp/trdcde * cd //zeus_dsp set a_mn_fit_lib//trd_dsp -f +SELF,IF=UNIX. set a_mn_fit_lib//libzeus_dsp.a -l +SELF,IF=-UNIX. set a_mn_fit_lib//zeus_dsp -l +SELF. set cfl trd trrecon * exec mn_macro#mn_seq exec mn_macro#mn_set * return +PATCH,EXEC,T=TEXT. +DECK,install. +SELF,IF=VMS. $!======================================================================== $! $! Name : INSTALL_MN_FIT $! $! Purpose : Command procedure to install Mn_Fit on a VAX/VMS node from $! scratch. I assume that you have either the .car or the .cmz files. $! You should be prompted for things that you need to know. $! $! If you do not have the mn_fit_logical.com file I assume that you are running $! this file from the top level Mn_Fit directory. $! $! Arguments : $! $! Created 29-JUN-1992 Ian C. Brock $! $!======================================================================== $ ON ERROR THEN $ GOTO EXIT $ ON CONTROL_Y THEN $ GOTO EXIT $! $ dirsav = f$environment("default") $ versav = f$verify(0) $ wwa = "write aa" $ ww = "write sys$output" $ aaopen = 0 $ relink = 0 $ do_fortran = 0 $ use_nag == 0 $ use_imsl == 0 $ use_cgrmin = 0 $ use_l3dsp == 0 $ use_zeusdsp== 0 $ dbg_compile== 0 $ cernlib_cmd = 0 $ expnam = "" $ tfcern = "2000" $ tvcern = tfcern $ if f$type(architecture).nes."STRING" then $architecture == "VAX" $ if f$getsyi("NODE_HWTYPE").eqs."ALPH" then $architecture == "ALPHA" $! $!============================================================================= $! A few words of introduction $!============================================================================= $! $ 'ww' "**********************************************************************" $ 'ww' "This is the Mn_Fit installation procedure. Please note the following: $ 'ww' "**********************************************************************" $ 'ww' "1) In order to link Mn_Fit your page file quota should be 50000" $ 'ww' "2) I assume that the symbol/command cmz is defined" $ 'ww' "**********************************************************************" $! $!============================================================================= $! Get the cernlib version to be used $!============================================================================= $! $ inquire tvcern "Give Cernlib version number (=2000)" $ if tvcern.eqs."" then $tvcern="2000" $! $ tvcern = f$edit(tvcern,"trim,lowercase") $ lenv = f$length(tvcern) $ if f$locate("94b",tvcern).lt.lenv then $tfcern="94b" $ if f$locate("95a",tvcern).lt.lenv then $tfcern="95a" $ if f$locate("96a",tvcern).lt.lenv then $tfcern="96a" $ if f$locate("97a",tvcern).lt.lenv then $tfcern="97a" $ if f$locate("98",tvcern).lt.lenv then $tfcern="98" $ if f$locate("99",tvcern).lt.lenv then $tfcern="99" $ if f$locate("2000",tvcern).lt.lenv then $tfcern="2000" $ if f$locate("00",tvcern).lt.lenv then $tfcern="00" $! $! Check that tfcern is OK $! $ if tfcern.nes."94b" .and. - tfcern.nes."95a" .and. tfcern.nes."96a" .and. - tfcern.nes."97a" .and. tfcern.nes."98" .and. - tfcern.nes."99" .and. tfcern.nes."2000" .and. - tfcern.nes."00" $ then $ 'ww' "Valid Cernlib versions are 94b, 95a, 96a, 97a, 98, 99, 2000 and 00" $ exit $ endif $! $!============================================================================= $! Make sure the Mn_Fit logicals are defined $!============================================================================= $! $make_logical: $ if f$trnlnm("mn_fit_dir").nes."" then $deass mn_fit_dir $ if f$trnlnm("mn_fit_com").eqs."" $ then $ dirnam = "" $ inquire dirnam - "Give directory name with mn_fit_logical.com ( for none)" $ if dirnam.eqs."" $ then $ 'ww' "***" $ 'ww' "*** I assume that ''dirsav' is the Mn_Fit top level directory" $ 'ww' "***" $ mndir = f$extract(0,f$length(dirsav)-1,dirsav) $ open/write aa mn_fit_logical.com $ aaopen = 1 $ 'wwa' "$!" $ 'wwa' "$! Defines Mn_Fit logicals" $ 'wwa' "$!" $ 'wwa' "$ if f$trnlnm(""mn_fit_dir"").nes."""" then $goto exit" $ 'wwa' "$!" $ 'wwa' "$ define mn_fit_com ''mndir']" $ 'wwa' "$ define mn_fit_root ''mndir']" $ 'wwa' "$ define mn_fit_dir ''mndir'.mgr]" $ 'wwa' "$ define mn_fit_lib ''mndir'.lib]" $ 'wwa' "$ define mn_fit_src ''mndir'.lib.src]" $ 'wwa' "$ define mn_fit_cmz ''mndir'.cmz]" $ 'wwa' "$ define mn_fit_exe ''mndir'.exe]" $ 'wwa' "$ define mn_fit_help ''mndir'.help]" $ 'wwa' "$ define mn_fit_doc ''mndir'.doc]" $ 'wwa' "$ define mn_fit_test ''mndir'.test]" $ 'wwa' "$ define mn_tem ''mndir']" $ 'wwa' "$!" $ 'wwa' "$exit:" $ 'wwa' "$ exit" $ close aa $ aaopen = 0 $ 'ww' "*** Defining the Mn_Fit logicals" $ @mn_fit_logical $ else $ @'dirnam'mn_fit_logical $ endif $ else $ @mn_fit_com:mn_fit_logical $ endif $! $!============================================================================= $! Make sure the Mn_Fit directories all exist $!============================================================================= $! $ 'ww' "*** Creating directories (if necessary)" $ set default mn_fit_com: $ if f$parse(f$environment("default")).eqs."" then - $ cre/dir/log 'f$trnlnm("mn_fit_com")' $ set default mn_fit_dir: $ if f$parse(f$environment("default")).eqs."" then - $ cre/dir/log 'f$trnlnm("mn_fit_dir")' $ set default mn_fit_lib: $ if f$parse(f$environment("default")).eqs."" then - $ cre/dir/log 'f$trnlnm("mn_fit_lib")' $ set default mn_fit_src: $ if f$parse(f$environment("default")).eqs."" then - $ cre/dir/log 'f$trnlnm("mn_fit_src")' $ set default mn_fit_cmz: $ if f$parse(f$environment("default")).eqs."" then - $ cre/dir/log 'f$trnlnm("mn_fit_cmz")' $ set default mn_fit_exe: $ if f$parse(f$environment("default")).eqs."" then - $ cre/dir/log 'f$trnlnm("mn_fit_exe")' $ set default mn_fit_help: $ if f$parse(f$environment("default")).eqs."" then - $ cre/dir/log 'f$trnlnm("mn_fit_help")' $ set default mn_fit_doc: $ if f$parse(f$environment("default")).eqs."" then - $ cre/dir/log 'f$trnlnm("mn_fit_doc")' $ set default mn_fit_test: $ if f$parse(f$environment("default")).eqs."" then - $ cre/dir/log 'f$trnlnm("mn_fit_test")' $! $! Set directory to the Mn_Fit cmz directory $! $ set default mn_fit_cmz: $ show default $! $!============================================================================= $! Check whether cmz or patchy should be used. $!============================================================================= $! $make_cmz: $ inquire answer "Do you have cmz [*Y/N]" $ if answer.nes."" .and. .not.answer $ then $ use_cmz = 0 $ inquire answer "Do you have patchy [*Y/N]" $ if answer.nes."" .and. .not.answer $ then $ do_fortran = 1 $ goto fortran_only $ endif $! $ inquire answer "Do you have patchy version 5 or nypatchy [*Y/N]" $ if answer.eqs."" .or. answer $ then $ if tfcern.nes."94b" $ then $ patchy5 == 1 $ else $ patchy5 = 1 $ 'ww' "+++" $ 'ww' "+++ Patchy5 not used to make code" $ 'ww' "+++ as it has problems with sequences" $ 'ww' "+++" $ endif $ else $ patchy5 == 0 $ endif $ else $ use_cmz = 1 $ endif $! $ if use_cmz $ then $! $! Check that the cmz symbol is defined properly $! $ if f$type(cmz).eqs."" $ then $ 'ww' "***" $ 'ww' "*** The symbol cmz is not defined" $ 'ww' "*** You should define it as something like:" $ 'ww' "*** cmz == ""$cern:[cmz.pro.exe]cmz.exe""" $ 'ww' "***" $ goto exit $ else $ tcmz = f$string(cmz) $ if f$locate("@",tcmz).lt.f$length(cmz) $ then $ 'ww' "***" $ 'ww' "*** The cmz command used to not work running a com file" $ 'ww' "*** It used to have to be something like:" $ 'ww' "*** cmz == ""$cern:[cmz.pro.exe]cmz.exe""" $ 'ww' "*** With Cernlib 95a (and maybe before) this is fixed" $ 'ww' "*** I will therefore just continue" $ 'ww' "***" $ tcmzat = 1 $! goto exit $ else $ tcmzat = 0 $ endif $ endif $ else $ tcmzat = 0 $ endif $! $!============================================================================= $! Extra options $!============================================================================= $! $ if expnam.eqs."" then $gosub get_expnam $! $ 'ww' "Extra options:" $ 'ww' "@CERNLIB Use the cernlib command to define the CERN libraries" $ 'ww' "@CERNNEW Use the cernlib/new command to define the CERN libraries" $ 'ww' "@CERNOLD Use the cernlib/old command to define the CERN libraries" $ 'ww' "NAGLIB You have NAGLIB available" $ 'ww' "IMSL You have IMSL available" $ 'ww' "@DBG Make a version compiled with debug" $ 'ww' "CGR_MINUIT Include C. Rippich MINUIT version" $ 'ww' "@DEV Development version (expert option)" $ 'ww' "L3DSP Include L3 display version" $ 'ww' "ZEUSDSP Include ZEUS display version" $ inquire extra_opt "Give option(s) ( for none)" $! $! Options separated by spaces for cmz and commas for patchy $! $ extra_opt = f$edit(extra_opt,"trim,lowercase") $ if use_cmz $ then $ extra_opt = f$element(0,",",extra_opt) + " " + - f$element(1,",",extra_opt) + " " + - f$element(2,",",extra_opt) + " " + - f$element(3,",",extra_opt) + " " $ extra_opt = extra_opt - ", " - ", " - ", " $ else $ extra_opt = f$element(0," ",extra_opt) + "," + - f$element(1," ",extra_opt) + "," + - f$element(2," ",extra_opt) + "," + - f$element(3," ",extra_opt) + "," $ extra_opt = extra_opt - " ," - " ," - " ," $ extra_opt = f$edit(extra_opt,"trim") $ leno = f$length(extra_opt) $ if f$extract(leno-1,1,extra_opt).eqs."," then - $extra_opt = f$extract(0,leno-1,extra_opt) $ endif $ extra_opt = f$edit(extra_opt,"trim") $ 'ww' "Extra options: ''extra_opt'" $! $! See if the cernlib command is to be used $! Also set flags for naglib and imsl $! $ tcmzextra = "" $ if f$locate("@cern",extra_opt) .lt.f$length(extra_opt) then $cernlib_cmd = 1 $ if f$locate("naglib",extra_opt).lt.f$length(extra_opt) then $use_nag == 1 $ if f$locate("imsl",extra_opt) .lt.f$length(extra_opt) then $use_imsl == 1 $ if f$locate("@dbg",extra_opt) .lt.f$length(extra_opt) then $dbg_compile== 1 $ if f$locate("l3dsp",extra_opt) .lt.f$length(extra_opt) then $use_l3dsp == 1 $ if f$locate("zeusdsp",extra_opt).lt.f$length(extra_opt) then $use_zeusdsp== 1 $ if f$locate("cgr",extra_opt) .lt.f$length(extra_opt) then $use_cgrmin = 1 $ if f$locate("@cernnew",extra_opt) .lt.f$length(extra_opt) .and. - tcmzat then $tcmzextra = "/new" $ if f$locate("@cernold",extra_opt) .lt.f$length(extra_opt) .and. - tcmzat then $tcmzextra = "/old" $! $! Set up the compile commands $! $compile_commands: $ if architecture.eqs."ALPHA" $ then $ if dbg_compile $ then $ FTN_COMMAND == "fortran/separ/warn=(nousage)/deb/noopt" $ CC_COMMAND == "cc/extern=common/standard=vaxc/deb/noopt" $ else $ FTN_COMMAND == "fortran/separ/warn=(nousage)/opt" $ CC_COMMAND == "cc/extern=common/standard=vaxc/opt" $ endif $ else $ if dbg_compile $ then $ FTN_COMMAND == "fortran/deb/noopt" $ CC_COMMAND == "cc/deb/noopt" $ else $ FTN_COMMAND == "fortran/opt" $ CC_COMMAND == "cc/opt" $ endif $ endif $! $ 'ww' "The command to compile the fortran code is:" $ 'ww' "Note that if you are using DEC FORTRAN you need /WARN=(NOUSAGE)" $ 'ww' "/WARN=(NOUSAGE,NOUNUSED) may be better to avoid lots of" $ 'ww' "variable was declared but not used messages" $ 'ww' "''FTN_COMMAND'" $ inquire answer_ftn "Give your command (or )" $ if answer_ftn.nes."" then $FTN_COMMAND == answer_ftn $! $ 'ww' "The command to compile the c code is:" $ 'ww' "Note that if you are using DEC C you need /EXTERN=COMMON/STANDARD=VAXC" $ 'ww' "You may also need /SHARE_GLOBALS if you get a lot of $ 'ww' "conflicting attributes for psect messages on a Vax" $ 'ww' "''CC_COMMAND'" $ inquire answer_cc "Give your command (or )" $ if answer_cc.nes."" then $CC_COMMAND == answer_cc $! $ 'ww' "Fortran command is: ''FTN_COMMAND'" $ 'ww' "c command is: ''CC_COMMAND'" $ if answer_ftn.nes."" .or. answer_cc.nes."" $ then - $ inquire answer "Are the commands OK [*Y/N]" $ if answer.nes."" .and. .not.answer then $goto compile_commands $ endif $! $!============================================================================= $! Make cmz files from the car files $!============================================================================= $! $ if use_cmz $ then $ inquire answer "Do you have the CMZ files [Y/N*]" $ if answer.nes."" .and. answer then $goto make_kumac $ else $ inquire answer "Do you have the car files in mn_fit_cmz: [Y/N*]" $ if answer.nes."" .and. answer then $goto make_kumac $ endif $! $! Ask where the car files are $! $cardir: $ inquire cardir "Give the directory name for the .car files" $ if cardir.eqs."" .or. cardir.eqs."[]" then $cardir = dirsav $ if use_cmz $ then $ ncarfile = 0 $ open/write aa install1.kumac $ aaopen = 1 $loopcarc: $ tsearch = f$search("''cardir'*.car",0) $! show sym tsearch $ if tsearch.eqs."" then $goto endloopcarc $ name = f$parse(tsearch,,,"name") $! show sym name $ if f$search("''name'.cmz",1).nes."" then $rename/log 'name'.cmz *.cmz_old $ ncarfile = ncarfile + 1 $ 'wwa' "make ''name'" $ 'wwa' "ytoc ''cardir'''name'.car $ goto loopcarc $endloopcarc: $ close aa $ aaopen = 0 $ if ncarfile.gt.0 $ then $ cmz'tcmzextra'/batch=install1 $ else $ 'ww' "***" $ 'ww' "*** No car files found" $ 'ww' "***" $ inquire answer "Did you give the right directory name [Y/N*]" $ if answer.eqs."" .or. .not.answer then $goto cardir $ endif $ purge/noconfirm install1.kumac $ else $ ncarfile = 0 $loopcarp: $ tsearch = f$search("''cardir'*.car",0) $! show sym tsearch $ if tsearch.eqs."" then $goto endloopcarp $ name = f$parse(tsearch,,,"name") $! show sym name $ ncarfile = ncarfile + 1 $ copy/log 'cardir''name'.car [] $ goto loopcarp $endloopcarp: $ endif $! $make_kumac: $ if .not.use_cmz then $goto make_link $ inquire answer "Make the kumacs [*Y/N]" $ if answer.nes."" .and. .not.answer then $goto make_link $ open/write aa install2.kumac $ aaopen = 1 $ 'wwa' "file mn_util -r" $ 'wwa' "select VMS ''architecture'" $ if expnam.nes."" then $'wwa' "select ''expnam'" $ if extra_opt.nes."" then $'wwa' "select ''extra_opt'" $ 'wwa' "select" $! $ 'wwa' "set *.kumac -f text" $ 'wwa' "ctot -y $kumacs" $ close aa $ aaopen = 0 $ cmz'tcmzextra'/batch=install2 $ purge/noconfirm install2.kumac $! $!============================================================================= $! Check that cmzlogon is as expected $!============================================================================= $! $ 'ww' "**********************************************************************" $ 'ww' "This is the cmzlogon.kumac file" $ 'ww' "**********************************************************************" $ type/page cmzlogon.kumac $ inquire answer "Is the cmzlogon.kumac file OK [*Y/N]" $ if answer.nes."" .and. .not.answer then $goto exit $! $!============================================================================= $! Start up cmz as it should be normally and make the files for linking $!============================================================================= $! $make_link: $ inquire answer "Make the com file to link Mn_Fit [*Y/N]" $ if answer.nes."" .and. .not.answer then $goto cernlib_def $! $ if use_cmz $ then $ open/write aa install3.kumac $ aaopen = 1 $ 'wwa' "exec cmzlogon ''tfcern'" $ 'wwa' "exec mn_macro#makelink" $ close aa $ aaopen = 0 $ cmz'tcmzextra'/batch=install3 $ purge/noconfirm install3.kumac $ else $ outfile="mn_fit_dir:mn_fit.lnk" $ open/write aa mn_fit_lnk.cra $ aaopen = 1 $ 'wwa' "+OPTION,FULL,COMPACT." $ 'wwa' "+USE,VMS,''architecture'. Machine" $ 'wwa' "+USE,''TFCERN'. Cernlib version" $ if expnam.nes."" then $'wwa' "+USE,''expnam',@SITE" $ if extra_opt.nes."" then $'wwa' "+USE,''extra_opt'." $ 'wwa' "+USE,CDES. KEEP sequences" $ 'wwa' "+USE,P=JOBS,D=MN_FIT,T=EXE. Deck" $ if patchy5 $ then $ 'wwa' "+ASM, TEXT, T=ATTACH .''outfile'" $ else $ 'wwa' "+ASM,21,R=* ." $ endif $ 'wwa' "+PAM,11,T=C,A. mn_util.car" $ 'wwa' "+QUIT." $ close aa $ aaopen = 0 $! $ 'ww' "*" $ 'ww' "************************************************************" $ 'ww' "Making the script to link Mn_Fit" $ 'ww' "************************************************************" $ 'ww' "*" $ if f$search("''outfile'").nes."" then $delete/log/noconf 'outfile'. $ if patchy5 $ then $ nypatchy - - mn_fit_lnk.cra mn_fit_lnk.ylis .go $ else $ ypatchy - 'outfile' mn_fit_lnk.cra mn_fit_lnk.ylis .go $ endif $ endif $ goto cernlib_def $! $!============================================================================= $! Fortran only $!============================================================================= $! $fortran_only: $ libdir = f$trnlnm("mn_fit_lib") $ lnkdir = f$trnlnm("mn_fit_dir") $ ww "***" $ ww "*** The fortran files should be in directory: ''libdir'" $ ww "*** The link files should be in directory: ''lnkdir'" $ ww "***" $ inquire answer "Is this the case [*Y/N]" $ if answer.nes."" .and. .not.answer then $goto exit $! $!============================================================================= $! Check that the CERN library directory is correct $!============================================================================= $! $cernlib_def: $ if cernlib_cmd.eq.1 then $goto link_mn_fit $ if expnam.eqs."" then $gosub get_expnam $ if expnam.eqs."L3" then $goto link_mn_fit $ inquire answer - "Give the CERN libraries directory (=CERN$LIBRARY:)" $ if answer.nes."" then $define/log CERN$LIBRARY 'answer' $! $!============================================================================= $! Link Mn_Fit $!============================================================================= $! $link_mn_fit: $ if .not.relink then $inquire answer "Link Mn_Fit [*Y/N]" $ if answer.nes."" .and. .not.answer then $goto make_files $! $ if .not.relink $ then $ inquire compile "Recompile all the code [*Y/N]" $ if compile.eqs."" then $compile = "Y" $ else $ compile = "N" $ endif $! $ if use_cmz $ then $ cmzopt = "" $ else $ if do_fortran $ then $ cmzopt = "-ncmz" $ else $ cmzopt = "-p" $ endif $ endif $! $ gosub get_graphics $! $! Make the right version of tvbgn if we are relinking $! $ if relink .and. .not.do_fortran $ then $ set default mn_fit_lib: $ if use_cmz $ then $ open/write aa install4.kumac $ aaopen = 1 $ 'wwa' "exec cmzlogon" $ 'wwa' "exec mn_macro#fort_opt" $ 'wwa' "exec mn_macro#graphics ''tgname'" $ close aa $ aaopen = "0" $ cmz'tcmzextra'/batch=install4 $ purge/noconfirm install4.kumac $ else $ outfile="tvbgn_''tgks'" $ tgnam_p = f$element(0," ",tgnam) + "," + f$element(1," ",tgnam) + "," + - f$element(2," ",tgnam) $ tgnam_p = tgnam_p - ", " - ", " $ open/write aa 'outfile'.cra $ aaopen = 1 $ 'wwa' "+OPTION,FULL,COMPACT." $ 'wwa' "+USE,VMS,''architecture'. Machine" $ 'wwa' "+USE,V93,''TFCERN'. Cernlib version" $ 'wwa' "+USE,''tgnam_p'. Graphics" $ 'wwa' "+USE,GRAPHIC" $ 'wwa' "+USE,MNCDE. KEEP sequences" $ 'wwa' "+USE,P=GRAPHICS,T=EXE. Patches" $ 'wwa' "+PAM,11,T=C,A. mn_fit.car" $ 'wwa' "+QUIT." $ close aa $ aaopen = 0 $! $ 'ww' "************************************************************" $ 'ww' "Making ''outfile'" $ 'ww' "************************************************************" $ if f$search("''outfile'").nes."" then delete/log/noconf 'outfile'. $ if patchy5 $ then $ nypatchy - 'outfile' 'outfile'.cra 'outfile'.ylis .go $ else $ ypatchy - 'outfile' 'outfile'.cra 'outfile'.ylis .go $ endif $ 'ftn_command' 'outfile'.for $ endif $ endif $! $ set default mn_fit_dir: $! $! Just link Mn_Fit without a recompile $! $ if relink .or. .not.compile $ then $ @mn_fit.lnk -nc -g 'graphics' -v 'tfcern' 'tvcern' $ else $ @mn_fit.lnk -g 'graphics' -v 'tfcern' 'tvcern' 'cmzopt' $ endif $ if relink then $goto relink $! $!============================================================================= $! Make all the other Mn_Fit files $!============================================================================= $! $make_files: $ inquire answer "Make all the other Mn_Fit files [*Y/N]" $ if answer.nes."" .and. .not.answer then $goto relink $! $ set default mn_fit_cmz: $ if use_cmz $ then $ open/write aa install5.kumac $ aaopen = 1 $ 'wwa' "exec cmzlogon ''tfcern'" $ 'wwa' "exec mn_macro#makerun" $ 'wwa' "exec mn_macro#makehelp" $ 'wwa' "exec mn_macro#makedemo" $ 'wwa' "exec mn_macro#maketest" $ 'wwa' "exec mn_macro#makehist" $ 'wwa' "exec mn_macro#makedoc" $ close aa $ aaopen = 0 $ cmz'tcmzextra'/batch=install5 $ purge/noconfirm install5.kumac $ else $! $! Fortran files $! $ nloop = 0 $loopfile1: $ nloop = nloop + 1 $ if nloop.eq.1 $ then $ name = "helpmke" $ endif $ if nloop.eq.2 $ then $ name = "histmke" $ endif $ if nloop.ge.3 then $goto endloopfile1 $ deck = name $ outfile = "mn_fit_dir:''deck'" $! $ open/write aa 'name'.cra $ aaopen = 1 $ 'wwa' "+OPTION,FULL,COMPACT." $ 'wwa' "+USE,VMS,''architecture'. Machine" $ 'wwa' "+USE,''TFCERN'. Cernlib version" $ if cernlib_cmd then $'wwa' "+USE,@CERNLIB." $ 'wwa' "+USE,MNCDE,CDES. KEEP sequences" $ 'wwa' "+USE,P=UTIL,D=''deck',T=EXE. Deck" $ 'wwa' "+PAM,11,R=MNCDE,T=C,A. mn_fit.car" $ 'wwa' "+PAM,11,T=C,A. mn_util.car" $ 'wwa' "+QUIT." $ close aa $ aaopen = 0 $! $ 'ww' "*" $ 'ww' "************************************************************" $ 'ww' "Making ''outfile'" $ 'ww' "************************************************************" $ 'ww' "*" $ if f$search("''outfile'").nes."" then $delete/log/noconf 'outfile'. $ if patchy5 $ then $ nypatchy - 'outfile' 'name'.cra 'name'.ylis .go $ else $ ypatchy - 'outfile' 'name'.cra 'name'.ylis .go $ endif $ goto loopfile1 $endloopfile1: $! $! Help files and documentation $! $ nloop = 0 $loopfile2: $ nloop = nloop + 1 $ if nloop.eq.1 $ then $ name = "mn_fit_help" $ patch = "mn_fit_help,changes" $ outfile = "mn_fit_help:mn_fit_help.fil" $ endif $ if nloop.eq.2 $ then $ name = "minuit_help" $ patch = "minuit_help" $ outfile = "mn_fit_help:minuit_help.fil" $ endif $ if nloop.eq.3 $ then $ name = "doc" $ patch = "doc" $ outfile = "mn_fit_dir:mn_fit.doc" $ endif $ if nloop.ge.4 then $goto endloopfile2 $ open/write aa 'name'.cra $ aaopen = 1 $ 'wwa' "+OPTION,FULL,COMPACT." $ 'wwa' "+USE,VMS,''architecture'. Machine" $ 'wwa' "+USE,''TFCERN'. Cernlib version" $ 'wwa' "+USE,CDES. KEEP sequences" $ 'wwa' "+USE,P=''patch',T=EXE. Deck" $ if patchy5 $ then $ 'wwa' "+ASM, TEXT, T=ATTACH .''outfile'" $ else $ 'wwa' "+ASM,21,R=* ." $ endif $ 'wwa' "+PAM,11,T=C,A. mn_util.car" $ 'wwa' "+QUIT." $ close aa $ aaopen = 0 $! $ 'ww' "*" $ 'ww' "************************************************************" $ 'ww' "Making ''outfile'" $ 'ww' "************************************************************" $ 'ww' "*" $ if f$search("''outfile'").nes."" then $delete/log/noconf 'outfile'. $ if patchy5 $ then $ nypatchy - - 'name'.cra 'name'.ylis .go $ else $ ypatchy - 'outfile' 'name'.cra 'name'.ylis .go $ endif $ goto loopfile2 $endloopfile2: $! $! Com files and other single files $! $ nloop = 0 $loopfile3: $ nloop = nloop + 1 $ if nloop.eq.1 $ then $ name = "helpmke" $ patch = "jobs" $ outfile = "mn_fit_dir:''name'.run" $ endif $ if nloop.eq.2 $ then $ name = "histmke" $ patch = "jobs" $ outfile = "mn_fit_dir:''name'.run" $ endif $ if nloop.eq.3 $ then $ name = "mn_fit" $ patch = "exec" $ outfile = "mn_fit_com:''name'.com" $ endif $ if nloop.eq.4 $ then $ name = "news" $ patch = "news" $ outfile = "mn_fit_help:mn_''name'.fil" $ endif $ if nloop.ge.5 then $goto endloopfile3 $ deck = name $! $ open/write aa 'name'.cra $ aaopen = 1 $ 'wwa' "+OPTION,FULL,COMPACT." $ 'wwa' "+USE,VMS,''architecture'. Machine" $ 'wwa' "+USE,''TFCERN'. Cernlib version" $ if cernlib_cmd then $'wwa' "+USE,@CERNLIB." $ 'wwa' "+USE,CDES. KEEP sequences" $ 'wwa' "+USE,P=''patch',D=''deck',T=EXE. Deck" $ if patchy5 $ then $ 'wwa' "+ASM, TEXT, T=ATTACH .''outfile'" $ else $ 'wwa' "+ASM,21,R=* ." $ endif $ 'wwa' "+PAM,11,T=C,A. mn_util.car" $ 'wwa' "+QUIT." $ close aa $ aaopen = 0 $! $ 'ww' "*" $ 'ww' "************************************************************" $ 'ww' "Making ''outfile'" $ 'ww' "************************************************************" $ 'ww' "*" $ if f$search("''outfile'").nes."" then $delete/log/noconf 'outfile'. $ if patchy5 $ then $ nypatchy - - 'name'.cra 'name'.ylis .go $ else $ ypatchy - 'outfile' 'name'.cra 'name'.ylis .go $ endif $ goto loopfile3 $endloopfile3: $! $! Test and demonstration files - nedd patchy version 5 $! $ if .not.patchy5 $ then $ 'ww' "***" $ 'ww' "*** You do not have patchy version 5" $ 'ww' "*** I cannot make the test and demonstration files - sorry!" $ 'ww' "***" $ goto endloopfile4 $ endif $ nloop = 0 $loopfile4: $ nloop = nloop + 1 $ if nloop.eq.1 $ then $ name = "demo" $ ftype = "TEXT" $ ext = ".mnf" $ outdir = "mn_fit_help:" $ endif $ if nloop.eq.2 $ then $ name = "test" $ ftype = "TEXT" $ ext = ".mnf" $ outdir = "mn_fit_test:" $ endif $ if nloop.eq.3 $ then $ name = "test_files" $ ftype = "TEXT" $ ext = ".for" $ outdir = "mn_fit_test:" $ endif $ if nloop.eq.4 $ then $ name = "test_data" $ ftype = "DATA" $ ext = ".mnd" $ outdir = "mn_fit_test:" $ endif $ if nloop.ge.5 then $goto endloopfile4 $ deck = name $! $ open/write aa 'name'.cra $ aaopen = 1 $ 'wwa' "+OPTION,FULL,COMPACT." $ 'wwa' "+USE,VMS,''architecture'. Machine" $ 'wwa' "+USE,''TFCERN'. Cernlib version" $ 'wwa' "+USE,CDES. KEEP sequences" $ 'wwa' "+USE,P=''name',T=EXE. Deck" $ 'wwa' "+ASM, ''ftype',T=EXT .''ext'" $ 'wwa' "+ASM, ''ftype',T=SPLIT,PREFIX .''outdir'." $ 'wwa' "+PAM,11,T=C,A. mn_util.car" $ 'wwa' "+QUIT." $ close aa $ aaopen = 0 $! $ 'ww' "*" $ 'ww' "************************************************************" $ 'ww' "Making ''name' in directory ''outdir'" $ 'ww' "************************************************************" $ 'ww' "*" $ nypatchy - - 'name'.cra 'name'.ylis .go $! $! Rename the AVEHST histogram definitions file $! $ if name.eqs."test_files" $ then $ if f$search("mn_fit_test:ave_test.for").nes."" then - $rename mn_fit_test:ave_test.for *.def $ endif $ goto loopfile4 $endloopfile4: $! $ set default mn_fit_dir: $ 'ftn_command' helpmke.for $ @helpmke.run $! $ 'ftn_command' histmke.for $ @histmke.run $ endif $! $!============================================================================= $! See if Mn_Fit should be relinked with some other graphics package $!============================================================================= $! $relink: $ answer = "N" $ inquire answer "Relink Mn_Fit with another graphics package [Y/N*]" $ if answer.eqs."" .or. .not.answer then $goto link_display $ relink = 1 $ goto link_mn_fit $! $!============================================================================= $! Link DISPLAY version of Mn_Fit $!============================================================================= $! $link_display: +SELF,IF=VMS,IF=-L3DSP,IF=-ZEUSDSP. $ goto exit +SELF,IF=VMS,IF=L3DSP,ZEUSDSP. $ answer = "N" $ inquire answer "Link display version of Mn_Fit [Y/N*]" $ if answer.eqs."" .or. .not.answer then $goto exit $ gosub get_graphics $ set default mn_fit_dir: $ @mn_dsp.lnk n -g 'graphics' $ goto link_display +SELF,IF=VMS. $! $EXIT: $ set default 'dirsav' $ versav = f$verify('versav') $ if aaopen then $close aa $ EXIT $! $get_expnam: $ 'ww' "Possible experiments:" $ 'ww' "L3 For L3 repository" $ 'ww' "ALEPH" $ 'ww' "CLEO" $ 'ww' "BONN" $ 'ww' "ZEUS Only for ZEUS online machines" $ 'ww' "FNAL Uses DI3LOAD to link, DI3000 as default graphics package" $ 'ww' "CMU Carnegie Mellon" $ inquire expnam "Give experiment name ( for none)" $ return $! $get_graphics: $ inquire graphics - "Give graphics package (GKSGRAL, DECGKS, DGKS3D, DI3000, X11 or PLTSUB)" $ graphics = f$edit(graphics,"lowercase,trim") $ tgname = "" $ if f$extract(0,1,graphics).eqs."g" $ then $ tgname = "GKSGRAL" $ tgks = "g" $ endif $ if f$extract(0,1,graphics).eqs."v" .or. - f$extract(0,2,graphics).eqs."de" $ then $ tgname = "DECGKS" $ tgks = "v" $ endif $ if f$extract(0,2,graphics).eqs."dg" $ then $ tgname = "DGKS3D" $ tgks = "d" $ endif $ tgnam = "''tgname' HIGZ GKS" $ if f$extract(0,1,graphics).eqs."x" $ then $ tgname = "X11" $ tgks = "x" $ tgnam = "''tgname' HIGZ" $ endif $ if f$extract(0,2,graphics).eqs."di" $ then $ tgname = "DI3000" $ tgks = "3" $ tgnam = "''tgname' HIGZ" $ endif $ if f$extract(0,1,graphics).eqs."p" $ then $ tgname = "PLTSUB" $ tgks = "p" $ tgnam = "''tgname'" $ endif $ if tgname.eqs."" $ then $ 'ww' "*** Unknown graphics package: ''graphics'" $ goto exit $ endif $ return +SELF,IF=UNIX. #!/bin/sh # # Script to install Mn_Fit from scratch # PWD=`pwd` SCRIPT=`basename $0` # # Try to find what system I am running under # SYSTYPE_MN=`uname` #[ $SYSTYPE_MN = "" ] && SYSTYPE_MN=$OS #[ $SYSTYPE_MN = "" ] && SYSTYPE_MN=$DCP_CNAMES echo "The system is $SYSTYPE_MN" case $SYSTYPE_MN in HP-UX) COMPUTER="HPUX" ECHO_PRE="" ECHO_SUF="\c" ;; DomainOS) COMPUTER="APOLLO" case $SYSTYPE in bsd*) ECHO_PRE="-n" ECHO_SUF="" ;; sys*) ECHO_PRE="-n" ECHO_SUF="" ;; esac ;; IRIX*) COMPUTER="SGI" ECHO_PRE="-n" ECHO_SUF="" ;; OSF1) COMPUTER="ALPHA" ECHO_PRE="-n" ECHO_SUF="" ;; ULTRIX) COMPUTER="DECS" ECHO_PRE="" ECHO_SUF="\c" echo "SysV (echo 'Prompt: \\\c') or BSD (echo -n 'Prompt: '): " read answer echo "Answer is <$answer>" case $answer in s*|S*) ECHO_PRE="" ECHO_SUF="\c" ;; b*|B*) ECHO_PRE="-n" ECHO_SUF="" ;; *) exit ;; esac ;; SunOS) case `uname -r` in 5*) COMPUTER="SOLARIS" ECHO_PRE="" ECHO_SUB="\c" ;; *) COMPUTER="SUN" ECHO_PRE="-n" ECHO_SUF="" ;; esac ;; Linux) COMPUTER="LINUX" ECHO_PRE="-n" ECHO_SUF="" ;; AIX) COMPUTER="IBMRT" case "`uname -v`" in 3) ECHO_PRE="-n" ECHO_SUF="" ;; 4) ECHO_PRE="" ECHO_SUF="\c" ;; esac ;; *) COMPUTER="$SYSTYPE_MN" echo "SysV (echo 'Prompt: \\\c') or BSD (echo -n 'Prompt: '): " read answer echo "Answer is <$answer>" case $answer in s*|S*) ECHO_PRE="" ECHO_SUF="\c" ;; b*|B*) ECHO_PRE="-n" ECHO_SUF="" ;; *) exit ;; esac echo "Computer is set to $COMPUTER" echo "Known are ALPHA, APOLLO, DECS, HPUX, IBMAIX, IBMRT, SGI, \ SunOS, LINUX" echo $echo_pre "Give the computer name: $ECHO_SUF" read name echo "Name is <$name>" [ name = "" ] || COMPUTER=$name esac # # Set Cernlib version # echo $ECHO_PRE "Give Cernlib version number (=2000): $ECHO_SUF" read TVCERN echo "Answer is <$TVCERN>" test -z "$TVCERN" && TVCERN="2000" # # Check that tvcern is OK # case $TVCERN in *94a) TFCERN="94a" ;; *94b) TFCERN="94b" ;; *95a) TFCERN="95a" ;; *96a) TFCERN="96a" ;; *97a) TFCERN="97a" ;; *98) TFCERN="98" ;; *99) TFCERN="99" ;; *2000) TFCERN="2000" ;; *00) TFCERN="00" ;; *) echo "Valid Cernlib versions are 94a, 94b, 95a, 96a, 97a, 98, 99, 2000 and 00" exit ;; esac export TFCERN export TVCERN # echo "Possible experiments/institutions:" echo "CERNAFS Use CERN AFS directories" echo "DESYAFS Use DESY AFS directories" echo "L3 Only for L3 repository" echo "CLEO /home/mnfit/mn_fit is top-level Mn_Fit directory" echo "CMU Carnegie Mellon" echo "BONN Bonn University" echo "BONNCIP Bonn University, CIP Pool" echo "ZEUS DESY non-AFS machines (zenbonn)" echo $ECHO_PRE "Give name ( for none): $ECHO_SUF" read EXPNAM echo "Answer is <$EXPNAM>" # echo "Other possible options for kumacs and scripts:" echo "@CERNLIB Use the cernlib command for the CERN libraries" echo "NAGLIB Include NAGLIB spline fitting and smoothing" echo "IMSL Include IMSL spline fitting and smoothing" echo "@DBG Make a version compiled with DEBUG" echo "@GCC Use gcc as the c compiler (default is cc)" echo "@DEV Development version (expert option)" echo "L3DSP Include L3 display" echo "ZEUSDSP Include ZEUS display" echo $ECHO_PRE "Give option(s): $ECHO_SUF" read EXTRA_OPT echo "Answer is <$EXTRA_OPT>" # echo "$EXTRA_OPT" | grep -i "@cernlib" >/dev/null && CERNLIB_CMD=1 echo "$EXTRA_OPT" | grep -i "naglib" >/dev/null && USE_NAG=1 echo "$EXTRA_OPT" | grep -i "imsl" >/dev/null && USE_IMSL=1 echo "$EXTRA_OPT" | grep -i "@dbg" >/dev/null && DBG_COMPILE=1 echo "$EXTRA_OPT" | grep -i "@gcc" >/dev/null && USE_GCC=1 echo "$EXTRA_OPT" | grep -i "cgr" >/dev/null && USE_CGRMIN=1 echo "$EXTRA_OPT" | grep -i "zeusdsp" >/dev/null && USE_ZEUSDSP=1 echo "$EXTRA_OPT" | grep -i "l3dsp" >/dev/null && USE_L3DSP=1 test "$CERNLIB_CMD" && export CERNLIB_CMD test "$USE_NAG" && export USE_NAG test "$USE_IMSL" && export USE_IMSL test "$DBG_COMPILE" && export DBG_COMPILE test "$USE_GCC" && export USE_GCC test "$USE_CGRMIN" && export USE_CGRMIN test "$USE_L3DSP" && export USE_L3DSP test "$USE_ZEUSDSP" && export USE_ZEUSDSP echo "cernlib_cmd = <$CERNLIB_CMD>" echo "use_nag = <$USE_NAG>" echo "use_imsl = <$USE_IMSL>" echo "dbg_compile = <$DBG_COMPILE>" echo "use_gcc = <$USE_GCC>" echo "use_cgrmin = <$USE_CGRMIN>" echo "use_l3dsp = <$USE_L3DSP>" echo "use_zeusdsp = <$USE_ZEUSDSP>" # #------------------------------------------------------------------------------ # Setup the NAG library directory if neceesary #------------------------------------------------------------------------------ # if [ "$USE_NAG" ]; then echo "On DESY Suns use /usr/local/lib" echo "On DESY SGIs use /usr/local/lib32" echo $ECHO_PRE "Give the NAG library directory"\ "[=/cern/nag/pro/lib]: " read answer echo "Answer is <$answer>" if [ "$answer" ]; then NAG_LIBDIR=$answer else NAG_LIBDIR="/cern/nag/pro/lib" fi export NAG_LIBDIR echo "On DESY SGIs and Suns use nag" echo $ECHO_PRE "Give the NAG library filename [=naglib]: " read answer echo "Answer is <$answer>" if [ "$answer" ]; then NAG_LIB=$answer else NAG_LIB="naglib" fi export NAG_LIB echo "+++" echo "+++ NAG library will be searched for in $NAG_ROOT" echo "+++ NAG library filename is assumed to be lib$NAG_LIB.a" echo "+++" fi # #------------------------------------------------------------------------------ # Setup the compiler commands #------------------------------------------------------------------------------ # OPTIMIZE='-O' test "$DBG_COMPILE" && OPTIMIZE='-g' # CC_COMM="cc $OPTIMIZE -I." test "$USE_GCC" && CC_COMM="gcc $OPTIMIZE -I." case $SYSTYPE_MN in HP-UX) test "$USE_GCC" || CC_COMM="cc $OPTIMIZE -Aa +DA1.1 -I." test "$DBG_COMPILE" || OPTIMIZE='+O1' test "$DBG_COMPILE" && OPTIMIZE='-g -C' FTN_COMM="f77 $OPTIMIZE -K +ppu +T +E4 +DA1.1" ;; DomainOS) FTN_COMM="f77 $OPTIMIZE -W0,-nuc,-save,-indexl -A cpu,$ISP" CC_COMM="/bin/cc $OPTIMIZE -I. -A cpu,$ISP" ;; IRIX) test "$DBG_COMPILE" && OPTIMIZE='-g -C' FTN_COMM="f77 $OPTIMIZE -static -nocpp" ;; IRIX64) test "$USE_GCC" || CC_COMM="cc -n32 $OPTIMIZE -I." test "$DBG_COMPILE" && OPTIMIZE='-g -C' FTN_COMM="f77 -n32 $OPTIMIZE" ;; OSF1) test "$DBG_COMPILE" && OPTIMIZE='-g -C' FTN_COMM="f77 $OPTIMIZE -warn nousage" #FTN_COMM="f77 $OPTIMIZE -cpp -warn nousage -vms" ;; ULTRIX) +SELF,IF=UNIX,IF=DECS,IF=CMU. FTN_COMM="fort $OPTIMIZE -static -G 3 -cpp -w1" +SELF,IF=UNIX,IF=-DECS,-CMU. FTN_COMM="f77 $OPTIMIZE -static -G 3 -cpp -w1" +SELF,IF=UNIX. test "$USE_GCC" || CC_COMM="c89 $OPTIMIZE -I." ;; SunOS) test "$DBG_COMPILE" && OPTIMIZE='-g -C' FTN_COMM="f77 $OPTIMIZE" ;; Linux) test "$DBG_COMPILE" && OPTIMIZE='-g -C -fdebug-kludge' FTN_COMM="g77 $OPTIMIZE" ;; AIX) FTN_COMM="xlf $OPTIMIZE -qextname -qrndsngl -qcharlen=32767 \ -qxlf77=leadzero" ;; *) FTN_COMM="f77 $OPTIMIZE" ;; esac # echo "If you use f2c with cc on Linux you may need the options -Nx400 -Nn1604" echo "On Solaris machines you often have to give the full pathname for the" echo "Fortran and C compilers. You also need to give the option -DSolaris2" echo "if you are using Cernlib version 95a or earlier, e.g." echo "/opt/SUNWspro/bin/f77" echo "/usr/local/bin/gcc -I. -DSolaris2" echo " " # echo "The command to compile the fortran code is" echo "$FTN_COMM" echo $ECHO_PRE "Give your command (or ): $ECHO_SUF" read answer echo "Answer is <$answer>" test "$answer" && FTN_COMM="$answer" # echo "The command to compile the c code is" echo "$CC_COMM" echo $ECHO_PRE "Give your command (or ): $ECHO_SUF" read answer echo "Answer is <$answer>" test "$answer" && CC_COMM="$answer" # FTN_COMMAND="$FTN_COMM" CC_COMMAND="$CC_COMM" # # Export the compilation commands # export FTN_COMMAND export CC_COMMAND # #------------------------------------------------------------------------------ # Create the necessary directories if needed #------------------------------------------------------------------------------ # if [ ! "$MN_FIT" ]; then export MN_FIT; MN_FIT=$PWD fi echo "+++" echo "+++ MN_FIT environment variable is set to <$MN_FIT>" echo "+++" # cd $MN_FIT test -d mgr || mkdir mgr test -d lib || mkdir lib test -d exe || mkdir exe test -d cmz || mkdir cmz test -d bin || mkdir bin test -d help || mkdir help test -d test || mkdir test # if [ $COMPUTER = "APOLLO" ]; then cd lib test -d m68k || mkdir m68k test -d a88k || mkdir a88k test -d m68k/fsub || mkdir m68k/fsub test -d a88k/fsub || mkdir a88k/fsub cd ../exe test -d m68k || mkdir m68k test -d a88k || mkdir a88k cd .. else cd lib test -d fsub || mkdir fsub cd .. fi # #============================================================================== # cmz or patchy installation #============================================================================== # echo $ECHO_PRE "Do you have cmz [*Y/N]: $ECHO_SUF" read answer echo "Answer is <$answer>" test -z "$answer" && answer="Y" case "$answer" in # # CMZ # y|Y) use_cmz=1 # # Setup the readline include directory if readline is already installed. # if [ ! -d $MN_FIT/lib/readline ]; then echo "+++" echo "+++ If readline is already installed separately from Mn_Fit," echo "+++ the readline directory in \$MN_FIT/lib" echo "+++ should be a soft link to the directory containing" echo "+++ the readline include files." echo "+++ This is probably /usr/local/include or something like that." echo "+++ Do not append readline to the directory name" echo "+++ On L3 shift it is /afs/cern.ch/asis/share/usr.local/include" echo "+++ On rsl3eth3 it is /afs/cern.ch/asis/share/usr.local/include" echo "+++ Under SUSE Linux it is /usr/include" echo "+++" echo "+++ You should then link Mn_Fit with the option -rl or -rcl, or" echo "+++ -r or -rc readline_directory" echo "+++" echo "+++ If you want the install procedure to make the library" echo "+++ just hit " echo "+++" echo $ECHO_PRE "Give the directory (or ): $ECHO_SUF" read answer echo "Answer is <$answer>" if [ "$answer" ]; then readline_lib="$answer" test -d "$MN_FIT/lib/readline" && rm -r $MN_FIT/lib/readline test -w "$MN_FIT/lib/readline" && rm $MN_FIT/lib/readline ln -s $answer/readline $MN_FIT/lib/readline fi fi ;; # # Patchy # *) use_cmz=0 PATCHY5=1 echo $ECHO_PRE "Do you have patchy version 5 or nypatchy? [*Y/N]: $ECHO_SUF" read answer echo "Answer is <$answer>" test -z "$answer" && answer="Y" case $answer in y|Y) if [ "$TFCERN" = "94b" ]; then echo "+++" echo "+++ Patchy 5 not used to make code" echo "+++ as it has problems with sequences" echo "+++" PATCHY5=0 fi ;; n|N) PATCHY5=0 ;; esac export PATCHY5 # # Make sure the readline include directory is setup # if [ ! -d $MN_FIT/lib/readline ]; then echo "+++" echo "+++ If you want to use readline," echo "+++ the readline directory in \$MN_FIT/lib" echo "+++ should be a soft link to the directory containing" echo "+++ the readline include files." echo "+++ This is probably /usr/local/include or something like that." echo "+++ Do not append readline to the directory name" echo "+++ On L3 shift it is /afs/cern.ch/asis/share/usr.local/include" echo "+++ On rsl3eth3 it is /afs/cern.ch/asis/share/usr.local/include" echo "+++ Under SUSE Linux it is /usr/include" echo "+++" echo $ECHO_PRE "Give the directory [/usr/local/include]: $ECHO_SUF" read answer echo "Answer is <$answer>" test -z "$answer" && answer="/usr/local/include" test -d "$MN_FIT/lib/readline" && rm -r $MN_FIT/lib/readline test -w "$MN_FIT/lib/readline" && rm $MN_FIT/lib/readline ln -s $answer/readline $MN_FIT/lib/readline fi # # Export the computer type # export COMPUTER ;; esac # # Options separated by space for cmz and commas for patchy # if [ "$use_cmz" -eq 1 ]; then EXTRA_OPT=`echo $EXTRA_OPT | tr -s ',' ' '` else EXTRA_OPT=`echo $EXTRA_OPT | tr -s ' ' ','` fi echo "Extra options: $EXTRA_OPT" # #============================================================================== # Make the cmz files if necessary #============================================================================== # if [ $use_cmz -eq 1 ]; then echo $ECHO_PRE "Do you have the cmz files [Y/N*]: $ECHO_SUF" read answer echo "Answer is <$answer>" test -z "$answer" && answer="N" case "$answer" in n|N) cd $PWD echo $ECHO_PRE "Give the directory with the .car files: $ECHO_SUF" read cardir echo "Directory is <$cardir>" cd $cardir CARDIR=`pwd` cd $MN_FIT/cmz echo "trace on" > install1.kumac for file in mn_fit mn_util typscn cgr_minuit l3_dsp dbase zeus_dsp do if [ -f $CARDIR/$file.car ]; then test -f $file.cmz && mv $file.cmz $file.cmz_old echo "make $file" >> install1.kumac echo "ytoc $CARDIR/$file.car" >> install1.kumac fi done cat install1.kumac echo "*" echo "************************************************************" echo "Making cmz from car files" echo "************************************************************" echo "*" cmz -b install1 # # See if the GNU readline is in the same directory as the car files # GNU_READLINE="mn_readline-1.2.tar.gz" if [ -f $CARDIR/$GNU_READLINE ]; then echo "*" echo "************************************************************" echo "Copying GNU readline" echo "************************************************************" echo "*" cp $CARDIR/$GNU_READLINE $MN_FIT/cmz fi esac # #============================================================================== # Put the car files in the right place for patchy #============================================================================== # elif [ $use_cmz -eq 0 ]; then cd $PWD echo $ECHO_PRE "Give the directory (if any) with the .car files: $ECHO_SUF" read cardir echo "Directory is <$cardir>" cd $cardir CARDIR=`pwd` cd $MN_FIT/cmz for file in mn_fit mn_util typscn dbase l3_dsp zeus_dsp do if [ -f $CARDIR/${file}.car ]; then echo "Copying $CARDIR/${file}.car" cp $CARDIR/${file}.car ${file}.car fi done fi # #============================================================================== # Make the kumac's #============================================================================== # if [ $use_cmz -eq 1 ]; then echo $ECHO_PRE "Make the kumacs [*Y/N]: $ECHO_SUF" read answer echo "Answer is <$answer>" test -z "$answer" && answer="Y" case "$answer" in y|Y) cd $MN_FIT/cmz echo "trace on" > install2.kumac echo "file mn_util -r" >> install2.kumac echo "select UNIX $COMPUTER" >> install2.kumac test "$EXPNAM" && echo "sel $EXPNAM @SITE" >> install2.kumac test "$EXTRA_OPT" && echo "sel $EXTRA_OPT" >> install2.kumac echo "set *.kumac -f text" >> install2.kumac echo "ctot -y \$kumacs" >> install2.kumac cat install2.kumac cmz -b install2 # # Check that the cmzlogon.kumac is as expected # echo "*" echo "************************************************************" echo "This is cmzlogon.kumac" echo "************************************************************" echo "*" cat cmzlogon.kumac echo $ECHO_PRE "Is the cmzlogon file OK [*Y/N]: $ECHO_SUF" read answer echo "Answer is <$answer>" if [ -z "$answer" ]; then answer="Y" fi case $answer in n|N) exit ;; esac esac fi # #============================================================================== # Start up cmz as it should be and make the files for linking #============================================================================== # if [ $use_cmz -eq 1 ]; then echo $ECHO_PRE "Make the script to link Mn_Fit [*Y/N]: $ECHO_SUF" read answer echo "Answer is <$answer>" test -z "$answer" && answer="Y" case "$answer" in y|Y) cd $MN_FIT/cmz echo "trace on" > install3.kumac if [ $COMPUTER = "APOLLO" ]; then echo "exec cmzlogon '$TFCERN' '$ISP'" >> install3.kumac else echo "exec cmzlogon '$TFCERN'" >> install3.kumac fi echo "exec mn_macro#makelink" >> install3.kumac cat install3.kumac echo "*" echo "************************************************************" echo "Making the script to link Mn_Fit" echo "************************************************************" echo "*" cmz -b install3 ;; esac # elif [ $use_cmz -eq 0 ]; then echo $ECHO_PRE "Make the script to link Mn_Fit [*Y/N]: $ECHO_SUF" read answer echo "Answer is <$answer>" test -z "$answer" && answer="Y" case "$answer" in y|Y) for file in mn_fit mn_user mn_dsp do cd $MN_FIT/cmz outfile="$MN_FIT/mgr/$file.lnk" echo "+OPTION,FULL,COMPACT." >mn_fit_lnk.cra echo "+USE,UNIX,$COMPUTER. Machine" >>mn_fit_lnk.cra echo "+USE,$TFCERN. Cernlib version" >>mn_fit_lnk.cra test "$EXPNAM" && echo "+USE,$EXPNAM,@SITE." >>mn_fit_lnk.cra test "$EXTRA_OPT" && echo "+USE,$EXTRA_OPT." >>mn_fit_lnk.cra echo "+USE,CDES. KEEP sequences" >>mn_fit_lnk.cra echo "+USE,P=JOBS,D=$file,T=EXE. Deck" >>mn_fit_lnk.cra if [ $PATCHY5 -eq 1 ]; then echo "+ASM, TEXT, T=ATTACH .$outfile" >>mn_fit_lnk.cra else echo "+ASM,21,R=* ." >>mn_fit_lnk.cra fi echo "+PAM,11,T=C,A. mn_util.car" >>mn_fit_lnk.cra echo "+QUIT." >>mn_fit_lnk.cra # echo "*" echo "************************************************************" echo "Making the script $file.lnk to link Mn_Fit" echo "************************************************************" echo "*" test -f $outfile && rm $outfile if [ $PATCHY5 -eq 1 ]; then nypatchy - - mn_fit_lnk.cra mn_fit_lnk.ylis .go else ypatchy - $outfile mn_fit_lnk.cra mn_fit_lnk.ylis .go fi chmod a+x $outfile done ;; esac fi # #============================================================================= # Link Mn_Fit #============================================================================== # echo $ECHO_PRE "Link Mn_Fit [*Y/N]: $ECHO_SUF" read answer echo "Answer is <$answer>" test -z "$answer" && answer="Y" case $answer in y|Y) cd $MN_FIT/mgr echo $ECHO_PRE \ "Give the graphics package (GKSGRAL, X11 or DECGKS): $ECHO_SUF" read graphics echo "Graphics package is <$graphics>" case $graphics in g*|G*) tgname='GKSGRAL' ;; x*|X*) tgname='X11' ;; d*|D*) tgname='DECGKS' ;; *) echo "Unknown graphics package $graphics" exit ;; esac echo "Extra options for linking are typically" echo " -r readline_directory," echo " -rc readline_directory," echo " if readline is not in /usr/local/lib for patchy installation, or" echo " should not be taken from \$MN_FIT/lib/readline for cmz installation" echo " -nr to not use GNU readline" echo " -nc to not compile everything (assumes you have compiled already)" echo "Note that IBM AIX4 at CERN no longer contains the termcap library" echo "so you MUST use -rc or -rcl as the readline options" # # if [ ! -d "$MN_FIT/lib/readline" -o -h "$MN_FIT/lib/readline" ]; then # # IBMAIX does not know about the -h option for test # On SGI -d on a link that it a directory returns true! # find seems to solve all these problems!! # SGI needs a cd and . instead of the directory in the command!!! # Do this in a subshell. # (cd $MN_FIT/lib if [ "`find . -name readline -type l -print`" ]; then echo "+++" echo "+++ You said that readline is already installed." echo "+++ You should then link Mn_Fit with the option -rl, -rcl or" echo "+++ -r readline_directory or -rc readline_directory" echo "+++ On L3 shift use -r /afs/cern.ch/asis/sgi_53/usr.local/lib" echo "+++ Under SUSE Linux use -r /usr/lib -rt /usr/lib/termcap" echo "+++" fi) echo $ECHO_PRE "Give options: $ECHO_SUF" read LINK_OPTS echo "Link options are <$LINK_OPTS>" echo "*" echo "************************************************************" echo "Linking Mn_Fit" echo "************************************************************" echo "*" if [ $use_cmz -eq 1 ]; then ./mn_fit.lnk -g $graphics -v $TFCERN $TVCERN $LINK_OPTS else ./mn_fit.lnk -p -rl -g $graphics -v $TFCERN $TVCERN $LINK_OPTS fi esac # #============================================================================= # Make all the other Mn_Fit files #============================================================================= # echo $ECHO_PRE "Make all the other Mn_Fit files [*Y/N]: $ECHO_SUF" read answer echo "Answer is <$answer>" test -z "$answer" && answer="Y" case $answer in y|Y) cd $MN_FIT/cmz # # CMZ # if [ $use_cmz -eq 1 ]; then if [ $COMPUTER = "APOLLO" ]; then echo "exec cmzlogon '$TFCERN' '$ISP'" > install5.kumac else echo "exec cmzlogon '$TFCERN'" > install5.kumac fi echo "exec mn_macro#makerun" >> install5.kumac echo "exec mn_macro#makehelp" >> install5.kumac echo "exec mn_macro#makedemo" >> install5.kumac echo "exec mn_macro#maketest" >> install5.kumac echo "exec mn_macro#makehist" >> install5.kumac echo "exec mn_macro#makedoc" >> install5.kumac cat install5.kumac echo "*" echo "************************************************************" echo "Making all other Mn_Fit files" echo "************************************************************" echo "*" cmz -b install5 # # Patchy # elif [ $use_cmz -eq 0 ]; then echo "*" echo "************************************************************" echo "Making all other Mn_Fit files" echo "************************************************************" echo "*" # # Fortran files # for i in helpmke histmke do echo "Making $i.f" echo "+OPTION,FULL,COMPACT." >$i.cra echo "+USE,UNIX,$COMPUTER. Machine" >>$i.cra echo "+USE,$TFCERN. Cernlib version" >>$i.cra echo "+USE,MNCDE,CDES. KEEP sequences" >>$i.cra echo "+USE,P=UTIL,D=$i,T=EXE. Deck" >>$i.cra echo "+PAM,11,R=MNCDE,T=C,A. mn_fit.car" >>$i.cra echo "+PAM,11,T=C,A. mn_util.car" >>$i.cra echo "+QUIT." >>$i.cra # outfile="$MN_FIT/mgr/$i" test -f $outfile.f && rm $outfile.f test -f $i.ylis && rm $i.ylis if [ $PATCHY5 -eq 1 ]; then nypatchy - $outfile $i.cra $i.ylis .go else ypatchy - $outfile $i.cra $i.ylis .go fi done # # Help files and documentation # for i in mn_fit_help minuit_help doc do if [ $i = "mn_fit_help" ]; then patch="MN_FIT_HELP,CHANGES" outfile="$MN_FIT/help/$i.fil" elif [ $i = "minuit_help" ]; then patch="MINUIT_HELP" outfile="$MN_FIT/help/$i.fil" elif [ $i = "doc" ]; then patch="DOC" outfile="$MN_FIT/mgr/mn_fit.doc" fi # echo "Making $i" echo "+OPTION,FULL,COMPACT." >$i.cra echo "+USE,UNIX,$COMPUTER. Machine" >>$i.cra echo "+USE,$TFCERN. Cernlib version" >>$i.cra echo "+USE,CDES. KEEP sequences" >>$i.cra echo "+USE,P=$patch,T=EXE. Deck" >>$i.cra if [ $PATCHY5 -eq 1 ]; then echo "+ASM, TEXT, T=ATTACH .$outfile" >>$i.cra else echo "+ASM,21,R=* ." >>$i.cra fi echo "+PAM,11,T=C,A. mn_util.car" >>$i.cra echo "+QUIT." >>$i.cra # test -f $outfile && rm $outfile test -f $i.ylis && rm $i.ylis if [ $PATCHY5 -eq 1 ]; then nypatchy - - $i.cra $i.ylis .go else ypatchy - $outfile $i.cra $i.ylis .go fi chmod a+x $outfile done # # Scripts and other files # for i in helpmke histmke mn_fit news do patch2='' deck="$i" deck2='' if [ $i = "helpmke" -o $i = "histmke" ]; then patch="JOBS" outfile="$MN_FIT/mgr/$i.run" elif [ $i = "mn_fit" ]; then patch="EXEC" outfile="$MN_FIT/bin/$i.com" elif [ $i = "news" ]; then patch="NEWS" outfile="$MN_FIT/help/mn_$i.fil" fi echo "Making $i" echo "+OPTION,FULL,COMPACT." >$i.cra echo "+USE,UNIX,$COMPUTER. Machine" >>$i.cra echo "+USE,$TFCERN. Cernlib version" >>$i.cra test "$EXPNAM" && echo "+USE,$EXPNAM,@SITE." >>$i.cra test "$CERNLIB_CMD" && echo "+USE,@CERNLIB." >>$i.cra echo "+USE,CDES. KEEP sequences" >>$i.cra echo "+USE,P=$patch,D=$deck,T=EXE. Deck" >>$i.cra if [ $PATCHY5 -eq 1 ]; then echo "+ASM, TEXT, T=ATTACH .$outfile" >>$i.cra else echo "+ASM,21,R=* ." >>$i.cra fi echo "+PAM,11,T=C,A. mn_util.car" >>$i.cra echo "+QUIT." >>$i.cra # test -f $outfile && rm $outfile test -f $i.ylis && rm $i.ylis if [ $PATCHY5 -eq 1 ]; then nypatchy - - $i.cra $i.ylis .go else ypatchy - $outfile $i.cra $i.ylis .go fi chmod a+x $outfile done # # Test and demonstration files - need patchy version 5 # if [ $PATCHY5 -eq 1 ]; then for i in demo test test_files test_data do patch="$i" if [ $i = "demo" ]; then ftype="TEXT" outdir="$MN_FIT/help/" ext=".mnf" elif [ $i = "test" ]; then ftype="TEXT" outdir="$MN_FIT/test/" ext=".mnf" elif [ $i = "test_files" ]; then ftype="TEXT" outdir="$MN_FIT/test/" ext=".for" elif [ $i = "test_data" ]; then ftype="DATA" outdir="$MN_FIT/test/" ext=".mnd" fi # echo "+OPTION,FULL,COMPACT." >$i.cra echo "+USE,UNIX,$COMPUTER. Machine" >>$i.cra echo "+USE,$TFCERN. Cernlib version" >>$i.cra echo "+USE,CDES. KEEP sequences" >>$i.cra echo "+USE,P=$patch,T=EXE. Deck" >>$i.cra echo "+ASM, $ftype, T=EXT .$ext" >>$i.cra echo "+ASM, $ftype, T=SPLIT,PREFIX .$outdir" >>$i.cra echo "+PAM,11,T=C,A. mn_util.car" >>$i.cra echo "+QUIT." >>$i.cra # dirsav=`pwd` nypatchy - - $i.cra $i.ylis .go cd $dirsav done else echo "***" echo "*** You do not have patchy version 5" echo "*** I cannot make the test and demonstration files - sorry!" echo "***" fi # # Help files # cd $MN_FIT/mgr $FTN_COMMAND -c helpmke.f ./helpmke.run # # Test histograms # $FTN_COMMAND -c histmke.f ./histmke.run # # Main script # mv $MN_FIT/bin/mn_fit.com $MN_FIT/bin/mn_fit fi ;; esac # #============================================================================= # See if Mn_Fit should be relinked with some other graphics package #============================================================================= # answer="Y" while [ "X$answer" = "XY" -o "X$answer" = "Xy" ]; do echo $ECHO_PRE "Relink Mn_Fit with another graphics package [Y/N*]: $ECHO_SUF" read answer echo "Answer is <$answer>" case $answer in y|Y) cd $MN_FIT/cmz echo $ECHO_PRE \ "Give the graphics package (GKSGRAL, X11 or DECGKS): $ECHO_SUF" read graphics echo "Graphics package is <$graphics>" case $graphics in g*|G*) tgname='GKSGRAL' ;; x*|X*) tgname='X11' ;; d*|D*) tgname='DECGKS' ;; *) echo "Unknown graphics package $graphics" exit ;; esac if [ $COMPUTER = "APOLLO" ]; then echo "exec cmzlogon '$TFCERN' '$ISP'" > install4.kumac else echo "exec cmzlogon '$TFCERN'" > install4.kumac fi echo "exec mn_macro#fort_opt" >> install4.kumac echo "exec mn_macro#graphics $tgname" >> install4.kumac cat install4.kumac cmz -b install4 # cd $MN_FIT/mgr if [ -z "LINK_OPTS" ]; then echo $ECHO_PRE "Give any other options for linking $ECHO_SUF" echo $ECHO_PRE " (e.g. -nr to not use GNU readline): $ECHO_SUF" read LINK_OPTS fi echo "*" echo "************************************************************" echo "Relinking Mn_Fit" echo "************************************************************" echo "*" ./mn_fit.lnk -nc -g $graphics -v $TFCERN $TVCERN $LINK_OPTS ;; *) break ;; esac done +SELF,IF=UNIX,IF=L3DSP,ZEUSDSP. # #============================================================================= # Link display version of Mn_Fit #============================================================================= # answer="Y" while [ "X$answer" = "XY" -o "X$answer" = "Xy" ]; do echo $ECHO_PRE "Link display version of Mn_Fit [Y/N*]: $ECHO_SUF" read answer echo "Answer is <$answer>" case $answer in y|Y) cd $MN_FIT/cmz echo $ECHO_PRE "Give the graphics package (GKSGRAL or X11): $ECHO_SUF" read graphics echo "Graphics package is <$graphics>" case $graphics in g*|G*) tgname='GKSGRAL' ;; x*|X*) tgname='X11' ;; esac # cd $MN_FIT/mgr if [ -z "LINK_OPTS" ]; then echo $ECHO_PRE "Give any other options for linking $ECHO_SUF" echo $ECHO_PRE " (e.g. -nr to not use GNU readline): $ECHO_SUF" read LINK_OPTS fi echo "*" echo "************************************************************" echo "Linking display version of Mn_Fit" echo "************************************************************" echo "*" ./mn_dsp.lnk -g $graphics -v $TFCERN $TVCERN $LINK_OPTS ;; *) break ;; esac done +SELF,IF=UNIX. # cd $PWD exit +DECK,mn_fit. +SELF,IF=VMS. $! $! COM file to run MN_FIT from either your terminal or a file $! To run from a terminal say $! DO MN_FIT at Cornell $! @DISK$L32:[BROCK]MN_FIT on VXCERN $! MN_FIT on the L3 online cluster $! $! To run from a file add filename.ext to the above syntax $! The screen device or a blank line should be included in filename.ext. $! $! Author Ian C. Brock Jan 9, 1987 $! Last changed: Nov 8, 1990 $! $! If a parameter starts with the symbol defined by Par_Flag, $ Par_Flag = "-" $! then it is interpreted as a special parameter. The currently $! defined special parameters are: $! $! Parameter Action $! $! -? Help $! -TEST Use the test version $! -USER Use a user version (give the exe name if it is not the default) $! -OLD Use the old version $! -DEV Use the development version $! -DISPLAY Use L3 online display version $! -GKSGRAL Use the GKSGRAL version $! -VAXGKS Use the VAXGKS version (equivalent to DECGKS) $! -DECGKS Use the DECGKS version (equivalent to VAXGKS) $! -DGKS3D Use the DEC GKS 3D version $! -DI3000 Use the DI3000 version $! -X11 Use the X11 version $! -NODE Hostname for the display in X-windows version $! -TRANSPORT Transport mechanism for the display in X-windows version $! -SERVER Server number for the display in X-windows version $! -PLTSUB Use the PLTSUB version $! -RUN Run parameters - only with cpc version at present $! -CGR_MINUIT Use the C. Rippich version of MINUIT $! -DBG Run Mn_Fit in debug $! -CPC Run CPC version of Mn_Fit $! $ If "''DebugIt'" .eqs. "" Then $ Debugit = 0 $! $ job = f$mode() $ on error then $goto end $ trun = "run/nodebug" $ tfname = "mn_fit_exe:mn_fit" $ tgks = "" $ tfile = "" $ xnode = "" $ xtrans = "" $ xserv = "" $ rparam = "" $! $! Set up the default graphics package $! +SEQ,GRAFPACK. $! $ GoSub Check_Params $! $! Set up the Control_Y exit if not debugging Mn_Fit $! $ if f$locate("nodeb",trun).lt.f$length(trun) then $on control_y then $goto end $! +SEQ,MN_LOGIC. $! $! Set up special stuff for GKSGRAL $! $ if tgks.eqs."g" $ then $ def gks_window mn_fit_dir: $! $! These definitions needed for GKSGRAL 7.4/2.6 and earlier. $! $! twindow = "" $! cop mn_fit_dir:mn_fit_window.dat []window.dat $! twindow = f$search("window.dat.") $! cernlib graflib +SELF,IF=VMS,IF=l3. $! $! On L3 VMS machines find out which directory to put FOR092 in $! $ user = f$user() $ luser = f$length(user) $ comma = f$locate(",",user) $ if comma.lt.luser then user = "[" + f$extract(comma+1,luser-comma,user) $ open/write/err=try_sys$login aa l3$scr:'user'junk.tmp $ close aa $ delete/nolog/noconf l3$scr:'user'junk.tmp. $ l_for092 = "l3$scr:" + user $ goto end_for092 $try_sys$login: $ l_for092 = "sys$login" $ goto end_for092 $end_for092: +SELF,IF=VMS,IF=-l3. $ l_for092 = "sys$login" +SELF,IF=VMS. $ endif $! $! For X windows version get the node name and transport mode $! $ if tgks.eqs."x" $ then +SELF,IF=VMS,IF=CLEO. $ pornam = f$getdvi("TT","TT_ACCPORNAM") $ start = f$locate("L",pornam) $ finis = f$locate(".",pornam) $ lents = finis - start $ machine = f$extract(start,lents,pornam) $ if machine .eqs. "" $ then $ machine = f$trnlnm("sys$node") $ machine = f$extract(0,f$locate(":",machine),machine) $ endif +SELF,IF=VMS,IF=-CLEO. $ machine = f$trnlnm("sys$node") $ machine = f$extract(0,f$locate(":",machine),machine) +SELF,IF=VMS. $ tdisplay = f$trnlnm("decw$display") $ if tdisplay.eqs."" .or. - xnode.nes."" .or. xtrans.nes."" .or. xserv.nes."" $ then $ if xnode.eqs."" then $xnode = machine $ if xtrans.eqs."" then $xtrans = "DECNET" $ if xserv.eqs."" $ then $ write sys$output "Setting DISPLAY to node ''xnode' via ''xtrans'" $ set display/create/node='xnode'/transport='xtrans' $ else $ write sys$output "Setting DISPLAY to node ''xnode' via", - " ''xtrans', server ''xserv'" $ set display/create/node='xnode'/transport='xtrans'/server='xserv' $ endif $ else $ write sys$output "Using default setting of DISPLAY:" $ show display $ endif $ endif $! $ if tfile.eqs."" then $goto inter $! $! read commands from a file $! $ open/read/err=open_err aa 'tfile' $ tfilename = f$search(tfile) $ close aa $ def/user sys$input 'tfilename' $ GOTO run $OPEN_ERR: $ WRITE SYS$OUTPUT "Could not open file: ",tfile," Aborting" $ GOTO END $! $! Running from a terminal $! $INTER: $ ASS/USER SYS$COMMAND SYS$INPUT $ GOTO RUN $RUN: $ if tgks.eqs."g" $ then $ write sys$output "Defining FOR092 as ",l_for092 $ def/user for092 'l_for092' $ def/user gks$fonts gks_root:[dat] $! def/user gks_window mn_fit_dir $ endif $realrun: $ if f$locate("nodeb",trun).lt.f$length(trun) $ then $ mn_fit_run = "$''tfname'_''tgks'.exe" $ else $ mn_fit_run = "''trun' ''tfname'_''tgks'" $ rparam = "" $ endif $ on error then $goto end $ mn_fit_run 'rparam' $END: $! if tgks.eqs."_g" $! then $! if twindow.nes."" then $delete/noconf 'twindow' $! endif $ exit $! $! Start of Check_Params subroutines. $! $Check_Params: $ Par = 1 $Check_Params_Loop: $ If Par .eq. 9 Then $ Goto Check_Params_End $ If Debugit Then $ Show Symbol P'Par' $ If P'Par' .eqs. "" Then $ Goto Check_Params_End $ If F$Locate(Par_Flag,P'Par') .eq. 0 $ Then $ GoSub Check_Params_Found_One $ Else $ tfile = P'Par' $ EndIf $ Par = Par + 1 $ GoTo Check_Params_Loop $Check_Params_end: $ Return ! Check_Params $! $Check_Params_Found_One: $ Good_Par = 0 $ Label_tmp = F$Edit(F$Extract(1,3,P'Par'),"UPCASE") $ If f$extract(0,1,Label_tmp) .eqs. "?" Then $ GoSub HELP $ If f$extract(0,1,Label_tmp) .eqs. "H" Then $ GoSub HELP $ If f$extract(0,2,Label_tmp) .eqs. "TE" Then $ GoSub TEST $ If f$extract(0,1,Label_tmp) .eqs. "T" Then $ GoSub TRANS $ If f$extract(0,1,Label_tmp) .eqs. "S" Then $ GoSub SERVER $ If f$extract(0,1,Label_tmp) .eqs. "U" Then $ GoSub USER $ If f$extract(0,1,Label_tmp) .eqs. "O" Then $ GoSub OLD $ If f$extract(0,1,Label_tmp) .eqs. "G" Then $ GoSub GKSGRAL $ If f$extract(0,3,Label_tmp) .eqs. "DEV" Then $ GoSub DEV $ If f$extract(0,3,Label_tmp) .eqs. "DIS" Then $ GoSub DISPLAY $ If f$extract(0,2,Label_tmp) .eqs. "DE" Then $ GoSub DECGKS $ If f$extract(0,1,Label_tmp) .eqs. "V" Then $ GoSub DECGKS $ If f$extract(0,2,Label_tmp) .eqs. "DG" Then $ GoSub DGKS3D $ If f$extract(0,3,Label_tmp) .eqs. "DI3" Then $ GoSub DI3000 $ If f$extract(0,1,Label_tmp) .eqs. "X" Then $ GoSub X11 $ If f$extract(0,1,Label_tmp) .eqs. "N" Then $ GoSub NODE $ If f$extract(0,1,Label_tmp) .eqs. "P" Then $ GoSub PLTSUB $ If f$extract(0,3,Label_tmp) .eqs. "RUN" Then $ GoSub RUN_PARAM $ If f$extract(0,2,Label_tmp) .eqs. "CG" Then $ GoSub CGR_MINUIT $ If f$extract(0,2,Label_tmp) .eqs. "DB" Then $ GoSub DEBUG $ If f$extract(0,2,Label_tmp) .eqs. "CP" Then $ GoSub CPC $ If .not. Good_Par $ Then $ Write Sys$Output - "MN_FIT: Parameter P''Par' =(",P'Par',") not understood. EXITING." $ Exit $ EndIf $! $ Return ! Check_Params_Found_One $! $HELP: $ ww = "write sys$output" $ 'ww' "The following options are available:" $ 'ww' "-? or -H This help" $ 'ww' "-TEST Use the test version" $ 'ww' "-USER Use a user version", - " (give the exe name if it is not the default)" $ 'ww' "-OLD Use the old version" $ 'ww' "-DEV Use the development version" $ 'ww' "-DISPLAY Use L3 online display version" $ 'ww' "-GKSGRAL Use the GKSGRAL version" $ 'ww' "-VAXGKS Use the VAXGKS version (equivalent to DECGKS)" $ 'ww' "-DECGKS Use the DECGKS version (equivalent to VAXGKS)" $ 'ww' "-DGKS3D Use the DEC GKS3D version" $ 'ww' "-DI3000 Use the DI3000 version" $ 'ww' "-X11 Use the X11 version" $ 'ww' "-NODE Node name for X display (default=SYS$NODE)" $ 'ww' "-TRANS Transport mode for data (default = DECNET)" $ 'ww' "-SERVER Server number for X display" $ 'ww' "-PLTSUB Use the PLTSUB version" $ 'ww' "-RUN Give parameters for running Mn_Fit (Vax CPC version) $ 'ww' "-CGR_MINUIT Use the C. Rippich version of MINUIT" $ 'ww' "-DBG Run Mn_Fit in debug" $ 'ww' "-CPC Run CPC version of Mn_Fit" $ Good_Par = 1 $ Exit ! ? or H = Help $! $TEST: $ tfname = "mn_fit_exe:mn_test" $ Good_Par = 1 $ Return ! TEST = Test version $! $CGR_MINUIT: $ tfname = "mn_fit_exe:mn_fit_cgr" $ Good_Par = 1 $ Return ! CGR_MINUIT = C. Rippich version of MINUIT $! $DISPLAY: $ tfname = "mn_fit_exe:mn_dsp" $ Good_Par = 1 $ Return ! DISPLAY = Display version $! $CPC: $ tfname = "mn_fit_exe:mn_dsp_cpc" $ Good_Par = 1 $ Return ! DISPLAY = Display version $! $OLD: $ tfname = "mn_fit_exe:mn_old" $ Good_Par = 1 $ Return ! OLD = Old version $! $DEV: $ tfname = "mn_fit_exe:mn_dev" $ Good_Par = 1 $ Return ! DEV = Development version $! $USER: $ tfname = "mn_user" $ tgks = "" $ Par_Next = Par + 1 $ If Par_Next.lt.9 .and. P'Par_Next'.nes."" .and. - f$locate(Par_Flag,P'Par_Next').ne.0 $ then $ tfname = P'Par_Next' $ Par = Par_Next $ EndIf $ Good_Par = 1 $ Return ! USER = User version - no qualifier $! $GKSGRAL: $ tgks = "g" $ Good_Par = 1 $ Return ! GKSGRAL = GKSGRAL version $DECGKS: $ tgks = "v" $ Good_Par = 1 $ Return ! DECGKS = DECGKS/VAXGKS version $DGKS3D: $ tgks = "d" $ Good_Par = 1 $ Return ! DGKS3D = DEC GKS3D version $DI3000: $ tgks = "3" $ Good_Par = 1 $ Return ! DI3000 = DI3000 version $X11: $ tgks = "x" $ Good_Par = 1 $ Return ! X11 = X11 version $NODE: $ Par_Next = Par + 1 $ If Par_Next.lt.9 .and. P'Par_Next'.nes."" .and. - f$locate(Par_Flag,P'Par_Next').ne.0 $ then $ xnode = P'Par_Next' $ Par = Par_Next $ Good_Par = 1 $ EndIf $ Return ! NODE = X Windows display node $TRANS: $ Par_Next = Par + 1 $ If Par_Next.lt.9 .and. P'Par_Next'.nes."" .and. - f$locate(Par_Flag,P'Par_Next').ne.0 $ then $ xtrans = P'Par_Next' $ Par = Par_Next $ Good_Par = 1 $ EndIf $ Return ! TRANSPORT = X Windows transport mode $SERVER: $ Par_Next = Par + 1 $ If Par_Next.lt.9 .and. P'Par_Next'.nes."" .and. - f$locate(Par_Flag,P'Par_Next').ne.0 $ then $ xserv = P'Par_Next' $ Par = Par_Next $ Good_Par = 1 $ EndIf $ Return ! SERVER = X Windows server number $PLTSUB: $ tgks = "p" $ Good_Par = 1 $ Return ! PLTSUB = PLTSUB version $! $DEBUG: $ trun = "run/debug" $ Good_Par = 1 $ Return ! DBG = Run Mn_Fit in debug $! $RUN_PARAM: $ Par_Next = Par + 1 $ If Par_Next.lt.9 .and. P'Par_Next'.nes."" .and. - f$locate(Par_Flag,P'Par_Next').ne.0 $ then $ rparam = P'Par_Next' $ Par = Par_Next $ EndIf $ Good_Par = 1 $ Return ! PAR = Run parameter $! $! End of Check_Params subroutines. +SELF,IF=UNIX. #!/bin/sh # # Command file to run Mn_Fit # Interpret any options that are set # debug="exec" fname="mn_fit" xnode='' uservsn='' # # Set up the default graphics package # +SEQ,GRAFPACK. +SEQ,MN_LOGMN. # # Define the executable directory # +SELF,IF=UNIX,IF=APOLLO. direxe="$MN_FIT/exe/$ISP/" +SELF,IF=UNIX,IF=L3,IF=-@DEV. direxe="/l3/bin/" +SELF,IF=UNIX,IF=BONN,IF=-@DEV. direxe="/usr/local/bin/" +SELF,IF=UNIX,IF=-APOLLO,IF=-L3,@DEV,IF=-BONN,@DEV. direxe="$MN_FIT/exe/" +SELF,IF=UNIX. # while [ "$#" -gt 0 ] do case $1 in -t*) fname="mn_test" ;; -dev*) fname="mn_dev" ;; -di*) fname="mn_dsp" ;; -c*) fname="mn_fit_cgr" ;; -o*) fname="mn_old" ;; -u*) uservsn=1 fname=mn_user if [ $# -gt 1 ]; then case $2 in -*) ;; *) fname=$2 shift ;; esac fi ;; -g*) tgks="g" ;; -x*) tgks="x" ;; -dg*) tgks="d" ;; -n*) if [ $# -gt 1 ]; then case $2 in -*) ;; *) xnode=$2 shift ;; esac fi ;; -db*) +SELF,IF=APOLLO. debug="dde -nwp" +SELF,IF=HPUX. debug="xdb" +SELF,IF=SGI. debug="cvd" +SELF,IF=LINUX. debug="gdb" +SELF,IF=UNIX,IF=-APOLLO,IF=-HPUX,IF=-SGI,IF=-LINUX. debug="dbx" +SELF,IF=UNIX. ;; -?|?|h) echo 'Valid options are:' echo ' -t Test version' echo ' -di Display version' echo ' -g GKSGRAL GKS interface' echo ' -dg DEC GKS3D version (Decstations only)' echo ' -x X windows interface' echo ' -n X windows display node' echo ' -u User version' echo ' -db Debug Mn_Fit' exit ;; -*) echo 'Invalid option: ' $1 exit ;; *) MACROFILE=$1 ;; esac shift done # +SELF,IF=APOLLO. case "$TERM" in apollo) echo "***" echo "*** You are using an Apollo pad" echo "*** The readline version of Mn_Fit does not work properly here" echo "*** Therefore command recall, history and filename" \ " completion are not available" echo "*** Run Mn_Fit from an Xterm to get these features" echo "***" readline="_nr" ;; *) readline="" ;; esac +SELF,IF=-APOLLO. readline='' +SELF,IF=UNIX. # if [ "$uservsn" ]; then direxe='' fi fname=${fname}_${tgks}${readline}.exe # if [ $tgks = "g" ]; then . $GKS_ROOT/mgr/gksstart.sh echo Using $GKS_INLIB as inlib inlib $GKS_INLIB fi # # X windows version set DISPLAY if needed # if [ $tgks = "x" ]; then if [ "$xnode" ]; then export DISPLAY; DISPLAY="${xnode}:0.0" echo "DISPLAY set to $DISPLAY" elif [ ! "$DISPLAY" ]; then export DISPLAY; DISPLAY="`hostname`:0.0" echo "DISPLAY set to $DISPLAY" fi fi # if [ "$MACROFILE" ]; then $debug $direxe$fname < $MACROFILE else $debug $direxe$fname fi # exit +SELF. +DECK,mn_fit_logical. +SELF,IF=VMS. $! $! COM file to set all the logicals needed to link MN_FIT $! This is an example file used on VXL3ON for L3. $! Modify it to suit your institute. $! $ IF F$LOGICAL("MN_FIT_DIR").NES."" THEN $GOTO END $! $! Directory for MN_FIT $! $ DEF MN_FIT_ROOT l3daq$pgm:[gra.MN_FIT] $ DEF MN_FIT_DIR l3daq$pgm:[gra.MN_FIT] $! $! Directory for MN_FIT library and source code $! $ DEF MN_FIT_LIB l3daq$dat:[gra.mn_fit.lib] $ DEF MN_FIT_SRC l3daq$dat:[gra.mn_fit.lib.src] $! $! Directory for MN_FIT help and documentation files $! $ DEF MN_FIT_HELP l3daq$dat:[gra.mn_fit.help] $ DEF MN_FIT_DOC l3daq$dat:[gra.mn_fit.doc] $! $! Directory for MN_FIT test files $! $ DEF MN_FIT_TEST l3daq$pgm:[gra.mn_fit.test] $! $! Directory for MN_FIT executable $! $ DEF MN_FIT_EXE l3daq$dat:[gra.mn_fit.exe] $! $! CMZ directory and logon file to set stuff up $! $ DEF MN_FIT_CMZ l3daq$pgm:[gra.mn_fit.cmz] $! $! Directory for this file and mn_fit.com $! $ DEF MN_FIT_COM l3daq$gra: $! $! Directory for temporary files $! $ DEF MN_TEM l3daq$dat:[gra] $! $END: $ EXIT +DECK,window. 0.20 0.25 0.13 0.01 Mn_Fit Window 0.15 0.15 0.00 0.50 GKS_WINDOW_2 0.10 0.10 0.50 0.00 GKS_WINDOW_3 0.20 0.17 0.50 0.50 GKS_WINDOW_4 0.15 0.15 0.00 0.50 GKS_WINDOW_5 0.10 0.10 0.00 0.00 GKS_WINDOW_6 0.20 0.17 0.00 0.00 GKS_WINDOW_7 0.15 0.15 0.00 0.50 GKS_WINDOW_8 0.10 0.10 0.00 0.00 GKS_WINDOW_9 0.20 0.17 0.00 0.00 GKS_WINDOW_10 +PATCH,DEMO,T=TEXT. +DECK,demo00. ! ! Run all the Mn_Fit demos ! Make sure I start from scratch ! set default unalias all set alias on set echo on ! +SELF,IF=VMS. exec mn_fit_help:demo01 exec mn_fit_help:demo02 '' exec mn_fit_help:demo03 exec mn_fit_help:demo04 exec mn_fit_help:demo05 '' exec mn_fit_help:demo06 message 'You must be running the L3 Display version for Demo 7' inquire -1 'Type 1 to run demo 7' if @1 > 0.5 & @1 < 1.5 exec mn_fit_help:demo07 endif +SELF,IF=UNIX. exec $MN_FIT/help/demo01 exec $MN_FIT/help/demo02 '' exec $MN_FIT/help/demo03 exec $MN_FIT/help/demo04 exec $MN_FIT/help/demo05 '' exec $MN_FIT/help/demo06 message 'You must be running the L3 Display version for Demo 7' inquire -1 'Type 1 to run demo 7' if @1 > 0.5 & @1 < 1.5 exec $MN_FIT/help/demo07 endif +SELF. +DECK,demo01. !------------------------------------------------------------------- ! Mn_Fit Demonstration file number 1. ! Simple fetch and plot. !------------------------------------------------------------------- ! +SELF,IF=VMS. fet mn_fit_test:hbook4_test.his 1 +SELF,IF=UNIX. fet $MN_FIT/test/hbook4_test.his 1 +SELF. set default !Set everything back to default set y mode integer !Show y scale as an integer set footer on !Turn on the footer ! plot 1 ! +SELF,IF=VMS. exec mn_fit_help:demohard 01 !Make a hardcopy file +SELF,IF=UNIX. exec $MN_FIT/help/demohard 01 !Make a hardcopy file +SELF. +DECK,demo02. !------------------------------------------------------------------- ! Mn_Fit Demonstration file number 2. ! Gaussian Fit to Histogram 1 !------------------------------------------------------------------- ! +SELF,IF=VMS. fet mn_fit_test:hbook4_test.his 1 +SELF,IF=UNIX. fet $MN_FIT/test/hbook4_test.his 1 +SELF. set default !Set everything back to default set y mode integer !Show y scale as an integer ! ! Add a Gaussian in terms of sigma and give the initial values fun del 0 fun add gaus sigma 1000 100 1 1 1 1 ! Do a likelihood fit to histogram 1 - fit type 1 fit/lik 1 minimize !Do the fit display !Show the results ! +SELF,IF=VMS. exec mn_fit_help:demohard 02 !Make a hardcopy file +SELF,IF=UNIX. exec $MN_FIT/help/demohard 02 !Make a hardcopy file +SELF. ! inquire 1 'Type ! if you do not want to exit from MINUIT' @1 exit !Exit from MINUIT +DECK,demo03. !------------------------------------------------------------------- ! Mn_Fit Demonstration file number 3. ! Demonstration of Windowing, with COMMENTS, KEYS and use of options ! for axes. You can print this picture on a colour printer also. !------------------------------------------------------------------- ! ! Set errors on 0 bins to 0, and do not display these points set err_zero off set show_zero off +SELF,IF=VMS. fetch mn_fit_test:hbook4_test.his 0 +SELF,IF=UNIX. fetch $MN_FIT/test/hbook4_test.his 0 +SELF. COP 7 7&1 PART 7&1 0 4 copy 5 5&1 part 5&1 0 4 ! set default x psize 20 y psize 21 x marg 2.5 y size 18 thick 2 thick frame 4 header off sym 32 ! Make 3 plots with 0 y separation ! Only draw the frame on the bottom and left ! 1 x label per page. WIND 1 3 0 0 FRAME TOP OFF RIGHT OFF LABEL BOTTOM PAGE X LABEL 'Arbitrary Units' = = = = = -1004 X SCALE = = 0.3 = = -1003 Y SCALE = = 0.3 = = -1003 TSIZE 0.3 endset ! ! Set up the colours. User variable to store default symbol colour. ! dep csymbol = 2 set colour frame black colour header black colour label 4 colour scale green colour symbol red endset ! ! Set an overall user title for all the plots. ! Make it a bit bigger and use a nice font. ! SET TITLE USER 'Gaussian Signal + Exponential Background' set title position = = 0.4 = = -1003 ! ! First make the bare plots. Then edit them to get them ! exactly as I want and finally REDRAW. ! plot 7 ! ! Closed axes again ! SET FRAM TOP ON SET FRAM RIGHT ON ! ! Add an insert to this plot. Window margins are measured ! from the position of the x and y margins. ! set x wsize 4 y wsize 3 x wmarg 10 y wmarg 14 sym 1 hatch 343 colour symbol magenta endset plot/noclear 5&1 ! ! Set margins back to default ! set x wsi