HW 1
Similarities and differences of the electron, muon, and tau lepton
- All categorized as charged leptons
- spin of 1/2
- does not undergo strong interactions
- charge of -1
- Electron's are stable
- Muons and Tau have a short lifetime
- Masses vary
- Electron: ~0.511MeV
- Muon: ~105.658MeV
- Tau: ~1777MeV
What do commands 'mkdir' and 'cd ../ ..' do?
- mkdir 'directory_name' makes a new directory
- cd ../.. switches to the / directory
HW 2
What are the fundamental particles and forces? How many particles standards model of particle physics has?
- Fundamental forces
- Weak ~10^25:
- Strong ~10^38
- Electromagnetic ~10^36
- Gravitation ~ 1
- Fundamental particles
- Fermions
- Quarks
- Up
- Down
- Charm
- Strange
- Top
- Bottom
- Leptons
- Electron
- Muon
- Tau
- Electron neutrino
- Muon neutrino
- Tau neutrino
- Bosons
- Gauge
- Photon
- Gluon
- W
- Z
- Scalar
- Higgs
Linux is a unix-like operating system
The shell is a command-line interpreter
echo $SHELL
pwd: Displays the current directory
ls: Lists files in current directory (ls <option> <directory>)
ls .: Lists files in current directory
ls /: Lists files in root directory
ls ./: Lists files in root directory
ls -l: Lists files one line at a time
ls ..: Lists files in parent directory
ls -Cfx:
cd: Switches directories (cd
cd ..: Switches to parent directory
mkdir: Creates a new directory in current directory
rmdir: Removes a directory from current directory
which:
whoami: Displays username
echo: Outputs provided input
cat: Outputs contents of a file (all at once, )
more: Outputs contents of a file (part by part)
--help: following a command provides more information on the command
HW3
A shell script is a program designed to be run on the unix shell.
#! is a shebang (it takes on the form #!interpreter)
#!/bin/tcsh: instructs program loader(part of OS) to run /bin/tcsh and passing path to text file as the first argument (runs shell script in unix shell)
chmod +x: changes users permissions to execute a file (chmod u/g/o/a+x) (u for user, g for group, o for other, a for all)
touch: Creates an empty file
./executablefile: executes the shell script
./script <option1> <option2> etC: optioni becomes $i in shell script
$sometext references variable sometext(ie retrieves the value stored in sometext), sometext is the variable(ie no value only memory address, used for assignment)
<command1> | <command2> | etC: passes output of command1 into command2, etC
sed -i 's/old-text/new-text/g' input.txt: replaces all occurrences of old-text in input.txt with new-text
HW4
Kinetic energy and Pseudorapidity derivation
Muons travel the furthest because they can penetrate several layers of iron without interacting, unlike most other particles.
https://cms.cern/detector/detecting-muons
=======================================
#include <iostream> //imports the iostream library
using namespace std; //declares std as the namespace being used in case of duplicate variable names
int main() { //declares function main
cout<< "Hello World!" << endl; //Print hello world to screen followed by end line (endl)
return 0; //Exit the program (0 represents the exit code that no errors occurred)
}
=======================================
#include <iostream>
using namespace std;
int main() {
cout << "hello world" << endl;
int i = 2; //initializes variable 'i' with value 2 (of type 2)
cout << "i = " << i << endl; //prints 'i = 2'
double a=3.3; //initializes variable 'a' with value 3.3 (of type double)
cout << "a = " << a << endl;
int j = a * i; //initializes variable 'j' with value of a*i (since of type int, 2*3.3 is automatically casted to 6)
cout << "a*i = " << j << endl;//prints "a*i= 6"
return 0;
}
==========================================
#include <iostream>
using namespace std;
int main() {
int n = 10;
cout << "n is " << n << endl;
n--; //decrements n by 1 (equivalent to n-=1 or n = n - 1)
cout << "n is now "<< n << endl;
n++;//increments n by 1 (equivalent to n += 1 or n = n + 1)
cout << "n is now " << n << endl;
return 0;
}
the difference between ++n and n++ is prefix vs postfix operation
n will be mutated to n + 1 at the end regardless, but the evaluation of n
will be n for n++ and n + 1 for ++n
for example
int n = 2;
cout <<n++<<endl; //prints 2
cout <<++n<<endl; //prints 4
the same is true for all other postfix vs prefix operations
====================================
#include <iostream>
using namespace std;
int main() {
bool prop; //declares variable 'prop' with no value
prop = (5 > 1); //assigns (initializes) variable 'prop with value (5>1) which is true which is represented by 1
cout << "prop is " << prop << endl; //prints out "prop is 1"
prop = (1 >5); //assigns value of 0 (which represents false)
cout << "prop is " << prop << endl;
prop = (1 != 5); //assigns value of 1
cout << "prop is " << prop << endl;
return 0;
}
=====================================
#include <iostream>
using namespace std;
int main() {
int n = 10;
while (n > 0) {//if n > 0 evaluates block of code between brackets (ie will print 10,9,..2,1 in this example each separated by \n)
cout << "n is " << n << endl;
n--;
}
return 0;
}
============================================
#include <iostream>
using namespace std;
int main() {
// initializes variable n within scope of for loop block (can't be accessed outside of for loop)
// set condition to loop as long as n > 0
// decrements value of n by 1 each iteration
for (int n = 10; n > 0; n--) {
cout << "n is " << n << endl;
}
return 0
}
# include <iostream>
using namespace std;
int main() {
for (int n = 0; n < 10; n++) {
cout << "n is " << n << ": ";
for (int m = 0; m <= n; m++) {
cout << m;
}
cout << endl;
}
return 0;
}
========================================================
========================================================
HW5
#include <iostream>
using namespace std;
int main() {
int n = 10;
while (n >= 10) {
if (n > 5) { //prints "n is <value of n>" (if value of n is > 5)
cout << "n is " << n << endl;
}
else { //prints "n = <value of n>" (if all prior if conditions are unsatisfied)
cout <<"n = " << n << endl;
}
n--;
}
return 0;
}
=========================================================
#include <iostream>
using namespace std;
int main() {
int i = 10;
cout << "The memory address of i is " << &i << "\n";// &i retrieves the memory address of i
cout << "The data stored at memory address " << &i << " is " << i << "\n";
int* p = &i; // int * declares an int pointer variable
cout << "The value of p is " << p << "\n"; //pointer variables store memory addresses
cout << "We say that p 'points at' the memory location referenced by address " << p << "\n";
cout << "The data stored at memory address " << p << " is " << *p << "\n"; // *p dereferences pointer variable (ie retrieves data stored at p)
return 0;
}
===========================================================
in program 1, the variable j stores the value of i, but in a completely new memory address (deep copy)
in program 2, pointer p copies the memory address of i (shallow copy), therefore changes made to data
at said memory address will be reflected by all variables referring to same memory address
===========================================================
#include <iostream>
using namespace std;
int main() {
double* p1 = new double(3.14);
double* p2 = p1;
cout << p1 << " value of " << *p1 << endl;
cout << p2 << " value of " << *p2 << endl;
(*p1) *= 2;
cout << *p1 << "\t" << *p2 << endl;
return 0;
}
==================================================
====================================================
#include <iostream>
using namespace std;
int main() {
int i = 0;
while (i < 10) {
if (i % 2) {
cout << i << " is odd"<<endl;
}
else {
cout << i << " is even" << endl;
}
i++;
}
return 0;
}
=====================================================
#!/bin/tcsh
set month = `date | awk '{print $2}'`
ls -lat | grep "$month "
======================================================
======================================================
HW6
=====================================================
#include <iostream>
using namespace std;
int main() {
int ii[3] = {1,2,3}; //initializes int array of length 3 with value {1,2,3}
int j = 0;
while (j < 3) {
cout << " ii of " << j << " is " << ii[j] << endl; //ii[j] refers to the value at jth index of ii
j++;
}
int LL[2][3] = {1,2,3,4,5,6}; //initializes int matrix of dimension 2x3 with value {{1,2,3},{4,5,6}}
j = 0;
int k;
while (j < 2) {
k = 0;
while (k < 3) {
cout << " LL of " << j << " " << k << " is " << LL[j][k] << endl; //LL[j][k] refers to the value at the jth row and kth column equivalent to LL[3j +k]
k++;
}
j++;
}
return 0;
}
=========================================================
#include <iostream>
#include <fstream> // a library for file i/o operations
using namespace std;
int main() {
ofstream myfile; //declares a basic output stream from fstream library
myfile.open("example.txt"); //example.txt becomes buffer for myfile (creates example.txt if it doesn't exist)
myfile << "write some junk.";//overwrites exisiting data in "example.txt" with "write some junk."
myfile.close(); //closes buffer
return 0;
}
==========================================================
#include <iostream>
#include <fstream>
// include the program dotprod.cpp so that we can find the dot_prod function
#include "dotprod.cpp"
using namespace std;
int main() {
// declare the vectors
double vector1[3];
double vector2[3];
// open the input file
ifstream infile;
infile.open("vectors.txt");
//store the input in the vectors and print the vectors for the user
infile >> vector1[0] >> vector1[1] >> vector1[2]; //stores the first int from infile(vectors.txt) in vector1[0], second int in vector1[1], etC
cout << "Vector 1 is (" << vector1[0]<<","<<vector1[1]<<","<<vector1[2]<<")"<<endl;
infile >> vector2[0] >> vector2[1] >> vector2[2];
cout << "Vector 2 is (" << vector2[0]<<","<<vector2[1]<<","<<vector2[2]<<")"<<endl;
double scalar;
infile >> scalar;
cout << "The scalar is " << scalar<<endl;
//close the input file
infile.close()
// call the dot_prod function from dotprod.cpp
dot_prod(vector1, vector2);
scalar_mult(scalar, vector1);
scalar_mult(scalar, vector2);
return 0;
}
#include <iostream>
using namespace std;
double dot_prod(double v1[3], double v2[3]) {
double dotdot;
dotdot = v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2];
cout << "The dot product is " << dotdot << endl;
return 0;
}
#include <iostream>
using namespace std;
int scalar_mult(double scalar, double v[]) {
cout << "The scalar multiple is (";
int i = 0;
for (; i < v.size() - 1; i++) {
v[i] *= scalar;
cout << v[i] << ","
}
v[i] *= scalar;
cout << v[i] <<")"<<endl;
return 0;
}
==========================================
#include <iostream>
#include <math.h>
using namespace std;
// this function is the actual random number generator
// this code is stolen from the book numerical recipes for fortran
// it relies on random generated from overflow of memory locations
// and is a pseudo random number generator
const int a = 7141;
const int c = 54773;
const int mmod = 256200;
double getFlatRandom(int& inew) {
double mranflat = 0.;
inew = inew%mmod;
double aa = double(inew)/double(mmod);
mranflat = aa;
inew = a * inew + c;
return mranflat;
}
// in this code, we will call the pseudo-random number generator and learn some things
// about its properties by filling and then displaying a histogram
int main() {
int num;
cout << "Enter the number of loop iterations: ";
cin >> num;
int inew = 2345; // This is the "seed" for the random number generator
// we will put the results from the call into a histogram that we can look at, to learn some of its
// properties. This histogram has 10 bins.
int histo[10] = {0,0,0,0,0,0,0,0,0,0};
double atmp;
// call the random number generator 1000 times and fill a histogram
for (int i = 0; i < num; i++) {
atmp = getFlatRandom(inew) // call the random number generator
histo[int(atmp * 10)]++; // increment the histogram bin the number falls within
}
// print the histogram to the screen
for (int i = 0; i < 10; i++) {
cout << i << ": ";
for (int j = 0; j < int((double(100*histo[i])/double(num))+0.5); j++) {
cout << "=";
}
cout << endl;
}
return 0;
}
Higgs Discovery
With the increase of center of mass energy from 7TeV to 8TeV luminosity exceeding 5fb^-1 (inverse femtobarn- number of interactions in 1 femtobarn 10^-28 m^2)
In the 5 decay modes of the higgs (WW, ZZ, tau tau, gamma gamma, bb) (some of the Z and W bosons in the ZZ and WW channels were off mass shell, which is that they violated classical energy-momentum relations)
Of the 5 decay modes greatest significance was seen in the gamma gamma channel (4.1std) and ZZ channel (3.2std). The significance of the whole experiment was (5 std when 5.8 was expected)
The predicted mass of the higgs with a certainty level of 95%
5.
Higgs distribution expected to fall between range 110-150GeV
Replaced cross-check analysis with multivariate analysis to achieve 15% higher sensitivity. (Machine learning techniques)
Collision was reconstructed through kinematic properties of tracks and their correlation with diphoton kinematics
Mass within |eta| < 2.5 (fiducial region, excluding barrel-endcap) requires only m/3 > expected to be considered significant, mass outside this region requires m/2 > expected to be considered significant
HZZ4LeptonsAnalysisReduced->MakeClass("HiggsAnalysis") //Generates HZZ4LeptonsAnalysisReduced from TTree, creates HiggsAnalysis class