ROOT logo
#include "TFile.h"
#include "TCanvas.h"
#include "TNtuple.h"
#include "TSpider.h"
   
// script illustrating the use of the TSpider class
//Author: Bastien Dallapiazza
void spider() {
   TCanvas *c1 = new TCanvas("c1","TSpider example",200,10,700,700);
   TFile *f = new TFile("$ROOTSYS/tutorials/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 select = "px>0 && py>0 && pz>0";
   TString options = "average";
   TSpider *spider = new TSpider(ntuple,varexp.Data(),select.Data(),options.Data());
   spider->Draw();
   c1->ToggleEditor();
   c1->Selected(c1,spider,1);
}
 spider.C:1
 spider.C:2
 spider.C:3
 spider.C:4
 spider.C:5
 spider.C:6
 spider.C:7
 spider.C:8
 spider.C:9
 spider.C:10
 spider.C:11
 spider.C:12
 spider.C:13
 spider.C:14
 spider.C:15
 spider.C:16
 spider.C:17
 spider.C:18
 spider.C:19
 spider.C:20
 spider.C:21
 spider.C:22
 spider.C:23
 spider.C:24
thumb