Physics 564 - Introductory Particle Physics

Analysing problems numerically

You will need to write some simple computer programs to solve some of the problems in physics 564. Windows is not particularly well suited for doing this. For this reason, here are instructions for writing simple programs and compiling them on one of the PCN computers that use a UNIX-like operating system.

You are free to use other computing platforms, including Windows if you like, but you may have to install some of the software we will use. I will be happy to discuss alternatives with you if you are interested.

Logging in from one of the computing labs

Using the Sun workstations...

There are Sun workstations located in room PHYS 022. Logging in to the PCN cluster is easy from a workstation that is already running a version of UNIX. To log in and connect to amdahl, do the following: From the terminal window you just have to type
$ ssh
and type 'y' if it prompts you with a question the first time you try it. Enter your ITaP user ID and password and you should be ready to go.

Using Windows...

This is more complicated... There are various ITaP maintained computer labs in the physics building, such as, PHYS 117 or PHYS 014 for example. You can log in to a Windows PC in one of the computing labs and connect to one of the PCN computers, for example, as follows:
Start --> All Programs
      --> Standard Software
      --> Telecommunications
      --> Secure CRT5.0
      --> Secure CRT5.0
From here you can click on the 'New Session' button, enter the host information picking the default parameters where appropriate and then click on 'Connect'. You can log in using your Purdue login and password.

You will need to export your DISPLAY so that you can pop up windows from the remote host. To allow it to do this you need to do the following:

Start --> PC-Xware Configuration
      --> Edit host list...
      --> Enter '' in the 'Host' box
      --> Add, OK
      --> Apply, OK
Then, from amdahl, follow this example:
jones105@amdahl:~$ who am i
jones105 pts/9        Aug 30 15:51 (
jones105@amdahl:~$ export
jones105@amdahl:~$ xterm &
If you get a new terminal window on your screen, then it worked.

Editing your programs

You first need to type in the program you need to develop to solve the problem on which you are working. There are several editors available: Once you have logged in, if the backspace key doesn't work, try this:
jones105@amdahl:~$ stty erase '^?'
Once you have logged in you can create a new directory in which to do your work, and edit a new program like this:
jones105@amdahl:~$ mkdir phys564
jones105@amdahl:~$ cd phys564
jones105@amdahl:~$ pico
Then you can enter a program like this:

#include <iostream>

using namespace std;

main() {
  cout << "Hello world!" << endl;

Then you can compile and run it like this:
jones105@amdahl:~$ g++
jones105@amdahl:~$ ./a.out
Hello world.
Congratulations. You are now programming in C++.

Better examples

For examples that illustrate how to compile programs using the ROOT class libraries, you can follow this link.