TWiki
>
CMS Web
>
NewPhysics
>
SusySearch
>
HUSUSYRoot
(revision 1) (raw view)
Edit
Attach
<html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> <title>Root</title> </head> <body> <big><big>How to use Root: </big></big> <br> <br> <a href="http://root.cern.ch/">http://root.cern.ch/</a><br> <br> "How to" page:<br> <a href="http://root.cern.ch/drupal/content/howtos">http://root.cern.ch/drupal/content/howtos</a><br> User's guide:<br> <a href="http://root.cern.ch/drupal/content/users-guide">http://root.cern.ch/drupal/content/users-guide</a><br> Reference guide:<br> <a href="http://root.cern.ch/drupal/content/reference-guide">http://root.cern.ch/drupal/content/reference-guide</a><br> <br> <big>Run it:</big><br> root -l<br> <br> <big>Open a file:</big><br> TFile *_file0 = TFile::Open("..... .root")<br> <br> File browser:<br> TBrowser <name><br> <br> <big>List the directories:</big><br> .ls<br> <directory name>.cd()<br> <br> <big>Print the tree:</big><br> ntuple.Print()<br> <br> <big>Scan the tree:</big><br> ntuple.Scan("name of a Branch.name of a leaf")<br> <br> <big>Make a new histogram:</big><br> TH1F *name_of_the_histogram = new TH1F("name","title",<#ofXaxis>,<#ofYaxis>,<#ofBins>);<br> <br> <big>Make a new canvas:</big><br> TCanvas *c1=new TCanvas ("name","title",1);<br> <br> Draw a histogram:<br> name of the tree in the file.Draw("name of a Branch.name of a leaf")<br> 2D histogram:<br> name of the tree in the file.Draw("name of a Branch1.name of a leaf1:name of a Branch2.name of a leaf2")<br> histogram with cut criteria:<br> <name of the tree in the file>.Draw("<name of a Branch1>.<name of a leaf1,name of a Branch2>.<name of a leaf2><cut criteria></small></big></small></big></small></small></big></big><big><big><small><small><big><small><big><small>")</small></big></small></big></small></small></big></big><br> <big><big><small><small><big><small>draw two histogram in one canvas:<br> </small></big></small></small></big></big><big><big><small><small><big><small><big><small><name of the tree in the file>.</small></big></small></big></small></small></big></big><big><big><small><small><big><small>Draw("</small></big></small></small></big></big><big><big><small><small><big><small><big><small><name of a Branch1>.<name of a leaf1></small></big></small></big></small></small></big></big><big><big><small><small><big><small>")</small></big></small></small></big></big><br> <big><big><small><small><big><small><big><small><name of the tree in the file>.</small></big></small></big></small></small></big></big><big><big><small><small><big><small>Draw("</small></big></small></small></big></big><big><big><small><small><big><small><big><small><name of a Branch2>.<name of a leaf2></small></big></small></big></small></small></big></big><big><big><small><small><big><small>","","SAME") <br> e.g.:<br> tree.Draw("pelectron_1.tight:</small></big></small></small></big></big><big><big><small><small><big><small>pelectron_1.loose</small></big></small></small></big></big><big><big><small><small><big><small>","pelectron_1.tight>-1") <br> <br> <big>Open an AOD file in root:</big><br> gSystem->Load("libFWCoreFWLite");<br> AutoLibraryLoader::enable();<br> TFile *_file0 = TFile::Open("rfio:/castor/cern.ch/user/........ .root") <br> TBrowser b<br> <br> <big>TChain:<br> <small>Chain.C:</small><br> <small>#include <TChain.h><br> void Chain(){<br> TChain tree("stopAnaMod/tree");<br> tree.AddFile("stopAnaNtuple_noselection_Chowder_00.root");<br> tree.Draw("event");<br> }<br> <br> <big>Save a histogram to .eps:<br> </big></small></big></small></big></small></small></big></big><big><big><small><small><big><small>TCanvas *c1=new TCanvas ("name","title",1);<br> </small></big></small></small></big></big><big><big><small><small><big><small><big><small><name of the tree in the file>.Draw("<name of a Branch>.<name of a leaf>");</small></big></small></big></small></small></big></big><big><big><small><small><big><small></small></big></small></small></big></big><br> <big><big><small><small><big><small><big><small>c1->SaveAs("name.eps");<br> <br> <big>Usage of MakeClass:</big><br> </small></big></small></big></small></small></big></big> </body> </html> -- Main.AnitaKapusi - 29 Jun 2009
Edit
|
Attach
|
Watch
|
P
rint version
|
H
istory
:
r4
<
r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r1 - 2009-06-29
-
AnitaKapusi
CMS
Hungarian Academy of Sciences (MTA)
Wigner RCP
Department of High Energy Physics
CMS (CERN)
Copyright &© by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback