Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "TGo4ComInitAnalysis.h"
00015
00016 #include "TGo4Log.h"
00017 #include "TGo4Thread.h"
00018 #include "TGo4AnalysisImp.h"
00019 #include "TGo4AnalysisClientImp.h"
00020
00021 TGo4ComInitAnalysis::TGo4ComInitAnalysis()
00022 :TGo4AnalysisCommand("ANInit","executes InitEventClasses of Analysis")
00023 {
00024 GO4TRACE((12,"TGo4ComInitAnalysis::TGo4ComInitAnalysis() ctor",__LINE__, __FILE__));
00025 SetReceiverName("AnalysisClient");
00026
00027 SetProtection(kGo4ComModeController);
00028 }
00029
00030 TGo4ComInitAnalysis::~TGo4ComInitAnalysis()
00031 {
00032 GO4TRACE((12,"TGo4ComInitAnalysis::~TGo4ComInitAnalysis() dtor",__LINE__, __FILE__));
00033 }
00034
00035 Int_t TGo4ComInitAnalysis::ExeCom()
00036 {
00037 GO4TRACE((12,"TGo4ComInitAnalysis::ExeCom()",__LINE__, __FILE__));
00038
00039 TGo4AnalysisClient* cli = dynamic_cast<TGo4AnalysisClient*> (fxReceiverBase);
00040 if (cli==0) {
00041 GO4TRACE((11,"TGo4ComInitAnalysis::ExeCom() - no receiver specified ERROR!",__LINE__, __FILE__));
00042 TGo4Log::Debug(" !!! ComInitAnalysis ''%s'': NO RECEIVER ERROR!!!",GetName());
00043 return 1;
00044 }
00045
00046 GO4TRACE((11,"TGo4ComInitAnalysis::ExeCom() - found valid receiver",__LINE__, __FILE__));
00047 TGo4Analysis* ana = TGo4Analysis::Instance();
00048 if(ana) {
00049 cli->SendStatusMessage(2, kTRUE,"INITIALISING submitted settings, PLEASE WAIT...");
00050 TGo4Thread::Sleep(1000);
00051 if(ana->InitEventClasses())
00052 {
00053 cli->SendStatusMessage(1, kTRUE,TString::Format(
00054 "Analysis %s event classes were initialized.", ana->GetName()));
00055 if(cli->MainIsRunning())
00056 ana->PreLoop();
00057 }
00058 else
00059 {
00060 cli->SendStatusMessage(3, kTRUE, TString::Format(
00061 "Analysis %s initialization failed !!! ", ana->GetName()));
00062 }
00063 }
00064 else
00065 {
00066 cli->SendStatusMessage(3, kTRUE, TString::Format(" %s ERROR no analysis", GetName()));
00067 }
00068
00069 return -1;
00070 }