Logo ROOT  
Reference Guide
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
spider.C File Reference

Detailed Description

View in nbviewer Open in SWAN TSpider example.

#include "TFile.h"
#include "TCanvas.h"
#include "TNtuple.h"
#include "TSpider.h"
void spider() {
TCanvas *c1 = new TCanvas("c1","TSpider example",200,10,700,700);
TFile *f = new TFile("hsimple.root");
if (!f || f->IsZombie()) {
printf("Please run <ROOT location>/tutorials/hsimple.C before.");
return;
}
TNtuple* ntuple = (TNtuple*)f->Get("ntuple");
TString varexp = "px:py:pz:random:sin(px):log(px/py):log(pz)";
TString selection = "px>0 && py>0 && pz>0";
TString options = "average";
TSpider *spider = new TSpider(ntuple,varexp.Data(),selection.Data(),options.Data());
spider->Draw();
c1->ToggleEditor();
c1->Selected(c1,spider,1);
}
#define f(i)
Definition: RSha256.hxx:104
The Canvas class.
Definition: TCanvas.h:27
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
Definition: TFile.h:53
A simple TTree restricted to a list of float variables only.
Definition: TNtuple.h:28
Spider class.
Definition: TSpider.h:40
virtual void Draw(Option_t *options="")
Draw the spider.
Definition: TSpider.cxx:453
Basic string class.
Definition: TString.h:131
const char * Data() const
Definition: TString.h:364
return c1
Definition: legend1.C:41
Author
Bastien Dallapiazza

Definition in file spider.C.