00001
00002
00003 #ifndef XAODCORE_TOOLS_PERFSTATS_H
00004 #define XAODCORE_TOOLS_PERFSTATS_H
00005
00006
00007 #include <TVirtualPerfStats.h>
00008
00009
00010 class TTree;
00011
00012 namespace xAOD {
00013
00025 class PerfStats : public ::TVirtualPerfStats {
00026
00027 public:
00029 ~PerfStats();
00030
00032 static PerfStats& instance();
00033
00035 void start( bool clear = true );
00037 void stop();
00038
00041
00043 virtual void SimpleEvent( EEventType type );
00045 virtual void PacketEvent( const char *slave, const char *slavename,
00046 const char *filename,
00047 ::Long64_t eventsprocessed,
00048 ::Double_t latency, ::Double_t proctime,
00049 ::Double_t cputime, ::Long64_t bytesRead );
00051 virtual void FileEvent( const char *slave, const char *slavename,
00052 const char *nodename, const char *filename,
00053 ::Bool_t isStart );
00055 virtual void FileOpenEvent( ::TFile *file, const char *filename,
00056 ::Double_t start );
00058 virtual void FileReadEvent( ::TFile *file, ::Int_t len,
00059 ::Double_t start );
00060
00061 #ifndef __CINT__
00062 #if ROOT_VERSION_CODE < ROOT_VERSION( 5, 34, 19 )
00064 virtual void FileUnzipEvent( ::TFile *file, ::Long64_t pos,
00065 ::Double_t start, ::Int_t complen,
00066 ::Int_t objlen );
00067 #else
00069 virtual void UnzipEvent( ::TObject *tree, ::Long64_t pos,
00070 ::Double_t start, ::Int_t complen,
00071 ::Int_t objlen );
00072 #endif // ROOT_VERSION
00073 #endif // not __CINT__
00074
00076 virtual void RateEvent( ::Double_t proctime, ::Double_t deltatime,
00077 ::Long64_t eventsprocessed,
00078 ::Long64_t bytesRead );
00080 virtual void SetBytesRead( ::Long64_t num );
00082 virtual ::Long64_t GetBytesRead() const;
00084 virtual void SetNumEvents( ::Long64_t num );
00086 virtual ::Long64_t GetNumEvents() const;
00087
00089
00090 protected:
00092 PerfStats();
00093
00094 private:
00096 static PerfStats* m_instance;
00097
00099 ::TVirtualPerfStats* m_otherPerfStats;
00100
00102 bool m_running;
00104 ::Double_t m_startTime;
00105
00107 ::TTree* m_tree;
00109 ::TFile* m_file;
00110
00112 bool m_treeWarningPrinted;
00113
00114 ClassDef( xAOD::PerfStats, 0 )
00115
00116 };
00117
00118 }
00119
00120 #endif // XAODCORE_TOOLS_PERFSTATS_H