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 NT/MASK STMASK n 3500 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 NT/MASK STMASK P 4 NT/MASK STMASK C 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'
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 NT/MASK STMASK P
=====> Current active selections in mask STMASK Bit Nevents Selection 1 41 STEP=15 2 877 GRADE>4.AND.STEP=13 3 57 (GRADE=13.AND.STEP=10).OR.(GRADE=14.AND.STEP=7) 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