Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "TGo4ComGetObjectStatus.h"
00015
00016 #include "TGo4Log.h"
00017 #include "TGo4ObjectStatus.h"
00018 #include "TGo4AnalysisClientImp.h"
00019 #include "TGo4AnalysisImp.h"
00020
00021 TGo4ComGetObjectStatus::TGo4ComGetObjectStatus(const char* obname)
00022 :TGo4AnalysisObjectCommand("ANObjectStatus","Get an object status from analysis",obname)
00023 {
00024 GO4TRACE((12,"TGo4ComGetObjectStatus::TGo4ComGetObjectStatus(const char*) ctor",__LINE__, __FILE__));
00025 SetReceiverName("AnalysisClient");
00026
00027 }
00028
00029 TGo4ComGetObjectStatus::~TGo4ComGetObjectStatus()
00030 {
00031 GO4TRACE((12,"TGo4ComGetObjectStatus::~TGo4ComGetObjectStatus() dtor",__LINE__, __FILE__));
00032 }
00033
00034 TGo4ComGetObjectStatus::TGo4ComGetObjectStatus()
00035 :TGo4AnalysisObjectCommand("ANObjectStatus","Get an object status from analysis","his")
00036
00037 {
00038 GO4TRACE((12,"TGo4ComGetObjectStatus::TGo4ComGetObjectStatus() ctor",__LINE__, __FILE__));
00039 SetReceiverName("AnalysisClient");
00040
00041 }
00042
00043 Int_t TGo4ComGetObjectStatus::ExeCom()
00044 {
00045 GO4TRACE((12,"TGo4ComGetObjectStatus::ExeCom()",__LINE__, __FILE__));
00046
00047 TGo4AnalysisClient* cli = dynamic_cast<TGo4AnalysisClient*> (fxReceiverBase);
00048 if (cli==0) {
00049 GO4TRACE((11,"TGo4ComGetObjectStatus::ExeCom() - no receiver specified ERROR!",__LINE__, __FILE__));
00050 TGo4Log::Debug(" !!! %s : NO RECEIVER ERROR!!!",GetName());
00051 return 1;
00052 }
00053
00054 GO4TRACE((11,"TGo4ComGetObjectStatus::ExeCom() - found valid receiver",__LINE__, __FILE__));
00055 TGo4Log::Debug(" Executing %s : Object %s Status requested ", GetName(), GetObjectName());
00056 TGo4Analysis* ana = TGo4Analysis::Instance();
00057 TGo4ObjectStatus* state = ana ? ana->CreateObjectStatus(GetObjectName(), GetFolderName()) : 0;
00058 if(state) {
00059 TString name = state->GetName();
00060 name.Append("_status");
00061 state->SetName(name.Data());
00062 cli->SendObject(state, GetTaskName());
00063 delete state;
00064 } else {
00065 cli->SendStatusMessage(3, kTRUE,TString::Format(
00066 "GetObjectStatus - ERROR: no such object %s in folder %s",
00067 GetObjectName(), GetFolderName()));
00068 }
00069
00070 return -1;
00071 }