TTreePerfStats.h

Go to the documentation of this file.
00001 // @(#)root/treeplayer:$Id: TTreePerfStats.h 31417 2009-11-25 14:07:51Z brun $
00002 // Author: Rene Brun 29/10/09
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2009, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TTreePerfStats
00013 #define ROOT_TTreePerfStats
00014 
00015 //////////////////////////////////////////////////////////////////////////
00016 //                                                                      //
00017 // TTreePerfStats                                                       //
00018 //                                                                      //
00019 // TTree I/O performance measurement                                    //
00020 //                                                                      //
00021 //////////////////////////////////////////////////////////////////////////
00022 
00023 
00024 #ifndef ROOT_TVirtualPerfStats
00025 #include "TVirtualPerfStats.h"
00026 #endif
00027 #ifndef ROOT_TString
00028 #include "TString.h"
00029 #endif
00030 
00031 
00032 class TBrowser;
00033 class TFile;
00034 class TTree;
00035 class TStopwatch;
00036 class TPaveText;
00037 class TGraphErrors;
00038 class TGaxis;
00039 class TText;
00040 class TTreePerfStats : public TVirtualPerfStats {
00041 
00042 protected:
00043    Int_t         fTreeCacheSize; //TTreeCache buffer size
00044    Int_t         fNleaves;       //Number of leaves in the tree
00045    Int_t         fReadCalls;     //Number of read calls
00046    Int_t         fReadaheadSize; //Readahead cache size
00047    Long64_t      fBytesRead;     //Number of bytes read
00048    Long64_t      fBytesReadExtra;//Number of bytes (overhead) of the readahead cache
00049    Double_t      fRealNorm;      //Real time scale factor for fGraphTime
00050    Double_t      fRealTime;      //Real time
00051    Double_t      fCpuTime;       //Cpu time
00052    Double_t      fDiskTime;      //Time spent in pure raw disk IO
00053    Double_t      fCompress;      //Tree compression factor      
00054    TString       fName;          //name of this TTreePerfStats
00055    TString       fHostInfo;      //name of the host system, ROOT version and date
00056    TFile        *fFile;          //!pointer to the file containing the Tree
00057    TTree        *fTree;          //!pointer to the Tree being monitored
00058    TGraphErrors *fGraphIO ;      //pointer to the graph with IO data
00059    TGraphErrors *fGraphTime ;    //pointer to the graph with timestamp info
00060    TPaveText    *fPave;          //pointer to annotation pavetext
00061    TStopwatch   *fWatch;         //TStopwatch pointer
00062    TGaxis       *fRealTimeAxis;  //pointer to TGaxis object showing real-time
00063    TText        *fHostInfoText;  //Graphics Text object with the fHostInfo data
00064       
00065 public:
00066    TTreePerfStats();
00067    TTreePerfStats(const char *name, TTree *T);
00068    virtual ~TTreePerfStats();
00069    virtual void     Browse(TBrowser *b);
00070    virtual Int_t    DistancetoPrimitive(Int_t px, Int_t py);
00071    virtual void     Draw(Option_t *option="");
00072    virtual void     ExecuteEvent(Int_t event, Int_t px, Int_t py);
00073    virtual void     Finish();
00074    virtual Long64_t GetBytesRead() const {return fBytesRead;}
00075    virtual Long64_t GetBytesReadExtra() const {return fBytesReadExtra;}
00076    virtual Double_t GetCpuTime()   const {return fCpuTime;}
00077    virtual Double_t GetDiskTime()  const {return fDiskTime;}
00078    TGraphErrors    *GetGraphIO()     {return fGraphIO;}
00079    TGraphErrors    *GetGraphTime()   {return fGraphTime;}
00080    const char      *GetHostInfo() const{return fHostInfo.Data();}
00081    const char      *GetName()    const{return fName.Data();}
00082    virtual Int_t    GetNleaves() const {return fNleaves;}
00083    virtual Long64_t GetNumEvents() const {return 0;}
00084    TPaveText       *GetPave()      {return fPave;}
00085    virtual Int_t    GetReadaheadSize() const {return fReadaheadSize;}
00086    virtual Int_t    GetReadCalls() const {return fReadCalls;}
00087    virtual Double_t GetRealTime()  const {return fRealTime;}
00088    TStopwatch      *GetStopwatch() const {return fWatch;}
00089    virtual Int_t    GetTreeCacheSize() const {return fTreeCacheSize;}
00090    virtual void     Paint(Option_t *chopt="");
00091    virtual void     Print(Option_t *option="") const;
00092 
00093    virtual void     SimpleEvent(EEventType) {}
00094    virtual void     PacketEvent(const char *, const char *, const char *,
00095                             Long64_t , Double_t ,Double_t , Double_t ,Long64_t ) {}
00096    virtual void     FileEvent(const char *, const char *, const char *, const char *, Bool_t) {}
00097    virtual void     FileOpenEvent(TFile *, const char *, Double_t) {}
00098    virtual void     FileReadEvent(TFile *file, Int_t len, Double_t start);
00099    virtual void     RateEvent(Double_t , Double_t , Long64_t , Long64_t) {}
00100 
00101    virtual void     SaveAs(const char *filename="",Option_t *option="") const;
00102    virtual void     SavePrimitive(ostream &out, Option_t *option = "");
00103    virtual void     SetBytesRead(Long64_t nbytes) {fBytesRead = nbytes;}
00104    virtual void     SetBytesReadExtra(Long64_t nbytes) {fBytesReadExtra = nbytes;}
00105    virtual void     SetCompress(Double_t cx) {fCompress = cx;}
00106    virtual void     SetDiskTime(Double_t t) {fDiskTime = t;}
00107    virtual void     SetNumEvents(Long64_t) {}
00108    virtual void     SetCpuTime(Double_t cptime) {fCpuTime = cptime;}
00109    virtual void     SetGraphIO(TGraphErrors *gr) {fGraphIO = gr;}
00110    virtual void     SetGraphTime(TGraphErrors *gr) {fGraphTime = gr;}
00111    virtual void     SetHostInfo(const char *info) {fHostInfo = info;}
00112    virtual void     SetName(const char *name) {fName = name;}
00113    virtual void     SetNleaves(Int_t nleaves) {fNleaves = nleaves;}
00114    virtual void     SetReadaheadSize(Int_t nbytes) {fReadaheadSize = nbytes;}
00115    virtual void     SetReadCalls(Int_t ncalls) {fReadCalls = ncalls;}
00116    virtual void     SetRealNorm(Double_t rnorm) {fRealNorm = rnorm;}
00117    virtual void     SetRealTime(Double_t rtime) {fRealTime = rtime;}
00118    virtual void     SetTreeCacheSize(Int_t nbytes) {fTreeCacheSize = nbytes;}
00119 
00120    ClassDef(TTreePerfStats,1)  // TTree I/O performance measurement
00121 };
00122 
00123 #endif

Generated on Tue Jul 5 14:28:17 2011 for ROOT_528-00b_version by  doxygen 1.5.1