2007-PHYS-339 Statistics / Geiger

From McGill University Physics Department Technical Services Wiki

Files

  • Geiger handout (http://www.ugrad.physics.mcgill.ca/resources/339/geiger/geiger.pdf) - PDF version of the lab handout
  • sample.data (http://www.ugrad.physics.mcgill.ca/resources/339/geiger/sample.data) - The imfamous sample data as collected by defective acquisition software
  • geiger.tar.bz2 (http://www.ugrad.physics.mcgill.ca/resources/339/geiger/geiger.tar.bz2) - Data collection package, see below for instructions


Guide to compiling and running the provided software

Rather than left-clicking on the links above, you can right click and select the menu entry Copy Link Location, then use the middle mouse button to paste the location as an argument to Wget, as shown in the example below.

mark.orchard-webb@artemis:~$ mkdir -p /mnt/data/orchard/geiger
mark.orchard-webb@artemis:~$ cd !!:2
cd /mnt/data/orchard/geiger
mark.orchard-webb@artemis:/mnt/data/orchard/geiger$ wget http://www.ugrad.physics.mcgill.ca/resources/339/geiger/geiger.tar.bz2
--12:44:00--  http://www.ugrad.physics.mcgill.ca/resources/339/geiger/geiger.tar.bz2
           => `geiger.tar.bz2'
Resolving www.ugrad.physics.mcgill.ca... 132.206.252.2
Connecting to www.ugrad.physics.mcgill.ca[132.206.252.2]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 31,601 [application/x-tar]

100%[====================================>] 31,601        --.--K/s             

12:44:01 (36.44 MB/s) - `geiger.tar.bz2' saved [31601/31601]

mark.orchard-webb@artemis:/mnt/data/orchard/geiger$ 

This has downloaded the file and placed it in the current dirrectory:

mark.orchard-webb@artemis:/mnt/data/orchard/geiger$ ls -l
total 32
-rw-r--r--  1 mark.orchard-webb ADSusers 31601 Jan 24  2006 geiger.tar.bz2
mark.orchard-webb@artemis:/mnt/data/orchard/geiger$

In case you are unfamiliar with tar files, they are basically archives, much like RAR, ZIP, ARJ or any of the multitude of other archive formats. To extract the contents of the archive use the command tar.

mark.orchard-webb@artemis:/mnt/data/orchard/geiger$ tar jxf geiger.tar.bz2 
mark.orchard-webb@artemis:/mnt/data/orchard/geiger$ ls -l
total 192
-rw-r--r--  1 mark.orchard-webb ADSusers    221 Jan 21  2003 Makefile.in
-rwxr-xr-x  1 mark.orchard-webb ADSusers 130488 Jan 16  2006 configure
-rw-r--r--  1 mark.orchard-webb ADSusers   1976 Jan 19  2004 geiger.1
-rw-r--r--  1 mark.orchard-webb ADSusers   1329 Jan 19  2004 geiger.5
-rw-r--r--  1 mark.orchard-webb ADSusers  12880 Jan 16  2006 geiger.c
-rw-r--r--  1 mark.orchard-webb ADSusers  31601 Jan 24  2006 geiger.tar.bz2
mark.orchard-webb@artemis:/mnt/data/orchard/geiger$

Now this software is slightly more complicated than the simple programs we worked with in the previous lab. This program requires a library supporting the data acquisition card and a graphics library. With more complicated software it is common to use a configure script which will test for necessary and optional libraries and customized the executable to the machine upon which it is run.

mark.orchard-webb@artemis:/mnt/data/orchard/geiger$ ./configure
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -E
checking for X... libraries /usr/X11R6/lib, headers /usr/X11R6/include
checking for labmaster_initialize in -llabmaster... yes
checking for XCreateWindow in -lX11... yes
checking for GrSetMode in -lgrx20X... yes
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for gethostname... yes
configure: creating ./config.status
config.status: creating Makefile

The above is what you should see on a machine with the appropriate libraries installed.

mark.orchard-webb@artemis:/mnt/data/orchard/geiger$ ls -l
total 236
-rw-r--r--  1 mark.orchard-webb ADSusers    687 Jan 15 12:50 Makefile
-rw-r--r--  1 mark.orchard-webb ADSusers    221 Jan 21  2003 Makefile.in
-rw-r--r--  1 mark.orchard-webb ADSusers  13888 Jan 15 12:50 config.log
-rwxr-xr-x  1 mark.orchard-webb ADSusers  20890 Jan 15 12:50 config.status
-rwxr-xr-x  1 mark.orchard-webb ADSusers 130488 Jan 16  2006 configure
-rw-r--r--  1 mark.orchard-webb ADSusers   1976 Jan 19  2004 geiger.1
-rw-r--r--  1 mark.orchard-webb ADSusers   1329 Jan 19  2004 geiger.5
-rw-r--r--  1 mark.orchard-webb ADSusers  12880 Jan 16  2006 geiger.c
-rw-r--r--  1 mark.orchard-webb ADSusers  31601 Jan 24  2006 geiger.tar.bz2
mark.orchard-webb@artemis:/mnt/data/orchard/geiger$ 

As you can see, a few additional files have appeared, the most useful for us is the Makefile. This file describes how to compile the executable, it is used by the program Make as follows:

mark.orchard-webb@artemis:/mnt/data/orchard/geiger$ make
gcc  -I/usr/local/include -I/usr/X11R6/include -g -O2 -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DHAVE_LIBLABMASTER=1 -DHAVE_LIBX11=1 -DHAVE_LIBGRX20X=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_UNISTD_H=1 -DHAVE_GETHOSTNAME=1  -c geiger.c
gcc  -L/usr/local/lib -L/usr/X11R6/lib -o geiger geiger.o -lgrx20X -lX11 -llabmaster 
mark.orchard-webb@artemis:/mnt/data/orchard/geiger$ 

Hopefully it is apparent why we use configure scripts and Makefiles :). So we now have a new executable geiger

mark.orchard-webb@artemis:/mnt/data/orchard/geiger$ ls -ltr
total 420
-rw-r--r--  1 mark.orchard-webb ADSusers    221 Jan 21  2003 Makefile.in
-rw-r--r--  1 mark.orchard-webb ADSusers   1976 Jan 19  2004 geiger.1
-rw-r--r--  1 mark.orchard-webb ADSusers   1329 Jan 19  2004 geiger.5
-rwxr-xr-x  1 mark.orchard-webb ADSusers 130488 Jan 16  2006 configure
-rw-r--r--  1 mark.orchard-webb ADSusers  12880 Jan 16  2006 geiger.c
-rw-r--r--  1 mark.orchard-webb ADSusers  31601 Jan 24  2006 geiger.tar.bz2
-rwxr-xr-x  1 mark.orchard-webb ADSusers  20890 Jan 15 12:50 config.status
-rw-r--r--  1 mark.orchard-webb ADSusers    687 Jan 15 12:50 Makefile
-rw-r--r--  1 mark.orchard-webb ADSusers  13888 Jan 15 12:50 config.log
-rw-r--r--  1 mark.orchard-webb ADSusers  45672 Jan 15 12:58 geiger.o
-rwxr-xr-x  1 mark.orchard-webb ADSusers 131670 Jan 15 12:58 geiger

With the Geiger Counter turned on an the gamma source placed close to the detector, try the following:

mark.orchard-webb@artemis:/mnt/data/orchard/geiger$ geiger 100 100 0.05 geiger.data

You should get a window which after a few seconds looks something like this:

Image:Geiger-2007-01-15.png

Structure of data

Check the documentation in the source tar file

christian.voyer@hades:~$ man ./geiger.5
Reformatting geiger.5, please wait...

Reads

GEIGER(5)                   Lab Programmers Manual                   GEIGER(5)

NAME
       geiger - a data collection tool - the output data format

DESCRIPTION
       The  data  saved by the geiger program consists of two major parts, the
       header and the data-body.

HEADER
       The header is a single line consisting of 4 numbers:  replicas,  inter-
       vals,  columns  and  period.  replicas, intervals and columns are inte-
       gers, period is a floating point number.  The definitions of the param-
       eters are as follows:

       replicas
              The number of replicas requested.

       intervals
              The number of intervals per replica.

       columns
              The number of columns in the histogram.

       period The period in seconds requested by the user.  If the true period
              differed from this because of quantization this a user  problem.

DATA-BODY
       The  data-body  section  consists of replicas rows, each row containing
       columns numbers, separated by tab characters.  The sum of numbers in  a
       given  row  should  equal intervals.  The number in the Nth column of a
       replica represents the frequency of observation of N counts per  period
       during the replica measurement.

SEE ALSO
       geiger(1)

BUGS
       The period problem mentioned above.

AUTHOR
       Mark Orchard-Webb (orchard@physics.mcgill.ca)

Supplemental toys

  • chisq.c (http://www.ugrad.physics.mcgill.ca/resources/339/geiger/chisq.c) - This is an implementation of table C4. in Bevington. There are two functions of interest in this file:

double chisq_five (int dof)
returns the reduced Χ2 value which only 5% of replicas having dof are expected to exceed.
double chisq_ten (int dof)
returns the reduced Χ2 value which only 10% of replicas having dof are expected to exceed.
These functions are written in such a way that they can easily be pasted into another piece of code.

Historical Archives

Log

Thursday January 18, 2007

  • We have decided to dump the historical dataset and replace it with a correct set and to put the old set as a challenge.