Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4CommandsAnalysis/TGo4ComSetPrintEvent.cxx

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 #include "TGo4ComSetPrintEvent.h"
00017 
00018 #include "Go4Log/TGo4Log.h"
00019 #include "Go4AnalysisClient/TGo4AnalysisClientImp.h"
00020 #include "Go4Analysis/TGo4AnalysisImp.h"
00021 #include "Go4EventServer/TGo4MbsEvent.h"
00022 
00023 TGo4ComSetPrintEvent::TGo4ComSetPrintEvent(const char* obname)
00024 :TGo4AnalysisObjectCommand("ANSetPrintEvent","Set event printout for analysis",obname)
00025 {
00026    SetReceiverName("AnalysisClient");  // this command needs client as receiver
00027                                                  // override default receiver
00028 }
00029 TGo4ComSetPrintEvent::TGo4ComSetPrintEvent()
00030 :TGo4AnalysisObjectCommand("ANSetPrintEvent","Set event printout for analysis","dummy")
00031  {
00032    SetReceiverName("AnalysisClient");  // this command needs client as receiver
00033                                                  // override default receiver
00034 }
00035 
00036 TGo4ComSetPrintEvent::~TGo4ComSetPrintEvent()
00037 {
00038 }
00039 
00040 
00041 Int_t TGo4ComSetPrintEvent::ExeCom()
00042 {
00043    TGo4Log::Debug(" Executing %s : Printou for %s requested for %d events of subid %d, long:%d, hex:%d, data:%d",
00044          GetObjectName(),
00045          fxPrintPar.fiNum,
00046             fxPrintPar.fiSid,
00047             fxPrintPar.fiLong,
00048             fxPrintPar.fiHex,
00049             fxPrintPar.fiData);
00050    TGo4AnalysisClient* cli=dynamic_cast<TGo4AnalysisClient*> (fxReceiverBase);
00051    if (cli!=0)
00052       {
00053          TGo4Analysis* ana=TGo4Analysis::Instance();
00054          if(ana==0)
00055              {
00056                     // never come here
00057                     cli->SendStatusMessage(3, kTRUE," %s ERROR no analysis ",GetName());
00058                     return -2;
00059              } else {}
00060          // request for event by name from folder
00061          TGo4EventElement* eve=ana->GetEventStructure(GetObjectName());
00062          if(eve)
00063             {
00064 
00065             if(eve->InheritsFrom("TGo4MbsEvent"))
00066                {
00067                    TGo4MbsEvent* mbseve=dynamic_cast<TGo4MbsEvent*>(eve);
00068                    mbseve->SetPrintEvent(fxPrintPar.fiNum,
00069                                           fxPrintPar.fiSid,
00070                                           fxPrintPar.fiLong,
00071                                           fxPrintPar.fiHex,
00072                                           fxPrintPar.fiData);
00073                }
00074             else
00075                {
00076                   // later we might put printout functionality in baseclass, for now:
00077                   cli->SendStatusMessage(2, kTRUE," Event %s of class %s is not yet supported for printevent mode!",GetObjectName(), eve->IsA()->GetName());
00078                }
00079             }
00080          else
00081             {
00082                cli->SendStatusMessage(2, kTRUE," Event %s was not found to set printout mode!",GetObjectName());
00083             }
00084       }
00085    else
00086        {
00087       TRACE((11,"TGo4ComSetPrintEvent::ExeCom() - no receiver specified ERROR!",__LINE__, __FILE__));
00088          TGo4Log::Debug(" !!! %s : NO or WRONG RECEIVER ERROR!!!",GetName());
00089          return 1;
00090       }
00091    return -1;
00092 }
00093 
00094 ClassImp(TGo4ComSetPrintEvent)
00095 
00096 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:55:51 2005 for Go4-v2.10-5 by doxygen1.2.15