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