Create can ntuple reading data from an ascii file.
This macro is a variant of tree101_basic.C
void tree102_basic()
{
auto h1 =
new TH1F(
"h1",
"x distribution", 100, -4, 4);
auto T =
new TTree(
"ntuple",
"data from ascii file");
printf(" found %lld points\n", nlines);
T->Draw("x", "z>2");
T->Write();
}
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)
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
TString & Append(const char *cs)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
A TTree represents a columnar dataset.
- Author
- Rene Brun
Definition in file tree102_basic.C.