Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
histobrowser.C File Reference

Detailed Description

Demonstrates how to use EVE as a histogram browser.

void histobrowser(const char *name = "HLT Histos")
{
// --- Create special browser
// --- Fill and register some lists/folders/histos
TH1F *h;
TList *l = new TList;
l->SetName("Cilka");
h = new TH1F("Foo", "Bar", 51, 0, 1);
for (Int_t i = 0; i < 500; ++i)
h->Fill(gRandom->Gaus(.63, .2));
l->Add(h);
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));
}
f->Add(h);
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
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
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define gDirectory
Definition TDirectory.h:384
R__EXTERN TEveManager * gEve
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
static TEveManager * Create(Bool_t map_window=kTRUE, Option_t *opt="FIV")
If global TEveManager* gEve is not set initialize it.
<div class="legacybox"><h2>Legacy Code</h2> TFolder is a legacy interface: there will be no bug fixes...
Definition TFolder.h:30
System file browser, used as TRootBrowser plug-in.
1-D histogram with a float per channel (see TH1 documentation)
Definition TH1.h:645
A doubly linked list.
Definition TList.h:38
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:275
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
TMarker m
Definition textangle.C:8
TLine l
Definition textangle.C:4
Author
Matevz Tadel

Definition in file histobrowser.C.