TTreeReader simplest example.
Read data from hsimple.root (written by hsimple.C)
void hsimpleReader() {
auto myHist =
new TH1F(
"h1",
"ntuple",100,-4,4);
if (!myFile || myFile->IsZombie()) {
return;
}
while (myReader.Next()) {
myHist->Fill(*myPx + *myPy);
}
myHist->Draw();
}
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
1-D histogram with a float per channel (see TH1 documentation)}
A simple, robust and fast interface to read values from ROOT columnar datasets such as TTree,...
- Author
- Anders Eie, 2013
Definition in file hsimpleReader.C.