Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "TGo4ComClearObject.h"
00015
00016 #include "TGo4Log.h"
00017 #include "TGo4AnalysisImp.h"
00018 #include "TGo4AnalysisClientImp.h"
00019
00020 TGo4ComClearObject::TGo4ComClearObject()
00021 :TGo4AnalysisObjectCommand("ANClearObject",
00022 "clears object by name",
00023 "his")
00024 {
00025 GO4TRACE((12,"TGo4ComClearObject::TGo4ComClearObject() ctor",__LINE__, __FILE__));
00026 SetReceiverName("AnalysisClient");
00027
00028 SetProtection(kGo4ComModeController);
00029 }
00030
00031 TGo4ComClearObject::TGo4ComClearObject(const char* name)
00032 :TGo4AnalysisObjectCommand("ANClearObject",
00033 "clears object by name",
00034 name)
00035 {
00036 GO4TRACE((12,"TGo4ComClearObject::TGo4ComClearObject(const char*) ctor",__LINE__, __FILE__));
00037 SetReceiverName("AnalysisClient");
00038
00039 SetProtection(kGo4ComModeController);
00040 }
00041
00042
00043 TGo4ComClearObject::~TGo4ComClearObject()
00044 {
00045 GO4TRACE((12,"TGo4ComClearObject::~TGo4ComClearObject() dtor",__LINE__, __FILE__));
00046 }
00047
00048
00049
00050 Int_t TGo4ComClearObject::ExeCom()
00051 {
00052 GO4TRACE((12,"TGo4ComClearObject::ExeCom()",__LINE__, __FILE__));
00053
00054 TGo4AnalysisClient* cli = dynamic_cast<TGo4AnalysisClient*> (fxReceiverBase);
00055 if (cli==0) {
00056 GO4TRACE((11,"TGo4ComClearObject::ExeCom() - no receiver specified ERROR!",__LINE__, __FILE__));
00057 TGo4Log::Debug(" !!! %s: NO RECEIVER ERROR!!!",GetName());
00058 return 1;
00059 }
00060
00061 TGo4Analysis* ana = TGo4Analysis::Instance();
00062 if(ana==0) {
00063 cli->SendStatusMessage(3, kTRUE,TString::Format(" %s ERROR no analysis ", GetName()));
00064 return -1;
00065 }
00066
00067 const char* obname = GetObjectName();
00068 Bool_t ok = ana->ClearObjects(obname);
00069 if(ok) {
00070 cli->SendStatusMessage(1,kTRUE,TString::Format("Object %s was cleared.", obname));
00071 } else {
00072 cli->SendStatusMessage(2,kTRUE,TString::Format("Could not clear object %s", obname));
00073 }
00074
00075 return -1;
00076 }