9/19/2015
Tutorial 2:
Had issues executing testscript.tcsh.
Added / infront of #!bin/tcsh
Used the command chmod +x testscript.tcsh to make testscript.tcsh an executable.
10/1/2015
Had issues pushing my updates to github. Github said that it couldn't push some references in order to prevent me from losing history.
To force update your git directory use the command.
git push origin +master
The + sign is the sign that forces the push to github.
10/4/2015
Completed the C++ tutorial. There were some errors in the example code such as missing quote marks or semicolons.
10/15/2015
Just some notes about the rand() function in c++.
rand() uses a set algorithm to generate a random number.
In this way rand() isn't really random.
rand() produces the same number unless given a different seed.
To change rand() seed you need to use the srand() method.
You can use srand(time(null)) to generate a seed based on the time.
If you change the seed for rand() each time you call that method you should get a more random number.
___________________________________________________________________________________________________________________________________________________________________________________
PYTHIA 8.2
2/2/2016
If anyone has a lot of files from last semester clogging up their CMS directory here is a link to WinSCP.
https://winscp.net/eng/download.php
Just download, run it and then sign in to hepcms.umd.edu and you can now view all the files and directories that you have. You can easily click and drag all your files into their desired directories.
2/3/2016
I worked on the code to add a branch for mass onto the tree in pythiaTree.cc
I added the code that was shown in Jacob's logbook but I would still get errors when I ran it.
When I typed the command make pythiaTree I would get numerous errors.
One of them explained that I had an out of date version of Pythia.
If you ever get this error just type this command in the terminal
source PYTHIA_setup.csh
I'm pretty sure this command force updates Pythia by reinstalling it. Regardless, it fixed my problem with conflicting versions of Pythia.
Another useful thing that I found was an easy tutorial on how to make a simple tree in root.
This is the link: ftp://root.cern.ch/root/doc/ROOTUsersGuideHTML/ch12s14.html
What I learned from this tutorial is that a tree object has a .Branch() method. The syntax for it is this:
TBranch* TTree::Branch(const char* name,void* address, const char* leaflist, Int_t bufsize = 32000)
This method creates a branch with a list of variables.
An example of how to make a branch with one variable is this:
t1.Branch("px",&px,"px/F");
t1 is the tree you want to add a branch to.
"px" is the name of the branch.
&px is the name of where you will take the input from.
"px/F" shows us that there is only 1 variable of type Float.
In order to show a mass branch on your tree you must first create an array of floats
Float_t mass[5000];
Then in the code where it says book tree you must add the line
t1->Branch("Mass",mass,"mass[nTot]/F");
where "Mass" is the name off the branch, mass is the name of the array of floats, and "mass[nTot]/F" specifies the list of variables to be inputted.
Then in the loop that starts with if(pythia.event[i].isFinal()) insert this line of code:
mass[nTot-1]=pythia.event[i].m();
This line will fill the array of floats you created with the mass values for the particles.
2/6/2016
I noticed an issue in the code. The code currently puts the x momentum in the x momemntum, y momentum, z momentum trees
To change this just put
t1->Branch("Apx",Apx,"Apx[nTot]/F");
t1->Branch("Apy",Apy,"Apy[nTot]/F");
t1->Branch("Apz",Apz,"Apz[nTot]/F");
instead of
t1->Branch("Apx",Apx,"Apx[nTot]/F");
t1->Branch("Apy",Apx,"Apy[nTot]/F");
t1->Branch("Apz",Apx,"Apz[nTot]/F");
It's not important to the assignment but it's wrong so I fixed it.
I attactched a graph of what your mass histogram should look like with 10000 events simulated.
2/9/2016
I looked up what the cards in the code to make Z0 bosons do
pythia.readString("NewGaugeBoson:ffbar2gmZZprime = on"); Turns f fbar -> Z'^0 scattering on
pythia.readString("32:m0 = 1500."); Sets the Z'0 center of mass distribution to 1500 GeV
pythia.readString("32:mMin = 900."); Sets the minimum mass of the Z'0 to 900 GeV
pythia.readString("32:mMax = 3000."); Sets the maximum mass of the Z'0 to 3000 GeV
pythia.readString("PhaseSpace:mHatMin = 20. "); Sets the invariant mass of the Z'0 to a minimum of 20 GeV
pythia.readString("Zprime:gmZmode = 3"); Sets the Z'0 processes to those without gamma
pythia.readString("Beams:eCM = 14000."); Sets the beams center of mass energy to be 14000 GeV
pythia.readString("32:onMode = off"); Turns the scattering off
pythia.readString("32:onIfAny = 11"); Turns the scattering on only for electrons
2/10/2016
How to get Pt:
I found some documentation on how to graph Pt
double pT = 0.;
for (int i = pythia.event.size(); i > 0; --i)
if( pythia.event[i].idAbs() == 24 ) {
pT = pythia.event[i].pT(); break;
}
I added a loop to that takes the two highest pt of each electron.
if(pythia.event[i].id() ==11 || pythia.event[i].id() == -11){
//if it is an electron compare and store the pT and invariant mass
//highest pT found so far, shift 1 to 2 and replace 1
if(particlePT > pT1){
pT2 = pT1;
mass2 = mass1;
pT1 = particlePT;
mass1 = pythia.event[i].m();
}
//higher than pT2 but lower than pt1
else if(particlePT > pT2){
pT2 = particlePT;
mass2 = pythia.event[i].m();
}
}
} //end if
This stores the two highest pt electrons in a single Z'0 event
You of course have to initialize two variables to hold the pt:
Just insert this line where you initialize the variables.
double pT1=0, pT2=0;
add this line to create a Histogram for the mass of the Z'0 we will call this the Signal Mass
TH1F *massSignal = new TH1F("massSignal", "Invariant mass of two highest pT electrons for signal events", 100, 0, 2000);
add this line at the end of the first event loop to fill the Signal Mass histogram
massSignal->Fill(pT2 + pT1);
This histogram should look like this
In the section of the code where you initialize the pythia objects add this line
Pythia pythia2;
This will allow us to use pythia to simulate only Drell Yan events while also separately simulating the Z'0 events
pythia2.readString("WeakSingleBoson:ffbar2gmZ = on");
pythia2.readString("PhaseSpace:mHatMin = 20. ");
pythia2.readString("Beams:eCM = 14000.");
pythia2.readString("23:onMode = off");
pythia2.readString("23:onIfAny = 11");
pythia2.init();
This code will set up Pythia for Drell Yan events
Initialize the histogram for Drell Yan Mass with this line
TH1F *massDY = new TH1F("massBackground", "Invariant mass of two highest pT electrons for background events", 100, 0 ,2000);
To begin filling the Drell Yan Mass histogram you should copy the same loop that fills the Z'0 mass histogram except you should replace pythia with pythia2
Except you add the Drell Yan events to the histogram use this line
massDY->Fill(pT1 + pT2, scale);
Where scale a float with value sigmaDY/sigmaZ'0 (cross sections of events)
This is going to be useful to normalize the histograms.
There shoudl be about 38000 DY events for each Z'0 event
The Drell Yan mass Histogram should look like this
The histograms were colored by adding the lines
massSignal->SetFillColor(16);
massDY->SetFillColor(42);
If you want to see the two histograms overlayed add the lines of code at the end of the program where all the histograms are written
massSignal->Write();
massDY->Write();
massSignal->Draw();
massDY->Draw("same");
c1->Write();
This overlayed plot should look like this
This is what the Drell Yan events look like compared to the z'0 events.
As you can see, if you were to cut at about 200 GeV you can eliminate most of the background.
SOURCES
http://home.thep.lu.se/~torbjorn/pdfdoc/pythia8200.pdf
http://home.thep.lu.se/~prestel/worksheet-merging.pdf
http://home.thep.lu.se/~torbjorn/pythia82html/Welcome.html
2/15/2016
GEANT
Used command
git clone https://github.com/saraheno/honrgeant.git
This clones the directory into your linux directory
I then proceeded with the tutorial and when I got to the command
source G4_setup.sh
I received the error
/home/eno/CMSSW_7_4_0: No such file or directory.
This means that sarah does not have this file in her directory, which means that the shell won't finish executing.
I emacs into G4_setup.sh and found the lines
cd /home/eno/CMSSW_7_4_0
cmsenv
I commented out the cd command and proceeded with the instructions in the tutorial.
This was a horrible idea that caused a decent amount of errors that I have no idea what to do with.
Will look into what the shell script is doing and change it so it works. In the mean time im deleting the cloned directory because the make files that I ran screwed it up.
Note: using the command rm -r honrgeant/ cause you to delete write protected files and made an infinite loop of y's being typed on my console. However, all of the directory was succesfully deleted.