GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4AnalysisClientImp.h
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#ifndef TGO4ANALYSISCLIENTIMP_H
15#define TGO4ANALYSISCLIENTIMP_H
16
17#include "TGo4Slave.h"
18
19#include "TString.h"
20
21class TTimer;
22class TGo4Analysis;
24class TGo4Ratemeter;
26class TGo4TaskStatus;
28
33
35
36 public:
37 TGo4AnalysisClient(const char *name,
38 TGo4Analysis *analysis,
39 const char *host = "localhost",
40 UInt_t negport = 0,
41 Bool_t histoserver = kFALSE,
42 const char *basename = "Go4",
43 const char *passwd = "abcd",
44 Bool_t servermode = kFALSE,
45 Bool_t autorun = kFALSE,
46 Bool_t cintmode = kFALSE,
47 Bool_t loadprefs = kTRUE,
48 Bool_t showrate = kFALSE);
49
50 TGo4AnalysisClient(int argc, char **argv,
51 TGo4Analysis *analysis,
52 Bool_t histoserver = kFALSE,
53 const char *basename = "Go4",
54 const char *passwd = "abcd",
55 Bool_t servermode = kFALSE,
56 Bool_t autorun = kFALSE);
57
58 virtual ~TGo4AnalysisClient();
59
60 TGo4Analysis *GetAnalysis() const { return fxAnalysis; }
61
62 void Start() override;
63
64 void Stop() override;
65
66 void Quit() override;
67
70 void KillMain() override;
71
74 void RestartMain() override;
75
80 TGo4TaskStatus *CreateStatus() override;
81
84 Int_t Initialization() override;
85
89 void SendAnalysisObject(const char *name);
90
93 void SendAnalysisStatus();
94
98
100 void SendNamesList();
101
103 void UpdateRate(Int_t counts = 1);
104
106 UInt_t GetCurrentCount() const;
107
109 Bool_t TestRatemeter();
110
113
116 void StartObjectServer(const char *basename, const char *passwd);
117
119 void StopObjectServer();
120
121
125 Int_t StartWorkThreads() override;
126
130 Int_t StopWorkThreads() override;
131
133 void Terminate (Bool_t termapp=kTRUE) override;
134
136 void TerminateFast() override;
137
138 /* submit a analysis server shutdown into local command queue.
139 * used by ctrl-c handler of analysis server*/
140 void SubmitShutdown();
141
143 void SendStatusMessage(Int_t level, Bool_t printout, const TString &text) override;
144
147 void ExecuteString(const char *command) override;
148
149 void SetCintMode(Bool_t on=kTRUE);
150
151 Bool_t IsCintMode() const { return fbCintMode; }
152
154 static const char *fgcMAINTHREAD;
155
157 static const char *fgcWATCHTHREAD;
158
160 static const UInt_t fguSTATUSUPDATE;
161
163 static const Double_t fgdSTATUSTIMEOUT;
164
166 static const UInt_t fguCINTTIMERPERIOD;
167
168 private:
169
170 void Constructor(Bool_t starthistserv = kFALSE, const char *basename = "Go4", const char *passwd = "abcd");
171
174 void UpdateStatus(TGo4TaskStatus * state) override;
175
176private:
177
183
185 TString fcMainName;
186
188 TString fcWatchName;
189
192
196
201
204 Bool_t fbAutoStart{kFALSE};
205
208 Bool_t fbCintMode{kFALSE};
209
211 Bool_t fbLoadPrefs{kFALSE};
212
214 Bool_t fbShowRate{kFALSE};
215
217
218 ClassDef(TGo4AnalysisClient,1)
219
220};
221
222#endif //TGO4ANALYSISCLIENT_H
void Terminate(Bool_t termapp=kTRUE) override
Overwrites the Threadmanager Terminate to shutdown the objectserver properly.
TGo4Analysis * fxAnalysis
The analysis the client is working on.
static const UInt_t fguCINTTIMERPERIOD
Timer period (in ms) for cint locking timer.
Bool_t fbCintMode
If true, this slave runs to control CINT macro.
void StartObjectServer(const char *basename, const char *passwd)
Start the object (histogram) server.
void Stop() override
General stop method of slave application to be called from remote command; should be re-implemented b...
void KillMain() override
Kill the main thread; method to be called from command, should be overridden in user implementation.
void ExecuteString(const char *command) override
Execute string command.
Bool_t fbShowRate
Then enabled, show current rate on the analysis terminal window.
void TerminateFast() override
Overwrites the Threadmanager TerminateFast to shutdown the objectserver properly.
TGo4TaskStatus * CreateStatus() override
create a status object with information on the current client state.
void SendAnalysisObject(const char *name)
Fetch object of name from analysis instance and put it into the data queue of the client.
TGo4Analysis * GetAnalysis() const
Int_t StopWorkThreads() override
stop the working threads of the slave implementation;
Bool_t TestRatemeter()
Test if ratemeter has been updated.
TGo4Ratemeter * fxRatemeter
aggregation 1
void SendAnalysisStatus()
Send a complete status object of the analysis via the status queue.
void SetCintMode(Bool_t on=kTRUE)
void StopObjectServer()
Stop the object (histogram) server.
void Start() override
General start method of slave application to be called from remote command; should be re-implemented ...
void UpdateRate(Int_t counts=1)
Update ratemeter.
Double_t fdBufferUpdateTime
absolute time of the last status buffer update.
static const UInt_t fguSTATUSUPDATE
Number of mainloop runs between two updates of the client status object.
UInt_t GetCurrentCount() const
Number of currently processed events since last start.
void UpdateStatus(TGo4TaskStatus *state) override
Method needed by method CreateStatus of any status subclasses to set the values of the clienttask spe...
TGo4AnalysisClient(const char *name, TGo4Analysis *analysis, const char *host="localhost", UInt_t negport=0, Bool_t histoserver=kFALSE, const char *basename="Go4", const char *passwd="abcd", Bool_t servermode=kFALSE, Bool_t autorun=kFALSE, Bool_t cintmode=kFALSE, Bool_t loadprefs=kTRUE, Bool_t showrate=kFALSE)
Int_t StartWorkThreads() override
start the working threads of the slave implementation;
static const char * fgcMAINTHREAD
suffix for main thread name
void SendAnalysisClientStatus()
Send a complete status object of the analysis client via the status queue.
void Constructor(Bool_t starthistserv=kFALSE, const char *basename="Go4", const char *passwd="abcd")
Bool_t fbLoadPrefs
If true, this slave load preferences for analysis from default file.
void SendNamesList()
Send the list of object names (folder structure) as status object to the gui.
Bool_t TestBufferUpdateConditions()
Test if status buffer shall be updated now.
void SendStatusMessage(Int_t level, Bool_t printout, const TString &text) override
Send message to gui.
Int_t Initialization() override
Override the ClientTask/ThreadManager Initialization used by AppControlTimer to init event classes be...
Bool_t fbAutoStart
If true, this slave will initialize and start analysis immediately without waiting for a submit/start...
TString fcMainName
remember name of main thread
static const char * fgcWATCHTHREAD
suffix for watch thread name
void Quit() override
Quit this instance and the owned task; method to be called from command object, may be overridden in ...
static const Double_t fgdSTATUSTIMEOUT
Maximum time (in s) between two updates of the client status object.
TGo4HistogramServer * fxHistoServer
aggregation 1 histogram server (optional)
TString fcWatchName
remember name of watch thread
void RestartMain() override
Restart the main thread; method to be called from command, should be overridden in user implementatio...
The mother of all go4 analysis.
Client status.
Handles a histogram server (mbs histogram protocol) for the histograms registered in the analysis.
Class containing event counter and ratemeter services.
Task status.