Go to the source code of this file.
Functions | |
void | generateUsefulROOTFile () |
void generateUsefulROOTFile | ( | ) |
Definition at line 2 of file generateUsefulROOTFile.C.
00002 { 00003 const Int_t version = gROOT->GetVersionInt(); 00004 00005 TString fn = TString::Format("ROOT-version-%d.root", version); 00006 00007 TFile *f = new TFile(fn, "recreate"); 00008 00009 // generate Tree 00010 TTree *ttree = new TTree("ttree", "ttree"); 00011 ttree->Write(); 00012 // generate TH1 00013 // TH1C : histograms with one byte per channel. Maximum bin content = 127 00014 TH1C *th1C = new TH1C("th1C", "th1C", 100, 0, 100); 00015 th1C->Write(); 00016 // TH1S : histograms with one short per channel. Maximum bin content = 32767 00017 TH1S *th1S = new TH1S("th1S", "th1S", 100, 0, 100); 00018 th1S->Write(); 00019 // TH1I : histograms with one int per channel. Maximum bin content = 2147483647 00020 TH1I *th1I = new TH1I("th1I", "th1I", 100, 0, 100); 00021 th1I->Write(); 00022 // TH1F : histograms with one float per channel. Maximum precision 7 digits 00023 TH1F *th1F = new TH1F("th1F", "th1F", 100, 0, 100); 00024 th1F->Write(); 00025 // TH1D : histograms with one double per channel. Maximum precision 14 digits 00026 TH1D *th1D = new TH1D("th1D", "th1D", 100, 0, 100); 00027 th1D->Write(); 00028 00029 00030 00031 00032 f->Close(); 00033 }