00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "TGo4ComSetSource.h"
00017
00018 #include "Go4Log/TGo4Log.h"
00019 #include "Go4AnalysisClient/TGo4AnalysisClientImp.h"
00020 #include "Go4Analysis/TGo4AnalysisImp.h"
00021
00022 TGo4ComSetSource::TGo4ComSetSource(const char* stepname, TGo4EventSourceParameter* newsource)
00023 :TGo4AnalysisStepCommand("ANSetSource","Set eventsource of analysis step",stepname)
00024 {
00025 TRACE((12,"TGo4ComSetSource::TGo4ComSetSource(const Text_t*) ctor",__LINE__, __FILE__));
00026 SetReceiverName("AnalysisClient");
00027
00028
00029 fxSourcePar=newsource;
00030
00031
00032 }
00033 TGo4ComSetSource::TGo4ComSetSource()
00034 :TGo4AnalysisStepCommand("ANSetSource","Set eventsource of analysis step",0)
00035 {
00036 TRACE((12,"TGo4ComSetSource::TGo4ComSetSource() ctor",__LINE__, __FILE__));
00037 SetReceiverName("AnalysisClient");
00038
00039
00040
00041 fxSourcePar=0;
00042 }
00043
00044 TGo4ComSetSource::~TGo4ComSetSource()
00045 {
00046 TRACE((12,"TGo4ComSetSource::~TGo4ComSetSource() dtor",__LINE__, __FILE__));
00047 }
00048
00049 Int_t TGo4ComSetSource::ExeCom()
00050 {
00051 TRACE((12,"TGo4ComSetSource::ExeCom()",__LINE__, __FILE__));
00052
00053 if (fxReceiverBase!=0)
00054 {
00055 TRACE((11,"TGo4ComSetSource::ExeCom() - found valid receiver",__LINE__, __FILE__));
00056 TGo4Log::Debug(" Executing %s : Step %s resets event source ",
00057 GetName(), GetStepName());
00058 TGo4Analysis* anna=0;
00059 TGo4AnalysisClient* cli=dynamic_cast<TGo4AnalysisClient*> (fxReceiverBase);
00060 if(cli)
00061 {
00062 anna=TGo4Analysis::Instance();
00063 const char* stepname = GetStepName();
00064 if(!strcmp(stepname,TGo4AnalysisStepCommand::fgcDEFAULTSTEP))
00065 stepname=0;
00066
00067
00068 const char* parname = "default";
00069 TGo4EventSourceParameter* par=GetSourcePar();
00070 if(par) parname = par->GetName();
00071
00072 if(anna && anna->NewStepSource(stepname , par ))
00073 {
00074
00075 cli->SendStatusMessage(1,kTRUE,"New source %s was set to step %s.",
00076 parname, GetStepName());
00077 }
00078 else
00079 {
00080
00081 cli->SendStatusMessage(3,kTRUE,"%s - ERROR at setting source %s to step %s !!!",
00082 GetName(),parname, GetStepName());
00083 }
00084
00085
00086
00087 }
00088
00089 else
00090 {
00091 TGo4Log::Debug(" !!! %s : WRONG RECEIVER ERROR, never come here!!!",GetName());
00092 }
00093 }
00094
00095 else
00096
00097 {
00098 TRACE((11,"TGo4ComSetSource::ExeCom() - no receiver specified ERROR!",__LINE__, __FILE__));
00099 TGo4Log::Debug(" !!! %s : NO RECEIVER ERROR!!!",GetName());
00100 return 1;
00101 }
00102
00103 return -1;
00104 }
00105
00106
00107 ClassImp(TGo4ComSetSource)
00108
00109
00110
00111