GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TGo4ComSetPrintEvent.cxx
Go to the documentation of this file.
1 // $Id$
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 fuer 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  if(!remcom) return;
40  fxPrintPar.fiNum = remcom->GetValue(0);
41  fxPrintPar.fiSid = remcom->GetValue(1);
42  fxPrintPar.fiLong = remcom->GetValue(2);
43  fxPrintPar.fiHex = remcom->GetValue(3);
44  fxPrintPar.fiData = remcom->GetValue(4);
45 }
46 
48 {
49  TGo4Log::Debug(" Executing %s : Printout for requested for %d events of subid %d, long:%d, hex:%d, data:%d",
52 
53  if (!cli) {
54  GO4TRACE((11,"TGo4ComSetPrintEvent::ExeCom() - no receiver specified ERROR!",__LINE__, __FILE__));
55  TGo4Log::Debug(" !!! %s : NO or WRONG RECEIVER ERROR!!!",GetName());
56  return 1;
57  }
58 
60  if(!ana) {
61  // never come here
62  cli->SendStatusMessage(3, kTRUE,TString::Format(" %s ERROR no analysis ",GetName()));
63  return -2;
64  }
65 
66  // request for event by name from folder
68  if (!eve) {
69  cli->SendStatusMessage(2, kTRUE,TString::Format(" Event %s was not found to set printout mode!",GetObjectName()));
70  return -1;
71  }
72 
73  TGo4MbsSource* mbs_src = dynamic_cast<TGo4MbsSource*> (eve->GetEventSource());
74 
75  if (!mbs_src) {
76  cli->SendStatusMessage(2, kTRUE,TString::Format(" Source of event %s of class %s is not yet supported for printevent mode!", GetObjectName(), eve->ClassName()));
77  return -1;
78  }
79 
85  return -1;
86 }
TGo4EventSource * GetEventSource() const
void SetReceiverName(const char *)
Definition: TGo4Command.cxx:93
TGo4CommandReceiver * fxReceiverBase
Definition: TGo4Command.h:116
void Set(TGo4RemoteCommand *remcon) override
void SendStatusMessage(Int_t level, Bool_t printout, const TString &text) override
static void Debug(const char *text,...) GO4_PRINTF_ARGS
Definition: TGo4Log.cxx:281
Int_t GetValue(Int_t i) const
TGo4MbsSourcePrintPar fxPrintPar
#define GO4TRACE(X)
Definition: TGo4Log.h:25
void Set(TGo4RemoteCommand *remcon) override
TGo4EventElement * GetEventStructure(const char *name) const
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()