00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "TGo4AnalysisClientStatus.h"
00017
00018 #include <iostream.h>
00019
00020 #include "TDatime.h"
00021
00022 #include "Go4Log/TGo4Log.h"
00023
00024 TGo4AnalysisClientStatus::TGo4AnalysisClientStatus()
00025 {
00026 }
00027
00028 TGo4AnalysisClientStatus::TGo4AnalysisClientStatus(const char* name)
00029 : TGo4ClientStatus(name), fuCurrentCount(0),fdRate(0), fdAveRate(0), fdTime(0)
00030 {
00031 TRACE((12,"TGo4AnalysisClientStatus::TGo4AnalysisClientStatus(Text_t*)",__LINE__, __FILE__));
00032 }
00033
00034 TGo4AnalysisClientStatus::~TGo4AnalysisClientStatus()
00035 {
00036 }
00037
00038 Int_t TGo4AnalysisClientStatus::PrintStatus(Text_t* buffer, Int_t buflen)
00039 {
00040 TRACE((12,"TGo4AnalysisClientStatus::PrintStatus()",__LINE__, __FILE__));
00041
00042 Int_t locallen=4096;
00043 Text_t localbuf[locallen];
00044 if(buflen<=0 && buffer!=0)
00045 return 0;
00046 Text_t* current=localbuf;
00047 Int_t size=0;
00048 Int_t restlen=locallen;
00049 current=PrintBuffer(current,restlen,"G-OOOO-> Analysis Client Status Class %s Printout: <-OOOO-G\n",GetName());
00050 current=PrintBuffer(current,restlen,"G-OOOO-> ---------------------------------------------- <-OOOO-G\n");
00051 current=PrintBuffer(current,restlen,"G-OOOO-> Current event rate: %f\n",GetRate());
00052 current=PrintBuffer(current,restlen,"G-OOOO-> Average event rate: %f\n",GetAvRate());
00053 current=PrintBuffer(current,restlen,"G-OOOO-> Total event counts: %d\n",GetCurrentCount());
00054 current=PrintBuffer(current,restlen,"G-OOOO-> Total time: %f\n",GetTime());
00055 current=PrintBuffer(current,restlen,"G-OOOO-> Creation date: %s\n",GetDateTime());
00056 current=PrintBuffer(current,restlen,"G-OOOO-> ---------------------------------------------- <-OOOO-G\n");
00057 Int_t delta=TGo4ClientStatus::PrintStatus(current,restlen);
00058 restlen-=delta;
00059 current+=delta;
00060 current=PrintBuffer(current,restlen,"G-OOOO-> END Analysis Client Status Class Printout END <-OOOO-G\n");
00061 if(buffer==0)
00062 {
00063 cout << localbuf << endl;
00064 }
00065 else
00066 {
00067 if(size>buflen-1)
00068 size=buflen-1;
00069 strncpy(buffer,localbuf,size);
00070 }
00071 return size;
00072 }
00073
00074 void TGo4AnalysisClientStatus::SetRates(Double_t rate, Double_t average, UInt_t counts, Double_t time)
00075 {
00076 TRACE((12,"TGo4AnalysisClientStatus::SetRates(...)",__LINE__, __FILE__));
00077 fdRate=rate;
00078 fdAveRate=average;
00079 fuCurrentCount=counts;
00080 fdTime=time;
00081 TDatime now;
00082 fxDateString=now.AsSQLString();
00083 }
00084
00085 ClassImp(TGo4AnalysisClientStatus)
00086
00087