[Home]

Eff - Calculates efficiency and its error

Overview

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/Registers/Flags

Stackbeforeafter
t-z
z-z
yNHITSerror
xNTOTeff

No registers are used.
No flags are used.

Example

Assume that only 19 particles out of 20 are detected.

	19
	ENTER
	20
	XEQ "Eff"
		... returns x=9.50E-1, y=4.87E-2
			

Program

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.