Updating plots in real time (1)

Keep and Update

MACRO DICE 1=50 set hcol 1001 set ndvx -11.05 6 OPT STAT 1 CALL DICE.F([1]) hi/fit 3 g

FORTRAN routine dice

subroutine dice(n) ifirst=1 2 CALL HBOOK1(3,'Playing with two dice',11,2.,13.,0.) do 3 j=1,n ix1=6.*rndm(.01234)+1 ix2=6.*rndm(.56789)+1 3 CALL HFILL(3,FLOAT(IX1+IX2),0.,1.) if (ifirst.eq.1) then 4 CALL HPLOT(3,'BK',' ',0) ifirst=0 else 5 CALL HPLOT(3,'BU',' ',0) endif enddo end

  1. This macro call a COMIS routine only to be faster. The COMIS routine can be replaced by a macro, in particular the options `` K '' and `` U '' are also available in command HIST/PLOT (try HELP H/PL ).
  2. The histogram is also booked in the FORTRAN program. The corresponding PAW command is 1DHISTO .
  3. Two random numbers between 1 and 6 are generated and the histogram is filled with the sum of this numbers to simulate dice playing.
  4. The first time the histogram is plotted the option `` K '' is used to keep in memory a copy of the histogram in order to update it later.
  5. With the `` U '' option, PAW looks at the current kept histogram contents and update the plot with the new contribution without redrawing everything. This mechanism is used in data acquisition.
  6. The statistics are also updated.



Last update: 96/05/24 17.24
Olivier.Couet@Cern.Ch