---+ 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: _TBrowser_ < name > ---++++++ List the directories: <em>.ls<br /></em> <em>< directory name >.cd()</em> ---++++++ Print the tree: <em>< ntuplename >.Print()</em> ---++++++ Scan the tree: <em>< ntuplename >.Scan("< name of a Branch >.< name of a leaf >")</em> ---++++++ Make a new histogram: _TH1F * = new TH1F("name","",#ofXaxis,#ofYaxis,#ofBins);_ ---++++++ Make a new canvas: _TCanvas *c1=new TCanvas ("name","",1);_ ---++++++ Draw a histogram: _name of the tree in the file.Draw("name of a Branch.name of a leaf")_ 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")_ 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")_ draw two histogram in one canvas:<br />< _name of the tree in the file>.Draw("<name of a Branch1>.<name of a leaf1>")_ <name of the tree in the file>.Draw("<name of a Branch2>.<name of a leaf2> _","","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 *=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
This topic: CMS
>
WebHome
>
NewPhysics
>
SusySearch
>
HUSUSYRoot
Topic revision: r2 - 2009-06-29 - AnitaKapusi
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