University of Amsterdam Nikhef institute for subatomic physics
Detector R&D, Nikhef Institute of Subatomic Physics

Amsterdam Science Park, Nikhef building office H044
Science Park 105
1098 XG Amsterdam, the Netherlands
jory.sonneveld@nikhef.nl
+31205925025




Are you looking for a research project in our Detector R&D group at Nikhef?
You can contact one of the members in the group. See also these non-exhaustive lists of (examples of) master projects and bachelor projects.
For a list of recommended literature, see here.


Setting up your machine

I would recommend an open source operating system like linux where you have the possibility to tweak everything to your needs and can easily install many kinds of software used in physics. Have a look at these popular operating systems.
If you do not like clicking around with a mouse but prefer a keyboard, I would recommend something like wmii or the i3 window manager. Here is an example of an i3 configuration file, to be saved in your home directory under ~/.config/i3/config, but there are probably plenty of nice examples on the web.
For efficient copy pasting which in linux is very easy with merely selecting and pressing the middle mouse button I recommend a clipboard manager that has a memory for multiple selections like parcellite.



Introduction to the linux shell

You can use these examples of a config, aliases, inputrc, and profile (to be saved under ~/.zshrc, ~/.aliases, ~/.zshinputrc, and ~/.zprofile, resp.) for inspiration.
You can probably find many other nice examples of such "dotfiles" on the web.
Then, have a look at what a shell is and how to use it. Some alternatives to zsh are described; however, I recommend you still use zsh.
You might want to memorize simple tools like ‹Esc›. and Ctrl-R for using commands from history. Also, the command grep is your friend. See this workbook for more basic unix commands.
You also might want to master regular expressions that you can use with the shell commands grep or sed, or the replace and search tools %s and / in vim. For viewing files, you could use vim (or view), but also the commands less and cat.
To read more about zsh, see for example: here.
You can create short names for logging in through ssh. See this example of an ssh config.

To not lose your work on a remote machine you can use for example tmux or screen that create session that you can detach and attach when you log in another time and/or from elsewhere. These sessions can also be set up so that they are shared. You can remap shorcuts in for example tmux, see this example of a tmux config.


Introduction to Vim

You can play around at this interactive vim tutorial.
See also this tutorial and this page for more on this editor.
You can use alternatives like emacs as well, but I recommend you use vim. You can use gvim as a start (graphical vim).
I recommend to save a vimrc similar to this example that is to be saved under ~/.vimrc. If you use this entire example, you will need to create the directories ~/.vim, ~/.vim/swaps, and ~/.vim/backups.
Or, have a look at the very nice vimrc among other "dotfiles" here.


Save and document your work

Document all lab work in an elog with a short summary of what you did and for what purpose, and what the main outcome was. Keep in mind, rather too much (even code) than too little. Add attachments like pictures and plots. I recommend keeping an editor open during the day to add your notes. Add pictures to the elog and reply with plots later. Ideally this can be used as a resource for your presentations where you report about your work. Keep in mind: one year on, what will you need to be able to reproduce what you did these days?
Save your work: commit your code to github or gitlab. You can set up and familiarize yourself with this workflow, see for example here. Back up your data.
You are expected to adhere to the European Code of Conduct for Research Integrity and publish your code and data inasfar this is in line with rules of collaborations and companies you work with. You can use github for this purpose, like in this example or zenodo where your data will be saved at CERN. Another possibility is figshare or figshare for UvA employees.


First steps in python

To get acquainted with python, have a look at this short tutorial, for example.
To execute the commands, I recommend you use (install) ptpython, bpython, or ipython
See my python seminar for more links on python; it is easy to write and read and has many features for data analysis.
See also:
Python signal processing
Fourier transform in python
Nice curve fitting with python


Workflow: ipython notebook

To document your work, I recommend you use jupyter notebooks (similar to mathematica). You can convert these to pdfs for documentation or embedding in presentations; your results ideally look something like this pdf document. See also this description.

Some examples of notebooks are these LIGO gravitational wave data in ipython Jupyter notebooks.
To use ROOT in python you will need to have ROOT installed with python support. The files might be useful: rootnotes and rootprint with utils. In order to be able to import them in any program anywhere, you can add the directory where you save them (e.g. ~/bin/python) to your python path.
These notebooks from the LHCb masterclass are examples of using ROOT in python: measuring the D0 lifetime at the LHC and obtaining signal variable distributions.
For more examples see also this gallery.


Introduction to LaTeX

You can create the document for your thesis in LaTeX right now with a title, contents, and references section. See LaTeX in minutes or this introduction by Andy Roberts if you are not yet familiar with latex. See also these templates in overleaf and this example.


Introduction to C++

It is very important that you are familiar with C(++). You can create your own "Hello world" program following this example and execute it.
You can try out this Makefile with this code.
Also, try to create the loop examples described in lesson 3 of a C tutorial and execute the programs.
For comparison, create a program with a for loop in python just like the one above in C, and execute it.
Whenever you start frowning at the quirks of C(++), you can refer to these very nice introductions to C.


pyROOT

See this example for opening a ROOT file and plotting or printing content in an ipython notebook
For this you will need some helper code rootnotes, rootprint, and utils.


See also this interface between ROOT and NumPy for converting trees to arrays and vice-versa.
Andre Holzner has a few pyROOT examples on his blog, for example filling an ntuple and using TCanvases (but I recommend using matplotlib instead, e.g. this rootpy example or just starting from e.g. arrays or dataframes of data).


First steps in ROOT

To get acquainted with ROOT, follow these tutorials on installing ROOT, debugging and documentation, interactive sessions with ROOTfiles, writing analysis code, storing results, (or download all at once).


Machine learning (ML) in high energy physics (HEP)

See also the HEP software foundation page on machine learning.
Here you can find a school with here the lectures and exercises for machine learning examples in high energy physics.
An examples of TMVA in python can be found here.
Alternatively, you can use for example scikit-learn instead of TMVA.
Have a look at this post about why you might not need machine learning.


Getting help

For programming problems, stackoverflow.com has many answered questions.