GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
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
15
16#include "TGo4Log.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",
50 GetObjectName(), fxPrintPar.fiNum, fxPrintPar.fiSid, fxPrintPar.fiLong, fxPrintPar.fiHex, fxPrintPar.fiData);
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
80 mbs_src->SetPrintEvent(fxPrintPar.fiNum,
81 fxPrintPar.fiSid,
82 fxPrintPar.fiLong,
83 fxPrintPar.fiHex,
84 fxPrintPar.fiData);
85 return -1;
86}
#define GO4TRACE(X)
Definition TGo4Log.h:25
void SendStatusMessage(Int_t level, Bool_t printout, const TString &text) override
Send message to gui.
const char * GetObjectName() const
access to the object name under command.
void Set(TGo4RemoteCommand *remcon) override
Set internals of this command from specification of external remote command (command container).
The mother of all go4 analysis.
static TGo4Analysis * Instance()
return analysis instance
TGo4EventElement * GetEventStructure(const char *name) const
Search reference to event structure in folder.
Int_t ExeCom() override
Do the command action.
void Set(TGo4RemoteCommand *remcon) override
Set internals of this command from specification of external remote command (command container).
TGo4MbsSourcePrintPar fxPrintPar
TGo4CommandReceiver * fxReceiverBase
void SetReceiverName(const char *)
The abstract base class for the data elements of which the unpacked events (or detector structure dat...
TGo4EventSource * GetEventSource() const
static void Debug(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 0.
Definition TGo4Log.cxx:281
Generic MBS source.
void SetPrintEvent(Int_t num=1, Int_t sid=-1, Int_t longw=1, Int_t hexw=1, Int_t dataw=0)
Set mbs source into printout (verbose) mode for the next num events.
This command is a container for commands to be send from master to slave via inter-process transport.
Int_t GetValue(Int_t i) const