Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
read_from_file.C
Go to the documentation of this file.
2
3 // Let's open the TFile
4 TFile in_file("my_rootfile.root");
5
6 // Get the Histogram out
7 TH1F* h;
8 in_file.GetObject("my_histogram",h);
9
10 // Draw it
11 auto myCanvas = new TCanvas();
12 h->DrawClone();
13}
#define h(i)
Definition RSha256.hxx:106
The Canvas class.
Definition TCanvas.h:23
void GetObject(const char *namecycle, T *&ptr)
Get an object with proper type checking.
Definition TDirectory.h:213
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
Definition TFile.h:130
1-D histogram with a float per channel (see TH1 documentation)
Definition TH1.h:878
void read_from_file()