11void hist001_TH1_fillrandom()
15 double rangeMin = 0.0;
16 double rangeMax = 10.0;
17 TH1D h1d(
"h1d",
"Test random numbers", nBins, rangeMin, rangeMax);
21 h1d.FillRandom(
"gaus", 10000);
24 auto myfile = std::unique_ptr<TFile>(
TFile::Open(
"fillrandom.root",
"RECREATE"));
25 myfile->WriteObject(&h1d, h1d.GetName());
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 double per channel (see TH1 documentation)