TWiki
>
CMS Web
>
NewPhysics
>
SusySearch
>
HUSUSYRoot
(revision 3) (raw view)
Edit
Attach
---+ How to use Root: <br /> <a href="http://root.cern.ch/">%RED%http://root.cern.ch/%ENDCOLOR%</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> ---+++ Run it: _root -l_ ---++++++ Open a file: _TFile *_file0 = TFile::Open("..... .root")_ ---++++++ File browser: <em>TBrowser < name ></em> ---++++++ List the directories: _.ls<br />< directory name >.cd()_ ---++++++ Print the tree: < ntuplename >.Print() ---++++++ Scan the tree: <em>< ntuplename >.Scan("< name of a Branch >.< name of a leaf >")</em> ---++++++ Make a new histogram: _TH1F *< name_of_the_histogram > = new TH1F("< name >","",< #ofXaxis >,< #ofYaxis >,< #ofBins >);_ ---++++++ Make a new canvas: _TCanvas *< c1 >=new TCanvas ("< name >","",1);_ ---++++++ Draw a histogram: <em>< name of the tree in the file >.Draw("< name of a Branch >.< name of a leaf >")</em> 2D histogram:<br /> <em>< name of the tree in the file >.</em> _Draw("< name of a Branch1 >.< name of a leaf1 >:< name of a Branch2 >.< name of a leaf2 >")_ histogram with cut criteria:<br /><em>< 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>") </em> draw two histogram in one canvas:<br /><em>< name of the tree in the file >.Draw("< name of a Branch1 >.< name of a leaf1 >") </em> <em> < name of the tree in the file >.Draw("< name of a Branch2 >.< name of a leaf2 > </em> _","","SAME")_ <br /> e.g.:<br /> _tree.Draw("pelectron_1.tight:_ _pelectron_1.loose_ _","pelectron_1.tight>-1")_ ---++++++ Open an AOD file in root: ---++++++ _gSystem->Load("libFWCoreFWLite");<br />AutoLibraryLoader::enable();<br /> TFile *_file0 = TFile::Open("rfio:/castor/cern.ch/user/........ .root") <br /> TBrowser b_ ---++++++ TChain: Chain.C:<br /> _#include_ _void Chain(){<br /> TChain tree("stopAnaMod/tree");<br /> tree.AddFile("stopAnaNtuple_noselection_Chowder_00.root");<br /> tree.Draw("event");<br /> }_ ---++++++ Save a histogram to .eps: _TCanvas *c1=new TCanvas ("<name>","",1);_ < name of the tree in the file >.Draw("< name of a Branch >.< name of a leaf >") _c1->SaveAs("< name >.eps");_ ---++++++ Usage of MakeClass: -- 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: r3 - 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