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

Basic Unix Computing

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:

Perl exercises

  • 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.
  • C++ or Python exercises

  • 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.
  • ROOT Exercises

    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.