ROOT
6.07/01
Reference Guide
ROOT Home Page
Main Page
Tutorials
User's Classes
Namespaces
All Classes
Files
Release Notes
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
tutorials
tree
spider.C
Go to the documentation of this file.
1
/// \file
2
/// \ingroup tutorial_tree
3
/// TSpider example
4
/// \macro_code
5
///
6
/// \author Bastien Dallapiazza
7
#include "
TFile.h
"
8
#include "
TCanvas.h
"
9
#include "
TNtuple.h
"
10
#include "
TSpider.h
"
11
12
void
spider() {
13
TCanvas
*c1 =
new
TCanvas
(
"c1"
,
"TSpider example"
,200,10,700,700);
14
TFile
*f =
new
TFile
(
"hsimple.root"
);
15
if
(!f || f->
IsZombie
()) {
16
printf
(
"Please run <ROOT location>/tutorials/hsimple.C before."
);
17
return
;
18
}
19
TNtuple
* ntuple = (
TNtuple
*)f->
Get
(
"ntuple"
);
20
TString
varexp =
"px:py:pz:random:sin(px):log(px/py):log(pz)"
;
21
TString
select =
"px>0 && py>0 && pz>0"
;
22
TString
options =
"average"
;
23
TSpider
*spider =
new
TSpider
(ntuple,varexp.
Data
(),select.
Data
(),options.
Data
());
24
spider->
Draw
();
25
c1->
ToggleEditor
();
26
c1->
Selected
(c1,spider,1);
27
}
TCanvas::Selected
virtual void Selected(TVirtualPad *pad, TObject *obj, Int_t event)
Emit Selected() signal.
Definition:
TCanvas.cxx:1503
TNtuple.h
TFile
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
Definition:
TFile.h:45
TDirectoryFile::Get
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
Definition:
TDirectoryFile.cxx:876
TFile.h
TObject::IsZombie
Bool_t IsZombie() const
Definition:
TObject.h:141
TString
Basic string class.
Definition:
TString.h:137
TString::Data
const char * Data() const
Definition:
TString.h:349
TCanvas.h
TNtuple
A simple TTree restricted to a list of float variables only.
Definition:
TNtuple.h:30
TSpider.h
TCanvas::ToggleEditor
virtual void ToggleEditor()
Toggle editor.
Definition:
TCanvas.cxx:2146
TCanvas
The Canvas class.
Definition:
TCanvas.h:48
printf
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
TSpider::Draw
virtual void Draw(Option_t *options="")
Draw the spider.
Definition:
TSpider.cxx:453
TSpider
Spider class.
Definition:
TSpider.h:52