CLASSROOM OPEN: 7AM-2PM AND 3PM-7PM on weekdays
Day 1:
To transfer files from Linux to computer or vice versa use http://www.mathcs.duq.edu/~jackson/TransferringFiles.html
Day 2:
To create a file, echo "here you write what you want to be written in your file" >> name of file.txt (.txt means it's text, .cpp means it is C++ code) or touch filename filename2 to create empty,extensionless files.
In order to move files to/from emacs to/from my computer,
To find a file, find . (that means look within the directory you are in) -name "file"
To move a file to a new directory, You could move that testfile into /home/jack/Documents with the command:
mv /home/jack/testfile /home/jack/Documents/
When I got lost within directories, I used cd ~ to bring me back to my home directory.
Day 3:
Emacs
To open emacs, emacs -nw (makes it terminal mode) nameoffile.txt *enter*.
To save while you are working, save with Cntrl XS, but to save and exit use Cntrl XC then type y.
To find a word, Cntrl S. Hit it again to move to the next one.
Hit enter at the end of the code.
To copy and paste within Linux, just select the part you want to copy and right click to paste. If you are copying from outside Linux, use CNTRL C and paste by right clicking in Linux.
To bring up previous commands, hold control R and type a letter, it will bring up the last command you typed that began with that letter.
9/17/15
Github
Having trouble [using (git push -u origin master). Error message: The requested URL returned error: 403 Forbidden while accessing https://github.com/anatpbs/rp1.git/info/refs"
Before using github, type git pull to get everyone's updates. Then type ~ git commit -a -m, do your work, and end with git push -u origin master ~
9/19/15
mkdir (name of directory ie gittest), cd gittest, then initialize it with git init, then git clone "paste the url of your repository"
cd (name of file in your directory, you can find this name by writing ls -l in the gittest directory), open whatever file you want in emacs by writing emacs -nw (name of directory)
To commit, git commit -a -m "title of this commit"
It wouldnt let me push - see above and discussion on elms for details.
Does caps matter when writing name of file to open in emacs?
Issue:
error: src refspec /home/sacks does not match any.
error: failed to push some refs to 'git@github.com:anatpbs/rp1.git'
git init
git remote add origin https://github.com/anatpbs/rp1
git status (it should say you are on branch master, and untracked fiels are present)
git commit -m "name of commit"
git add *file name*
git push -u master origin ~
9/20/15
Scripts/Shells
Script: code that does something (anything written in emacs, execute with ./ *insert the rest*)
Having trouble running my search script because I get the message "missing name for redirect".
Resolved by giving myself permission.- This combo worked to run my testscript:
[sacks@hepcms-in2 ~]$ chmod +x testscript.tcsh
[sacks@hepcms-in2 ~]$ tcsh ./testscript.tcsh test
When I tried to use emacs to write a simple script called homesearch (according to Linux Tutorial 2), rather than /home/<anatpbs>/PhysHonr268n/testfile,I got the following:
[sacks@hepcms-in1 ~]$ chmod +x homesearch.tcsh
[sacks@hepcms-in1 ~]$ touch testfile
[sacks@hepcms-in1 ~]$ ./homesearch.tcsh testfile
testfile
[sacks@hepcms-in1 ~]$ cat homesearch_testfile.txt
/home/sacks/testfile
/home/sacks/homesearch_testfile.txt
***If you ls you will see the new homesearch_test.txt which was formed.
Grep
To "make a script that will use the grep command to search in the same area for files containing a string that is passed to it via an argument":
[sacks@hepcms-in1 ~]$ emacs -nw grephw.tcsh
(insert the following script)
#!/bin/tcsh
set ARG=$1
echo $ARG
grep "$1" *
[sacks@hepcms-in1 ~]$ chmod +x grephw.tcsh
[sacks@hepcms-in1 ~]$ ./grephw.tcsh *
errors.txt
grep: gittest: Is a directory
grep: junk: Is a directory
grep: PhysHonr268n: Is a directory
sleep.sub:error = errors.txt
Here's a link to a page with commands for grep: http://www.uccs.edu/~ahitchco/grep/
9/21/15
The cat command allows us to create single or multiple files, view contents of file, and redirect output in terminal or files.
Useful commands with piping:
To count logged in users: who *pipe* wc -l
To execute a shutdown command at a given time: echo "shutdown -h now" *pipe* at 12am tomorrow
-put arguments after the command and before the pipe sign
Condor
[sacks@hepcms-in2 ~]$ emacs -nw practicecondor.exe
[sacks@hepcms-in2 ~]$ emacs -nw practicecondor.sub
[sacks@hepcms-in2 ~]$ chmod u+x practicecondor.exe
[sacks@hepcms-in2 ~]$ condor_submit practicecondor.sub
Submitting job(s)
ERROR: Can't open "/home/sacks/infile-A.txt" with flags 00 (No such file or directory)
PRACTICECONDOR.SUB
# science1.sub -- run one instance of practicecondor.exe
executable = practicecondor.exe
arguments = "infile-A.txt infile-B.txt outfile.txt"
transfer_input_files = infile-A.txt,infile-B.txt
should_transfer_files = IF_NEEDED
when_to_transfer_output = ON_EXIT
log = practicecondor1.log
queue
PRACTICECONDOR.EXE
science.exe infile-A.txt infile-B.txt outfile.txt
10/2/15
Coding: C++
Variable: a portion of memory to store a value in the form of zeros and ones; it's "name" is an identifier and can be made of letters, digits, and underscores (_)
*C++ IS CASE SENSITIVE
String: A type of variable that represent a sequences of characters. They can perform basic operations and are shortcuts (so you don't have to write out many individual codes).
To create a string:
// my first string#include <iostream>#include <string>using namespace std; int main () { string mystring; mystring = "This is a string"; cout << mystring; return 0; }
To write a C++ code, write emacs -nw *name*.cpp
To run a C++ code, exit emacs then write two commands:
g++ main.cpp
./a.out
TO write a loop that subtracts one each time:
for (int n=1st number; n==ending condition; n--)
TO write a loop that adds one each time:
for (int n=1st number; n==ending condition; n++)
when you ue one = sign, it assigns that number to the variable
when you use two = signs (==), it means compare your variable (does it equal the ending condition). If it doesnt, equal the ending condition, it will add/subtract one from n and try again.
return 0 is slang for 'end program', tells int main () the program is over
bool= a very useful type is a logical variable, that stores true (1) and false (0).
if (evaluate the statement in parenthesis)
Since there is no less than or equal to key, you write <= (same with greater than or equal to)
% gives you the reminder after you divide (i.e. 11 divided by 3 gives you remainder 1)
using namespace std; tells the computer what all the terms mean
The difference between for and while loops:
while loop: write it as: while (expression) statement
"The while-loop simply repeats statement while expression is true. If, after any execution of statement, expression is no longer true, the loop ends, and the program continues right after the loop."
for loops: write it as: do statement while (condition);
while loops: runs continuosly for all the variables that fulfill your requirement (ie x<5)
"It behaves like a while-loop, except that condition is evaluated after the execution of statement instead of before, guaranteeing at least one execution of statement, even if condition is never fulfilled."
10/7/15
You can display the current date and time in the given FORMAT using date command. If you just type date command it will display in standard FORMAT:
$ date
http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html
super useful website: http://www.cplusplus.com/doc/tutorial/control/
Pointer: "type of variable which stores a memory address. When we declare a pointer, we will set it equal to the address of some other variable. We must also specify the type of the variable that is stored in that address. If we want to declare a pointer to i, we code:
The * operator tells the program to open the memory location ‘pointed at’ by p and retrieve the data inside.
The & operators check the address where our integer is located
int* p = &i;
cout << “The value of p is “ << p;
cout << “We say that p ‘points at’ the memory location referenced by address “ << &i;
my hw6.cpp worked but when i run scalarmult it says:
[sacks@hepcms-in1 testRoot]$ g++ scalarmult.cpp
/usr/lib/../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
[sacks@hepcms-in1 testRoot]$ emacs -nw scalarmult.cpp
emacs: /cvmfs/cms.cern.ch/slc6_amd64_gcc472/cms/cmssw/CMSSW_5_3_30/external/slc6_amd64_gcc472/lib/libz.so.1: no version information available (required by /lib64/libgio-2.0.so.0)
TO select a block of text in emacs, write /* before the start of your selection and */
10/21/15
Root
Enter root:
cd to CMSSW_5_3_30 (the last number may change)
cmsenv
To open a file: cd to necessary directory
root -nw *insert file name (which ends in .C)
or
../../HONR268N (then hit enter to see fiels you can open)
root -l ../../HONR268N/*name of file continued*
(the next line in LInux will start as root [1]) TBrowser t;
Exit root:
.quit
When you remove the & sign from the argument for the the function mranflat, the histogram shows all the results under the "0" category. With the & sign, the results are distributed between different categories.
include "*insert name*" means it is a program as opposed to include <*insert name*> which means a library
To graph a function:
root [11] TF1 *f1 = new TF1("f1","sin(x)/x",0.,10.); //those last two numbers give teh range
root [12] f1->Draw();
To
quit root, simply type .q
obtain a list of commands, use .?
access the shell of the operating system, type .!<OS_command>; try, e.g. .!ls or .!pwd
execute a macro, enter .x <file_name>; in the above example, you might have used .x slits.C at the ROOT prompt
load a macro, type .L <file_name>; in the above example, you might instead have used the command .L slits.Cfollowed by the function call slits();. Note that after loading a macro all functions and procedures defined therein are available at the ROOT prompt.
compile a macro, type .L <file_name>+; ROOT is able to manage for you the C++ compiler behind the scenes and to produce machine code starting from your macro. One could decide to compile a macro in order to obtain better performance or to get nearer to the production environment.
https://root.cern.ch/download/doc/primer/ROOTPrimer.html
11/9/15
The fill area color is a color index (integer) pointing in the ROOT color table. The fill area color of any class inheriting from TAttFill can be changed using the method SetFillColor and retrieved using the method GetFillColor. The following table shows the first 50 default colors.
https://root.cern.ch/doc/master/classTAttFill.html
When doing Step 2: Analysis of ntuples: access and display electron candidates kinematics in data
10/3/15
HW #9 Tips:
If you get error message: "no such file or directory" for el1_eta->Draw();
use this series of commands to see graphs within root:
root [0] .L ana.C+
root [1] ana t
root [2] t.Loop()
1234567890
root [3] TBrowser f
then find Dielectron_Data_cut3.root and select the histogram you want to see
10/6/15
! means does not equal
10/11/15
-do step five but use your own directory address (find with pwd), run code and save pic then continue following instructions (create new file comparing both distributions)
-exercise 4: comment back in limits and change to >= 1.44, take pictures of this for both mc.root and cut3.root files
-exercise 5: look at f_njets_pass in the tree at the end of the histograms listed in the root file then apply a cut looking at the values in this variable (>0.5 means jets were found and <0.5 means jets were not found), use similar formula to cuts on leptons earlier in the homework
Pythia
1/28/16-2/1-16
Changes I made for the purpose of:
TODO: alter pythiaTree.cc so that the particle's mass is stored in the tree.
TODO: alter it so that it does 10000 events instead of 100
(italicized parts are the actual code)
I added the line Float_t mass[5000]; under using namespace Pythia8;
I added the line t1->Branch("mass",mass,"mass[nTot]/F"); under TTree* t1= new TTree("t1","a tree");
I added the line mass[nTot-1]=pythia.event[i].m(); under if(pythia.event[i].isFinal()) {
Changed the 100 value in for (int iEvent = 0; iEvent < 100; ++iEvent) { to 10,000
To
I deleted
pythia.readString("HardQCD:all = on");
pythia.readString("PhaseSpace:pTHatMin = 20.");
pythia.readString("Beams:eCM = 14000.");
pythia.init();
In the pythia8 documentation I see what each of these cards do on this page: http://home.thep.lu.se/~torbjorn/pythia82html/Welcome.html
I had trouble figuring out how to get pythiaTree to run in root. I tried a series of commands in root (.x pythiaTree.cc , .L pythiaTree etc).
You need to git clone the honrpythia directory into the CMS environment (cd CMSW_5_3... and cmsenv then follow instructions from HW #1).
*****See the link below for a paper summary on PYTHIA.****
References
https://en.wikipedia.org/wiki/PYTHIA
---------------------------------
Do the following to amke the invariant mass histogram:
Enter root. Then do the following commands.
TFile *f = new TFile(“output.root”);
f->ls();
t1->MakeClass(“MyClass”);
now exit root. You should see two new files in your area, MyClass.h and MyClass.C.
Let’s now add a histogram to this code, and fill it. We create the histogram in the “MyClass” creator, and fill it in the Loop method.
In MyClass.C, after the line “if(fChain ==0) return; add
TH1F* histo1 = new TH1F("histo1","e1",100,0.,200.);
Then, after the line ending with “nbytes += nb; add
histo1->Fill(e1[ientry]);
then, just before the last } add
histo1->Draw();
Now that we have the code, let’s tell root to use this code to analyze output.root.
(this is much better in pythia 6. See https://root.cern.ch/meet-ttree
also, MakeClass is a bit obsolete. see root tutorials tree1.C, etc for more modern way)
now go into root and do
.L MyClass.C (this line pulls the code into memory)
MyClass m (this calls the creator for the class root wrote)
m.Loop() (this will pull the events one by one into memory, call the loop method for each event)
IceCube
We will be working on Professor Kara Hoffman and Dr. Erik Blaufuss.
"An epic scientific exploration is now underway, using the largest, most complicated research facility ever devised. Its goal is as ambitious as it is urgent: to fill troubling gaps in our understanding of the fundamental nature of physical reality. It seeks to identify the full range of particles, fields and forces that act on all scales from the submicroscopic to the cosmic, and that shape the familiar luminous matter of galaxies, the enigmatic, invisible "dark matter" that surrounds them, and a previously undetected, parallel world of "supersymmetric" objects.
The explorers are an elite worldwide collaboration that includes five physicists from the University of Maryland. Their laboratory is a 27-kilometer undergroundring on the Swiss-French border, called the Large Hadron Collider (LHC), where super-accelerated clusters of protons slam into each other at 99.99% the speed of light. Their tools are ultra-sensitive detectors, some as large as five-story office buildings, that record the results of those collisions—including the creation of heretofore unseen particles predicted by theory.
The energy produced in LHC collisions is unprecedented and almost unimaginably intense. It is equivalent to conditions at
10-15 second (a millionth of a billionth of a second) after the Big Bang that occurred about 14 billion years ago, and will reveal the kind of primordial miasma that eventually cooled and expanded into the universe we see today. "
http://www.icecube.umd.edu/~goodman/IceCube.htm
"Our group is active in many areas of the experiment, including:
Online event filtering and reconstruction
Simulations
Analysis tools and software
The IceTray Framework
Dataclasses
2/12/16
Here is the powerpoint summarizing out first meeting: https://docs.google.com/presentation/d/1BNdv18JYL32mmo3c1-n-RUyFOkummR4ag0BUmGt-Ab4/pub?start=false&loop=true&delayms=10000
Here are the relevant papers
IceCube Point source results: http://arxiv.org/abs/1406.6757
A good methods paper, that describes how things work. http://arxiv.org/abs/0912.1572
The Icecube wiki is here:
https://wiki.icecube.wisc.edu/index.php/Main_Page
Notes from meetings with Erik: see attached document and powerpoint
3/3/15
To work on mapping point sources, I began to learn Python. I used codecademy.com to practice the basics of the language.
*whitespace matters
Formatting:
To add a comment:
# (for single line comments) and "" ___ "" (for multiline comments)
To print whatever (a message, an output):
print ("_____")
To create a variable:
variable name = expression
def say_hello(name):
return "Hello, " + name
foo = say_hello("Alice") (Now the value of 'foo' is "Hello, Alice")
To put X to the power of Y
x**y
To create a string
str(object_name)
"this is a valid string" , 'this is also a valid string' , 'this is' + ' ' + 'also' + ' ' + 'a string'
you can use dot notation for strings (i.e. "string".upper() )
To format strings with %
The %operator will replace a %s in the string with the string variable that comes after it.
"My name is %s and age is %s." % (string_1, string_2)
To give the remainder of an integer division:
%
Operators
< (less than) , > (greater than), <= (less than or equal to), >= (greater than or equal to), == (equals), != or <> (does not equal)
Boolean operators (order of operations: 1st not, 2nd and, 3rd or):
and returns True when the statements on both sides are True
or returns True when at least one statement (on either side of or) is True
not returns True for False statements and False for True statements
To count the # of items (i.e. letters in a word, nubmers in an array):
Len(object_name)
To get rid of all the capitalization in your strings
lower(object_name)
To capitalize everything in your strings
upper(object_name)
3/7/16
Downloaded Virtual Box and Lubuntu
make sure not to use too much RAM
it's ok to "erase disk" because it is just the virtual machine's memory
Everytime you open virtual box:
python
ipython -pylab
Exit by writing "exit"
To configure: start -> open .iso (lubuntu)
download packages: ipython, matlib, and pylab
apt-get install ipython
python -matplot lib ?
azimuthal and zenith dont change (where that is is changing in right ascention
When trying out the graph on Alison's page: see attached pictures called error, error2, error3
-------------------------
Use the command -i plot to pull in packages automatically (l.e. pylab)
For ps- test code and graph:
The poles aren't well represented because the hits aren't well represented by the number of bins. It isn't area per bin conserving becuase the declination
- healpy optimized for sky plots (use meshgrids etc), use equal area bins
- use appget install python-dev
-Use sudo pip instal healpy then import healpy as hp
The figures reminded me of Van Gogh's night sky landscapes.
-------------------------------
i3 fiels = icecube data files
To make our dataset:
ice tray = frames (gets geometry of frame (location of dom), pulses (time of hits for each dom, charge = approximately number of photoelectrons released by photomultipliers (triggered by light)
- all the doms mapped with string number and dom #
structure = returns plain data, like dictionary, simplified class (for example: location of dom = (x = ____, y = _____, z = ____)
3/24/16
Work on:
including more bins
including neighboring bins
*Week 7: Erik was gone so continued past work, looked up contemporary developments at icecube
4/7/15
Look at the IceCube Research page on Paul's logbook (it is where we kept out research group work)
SEE PAUL'S WORKBOOK (ICE CUBE SUB-PAGE) FOR OUR GROUP'S WORK
4/14/15
Is my hottest spot I find in the sky map interesting?
Just plotting the hottest spot for each scramble then comparing with the one hottest spot from our scramble. It's not the true p-value because given the number of places in the sky we've looked
How often do we see a p-value like that or higher in scambled data? Thats your level of agreement with the background. Until it's 5 sigma plus we discount it.
It looks like our expectations are far too high for outliers. To figure this out:
-sum expectations over the sky and should get about number of events in the map
Next: try picking points and putting in by hand the number of events, and see how many events you have to put in before you get a significant result
-make a 3 sigma discovery in 50% of your scramblings
-try at a dozen different points (at dif declinations cuz have dif declinations) -> that tells you how many events using your Monte Carlo
make histograms for every bin - expected # and count
4/21/16
(out of town for Passover - didn't meet)
4/28/16
How much would would we need to see to say our data is significant? By putting x neutrons in y declinations, we find the p-value for that pixel and compare it to how many neutrons need to be there to be statistically significant. By analyzing how many more neutrons we would need for the results to be significant it sets an upper limit on ___
The most significant bin in the actual data given to us is 10 to the 5th, which is the peak of the histogram.
Find a point where 3 sigma of trials where an observance is 3 sigma significane (different from background).
Inject events in a single healpix seven times ( for 7 dif declinations) until your injection is the point with the highest significance and goes over the 3 sigma cut of your values; scramble events 30 times for each declination cuz 12-15 events will be routinely have a point above the background
If anything our info is biased towards the background.