GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4ComSetPrintEvent.cxx
Go to the documentation of this file.
1 // $Id: TGo4ComSetPrintEvent.cxx 1001 2013-07-25 15:10:31Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #include "TGo4ComSetPrintEvent.h"
15 
16 #include "TGo4Log.h"
17 #include "TGo4AnalysisClientImp.h"
18 #include "TGo4AnalysisImp.h"
19 #include "TGo4EventElement.h"
20 #include "TGo4MbsSource.h"
21 #include "TGo4RemoteCommand.h"
22 
24 :TGo4AnalysisObjectCommand("ANSetPrintEvent","Set event printout for analysis",obname)
25 {
26  SetReceiverName("AnalysisClient"); // this command needs client as receiver
27  // override default receiver
28 }
30 :TGo4AnalysisObjectCommand("ANSetPrintEvent","Set event printout for analysis","dummy")
31  {
32  SetReceiverName("AnalysisClient"); // this command needs client as receiver
33  // override default receiver
34 }
35 
37 {
38 }
39 
41 {
42  if(remcom==0) return;
44  fxPrintPar.fiNum = remcom->GetValue(0);
45  fxPrintPar.fiSid = remcom->GetValue(1);
46  fxPrintPar.fiLong = remcom->GetValue(2);
47  fxPrintPar.fiHex = remcom->GetValue(3);
48  fxPrintPar.fiData = remcom->GetValue(4);
49 }
50 
52 {
53  TGo4Log::Debug(" Executing %s : Printout for %s requested for %d events of subid %d, long:%d, hex:%d, data:%d",
56 
57  if (cli==0) {
58  GO4TRACE((11,"TGo4ComSetPrintEvent::ExeCom() - no receiver specified ERROR!",__LINE__, __FILE__));
59  TGo4Log::Debug(" !!! %s : NO or WRONG RECEIVER ERROR!!!",GetName());
60  return 1;
61  }
62 
64  if(ana==0) {
65  // never come here
66  cli->SendStatusMessage(3, kTRUE,TString::Format(" %s ERROR no analysis ",GetName()));
67  return -2;
68  }
69 
70  // request for event by name from folder
72  if (eve == 0) {
73  cli->SendStatusMessage(2, kTRUE,TString::Format(" Event %s was not found to set printout mode!",GetObjectName()));
74  return -1;
75  }
76 
77  TGo4MbsSource* mbs_src = dynamic_cast<TGo4MbsSource*> (eve->GetEventSource());
78 
79  if (mbs_src==0) {
80  cli->SendStatusMessage(2, kTRUE,TString::Format(" Source of event %s of class %s is not yet supported for printevent mode!", GetObjectName(), eve->ClassName()));
81  return -1;
82  }
83 
89  return -1;
90 }
void SetReceiverName(const char *)
Definition: TGo4Command.cxx:92
virtual void SendStatusMessage(Int_t level, Bool_t printout, const TString &text)
TGo4CommandReceiver * fxReceiverBase
Definition: TGo4Command.h:117
TGo4EventSource * GetEventSource() const
Int_t GetValue(Int_t i) const
virtual void Set(TGo4RemoteCommand *remcon)
TGo4EventElement * GetEventStructure(const char *name)
const char * GetObjectName() const
virtual void Set(TGo4RemoteCommand *remcon)
TGo4MbsSourcePrintPar fxPrintPar
#define GO4TRACE(X)
Definition: TGo4Log.h:26
void SetPrintEvent(Int_t num=1, Int_t sid=-1, Int_t longw=1, Int_t hexw=1, Int_t dataw=0)
static TGo4Analysis * Instance()
static void Debug(const char *text,...)
Definition: TGo4Log.cxx:270