00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "TGo4AnalysisStepStatus.h"
00017
00018 #include <iostream.h>
00019
00020 #include "TROOT.h"
00021
00022 #include "Go4Log/TGo4Log.h"
00023
00024 TGo4AnalysisStepStatus::TGo4AnalysisStepStatus(const char* name) :
00025 TGo4Status(name, "Go4 AnalysisStep Status Object"),
00026 fxSourceType(0), fxStoreType(0), fxProcessorType(0),
00027 fbSourceEnabled(0),fbStoreEnabled(0),fbProcessEnabled(0),
00028 fbErrorStopEnabled(0), fbErrorStopped(0), fiProcessStatus(0)
00029 {
00030 TRACE((15,"TGo4AnalysisStepStatus::TGo4AnalysisStepStatus(const char*)",__LINE__, __FILE__));
00031 }
00032
00033 TGo4AnalysisStepStatus::~TGo4AnalysisStepStatus()
00034 {
00035 TRACE((15,"TGo4AnalysisStepStatus::~TGo4AnalysisStepStatus()",__LINE__, __FILE__));
00036 delete fxSourceType;
00037 delete fxStoreType;
00038 delete fxProcessorType;
00039 }
00040
00041 Int_t TGo4AnalysisStepStatus::PrintStatus(Text_t* buffer, Int_t buflen)
00042 {
00043 TRACE((12,"TGo4AnalysisStepStatus::PrintStatus()",__LINE__, __FILE__));
00044
00045
00046 Int_t locallen=64000;
00047 Text_t localbuf[locallen];
00048 if(buflen<0 && buffer!=0)
00049 return 0;
00050 Int_t size=0;
00051
00052 Text_t* current=localbuf;
00053 Int_t restlen=locallen;
00054 current=PrintIndent(current,restlen);
00055 current=PrintBuffer(current,restlen, "++++ Analysis Step %s ++++\t \n",GetName());
00056 TROOT::IncreaseDirLevel();
00057 if(IsProcessEnabled())
00058 {
00059 if(IsSourceEnabled())
00060 {
00061 TGo4EventSourceParameter* spar=GetSourcePar();
00062 if( spar!=0 )
00063 {
00064 Int_t delta=spar->PrintParameter(current,restlen);
00065 restlen-=delta;
00066 current+=delta;
00067 }
00068 else
00069 {
00070 current=PrintIndent(current,restlen);
00071 current=PrintBuffer(current,restlen, "EventSource Type: undefined \n");
00072 }
00073 }
00074 else
00075 {
00076 current=PrintIndent(current,restlen);
00077 current=PrintBuffer(current,restlen, "EventSource is disabled. \n");
00078 }
00079
00080 TGo4EventProcessorParameter* ppar=GetProcessorPar();
00081 if(ppar !=0)
00082 {
00083 Int_t delta=ppar->PrintParameter(current,restlen);
00084 restlen-=delta;
00085 current+=delta;
00086 }
00087 else
00088 {
00089
00090
00091
00092 }
00093
00094
00095 if(IsStoreEnabled())
00096 {
00097 TGo4EventStoreParameter* tpar=GetStorePar();
00098 if(tpar!=0)
00099 {
00100 Int_t delta=tpar->PrintParameter(current,restlen);
00101 restlen-=delta;
00102 current+=delta;
00103 }
00104 else
00105 {
00106 current=PrintIndent(current,restlen);
00107 current=PrintBuffer(current,restlen, "EventStore Type: undefined \n");
00108 }
00109 }
00110 else
00111 {
00112 current=PrintIndent(current,restlen);
00113 current=PrintBuffer(current,restlen, "EventStore is disabled.\n");
00114 }
00115
00116
00117
00118
00119 current=PrintIndent(current,restlen);
00120 current=PrintBuffer(current,restlen, "Process Status: %d\n",GetProcessStatus());
00121 }
00122 else
00123 {
00124 current=PrintIndent(current,restlen);
00125 current=PrintBuffer(current,restlen, "Step is disabled.\n");
00126 }
00127 TROOT::DecreaseDirLevel();
00128 current=PrintIndent(current,restlen);
00129 current=PrintBuffer(current,restlen, "---------------------------------------------- \n");
00130 if(buffer==0)
00131 {
00132 cout << localbuf << endl;
00133 }
00134 else
00135 {
00136 size=locallen-restlen;
00137 if(size>buflen-1)
00138 size=buflen-1;
00139 strncpy(buffer,localbuf,size);
00140 }
00141 return size;
00142 }
00143
00144 void TGo4AnalysisStepStatus::SetSourcePar(TGo4EventSourceParameter* kind)
00145 {
00146 if(fxSourceType) delete fxSourceType;
00147 if(kind)
00148 fxSourceType=dynamic_cast<TGo4EventSourceParameter*>(kind->Clone());
00149 else
00150 fxSourceType=0;
00151 }
00152
00153 void TGo4AnalysisStepStatus::SetStorePar(TGo4EventStoreParameter* kind)
00154 {
00155 if(fxStoreType) delete fxStoreType;
00156 if(kind)
00157 fxStoreType=dynamic_cast<TGo4EventStoreParameter*>(kind->Clone());
00158 else
00159 fxStoreType=0;
00160 }
00161
00162 void TGo4AnalysisStepStatus::SetProcessorPar(TGo4EventProcessorParameter* kind)
00163 {
00164 if(fxProcessorType) delete fxProcessorType;
00165 if(kind)
00166 fxProcessorType=dynamic_cast<TGo4EventProcessorParameter*>(kind->Clone());
00167 else
00168 fxProcessorType=0;
00169 }
00170
00171
00172 ClassImp(TGo4AnalysisStepStatus)
00173
00174
00175
00176