Examples and HOWTOs



File

Description

ohmsLaw.C

Plot ohmsLaw.dat as a simple graph. This shows how to read a file with two columns of numbers and plot the second column versus the first column.

mudkTime.C

Plot a histogram of the muon decay times saved in mudkTime.dat. This shows how to read a file of numbers (one column), fill a histogram, and then plot the histogram.

linear_chi2.maxima

An exact least-squares fit to a line using maxima to solve the linear equations. This is a solution to example 6.2 in Bevington and Robinson

simulate_line.py

Simulate linearly correlated data. The independent variable is distributed around the line with a variance of 1.0.

hist_pylab.py, hist_pylab.png

Make a histogram using pylab (part of matplotlib).

hist_pyroot.py, hist_pyroot.png

Make a histogram using ROOT through python.

optimize_amoeba.py, optimize_amoeba.txt

Use amoeba.py to minimize (or maximize) a function.

Example Analysis

Code for a data analysis example worked through during lecture.