REFERENCES:
Pythia
Pythia Homepage: http://home.thep.lu.se/~torbjorn/pythia82html/Welcome.html
New Gauge Boson Proces: http://home.thep.lu.se/~torbjorn/pythia82html/Welcome.html
Helps to determine what some of the cards in the Z boson decay do in tutorial 1
Phase cuts: http://home.thep.lu.se/~torbjorn/pythia82html/Welcome.html
NEW SEMESTER
2/15/16
Restarting the GEANT tutorial from scratch to catch up on what I started.
Use git clone https://github.com/saraheno/honrgeant.git clone the repository
cd honrgeant
For some reason, the source G4_setup.sh doesnt work. The s in setup should be capitalized but I still get the error /home/eno/CMSSW_7_4_0: No such file or directory.
2/10/16
I have been stuck on plotting the invariant mass for a week, could not find the code necessary. Tal's github page was extremely useful. Here is the link to the: repository https://github.com/robotal/PythiaWork/blob/master/pythiaTree.cc
After many hours, this is what the invariant mass graph of the two highest pT electrons should look like.
2/7/16
Changed my code to the new masses in actual GeV units as indicated in Jacobs logbook. However, my mass histogram did not change
2/4/16
Started working on Geant.
After running the given code, got this nice image.
2/2/16
Going to ask questions about TODO: alter pythiaTree.cc so that the particle's mass is stored in the tree.
Alright, Fixing the code from the last time. To add the mass to the histogram.
Define the mass next to the other variables: Float_t Am[100];
Create a branch next to the section with all other branches: t1->Branch("Am",Am,"Am[nTot]/F");
Finally copy the format for the section under if(pythia.event[i].isFinal()) using this code: Am[nTot-1]=pythia.event[i].m();
Look at Jacob's Logbook for details on how he found the syntax for this code.
To change the number of events from 100 to 10000:
Look at the part where it says for (int iEvent = 0; iEvent < 100; ++iEvent) and change the 100 to 10,000
WARNING: changing it to 10,000 causes the program to never compile when I try to run it to the output.txt file. I do not know why that is. I changed it to 1000, and it took a little while to run but it worked.
To make a Z of mass 1500 GeV that decays to electron pairs.
Locate where it says Pythia pythia; and remove the code below it.
Add this code:
pythia.readString("NewGaugeBoson:ffbar2gmZZprime = on");
This indicate the process of scattering ffbar -> Z^0 will occur, which is just like a fermion pair production
pythia.readString("32:m0 = 150.");
The 32 in front of most of these lines gives the particles status. 32 indicates that the particle is a Z^0 boson. m0 =150 indicates that the nominal mass of the particle is150
pythia.readString("32:mMin = 90.");
mMin indicates that the minimal mass of the particle is 90
pythia.readString("32:mMax = 300.");
mMax indicates that the maximal mass is 300
pythia.readString("PhaseSpace:mHatMin = 20. ");
This indicates that the minimum invariant mass is 20. Link in reference.
pythia.readString("Zprime:gmZmode = 3");
Because this is mode 3 it means only pure Z'^0 contributions are made in the events. So no other events like gammas or W bosons are counted.
pythia.readString("Beams:eCM = 14000.");
this indicates that the CM (center of mass) energy for the two beams is 14000
pythia.readString("32:onMode = off");
This indicates that the Z^0 channel is turned off
pythia.readString("32:onIfAny = 11");
Switches back on the Z'0 channel for electrons (taken from Jacob's logbook, could not find it on the pythia website)
Note: Do not remove the pythia.init(); line though or else the code will not initialize. Look at my references to find the pages where I found pieces of the above code and tried to figure out what they mean.
This is my mass (Am) histogram.
1/29/16
Continuing to work on HW 1:Pythia. The syntax above to store the particle's mass does not work at the moment even though I copied the format of the other variables. Will have to check up in class.
1/28/16
I started HW 1: Pythia
Logged into hepcms server and in the home directory I copied the code given in the tutorial.
To add a branch to a tree where the mass is recorded, create a mass variable where the variables are initialized:
Float_t m[5000];
Then to make a branch where the mass is recorded, follow the syntax given in the code:
t1->Branch("m", m, "m[nTot]/F");
Also in if(pythia.event... section of the code, include the mass by following the syntax:
m[nTot-1]=pythia.event[i].m();
To alter the number of events from 100 to 10000, look for the for loop and change the code:
change iEvent < 100 to iEvent < 10000
1/29/16
Continuing to work on HW 1:Pythia. The syntax above to store the particle's mass does not work at the moment even though I copied the format of the other variables. Will have to check up in class.
OLD SEMESTER
9/20
Started reading "Special Relativity" in the online text. Wrote down questions about certain topics that were confusing.
9/21
Created emacs file for the search script using emacs nw- testscript.tcsh
Then copied and pasted the text given in the tutorial.
Tried to run the given search script but experiencing difficulties because I get the message saying "missing name for redirect"
Found the problem (in discussion). I needed to add / in front of #!/bin/tcsh and remove the <> when trying to run the code ./testscript.tcsh
Started my own search script named homesearch.tcsh
Used chmod +x homesearch.tcsh to allow access
chmod +x is a command that gives access for the script to be run
Had difficulty creating a script that performed the function needed.
Change code in my search script to solution:
#!/bin/tcsh
find ~ -name "*$1*" -print > homesearch_$1.txt
Sequentially, I typed in:
1. touch testfile
2. ./homesearch.tcsh testfile
3. cat homesearch_testfile.txt
Opened emacs nw- homesearch_testfile.txt then this appeared on emacs:
/home/bissonnette/testfile
/home/bissonnette/homesearch_testfile.txt
Tried it again using Phys as my input
So it created a file called: homesearch_Phys.txt
It displays on emacs:
/home/bissonnette/homesearch_Phys.txt
/home/bissonnette/PhysHonr268
/home/bissonnette/PhysHonr268n
/home/bissonnette/Phys
Created github account with the user mbissonnette96.
Typed into hepcms:
git config --global user.name Mathieu Bissonnette
git config --global user.email mathieu.bissonnette.96@gmail.com
git config --global user.github mbissonnette96
Continued to follow instructions on the github website. Created an SSH key and added a passphrase, although I don't know if we need one. Followed instructions on github to save key.
Finshed the github tutorial and proceeded to homework tutorial.
Created new directory using: mkdir gittest
followed directions on tutorial
Having trouble when trying to push.
9/22
New commands/code learned in class
ls / shows the first layer of directories, the ones that you don't even begin on when you first log into linux
ls -l shows the information of the files and directories
$1 This refers to argument 1 in emacs
. Current directory
/ First area in the Linux directory structure
./[filename] This tells linux to run the file in the current directory
I decided to make a google doc where I can add all of the commands and code that I learn throughout the course, so they can be all in one place.
https://docs.google.com/document/d/1LvJ4ZSqE9FKLV-GhFF4n2IUL9Lwpyi1R5WsalRQyakY/edit
9/28
Created a file named main.cpp with emacs in the HONRPHYS subdirectory
Followed the instructions, and copied the code into the emacs file.
Typed ./a.out and Hello World! appeared in my terminal, so I assume that the code worked fine.
Began looking at the penguin programmer tutorial.
9/30
Useful things I learned on the Penguin Programmer so far:
{ and } enclose the code you want to execute
#include <iostream> tells the computer to access the library of code for the C++ language
int main() tells the computer that the code starts here
// allows you to write a comment in your code
10/1
Used the cd command to move into the HONRPHYS subdirectory
Opened up the file main.cpp on emacs using: emacs nw- main.cpp
Changed the first code given in the tutorial to the second set of code.
Typed in ./a.out into the terminal to execute the new program
Only Hello World! appeared. Shouldn't something else happen?
Found the source of the problem. In main.cpp, the first command should end with "endl" not "end".
Also, to execute the new program, I first needed to use the g++ command again. So I typed in g++ main.cpp
g++ is a command that compiles the code in a file and makes it an executable program.
Still have not figured out how to push code to github, need to learn his process.
Created a new file named main2.cpp to see if I could have two executable programs. I inserted the next line of code (the one under Some Operations with Numbers)
Used the g++ command to make it executable, but there was an error. In the code there is a " missing towards the bottom of the code that is necessary.
Afterwards, I used g++ main2.cpp and used the ls command to see if it would create a new program other than a.out (a.out is the default). In fact, instead of creating a new program, it just replaced the old program that a.out executed (which was the code from the previous section).
Typed in ./a.out. This is the code that appeared:
n is 10
n is now 9
n is now 10
The operation ++ increments the variable by one and the operation -- decrements the variable by one
Opened up the old file main.cpp (I just bounced between main.cpp and main2.cpp but it doesn't matter because the one i use the g++ command on is the one that gets executed).
Wanted to find a way to delete the entire code at once instead of holding backspace. Looked it up, and you can use "marks" and something called the "region" to delete a whole section of code.
Use [cntl] [space] to set your mark, then scroll to include all the code you want to delete (this is the "region") then use [cntl] w to delete it all.
Changed the code in main.cpp to the new code (non-numeric variables 1)
Used g++ main.cpp and then ./a.out. This showed up on the terminal:
prop is 1
prop is 0
prop is 1
Changed the code in main.cpp to the first loop code. This was the result:
n is 10
n is 9
n is 8
n is 7
n is 6
n is 5
n is 4
n is 3
n is 2
n is 1
Created a new file named mainloop.cpp
Entered the next loop code into the emacs file. Then used g++ to compile the code and ./a.out to execute it.
When I typed ./a.out this appeared:
n is 0:0
n is 1:01
n is 2:012
n is 3:0123
n is 4:01234
n is 5:012345
n is 6:0123456
n is 7:01234567
n is 8:012345678
n is 9:0123456789
10/3
cout is the standard output command. This means that it will print on the terminal whatever is between the symbols << <<. If you print something with quotation marks (like this cout<< "hello" <<) it will print the exact text between the quotation marks. If not it will print the value of the variable between the signs << <<.
cin is the standard input command. It allows the user to type in something the terminal when the program is executed, which will cause a the program to respond according to the code. (cin uses the operator >>)
Started trying to develop the code for the program that calculated n! for the first 10 integers.
Found this website that was very useful to understand loops in general and is very relevant to this code (it gives you a general version of how to do an n! code).
http://www.programiz.com/cpp-programming/for-loop
10/11
Used cd HONRPHYS to go into the subdirectory
The first code in the tutorial for HW 5 did not work at first, as only n is 10 appeared on the terminal.
I played around with the code and finally got it to work. This is the code I fixed.
#include <iostream>
using namespace std;
int main() {
int n = 10;
while (n<=10) {
if (n>0){
if(n>5) {
cout<<"n is "<<n<<endl;
n--;}
else {
cout<<"n = "<<n<<endl;
n--;}
}
}
return 0;}
Continued with the tutorial and proceeded to change the code and understand its new meanings
10/19
The version of root listed on the tutorial does not exist. Instead this is the one to use.
cmsrel CMSSW_5_3_13_patch1
To access ROOT everytime:
need to login with ssh -Y bissonnette@hepcms.umd.educ
cd HONRPHYS
cd CMSSW_5_3_13_patch1
cmsenv
cd test
10/23
copied first code for arrays in a file named matrices.cpp
g++ matrices.cpp
./a.out
This is what appeared in the terminal:
ii of 0 is 1
ii of 1 is 2
ii of 2 is 3
LL of 0 0 is 1
LL of 0 1 is 2
LL of 0 2 is 3
LL of 1 0 is 4
LL of 1 1 is 5
LL of 1 2 is 6
10/24
Arrays:
to initialize an array, you use the variable type, then the name of the array, followed by the dimensions, and then set it equal to the values of each cell in the array.
Example: int array[2][2] = {{1,2},{1,2}};
The first number in brackets is the number of rows, and the second is the number the number of columns (i.e. the number of variables in a row
using namespace std is where many built in c++ library routines are stored in, such as vector, string, cout, cin. If you don't put in in your code, you would have to do std::vector every time.
Created a file named main.cpp, and another file named dotprod.cpp
Made another file named vector.txt
10/26
created a file named randomnumber.cpp
Copied the code given in the tutorial
I noticed that when you increase the number times you call in the random generator, the bins in the histogram get closer and closer to all looking the same. At 10000, all the bins are the same length
Classes -
10/29
cd to CMSSW_5_3_13_patch1
set up the CMS environment by using cmsenv
Then typed in:
root -l ../../../HONR268N/output_DoubleElectron_MC.root
the ../.../../ depends on how many directories you need to go back to to get back to your Home from your CMSSW_5_3_13_patch1
TBrowser t;
11/1
Created a file in my test subdirectory named rootest.C and copied the code into it.
-> The arrow operator is to indicate to access something beyond a pointer.
I copied the code under the fitting section of HW 7, but when i use .x roottest.C in ROOT, nothing happens.
Found the solution, you can copy the given code directly into ROOT and it executes it for you.
11/10
Tutorial for HW8:
Grab Abraham's code from the discussion to get rid of the links in the code
Make a new file named tree1.C and copy the code into it
root -nw
.x tree1.C
A TBrowser page should pop up, with a the file tree1.root visible under ROOT files.
You can click on the file to look t its contents
Another way to access tree1.root
Go into Linux and type in:
root.exe tree1.root
Then in root type in:
TBrowser new
11/30 HW-9
Downloaded toyMC.C
followed the instructions and created a file output.root
A nice histogram appeared
For the Higgs Analysis:
typed in:
root -l /data/users/jabeen/HONR268N_HiggsAnalysis/Excercise-Electron/output_DoubleElectron_MC.root .ls HZZ4LeptonsAnalysisReduced->MakeClass("ana") .q
Then the terminal told me that "ana.h and ana.C generated from TTree: HZZ4LeptonsAnalysisReduced", so two files, ana.h and ana.C were created
changed the section that begins with ana::ana(TTree *tree) : fChain(0) to the code in the tutorial
Opened up ana.C file
Changed the code to the new code that adds declarations of histograms
Tried to type in the commands
root [0] .L ana.C+ root [1] ana t root [2] t.Loop() root [3] el1_eta->Draw();
But got errors
I used .L ana.C without the + and did not get an error, but then got an error when i did t.Loop()
I found the error, there is a line of code missing when you modify the code
Long64_t ientry = LoadTree(jentry);
For Step 3:
Encountered many errors when trying to run ana.C after the additions to the code
Put this command before if (fChain == 0) return;
TH1F* Z_ee = new TH1F("Z_ee", "Di-electron candidate invariant mass", 200, 0, 200);
After that it works, use Z_ee->Draw(); to create the histogram
I realized you need to do these steps every time you want to run the code
root [0] .L ana.C+
root [1] ana t
root [2] t.Loop()
root [3] Z_ee->Draw();
Step 5:
I changed the code and put in the new code for the files ana.C and ana.h
Then did Z_ee->Draw();
12/4
I wanted to make changes to HW9 since it was confusing the first time around.
For Execise 4 and 5, I did not know how to make the cuts, but I found out that you have to create your own line of code to add the cuts. Alison has the line in her Logbook and it works.
When I tried to make the cuts outside the barrel and draw the histogram for the di-electron invariant mass, I got a graph with 0 entries. I do not know if that is what I am supposed to get.
12/8
Could not figure out the issue with the cut outside the barrel, so I moved on to the next steps.
To obtain the eta cut in the MC file:
emacs -nw ana.h
switch // to uncomment the MC file and put // to comment out the data file
Now I need to make a cut for the pT of the two electrons.
This is the code for the pT cut i made to the two electrons in the MC file
Then I had to switch back to the data file
emacs -nw ana.h
Put // to uncomment the Data file and put // to comment out the MC file
NEW SEMESTER
1/28/16
I started HW 1: Pythia
Logged into hepcms server and in the home directory I copied the code given in the tutorial.
To add a branch to a tree where the mass is recorded, create a mass variable where the variables are initialized:
Float_t m[5000];
Then to make a branch where the mass is recorded, follow the syntax given in the code:
t1->Branch("m", m, "m[nTot]/F");
Also in if(pythia.event... section of the code, include the mass by following the syntax:
m[nTot-1]=pythia.event[i].m();
To alter the number of events from 100 to 10000, look for the for loop and change the code:
change iEvent < 100 to iEvent < 10000
1/29/16
Continuing to work on HW 1:Pythia. The syntax above to store the particle's mass does not work at the moment even though I copied the format of the other variables. Will have to check up in class.
2/22/16
Going to ask questions about TODO: alter pythiaTree.cc so that the particle's mass is stored in the tree.