spider.C

Go to the documentation of this file.
00001 #include "TFile.h"
00002 #include "TCanvas.h"
00003 #include "TNtuple.h"
00004 #include "TSpider.h"
00005    
00006 // script illustrating the use of the TSpider class
00007 //Author: Bastien Dallapiazza
00008 void spider() {
00009    TCanvas *c1 = new TCanvas("c1","TSpider example",200,10,700,700);
00010    TFile *f = new TFile("$ROOTSYS/tutorials/hsimple.root");
00011    if (!f || f->IsZombie()) {
00012       printf("Please run <ROOT location>/tutorials/hsimple.C before.");
00013       return;
00014    }
00015    TNtuple* ntuple = (TNtuple*)f->Get("ntuple");
00016    TString varexp = "px:py:pz:random:sin(px):log(px/py):log(pz)";
00017    TString select = "px>0 && py>0 && pz>0";
00018    TString options = "average";
00019    TSpider *spider = new TSpider(ntuple,varexp.Data(),select.Data(),options.Data());
00020    spider->Draw();
00021    c1->ToggleEditor();
00022    c1->Selected(c1,spider,1);
00023 }

Generated on Tue Jul 5 15:45:11 2011 for ROOT_528-00b_version by  doxygen 1.5.1