Read data from an ascii file and create a root file with an histogram and an ntuple.
See a variant of this macro in basic2.C.
dir.ReplaceAll(
"/./",
"/");
ifstream in;
in.open(
Form(
"%sbasic.dat",
dir.Data()));
TH1F h1(
"h1",
"x distribution",100,-4,4);
while (1) {
if (!in.good()) break;
}
in.close();
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
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)
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
A simple TTree restricted to a list of float variables only.
- Author
- Rene Brun
Definition in file basic.C.