similarities and differences of the electron, muon, and tau leptons
All these three leptons have a spin of 1/2, a charge of -1, and don't undergo strong interactions. The difference between them is their mass. Tau has the heaviest among the three and is followed by muon. Also, their lifetime varies. While electrons are stable, both tau and muon would decay into other particles.
What do commands ‘mkdir' and 'cd ../..’ do?
mkdir: Make new dictionaries.
cd: Change the current dictionary, which means one can go back to the previous directories or access other directories
What are the fundamental particles and forces? How many particles standard model of particle physics have?
Fundamental particles including leptons, quarks, and bosons.
There are 4 fundamental forces -- electromagnetic force, weak force, strong force, and gravity.
There are 17 particles in the standard model.
What is the spin of a fundamental particle?
Spin is one of two types of angular momentum in quantum mechanics.
What is the difference between bosons and fermions?
Fermions have spins of 1/2 times an integer, whereas bosons have integer spins. Also, bosons act as force particles, but fermions are matter particles
What is Linux?
Linux is an operating system.
What is a Linux Shell?
An command line which prompt users to input commands
How do you find which shell you are working in?
Echo $SHELL
What is the basic linux command structure?
command [-options] [arguments]
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
pwd: show current directory
ls: lists of files and folders
ls-l: get lists of files with more information
ls-lr: get lists in reverse order
ls ..: gives parent directory
ls -CFx cd: makes list of files or directory
cd ..: moves into the directory named ...
mkdir: make directory
find: find a certain directory
rmdir: remove directory
which: shows the full path of commands
Whoami: show users
echo: display a line of text
cat: concatenates and prints files
What is the difference between ls, ls ., and ls .., ls /, ls ./
ls: list files and folders
ls ..: show parent directory
ls /: show root directory
ls ./: show list of files in root directory
How can I get help to learn more about linux commands on the command line?
-help
What is the symbol ~ used for in the directory structure?
home directory
What do uparrow and enter keys do?
uparrow: go through the text
enter key: run commands
What kind of programs/apps you can use to open the following file types: .txt, .C, .cpp, .root, .sh, .csh
.txt: Notepad, Wordpad
.C: Notepad, Notepad++
.cpp: Notepad, Notepad++, repl.it
.root: ROOT, Tbrowser
.sh: GNU Bash, Vim, gVim, Apple terminal
.csh: Photshop
What do operators, > and >> do?
> overwrite whatever was in the file with the new files, but >> append the new files with previous files
What is emacs?
Text editor for Linux
What is the difference between the commands
emacs -nw mycode.C
opens the mycode.c file in emacs with no window
emacs mycode.C
opens the mycode.c file in emacs in a separate window
emacs mycode.C &
Same as emacs mycode.c, plus its ability to process command
What do you expect to happen if you run the command ‘emacs myfile.txt &’ where the file myfile.txt does not exist already.
create a file called myfile.txt
How do you save a file in emacs?
ctrl c + ctrl v
How do you search for some string in emacs?
ctrl + s, then the string, then enter
What did it seem like the 'touch' command does?
it is used to create a file without any content
Why do you think we include that '.' after the 'find' commands?
to specify that we want it to search in the current directory
Based on the outputs from the four 'find' commands, what purpose do you think the '*' character serves? (Hint: it's called the "wildcard" character in linux jargon)
* matches zero or more characters
What did the 'rm' command do, and how do you think 'rm' differs from the 'rmdir' command we saw earlier? Warning: There is no way to undo the 'rm' command!
'rm' is removing files, whereas 'rmdir' is removing directories
Finally, to test your understanding, why do you think that you should never run the command 'rm *'?
'rm *' will remove all files in the current directory
What do the '>' and '>>' operators do? How are they similar? How are they different?
> overwrite whatever was in the file with the new files, but >> append the new files with previous files
What is one potential danger of using the '>' operator?
> rewrites all your previous files
What do you expect to see if you run:
ls -l > log.txt
cat log.txt
ls -l
Use google and collect 10 Linux commands that you think could be useful for you. For example, one such command would be to find and replace a word or phrase in a large text file.
history - display all commands used
clear - clears all commands and files
kill - kills current process
cp - copy files to directories
mv - move files to directories
w - list all the users who currently log in
ctrl c - ignore the command one have just typed
df - display disk size
ping - exchanges of information with a specified IP address
grep - finds all lines with specific text within a file
chmod - a command with many different flags that changes the permissions of a specified file.
What is a shell script?
allow us to execute lists of commands without retyping them all
What do line #!/bin/tcsh on top of a shell script means?
it tells the computer where to execute the script
What is the command 'chmod +x' used for?
add the executable flag for file permissions
What do ’touch’ commands do?
create a new file if it doesn’t exist, and update a file if it exist
How do you execute shell scripts?
chmod +x script-name-here.tcsh
What is the argument to a shell script?
they are 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?
sometext is just sometext, but adding $ makes it become a variable
What is piping (|) in linux and how to use it?
Piping is a way of redirecting the output of one command into a second command
How can you search and replace something in a file from the command line or from within a shell script.
sed -i -e 's/(search term)/(replace term)/g'
Exercise 1:
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
Exercise 2:
In Linux, what is piping (done with the symbol | )? Write a short description.
| sends the output from one program as input to another program. It can be thought of as the previous output becomes an input for the next program.
Exercise 3:
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 a test.txt file in your directory. Write a script that uses this and/or other commands to :
1. replace every "was" with "is"
Show that for small beta relativistic kinetic energy has the same expression as the usual KE (= 1/2 mv2)
When beta is small, the Lorentz factor gamma becomes 1. So we can apply binomial expansion for gramma which gives grammar = 1 + v2/2c2. Then plug in KE = (grammar - 1)mc2 = 1/2mv2.
Show that pseudorapidity and rapidity are the same for massless particles.
For massless particles, the momentum and energy will be the same for these particles since they both have zero mass.
Why muons travel farthest in the detector.
Because muons can penetrate several metres of iron without interacting, unlike most particles they are not stopped by any of CMS's calorimeters.
How can you create a file with emacs?
ctrl-x, ctrl-f
How to print a statement in c++ code.
count << “....”
what is ‘ #include xyz’ mean in a C++ file?
access a file in dictionary
How to add comments in C++?
// for single lines. */...*/ for multiple lines of code
How do you compile c++ code to create an executable that you can then run as './executible-name’?
g++ filename.cpp
What does the g++ compiler do?
It compiles code as well as checks for errors
What punctuation c++ code uses to separate the code lines?
Semicolons, parenthesis, and brackets
What does command 'g++ dumpspecs’ do?
Prints the compiler's specs
How you define variables of kind int, double, float, bool,
What do the operators ++ and —, !=, ==, do?
++: plus 1 from original value
--: subtract 1 from original value
!=: unequal
==: equal
How while and for loops work in c++?
While loops checks if the condition is true. The loop will end when the condition is false.
For loops continuously check if a condition is true.
How to add debug statements in the C++code?
std::cerr will check what to debug
main.cpp:
outcome:
variable.cpp
outcome:
operation.cpp
outcome:
Non-numeric.cpp
outcome:
while.cpp
outcome:
for.cpp
outcome:
myself.ccp
outcome:
HW5
How you define Pointers in C++? How you can get the address and the value of a pointer?
int* p = &i. Yes.
How can you define a pointer with a new memory address?
int* p = &i
Using ‘date' and ‘awk' commands in a script.
It outputs currentdates.
logic statements
output:
What is ROOT? (answer in the context of LHC data analysis. We are not concerned with any other uses of the word ‘root’)
Root is a data analysis software that can display data
What does command ‘cmsenv’ do?
It set up a space that root can run
What happens when you run command ‘root'?
It shows the terminal to the root
What is the difference between commands ‘root' and 'root -l’
root -l won’t bring up the logo
How do you quit a root session?
.q
Working with arrays in C++.
See code below
How can you add single and multi line comments in C++?
// for single line and /* */ for multiline
What do we mean by the ’seed’ of a random number generator?
It is used to generate the string of numbers
What changes in the distribution of random numbers as you increase statistics?
What is ‘class' in C++?
Classes are similar to variables. They can store data.
Name two classes you have used in C++ code in this class?
How do you run C++ code with root?
cd CMSSW_5_3_30/src
cmsenv
root
How do you book, fill, draw, and save a histogram in C++ code to be used in root?
Arrays and vectors in C++
Any nXm arrays can be expressed as:
[00, 01, 02, ... , 0m]
[10, 11, 12, ... , 1m]
[.............................]
[n0, n1, n2, ... , nm]
Array 1: create a 2X3 array
Output:
Array 2: create a 3X2 array
Output:
Read Files in C++
In this program, we can rewrite any existing data
Output:
The first code we’ve written is the main code for this operation called vector.cpp:
The following one is the code which operates the dot product called dotprod.cpp:
Then we want to make scalar multiple(scalar_mult.cpp):
outcome:
The code for the random number generator is below:
Put a cout statement into the code that makes it print the first 10 “random” numbers it generates. Run the executable a couple of times. What do you notice? (This is why they are called pseudo-random numbers.)
By adding the following code, we are able to print the value of randomly generated numbers:
The outcome is below, here I chose interaction number = 10.
After choosing some large iteration numbers, I noticed that the first 10 numbers don't change.
n = 100:
n = 1000:
Try changing the seed (it should be odd and large). What happens then?
The numbers change when changing the seed.
What happens to the contents of the histogram as you iterate more and more?
The histogram becomes more evenly distributed.
n =100:
n = 1000:
Calorimeter problem
Set N=1 and run it. From this "data", what would you guess the mass of the mother particle is? And, how far would you guess the true mother mass could be from this measured value?
It looks like it has a mass of about 96 and is off by 5. The mother mass should be around 91Gev.
Now change N to 10. What do you find?
The range of values for the mass is now spread from around 73 to 115. Center around 90.
Change N to 100? What do you find?
Ranges from about 38 to 151. Center around 90
Change N to 1000. What do you find?
Ranges from less than 10 to over 150. Center around 90. The histogram looks more like a bell curve now.
Now open secretparameters.txt and change the first number in it to 1. Repeat with N=1,10,100,1000. What have you learned?
As I changed mass from 91Gev to 1Gev, the bell curve has shifted to the left. However, this time it no longer centered at 1.
HW7
What is missing energy?
Missing energy refers to the energy that is not detected in a particle detector, but is expected because of the laws of conservation of energy and conservation of momentum.
What are jets?
Jet is a narrow cone of hadrons and other particles produced in the QCD scattering process which creates high transverse momentum quarks or gluons
How to distinguish between physics objects in the detector?
1. Electrons
Electrons can interact with nuclei in the material via the long-range electromagnetic interaction of pair production, so they shower quickly upon impact. Electrons are caught by the EM calorimeter.
2. Muons
Muons lose energy by exciting or ionizing the electrons in the material. Because of this, they lose energy very slowly, and they are the only charged particle which can penetrate through the calorimeters. Tracking chambers outside the calorimeters with return yoke are used to detect muons.
3. Photons
Same as electrons.
4. Jets
Jets can be detected by jet finding algorithms. It contains four different algorithms divided up the calorimeter energies into “jets”. They are caught by the hadronic calorimeter.
What is the MadGraph package used for?
MadGraph helps us generate and simulate collision events inside CMS.
How is tar command used? What is the difference between xvzf and cvzf options for tar?
tar command is used to unzip .tzg files.
What kind of information can you find in the madgrapgh output .lhe file?
Data that corresponds to collision events in a given run.
What is monte carlo (MC) ID?
MC ID is used for some particular particle simulation
Find how to change the display to show you a view along the beam pipe?
Drag mouse
Which color tracks are electrons
green
Which color tracks are muon?
red
Which color track missing energy is represented with?
purple
How are jets depicted in this visualization?
orange cones
Can you figure out if a track has clockwise curvature, is +vely charged or negatively charged? (when looking at the x-y view, with x along the horizontal axis)
muon tracks, because it has a clockwise curvature with a positive charge
Study at least 2 events from each category in the files available with the display and specify how many objects of each kind are seen in every event?
Hto4l_120-130GeV.ig:Events/Run_201191/Event_1357605031:
electrons: 4
muons: 2
photons: 4
jets: 49
missing energy: 1
vertices: 15
Hto4l_120-130GeV.ig:Events/Run_199319/Event_1203594102:
electrons: 4
muons: 2
photons: 0
jets: 44
missing energy: 1
vertices: 11
HW8
Using relativistic kinematics - TLORENTZ vector class to get Z-boson and Higgs boson invariant mass
Excercise:
in the above code add new TLorentzVector el3, el4 for the 3rd and 4th lepton and set their pt, eta phi, mass.
Add these two vectors to get a new vector TLorentzVector zCandidate2.
Add the two vectors zCandidate and zCandidate2 to get a new TLorentzVector Higgs.
DEfine a new histogram H_zz
TH1F* H_zz = new TH1F("H_zz", "ZZ candidate invariant mass", 200, 0, 300);
Fill the H_zz histogram with HIggs mass. (using Higgs.M() )
Write the H_zz histogram.
open the output file and paste the Z_ee and H_zz histograms in your HW file.
The new code which includes H_zz is shown below:
]
HW9
MOVING to PYTHON and Machine Learning.