Computing List for Particle Physics Students
Many students are excited about particle physics and the fundamental
insights it offers into our universe. Learning particle physics is a
challenge, and the computing is not the least of it. The following are
some computing exercises that can help you get started.
Basic Unix Computing
Perl exercises
C++ or Python exercises
ROOT exercises
Learn all of the following:
various shells: bash, csh, tcsh, zsh; how to tell which shell
^h; ^u; ^d; ^s; ^q; ^z; ^c; \; '; "; `; ~user
&; ^c; ^z; fg; bg; ;; !; |; >; <; >>; script
jobs; ps; kill; nice; crontab; alias; Environment variables
login; logout; passwd; kinit; date; history; man; whoami; top
cat; cp; ls; mv; rm; ln; chmod; find; more; head; tail; grep
cd; mkdir; rm -r; mv; pwd; lpr; diff; wc; who; which; df; du; mount
emacs; ex; tex; latex; dvips; gs; ps2pdf; pdflatex; ssh; scp; host
sed; awk; perl; sort; gzip, gunzip; tar; g++; dbx; make
Some unusual, but sometimes useful Unix commands:
- Use regexp's (can be tricky!)
- uptime show one line summary of system status
- crypt encode/decode a file with a private key
- wc count characters, words, and lines in a file
- () group commands on same line
- nice run program at lower priority
- at run program at a later time
- crontab run program at specified intervals
- a2ps / enscript convert text files to PostScript format for printing
- host find IP address for given host name, or vice versa
- lynx web browser for character based (text-only) terminals
- uuencode/uudecode encode/decode a binary file for transmission via email
- Use chmod to change the permissions on a file
- Use "umask 000" and "umask 024" and then create files.
Check their permissions. Reset your umask!
- Use cat to create a file with at least 10 lines and
head and tail to look at it.
- Use find to display the names of all files in your home (login)
area. Use find to display all files larger than a certain size, or
older than a certain time.
- Use grep to find the file in your home area which contains your
aliases. Use find, grep and sort to find the smallest .txt files
anywhere in your account which contain the word "the".
- Use sleep and ps to display all the jobs running after 2 minutes
have passed.
- Use ping and traceroute to find properties of lxplus.cern.ch
- Create a cron job which copies all .cc files in one subdirectory to
another subdirectory every day at 6 PM.
- Create a shell script which makes three copies of a file (whose
name is given as the first command line argument) with three
different extensions. For example, copies "a" to a.1, a.two and a.3.
- What is the command to delete all files and directories in your
account? How do you prevent yourself from running it?!
- Create "l" as the alias for "logout".
- Change your password.
Write a script to do the same thing as the Unix "wc" command.
Write a script to count the number of times a given word occurs in
a file.
Write a script to find (and print) all lines containing the year
(e.g., 2012 or 2010 etc.).
Write a script to print out the contents of all files in a given
subdirectory if they are (a) text files and (b) smaller than 10 lines.
Write a program to write out 10 lines of 5 random numbers per line.
Write a program to read a text file and randomly change the order
of lines, but only within each paragraph.
Write a program to create a random matrix, find its eigenvalues,
and write them out in decreasing order. How large a matrix can your
program handle before it crashes (or takes too long)?
Write a program to play tic-tac-toe with you.
Write a program that uses classes: one class of students, one class
of teachers, and one class of classes! The constructor of the class
of classes should take vectors of pointers to student objects and a
single pointer to a teacher object, as well as other attributes
such as subject, classroom, class times etc. The program should be
able to read a file in which you specify several classes, but not
classrooms; another file which has the classrooms, and it should
assign classrooms to classes based on availability (classrooms
should never have more than one class at the same time!). Then it
should print out a weekly schedule for each student, each teacher,
and each classroom.
Simple ROOT stuff:
Display points with error bars and draw a curve through them
Plot multiple points on a plot
Make a Feynman diagram: tree and penguin diagrams
Use cd() to change directories in a tree
Intermediate level ROOT:
Make interactive plots, including 2-D correlation plots, useing
ntuples. Be able to make cuts interactively.
Set the y-axis minimum and maximum for histograms, and for plots.
Save created histograms to a new file.
Beautify plots: be able to set fill color, histogram title, axis
titles, draw the fit parameters on the histogram, set statistics box
options, use sumw2(), SetFillStyle(), SetLineColor(), SetLineStyle(),
SetLineWidth(), add text using TLatex, make profile histograms.
Advanced level ROOT:
Create a comparison histogram from two with similar names. Be able
to print means and RMSs for the two in such cases.
Be able to create a "style" and then enforce it for all plots.
Use TMVA to optimize variables
Read a friend tree
Make plots using histograms in a .root file
Be able to select events in a root file.
Be able to concatenate several ROOT files into one.
Be able to get the name of the file ROOT is currently using.
Further ROOT exercises:
Read ntuples (C++ tree reading)
Make histograms and eps files from ntuples (ROOT tree reading)
Make a ntuple (C++ tree writing)
Make a flat (ASCII) file from a simple ntuple
Use MakeClass() to make a class from a root file; then use it
Make a reduced ntuple (fewer variables, also fewer events!)
Merge many root files into one
Read a friend tree
Read in data from a file and fit it. For simple fits, be able to use
GetParameter(), GetParError(), GetChisquare()
Do a MINUIT fit (from scratch): this is the single most important
thing to learn! It is complex, but critical, absolutely critical, to
have a very clear (a) understanding and (b) working knowledge of doing a
sophisticated fit.