Use of Ntuple masks and loops


Use of Ntuple masks and loops

hi/file 2 rwn_aptuple.hbook 1dhisto 20 'Distribution by grade' 12 3 15 max 20 700 ntuple/plot 10.grade IDH=20 1 MASK/FILE STMASK n 2 NT/LOOP 10 STEP=15>>STMASK(1) nt/loop 10 grade>4.and.step=13>>stmask(2) nt/loop 10 _ (grade=13.and.step=10).or.(grade=14.and.step=7)>>stmask(3) NT/PLOT 10.GRADE _ STMASK(1).OR.STMASK(2).OR.STMASK(3)>>STMASK(4) OPTION=S IDH=20 3 MASK/LIST STMASK 4 MASK/CLOSE STMASK set CHHE 0.35 5 EXEC LEGEND 245 9.3 10.3 610 640 'All Staff' 5 EXEC LEGEND 244 9.3 10.3 560 590 'Staff at end of grade'

  1. NT/MASK perform operations with masks. A mask is a direct-access file with the name MNAME.MASK (here STMASK.MASK ). It must contain as many 32 bit words as there are events in the associated Ntuple. Masks are interesting when only a few events of a Ntuple are selected with a time consuming selection algorithm.
  2. The symbol ``>>'' in NT/LOOP and NT/PLOT allows to fill the mask according to the selection function.
  3. This command allows to print the definition of the mask.
  4. The command MASK/CLOSE close the mask.
  5. A general macro to draw a legend (see next page).
  6. Try NT/PLOT 10.GRADE STMASK(4) : It produce the same result as the last NT/PLOT of the macro.
  7. Compare the execution time (with TIMING ) of the two following commands:
      NTUPLE/PLOT 10.GRADE (GRADE=13.AND.STEP=10).OR.(GRADE=14.AND.STEP=7)
      NTUPLE/PLOT 10.GRADE STMASK(3)
    


Output of the command MASK/LIST

STMASK Events: 3354 (file stmask.mask, read/write) # select Description bit 1: 41 step=15 bit 2: 877 grade>4.and.step=13 bit 3: 57 (grade=13.and.step=10).or.(grade=14.and.step=7) bit 4: 975 stmask(1).or.stmask(2).or.stmask(3)

A general macro to draw a legend

Macro Legend 1 TYPE = [1] | Type of hatches 1 X1 = [2] | X bottom left corner of the box. 1 X2 = [3] | X top right corner of the box. 1 Y1 = [4] | Y bottom left corner of the box. 1 Y2 = [5] | Y top right corner of the box. 1 TEXT = [6] | Text to be printed Set FAIS 3 Set FASI [TYPE] Set BORD 1 Box [X1] [X2] [Y1] [Y2] Set TXAL 03 2 XT = [X2]+$GRAFINFO('?CHHE') 2 YT = ([Y2]+[Y1])/2 2 Itx [XT] [YT] [TEXT] Return

  1. Input parameters 1 to 6 are copied into locale variables with meaningful names.
  2. The text is positionned according to the text size and the box position.

PAW TutorialLast update: 1999/04/01 14.59
Olivier.Couet@Cern.Ch