40 const Int_t N = 10000;
45 void billw(
const char *billname,
Int_t compress) {
48 TFile f(billname,
"recreate",
"bill benchmark with keys",compress);
49 TH1F h(
"h",
"h",1000,-3,3);
54 sprintf(name,
"h%d",i);
60 printf(
"billw%d : RT=%7.3f s, Cpu=%7.3f s, File size= %9d bytes, CX= %g\n",compress,timer.
RealTime(),timer.
CpuTime(),
64 void billr(
const char *billname,
Int_t compress) {
73 TH1F *hmean =
new TH1F(
"hmean",
"hist mean from keys",100,0,1);
77 hmean->
Fill(h->GetMean());
85 void billtw(
const char *billtname,
Int_t compress) {
88 TFile f(billtname,
"recreate",
"bill benchmark with trees",compress);
89 TH1F *h =
new TH1F(
"h",
"h",1000,-3,3);
92 T->
Branch(
"event",
"TH1F",&h,64000,0);
95 sprintf(name,
"h%d",i);
103 printf(
"billtw%d : RT=%7.3f s, Cpu=%7.3f s, File size= %9d bytes, CX= %g\n",compress,timer.
RealTime(),timer.
CpuTime(),
107 void billtr(
const char *billtname,
Int_t compress) {
114 TH1F *hmeant =
new TH1F(
"hmeant",
"hist mean from tree",100,0,1);
127 TString bill = dir +
"/bill.root";
128 TString billt = dir +
"/billt.root";
132 for (
Int_t compress=0;compress<2;compress++) {
133 billw(bill,compress);
134 billr(bill,compress);
135 billtw(billt,compress);
136 billtr(billt,compress);
143 printf(
"billtot : RT=%7.3f s, Cpu=%7.3f s\n",rtime,ctime);
145 Float_t rootmarks = 600*(16.98 + 14.40)/(rtime + ctime);
146 printf(
"******************************************************************\n");
147 printf(
"* ROOTMARKS =%6.1f * Root%-8s %d/%d\n",rootmarks,
gROOT->GetVersion(),
gROOT->GetVersionDate(),
gROOT->GetVersionTime());
148 printf(
"******************************************************************\n");
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
Double_t RealTime()
Stop the stopwatch (if it is running) and return the realtime (in seconds) passed between the start a...
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
virtual Double_t Rndm(Int_t i=0)
Machine independent random number generator.
virtual Int_t Fill()
Fill all branches.
virtual TList * GetListOfKeys() const
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
virtual Long64_t GetBytesWritten() const
Return the total number of bytes written so far to the file.
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
1-D histogram with a float per channel (see TH1 documentation)}
Double_t CpuTime()
Stop the stopwatch (if it is running) and return the cputime (in seconds) passed between the start an...
virtual const char * DirName(const char *pathname)
Return the directory name in pathname.
static void AddDirectory(Bool_t add=kTRUE)
Sets the flag controlling the automatic add of histograms in memory.
virtual const char * UnixPathName(const char *unixpathname)
Convert from a Unix pathname to a local pathname.
virtual int Unlink(const char *name)
Unlink, i.e. remove, a file.
void Stop()
Stop the stopwatch.
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr=0)
Change branch address, dealing with clone trees properly.
Book space in a file, create I/O buffers, to fill them, (un)compress them.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
virtual Double_t GetMean(Int_t axis=1) const
For axis = 1,2 or 3 returns the mean value of the histogram along X,Y or Z axis.
virtual void FillRandom(const char *fname, Int_t ntimes=5000)
Fill histogram following distribution in function fname.
R__EXTERN TSystem * gSystem
R__EXTERN TRandom * gRandom
virtual void SetName(const char *name)
Change the name of this histogram.
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
Float_t GetCompressionFactor()
Return the file compression factor.
virtual Int_t Branch(TCollection *list, Int_t bufsize=32000, Int_t splitlevel=99, const char *name="")
Create one branch for each element in the collection.
virtual TObject * ReadObj()
To read a TObject* from the file.
virtual Long64_t GetEntries() const
A TTree object has a header with a name and a title.