Logo ROOT  
Reference Guide
histobrowser.C File Reference

Detailed Description

Demonstates how to use EVE as a histogram browser.

TGFileBrowser *g_hlt_browser = 0;
TCanvas *g_hlt_canvas = 0;
void histobrowser(const char* name="HLT Histos")
// --- Create special browser
g_hlt_browser = gEve->GetBrowser()->MakeFileBrowser();
// --- Fill and register some lists/folders/histos
TH1F* h;
TList* l = new TList;
h = new TH1F("Foo", "Bar", 51, 0, 1);
for (Int_t i=0; i<500; ++i)
h->Fill(gRandom->Gaus(.63, .2));
TFolder* f = new TFolder("Booboayes", "Statisticos");
h = new TH1F("Fooes", "Baros", 51, 0, 1);
for (Int_t i=0; i<2000; ++i) {
h->Fill(gRandom->Gaus(.7, .1));
h->Fill(gRandom->Gaus(.3, .1));
h = new TH1F("Fooesoto", "Barosana", 51, 0, 1);
for (Int_t i=0; i<4000; ++i) {
h->Fill(gRandom->Gaus(.25, .02), 0.04);
h->Fill(gRandom->Gaus(.5, .1));
h->Fill(gRandom->Gaus(.75, .02), 0.04);
// --- Add some macros.
m = new TMacro;
m->AddLine("{ g_hlt_canvas->Clear();"
" g_hlt_canvas->cd();"
" g_hlt_canvas->Update(); }");
m->SetName("Clear Canvas");
m = new TMacro;
m->AddLine("{ g_hlt_canvas->Clear();"
" g_hlt_canvas->Divide(2,2);"
" g_hlt_canvas->cd(1);"
" g_hlt_canvas->Update(); }");
m->SetName("Split Canvas");
// --- Create an embedded canvas
g_hlt_canvas = new TCanvas;
gEve->GetBrowser()->StopEmbedding("HLT Canvas");
#define f(i)
Definition: RSha256.hxx:104
#define h(i)
Definition: RSha256.hxx:106
int Int_t
Definition: RtypesCore.h:45
#define gDirectory
Definition: TDirectory.h:290
R__EXTERN TEveManager * gEve
Definition: TEveManager.h:243
char name[80]
Definition: TGX11.cxx:110
R__EXTERN TRandom * gRandom
Definition: TRandom.h:62
The Canvas class.
Definition: TCanvas.h:23
TGFileBrowser * MakeFileBrowser(Bool_t make_default=kFALSE)
Create a file-browser.
TEveBrowser * GetBrowser() const
Definition: TEveManager.h:137
static TEveManager * Create(Bool_t map_window=kTRUE, Option_t *opt="FIV")
If global TEveManager* gEve is not set initialize it.
A TFolder object is a collection of objects and folders.
Definition: TFolder.h:30
virtual void Add(TObject *obj, const char *name=0, Int_t check=-1)
Add items to the browser.
1-D histogram with a float per channel (see TH1 documentation)}
Definition: TH1.h:575
A doubly linked list.
Definition: TList.h:44
Class supporting a collection of lines with C++ code.
Definition: TMacro.h:31
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
Definition: TRandom.cxx:274
void StartEmbedding(Int_t pos=kRight, Int_t subpos=-1) override
Start embedding external frame in the tab "pos" and tab element "subpos".
void StopEmbedding(const char *name=nullptr) override
Definition: TRootBrowser.h:151
auto * m
Definition: textangle.C:8
auto * l
Definition: textangle.C:4
Matevz Tadel

Definition in file histobrowser.C.