Similarities and differences of the electron, muon, and tau leptons
Similarities
e, μ, τ
EM charge of -1
Weak charge of -1/2
ve, vμ, vτ
EM charge of 0
Weak charge of +1/2
e, μ, τ, ve, vμ, vτ
Spin +1/2
Fermions
Leptons
Differences
e → Stable
μ, τ → Rapid Decay
me < mμ < mτ
Same order for neutrinos
cd .. is essentially a back button and will return you to the directory in which the current one resides.
mkdir creates the specified directory, where cd changes the directory.
What do commands ‘mkdir' and 'cd ../..’ do?
End 9/23/2020
What are the fundamental particles and forces? How many particles standard model of particle physics has?
Matter Particles
Fermions
Generation I
Leptons
Electron
Electron Neutrino
Quarks
Up
Down
Generation II
Leptons
Muon
Muon Neutrino
Quarks
Charm
Strange
Generation III
Leptons
Tau
Tau Neutrino
Quarks
Top
Bottom
Force Particles
Bosons
Strong Force
Gluon
Electromagnetic Force
Photon
Weak Force
W
Z
Gravitational Force
Graviton (Theoretical)
Total Number of Fundamental Particles: 36 + 1 Theoretical
6 Leptons
6 Anti-Leptons
6 Quarks
6 Anti-Quarks
8 Gluons
1 Photon
1 W+
1 W-
1 Z
1 G (Theoretical)
What is spin of a fundamental particle?
Quantum mechanical spin is essentially an intrinsic angular momentum for a given particle. It is not the same as spin / spinning in classical physics.
What is the difference between bosons and fermions?
Bosons refer to the force carrying particles (see above), whereas fermions refer to the matter particles (see above)
What is Linux?
A secure, open source operating system kernel. There are many different distributions of it available.
What is a Linux Shell?
See What is my "shell"? section below.
How do you find which shell your are working in?
See What is my "shell"? section below.
What is basic linux command structure?
See What is my "shell"? section below.
What do the following commands do?
pwd, ls, ls -l, ls -lr, ls .., ls -CFx cd, cd .., mkdir, find, rmdir, which, whoami, echo, cat, more
See Directory Structure section below.
What is the difference between ls, ls ., and ls .., ls /, ls ./
ls
List contents of current directory
ls .
List contents of current directory
ls ..
List contents of parent directory to the current directory
ls /
List contents of root directory
ls ./
List contents of current directory
How can get help to learn more about linux commands on the command line?
command --help
What is symbol ~ used for in the directory structure?
Home Directory
What do uparrow and enter keys do?
Up brings you through your previously used commands, enter runs the command currently typed
What kind of programs/apps you can use to open the following file types: .txt, .C, .cpp, .root, .sh, .csh
Text editors: emacs, vim, nano
What do operators, > and >> do?
[command] > [file]
Print output of command to the specified file, overwriting any existing data.
[command] >> [file]
Print output of command to the specified file, adding to any existing data.
What is emacs?
emacs is a text editor
What is the difference between the commands
emacs -nw mycode.C
emacs mycode.C
emacs mycode.C &
-nw option stands for no window, i.e emacs will open directly through the terminal
Without -nw, emacs will open in a separate window
Without -nw and with & at the end of the command line, emacs should open in a separate window and process, allowing your terminal to continue to be used for commands.
I have had issues with this not actually working both on my linux laptop and using ubuntu WLS on my desktop
What do you expect to heppen if you run the command ‘emacs myfile.txt &’ where the file myfile.txt does not exist already.
I expect emacs to create the specified file in the current directory
How do you save a file in emacs?
Ctrl + X
How do you search some string in emacs?
Ctrl + S → type string → enter
Commands used: echo $0, echo $SHELL
My system uses the bash shell, whereas the cluster uses the tcsh shell.
Here is the output of both commands on the cluster:
[abeisaw1@hepcms-in2 ~]$ echo $0
-tcsh
[abeisaw1@hepcms-in2 ~]$ echo $SHELL
/bin/tcsh
This basically means that my current shell is tcsh, and my default shell is also tcsh and /bin/tcsh is the path to it.
The shell is the user's means of communication with the Unix system, i.e it is what interprets the user's commands and displays the output from the system.
Linux Command Structure → command [-option(s)] [arguments]
Commands used: pwd, ls, ls -l, ls --help, mkdir, cd, ls .., cd .., rmdir, ls -CFx, find, which, whoami
pwd
This command displays the current directory. Upon logging into the cluster, my current directory was
/home/abeisaw1
ls
ls
ls without any options simply lists the contents of the current directory. In my default directory on the cluster, this currently includes
[abeisaw1@hepcms-in2 ~]$ ls
ABDocs TEST rootlogon.C
ls -l
Adding the -l option to the ls command displays additional information: permissions, the owner, the file name or directory name, the modified date, and size. Output of this command as of today:
[abeisaw1@hepcms-in2 ~]$ ls -l
total 12
drwxr-xr-x 2 abeisaw1 users 4096 Sep 21 16:33 ABDocs
drwxr-xr-x 2 abeisaw1 users 4096 Sep 21 13:09 TEST
-rw-r--r-- 1 abeisaw1 users 146 Jun 20 2016 rootlogon.C
ls --help
On the tcsh system, typing a command followed by --help will display information on the command and its options. Doing this for ls teaches me that the usage of this command is
Usage: ls [OPTION]... [FILE]...
Following the usage of the command, it lists the many different options for it.
It is nice to use the clear command when starting something new in the terminal, as it automatically scrolls to the point where only your current line is visible.
mkdir and cd
mkdir creates a new directory within the current directory, and cd allows you to enter the directory you type after it.
If you try to cd into a directory that does not exist, it will tell you that there is no such file or directory.
After creating and entering the directory "new_directory" within my default, using the command "ls .." displays the contents of the directory one up from the current, and using "cd .." will change directory to the next one up:
[abeisaw1@hepcms-in2 ~]$ mkdir new_directory
[abeisaw1@hepcms-in2 ~]$ cd new_directory
[abeisaw1@hepcms-in2 ~/new_directory]$ pwd
/home/abeisaw1/new_directory
[abeisaw1@hepcms-in2 ~/new_directory]$ ls
[abeisaw1@hepcms-in2 ~/new_directory]$ ls ..
ABDocs TEST new_directory rootlogon.C
[abeisaw1@hepcms-in2 ~/new_directory]$ cd ..
[abeisaw1@hepcms-in2 ~]$ pwd
/home/abeisaw1
[abeisaw1@hepcms-in2 ~]$ ls
ABDocs TEST new_directory rootlogon.C
[abeisaw1@hepcms-in2 ~]$ pwd
/home/abeisaw1
find
The find command looks for all files matching your input in a given directory.
which
The which command displays the path to the given input:
[abeisaw1@hepcms-in2 ~]$ which g++
/usr/bin/g++
whoami
Tells you who you are.
Special Characters
Using the ~ character allows you to reference your home directory
Using . references the current directory
Using .. references one directory up from current
cd .. can be thought of as a back button
The touch command seems to modify timestamps of files. Using touch on file 1 in my ~/TEST directory resulted in the following:
[abeisaw1@hepcms-in2 ~/TEST]$ ls -l
total 16
-rw-r--r-- 1 abeisaw1 users 0 Sep 9 12:15 file1
-rw-r--r-- 1 abeisaw1 users 0 Sep 9 12:15 file2
-rw-r--r-- 1 abeisaw1 users 57 Sep 16 11:18 test.txt
-rw-r--r-- 1 abeisaw1 users 26 Sep 16 11:15 test.txt~
-rw-r--r-- 1 abeisaw1 users 0 Sep 9 12:15 test1
-rw-r--r-- 1 abeisaw1 users 0 Sep 9 12:15 test2
-rw-r--r-- 1 abeisaw1 users 893 Sep 21 13:09 testscript.tcsh
-rw-r--r-- 1 abeisaw1 users 892 Sep 16 11:57 testscript.tcsh~
[abeisaw1@hepcms-in2 ~/TEST]$ touch file1
[abeisaw1@hepcms-in2 ~/TEST]$ ls -l
total 16
-rw-r--r-- 1 abeisaw1 users 0 Sep 23 13:02 file1
-rw-r--r-- 1 abeisaw1 users 0 Sep 9 12:15 file2
-rw-r--r-- 1 abeisaw1 users 57 Sep 16 11:18 test.txt
-rw-r--r-- 1 abeisaw1 users 26 Sep 16 11:15 test.txt~
-rw-r--r-- 1 abeisaw1 users 0 Sep 9 12:15 test1
-rw-r--r-- 1 abeisaw1 users 0 Sep 9 12:15 test2
-rw-r--r-- 1 abeisaw1 users 893 Sep 21 13:09 testscript.tcsh
-rw-r--r-- 1 abeisaw1 users 892 Sep 16 11:57 testscript.tcsh~
We include the '.' after the find command to restrict the search to the current directory.
The "*" character appears to serve as a placeholder i.e. * means anything can go here.
The rm command removes the files listed after it without warning.
I think using rm * would remove all files since all files will match with a wildcard...definitely don't want to do that.
The > and >> operators specify where to send the output of the command to. The > operator rewrites the location contents if there is anything already there, whereas >> adds to any existing contents. That is a potential danger of using >, you may overwrite data by accident.
If I run "ls -l > log.txt" I expect to see the contents of the directory printed to log.txt
[abeisaw1@hepcms-in2 ~/TEST]$ ls -l > log.txt
[abeisaw1@hepcms-in2 ~/TEST]$ cat log.txt
total 16
-rw-r--r-- 1 abeisaw1 users 0 Sep 23 13:20 log.txt
-rw-r--r-- 1 abeisaw1 users 57 Sep 16 11:18 test.txt
-rw-r--r-- 1 abeisaw1 users 26 Sep 16 11:15 test.txt~
-rw-r--r-- 1 abeisaw1 users 893 Sep 21 13:09 testscript.tcsh
-rw-r--r-- 1 abeisaw1 users 892 Sep 16 11:57 testscript.tcsh~
[abeisaw1@hepcms-in2 ~/TEST]$
This is what I expected to see.
10 Useful Commands
ps
The ps command displays running processes:
[abeisaw1@hepcms-in2 ~]$ ps
PID TTY TIME CMD
3598671 pts/12 00:00:00 tcsh
3605595 pts/12 00:00:00 ps
kill
The kill command allows you to end a process that might be stuck. I don't currently have anything to kill, but I think it is useful to know incase the situation presents itself
grep
The grep command allows us to search for certain words within files and then list the matching lines within the specified files.
[abeisaw1@hepcms-in2 ~/TEST]$ cat greptest.txt
This is a demonstration of the grep command.
Here is some text from my physics textbook on waves.
A wave is a correlated collection of oscillations. For example, in a transverse wave traveling
along a string, each point in the string oscillates back and forth in the transverse direction (not along the direction of the string). In sound waves, each air molecule oscillates
back and forth in the longitudinal direction (the direction in which the sound is traveling).
The molecules don’t have any net motion in the direction of the sound propagation. In
water waves, each water molecule also undergoes oscillatory motion, and again, there is no
overall net motion. So needless to say, an understanding of oscillations is required for an
understanding of waves.
[abeisaw1@hepcms-in2 ~/TEST]$ cat greptest2.txt
Here is some more text for the grep test.
The ironic thing about water waves is that although they might be the first kind of wave that comes to
mind, they’re much more complicated than most other kinds. In particular, the oscillations of the molecules
are two dimensional instead of the normal one dimensional linear oscillations. Also, when waves “break”
near a shore, everything goes haywire (the approximations that we repeatedly use throughout this book
break down) and there ends up being some net forward motion. We’ll talk about water waves in Chapter
12.
[abeisaw1@hepcms-in2 ~/TEST]$ grep wave *.txt
greptest.txt:Here is some text from my physics textbook on waves.
greptest.txt:A wave is a correlated collection of oscillations. For example, in a transverse wave traveling
greptest.txt:along a string, each point in the string oscillates back and forth in the transverse direction (not along the direction of the string). In sound waves, each air molecule oscillates
greptest.txt:water waves, each water molecule also undergoes oscillatory motion, and again, there is no
greptest.txt:understanding of waves.
greptest2.txt:The ironic thing about water waves is that although they might be the first kind of wave that comes to
greptest2.txt:are two dimensional instead of the normal one dimensional linear oscillations. Also, when waves “break”greptest2.txt:break down) and there ends up being some net forward motion. We’ll talk about water waves in Chapter
history
The history command allows us to see a numbered list of the commands we have run in the current session. From this we can type a ! followed by the number of the command to run it again:
107 13:34 emacs -nw greptest.txt
108 13:37 emacs -nw greptest2.txt
110 13:39 clear
111 13:39 cat greptest.txt
112 13:39 cat greptest2.txt
113 13:39 grep wave *.txt
114 13:42 history
[abeisaw1@hepcms-in2 ~/TEST]$ !113
grep wave *.txt
greptest.txt:Here is some text from my physics textbook on waves.
greptest.txt:A wave is a correlated collection of oscillations. For example, in a transverse wave traveling
greptest.txt:along a string, each point in the string oscillates back and forth in the transverse direction (not along the direction of the string). In sound waves, each air molecule oscillates
greptest.txt:water waves, each water molecule also undergoes oscillatory motion, and again, there is no
greptest.txt:understanding of waves.
greptest2.txt:The ironic thing about water waves is that although they might be the first kind of wave that comes to
greptest2.txt:are two dimensional instead of the normal one dimensional linear oscillations. Also, when waves “break”
greptest2.txt:break down) and there ends up being some net forward motion. We’ll talk about water waves in Chapter
[abeisaw1@hepcms-in2 ~/TEST]$
less
The less command allows us to view a file wthout actually opening it, which prevents modification of the file if you simply want to view it. Here is the output after typing less greptest.txt
This is a demonstration of the grep command.
Here is some text from my physics textbook on waves.
A wave is a correlated collection of oscillations. For example, in a transverse wave traveling
along a string, each point in the string oscillates back and forth in the transverse direction (not along the direction of the string). In sound waves, each air molecule oscillates
back and forth in the longitudinal direction (the direction in which the sound is traveling).
The molecules don<E2><80><99>t have any net motion in the direction of the sound propagation. In
water waves, each water molecule also undergoes oscillatory motion, and again, there is no
overall net motion. So needless to say, an understanding of oscillations is required for an
understanding of waves.
greptest.txt (END)
To exit the file after, press q
head
head allows us to see jsut the top of a file. Useful to quickly check what the file is.
tail
tail is the compliment of head, and allows us to see the bottom of a file. Here is an example showing head and tail:
[abeisaw1@hepcms-in2 ~/TEST]$ emacs -nw headtailtest.txt
[abeisaw1@hepcms-in2 ~/TEST]$ head headtailtest.txt
Here is the top of my file.
Here is a code I wrote for a python class to give the file some length.
import numpy as np
import sympy as sp
import matplotlib.pyplot as plt
"""
Note: All references to the speed of light being constant are referring to vacuum speed. All motion is referring to non-accelerated motion in inertial reference frames.
"""
[abeisaw1@hepcms-in2 ~/TEST]$ tail headtailtest.txt
v_twin_4 = ((10e12-1)/10e12)
Twin_B_Age_4 = 50 + Earth_Time_Elapsed/gamma(v_twin_4)
Twin_B_Age.append(Twin_B_Age_4)
v_twin.append(v_twin_4)
for i in range(4):
print('If Twin B travels at ' + str(v_twin[i]) + ' for 50 years according to Earth, he will return at age ' + str(Twin_B_Age[i]) + ' while Twin A will be 90 years old.')
print('This corresponds to an time difference of ' + str(90 - Twin_B_Age[i]) + ' years. ')
Here is the bottom of my file.
Some keyboard shortcuts
ctrl k
Cut text from cursor to end of line
ctrl y
Paste text
ctrl a
move cursor to beginning of the line
alt f
jumps cursor to next space
alt backspace
deletes previous word
ctrl w
cuts behind cursor
bc
provides a command line calculator. There are functions built in to this that you can choose whether or not to load in. This can be used in two ways.
Method 1: bc -> perform calculations -> ctrl-c to exit
[abeisaw1@hepcms-in2 ~/TEST]$ bc
bc 1.06.95
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
1+1
2
2+2
4
10^2
100
10^10
10000000000
3*10^8
300000000
6.02*10^23
602000000000000000000000.00
^C
(interrupt) Exiting bc.
[abeisaw1@hepcms-in2 ~/TEST]$
Method 2: Piping into bc
[abeisaw1@hepcms-in2 ~/TEST]$ echo pi=`echo "h=10;4*a(1)" | bc -l`
pi=3.14159265358979323844
More info on this command with usage examples: https://www.geeksforgeeks.org/bc-command-linux-examples/
whatis
Gives a short description of what a command can be used for
[abeisaw1@hepcms-in2 ~/TEST]$ whatis bc
bc (1) - An arbitrary precision calculator language
bc (1p) - arbitrary-precision arithmetic language
[abeisaw1@hepcms-in2 ~/TEST]$ whatis sudo
sudo (8) - execute a command as another user
sudo [sudoedit] (8) - execute a command as another user
sort
Just as the name suggests, this will sort the contents of a text file based on ASCII values
Before
[abeisaw1@hepcms-in2 ~/TEST]$ cat sorttest.txt
1
2
5
6
4
9
8
Aaron's text file to test 'sort' command
Baryon
Quark
Lepton
Neutron
Quantum Mechanics
90099
10
5
a
e
z
After
[abeisaw1@hepcms-in2 ~/TEST]$ sort sorttest.txt
1
10
2
4
5
5
6
8
9
90099
Aaron's text file to test 'sort' command
Baryon
Lepton
Neutron
Quantum Mechanics
Quark
a
e
z
Homework Three
HW3 Goals
What is a shell script?
A shell script is a series of commands stored in a file. These can be used to automate a commonly used series of commands so that you don't waste time typing them out every time you need them.
What do line #!/bin/tcsh on top of a shell script means?
The #! piece of this line tells the kernel that the script is written for an interpreter, the /bin/tcsh is the path to the interpreter to use.
What is command 'chmod +x' used for?
chmod +x → add the executable flag to the file permissions
What do ’touch’ command do?
touch can create files or modify timestamps on existing files.
How do you execute a shell scripts?
You must add executable permissions using chmod +x scriptname.tcsh
What is the argument to a shell script?
Arguments in shell scripts are essentially variables which take on the value of the input when executing the script.
What is the difference between ’sometext’ and ‘$sometext’ in a shell script?
Assuming that we define sometext=$1: at the beginning of the script:
sometext would be interpreted as just that: sometext
$sometext would be interpreted as an environment variable and would be the user input when the script was executed
What is piping (|) in linux and how to use it?
See exercise two.
How can you search and replace something in a file from command line or from within a shell script.
See exercise three.
Shell Scripts
I've created a shell script called testscript.tcsh
This script is interpreted by the tcsh shell and it takes the user input and searches the / directory and all of its subdirectories, one directory up from the current directory, and the current directory for files whose names contain the user input.
The script ran successfully after I got clarification during class about the backtick character: ` instead of '
To minimize how long the output was for the logbook, I created a file called "thisfileshouldonlyexisthere.txt" and then used the following command tcsh ./testscript.tcsh thisfileshouldonlyexisthere :
The script searches for file names that contain the input and prints all files and paths which contain it.
Trying to run just ./testscript.tcsh thisfileshouldonlyexisthere resulted in a permission denied error. To solve this, I added executable permissions to the file by running chmod +x testscript.tcsh after which the previous command worked:
Now, as an exercise, try using emacs to write a simple script based on testscript.tcsh called homesearch.tcsh which takes one input, <input>.
homesearch.tcsh should search your home directory and its subdirectories for any files which contain <input> somewhere in their name. Finally, homesearch.tcsh should log the results of the search to a file called homesearch_<input>.txt. (Don't forget to 'chmod +x' your new script!) Try:
touch testfile
./homesearch.tcsh testfile
cat homesearch_testfile.txt
What is the output of this script?
In Linux, what is piping (done with the symbol | )? Write a short description.
Piping is a way of redirecting the output of one command into a second command. I think of it kind of like a composition of functions. In math this would be written as f(g(x)). Putting this in linux format, I see piping as g(x) | f(x).
The output of the first command is used as the input of the second command.
The command
sed -i -e 's/one/two/g' test.txt
searches the word "one" everywhere in the file test.txt and replaces it with the word "two."
Copy paste the following text to create test.txt file in your directory. Write a script that uses this and/or other commands to :
1. replace every "was" with "is"
cat on text file from copy + paste:
cat after sed command:
Show that for small beta relativistic kinetic energy has the same expression as the usual KE (= 1/2 mv2)
Show that pseudorapidity and rapidity are same for massless particles.
Why muons travel farthest in the detector.
How can you create a file with emacs?
emacs -nw filename.extension
How to print a statement in c++ code.
cout<<"Statement"<<endl;
what is ‘ #include xyz’ mean in a C++ file?
Header file for the C++ program, more detail below.
How to add comments in C++?
C++ comments are denoted by double slashes //
How do you compile c++ code to create and executable that you can then run as './executible-name’?
g++ -o outputname.out filename.cpp
What does the g++ compiler do?
g++ performs the necessary actions to take your source code file and return an executable file
What punctuation c++ code uses to separate the code lines?
C++ uses semicolons to separate code lines;
What does command 'g++ dumpspecs’ do?
g++ -dumpspecs displays all of the built in spec strings
How you define variables of kind int, double, float, bool,
int a = value;
double b = value;
float c = value;
bool d;
What do the operators ++ and —, !=, ==, do?
++ Unary increment operator (Works on a single variable, increment by 1)
— Unary decrement operator (Works on single variable, decrement by 1)
!= Relational operator: Tests whether one value is not equal to another value. Binary operator.
== Relational operator: Tests whether two values are equal to each other. Binary operator.
How while and for loops work in c++?
See below.
How to add debug statements in the C++code?
See below.
Created a C++ folder in my home directory and created main.cpp within that directory
main.cpp prints "Hello World!" with a new line to the console when it is ran, and then it exits
How Computers Actually Work
Learned that at their fundamental level, data on a computer is manipulated in the form of 1's and 0's. These numbers are stored in the memory and are moved into the register and then manipulated by the CPU. The basic operations performed are done in the Assembler language.
Libraries of assembler code have many of the operations stored in ways such that they can be accessed by programing languages to perform different tasks, such as multiplication. (higher level commands in programming languages further group together basic steps and store them in libraries to make it easier to perform more complex tasks)
When we write code, we write it with ASCII symbols and then compile it, i.e. translating it from ASCII → Assembler. We use the compiler g++
From find /usr/include/c++ -name "4*":
We have c++ versions 4.4.4 as well as 4.4.7
From g++ -dumpspecs
We have g++ version 4.4.7
Note: g++ -o filename.out will allow you to rename your output file
Some extra resources:
www.codeblocks.org
www.cplusplus.com/doc/tutorial
I combined most of the code from the variable and loop sections into one file by taking user input inside of a while loop, then used if else statements to determine where the code should run based on what the user input was. Inputs of 1, 2, 3, 4, and 5 will send the user to a section of code from the lesson. An input of 6 will exit the program, and anything outside of the discrete range [1,6] will automatically return to the user input part. My implementation of the user input and else if statements went smoothly despite not being required; there were no errors.
Output for the above code:
C++ is said to be C incremented by 1. It is called C++ not ++C because C++ will return C and then increment, whereas ++C will not return until after increment, thus C++ allows one to get C and C incremented by 1 from it (Both C++ and its parent language).
For debugging, we can define a variable:
int idebug=0;
and add in these lines:
if(idebug) cout<<"The current value of my variable is "<<my_variable_name<<endl;
When enabled (idebug=1), these statements would help us figure out what our variables at each section of the code are doing. I did not add these in to this code because there are already cout statements for the variables throughout.
Logic statements in C++, if-else.
How you define Pointers in C++? How you can get the address and the value of a pointer?
How can you define a pointer with a new memory address?
Using ‘date' and ‘awk' commands in a script.
The given example code contained an infinite loop. I have edited the code to remove this loop but have provided output for both the infinite loop and what happens if we add a decrement on n inside of the if statement.
Source:
Infinite Loop Output:
Output with decrement n-- added:
Here is the combined code for the pointers section along with its output for each case:
Output:
1. See Variables and Loops above, this main code was created using while, if, and else.
2. [Add FileDateList.tcsh]
We began this homework by setting up ROOT within our directory on the cluster.
Before accessing root we must run the command cmsenv, after which we can run commands through it.
We spent some time in class looking at the ana.C file and its uses, such as looking at data from collisions. Unfortunately I lost my screenshots from this portion of the lesson and have not remade them quite yet but they will be added
For the homework assignment, we began with looking at arrays and vectors in c++
We explored 1D and 2D arrays first:
First program source:
Second program source:
Outputs of the two above codes:
One dimensional arrays appear to be read as:
[00, 01, 02, ... , 0n]
Where the first number indicates row # and the second indicates column #
Two dimensional nxm arrays appear to be read as:
[00, 01, 02, ... , 0m]
[10, 11, 12, ... , 1m]
[20, 21, 22, ... , 2m]
.
.
.
[n0, n1, n2, ... , nm]
OR an nth row may be accessed by referring to the n-1th row's m+ath column, where a determines how far into the nth row you go (n0 -> a=1, nm -> a=m)
We then played around with opening, writing data to, and saving a file. In this case, we overwrite any existing data.
Source:
Output:
Now we learned about vectors and how to include and make use of code from other files.
The following source is the main code in which the other two files are called:
Next is the source of the dot product code:
And then the scalar multiplication code:
Here is the output of the main.cpp:
Next we moved on to exploring random number generation. This is the source for the one we created:
Along with its output which includes the first 10 generated numbers as well as a histogram plot for all of them. I've included output for n=10, n=100, n=10000:
After this we had another much shorter RNG, however, mine continues to output 83. I feel like I missed something in coding it but I'm not sure what (seed, perhaps?)
Finally, we explored more with ROOT in a file called resolutions.C with the accompanying secretparameters.txt
This is the source of resolutions.C:
This code was ran for N= 1, 10, 100, and 1000 for mass = 91 and mass = 1. Initially, N=1000 took a very very long time, however, thanks to a suggestion by Neo, choosing to update after everything else is finished makes the higher N values much much faster.
Here are the output plots
N=1 mass =91
N=10 Mass = 91
N = 100 Mass = 91
N = 1000 Mass = 91
N = 1 Mass = 1
N = 10 Mass = 1
N = 100 Mass = 1
N = 1000 Mass = 1
Based on the source code, I expected changing mass from 91 to 1 to shift the center of the plot towards the left, however, it seems as if something is not quite right (There is not really a shift here at all for mass = 91 vs mass = 1)
We can, however, see that as N increases, the shape of the plot becomes more defined and the data seems to remain centered around 90 ish. I'm not sure why changing mass has no effect for me, though. Will have to look into this more.
Find how to change the display to show you a view along the beam pipe?
You can use either your mouse to freely change orientation or use presets given by buttons on the bar.
Which color tracks are electrons
Green tracks
Which color tracks are muon?
Red Tracks
Which color track missing energy is represented with?
Pink
How are jets depicted in this visualization?
Orange cones
Can you figure out if a track has clockwise curvature, it is +vely charged or negatively charged? (when looking at the x-y view, with x along the horizontal axis)
CW → positive CCW → negative