If NTOT particles passes through a detector, and
NHITS events were detected, then the efficiency
of the detector is:
eff = NHITS/NTOT, and
error on eff = sqrt( eff * (1-eff) / NTOT) ,
based on binominal distribution.
| Stack | before | after |
|---|---|---|
| t | - | z |
| z | - | z |
| y | NHITS | error |
| x | NTOT | eff |
No registers are used.
No flags are used.
Assume that only 19 particles out of 20 are detected.
19 ENTER 20 XEQ "Eff" ... returns x=9.50E-1, y=4.87E-2
V1.00 April 18, 1989
00 { 20-Byte Prgm } ;
01 LBL "Eff" ;
02 / ;
03 ENTER ;
04 RCL/ ST L ; NTOT in LASTX (key strokes = RCL / . ST L)
05 1 ;
06 RCL- ST Z ; eff in Z-reg
07 x ;
08 SQRT ; err = sqrt( eff*(1-eff)/tot )
09 X<>Y ;
10 END ;
Programmed by Taku Yamanaka, April 18, 1989.