GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4AnalysisClientImp.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 "TApplication.h"
17#include "TROOT.h"
18#include "TDatime.h"
19#include "TDataType.h"
20
21#include "TGo4Log.h"
22#include "TGo4LockGuard.h"
23
24#include "TGo4CommandInvoker.h"
26#include "TGo4ComServerQuit.h"
27#include "TGo4ThreadHandler.h"
28#include "TGo4Task.h"
29#include "TGo4TaskHandler.h"
32#include "TGo4AnalysisSniffer.h"
33#include "TGo4HistogramServer.h"
34#include "TGo4AnalysisStatus.h"
35#include "TGo4AnalysisImp.h"
36#include "TGo4AnalysisStep.h"
37
40#include "TGo4Ratemeter.h"
41
42const char *TGo4AnalysisClient::fgcWATCHTHREAD = "WATCH-";
43const char *TGo4AnalysisClient::fgcMAINTHREAD = "MAIN-";
44const UInt_t TGo4AnalysisClient::fguSTATUSUPDATE = 1000; // events between two updates
45const Double_t TGo4AnalysisClient::fgdSTATUSTIMEOUT = 2; // maximum seconds between two updates
46const UInt_t TGo4AnalysisClient::fguCINTTIMERPERIOD = 200; // frequency of timer for cint lock
47
48
50 TGo4Analysis *analysis,
51 const char *host,
52 UInt_t negport,
53 Bool_t histoserver,
54 const char *basename,
55 const char *passwd,
56 Bool_t servermode,
57 Bool_t autorun,
58 Bool_t cintmode,
59 Bool_t loadprefs,
60 Bool_t showrate) :
61 TGo4Slave(name, servermode, host, negport),
63 fbAutoStart(autorun),
64 fbCintMode(kFALSE),
65 fbLoadPrefs(loadprefs),
66 fbShowRate(showrate)
67{
68 GO4TRACE((15,"TGo4AnalysisClient::TGo4AnalysisClient(const char *,...)",__LINE__, __FILE__));
69
70 if(!analysis) {
71 TGo4Log::Debug("!!! AnalysisClient ''%s'': no external analysis specified !!",GetName());
73 } else {
74 fxAnalysis = analysis;
75 }
76 fxAnalysis->SetAnalysisClient(this);
77
78 Constructor(histoserver, basename, passwd);
79
80 SetCintMode(cintmode);
81}
82
84 TGo4Analysis *analysis,
85 Bool_t histoserver,
86 const char *basename,
87 const char *passwd,
88 Bool_t servermode,
89 Bool_t autorun) :
90 TGo4Slave(argv[2], servermode, argv[3], (argc>4) ? atoi(argv[4]) : 5000),
92 fbAutoStart(autorun),
93 fbCintMode(kFALSE),
94 fbLoadPrefs(kTRUE),
95 fbShowRate(kFALSE)
96{
97 GO4TRACE((15,"TGo4AnalysisClient::TGo4AnalysisClient(int, char**...)",__LINE__, __FILE__));
98
99 if (argc < 5) {
100 TGo4Log::Error("!!! AnalysisClient: missing commandline arguments, aborting !!");
101 gApplication->Terminate();
102 }
103 if (!strcmp("-lGUI", argv[1])) {
104 TGo4Log::Error(" !!! AnalysisClient: GUI mode not specified, aborting !!");
105 gApplication->Terminate();
106 }
107
108 if (!analysis) {
109 TGo4Log::Debug(" !!! AnalysisClient ''%s'': no external analysis specified !!", GetName());
111 } else {
112 fxAnalysis = analysis;
113 }
114 fxAnalysis->SetAnalysisClient(this);
115 Constructor(histoserver, basename, passwd);
116}
117
118void TGo4AnalysisClient::Constructor(Bool_t starthistserv, const char *basename, const char *passwd)
119{
120 if (IsServer()) {
121 if (fxAnalysis->fServerObserverPass.Length()>0)
122 TGo4TaskHandler::SetObservAccount(nullptr, fxAnalysis->fServerObserverPass.Data());
123 if (fxAnalysis->fServerCtrlPass.Length()>0)
124 TGo4TaskHandler::SetCtrlAccount(nullptr, fxAnalysis->fServerCtrlPass.Data());
125 if (fxAnalysis->fServerAdminPass.Length()>0)
126 TGo4TaskHandler::SetAdminAccount(nullptr, fxAnalysis->fServerAdminPass.Data());
127 }
128
130 TGo4Log::Debug(" AnalysisClient ''%s'' started ",GetName());
131
132 fcMainName = TString::Format("%s%s", fgcMAINTHREAD, GetName());
133 fcWatchName = TString::Format("%s%s", fgcWATCHTHREAD, GetName());
134
135 TGo4AnalysisMainRunnable* mainrun =
136 new TGo4AnalysisMainRunnable(TString::Format("MainRunnable of %s",GetName()).Data(), this);
137 TGo4AnalysisWatchRunnable* watchrun =
138 new TGo4AnalysisWatchRunnable(TString::Format("WatchRunnable of %s",GetName()).Data(), this);
139
140 // adding runnables to thread handler who takes over the responsibility...:
142 th->NewThread(fcMainName.Data(), mainrun);
143 th->NewThread(fcWatchName.Data(), watchrun);
144
145 TGo4CommandInvoker::Instance(); // make sure we have an invoker instance!
147 TGo4CommandInvoker::Register("AnalysisClient",this); // register as command receiver at the global invoker
148 TGo4Slave::Stop();// prevent analysis to run before init
150 if(starthistserv) StartObjectServer(basename, passwd);
151 GetTask()->Launch();
152}
153
154
156{
157 GO4TRACE((15,"TGo4AnalysisClient::~TGo4AnalysisClient()",__LINE__, __FILE__));
158// if(GetTask())
159// {
160// GetTask()->GetTaskHandler()->DisConnect(); // disconnect before we autosave etc.
161// GetTask()->GetTaskHandler()->SetAborting(); // for superclass dtor: set fast abort mode
162// }
163 fxAnalysis->LockAutoSave(); // wait until mainthread finishes the
164 // final autosaving before we cancel
165 StopObjectServer(); // first cancel histoserver and its thread!
166 if(GetThreadHandler()) // make sure threads wont work on application when its deleted
168
169 fxAnalysis->UnLockAutoSave();
170
171 delete fxRatemeter;
172 delete fxAnalysis;
174}
175
176
178{
179 TGo4LockGuard mainguard; // threads are already up, protect next actions!
180 SendStatusMessage(1, kTRUE, TString::Format("AnalysisClient %s starting initialization...",GetName()));
181
182 if(!fbAutoStart) { // normal mode: load last prefs and wait for submit
183
184 // startup of analysis: get last saved status
185
186 if (fbLoadPrefs) {
187 if(fxAnalysis->LoadStatus()) { // will load, close analysis and set the new status
188 // we have a status from file, i.e. go4 analysis: wait with init until gui command
189 SendStatusMessage(1,kTRUE, TString::Format("AnalysisClient %s: Status loaded from %s",
191 } else {
192 SendStatusMessage(2,kTRUE, TString::Format("AnalysisClient %s: Could not load status from %s",
194 }
195 }
196 // recover objects and dynamic list links from last autosave file:
197 if(!fxAnalysis->IsAutoSaveOn()){
198 SendStatusMessage(1,kTRUE, TString::Format("AnalysisClient %s: AUTOSAVE is DISABLED, Initialization did NOT load analysis objects!",
199 GetName()));
200 }
201 else if(fxAnalysis->LoadObjects()) {
202 SendStatusMessage(1,kTRUE, TString::Format("AnalysisClient %s: Objects loaded.",GetName()));
203 }
204 else {
205 //TGo4Log::Debug(" !!! Analysis Client Initialization -- Could not load dynamic list!!! ");
206 SendStatusMessage(2,kTRUE, TString::Format("AnalysisClient %s: Initialization could not load analysis objects!",GetName()));
207 }
208
209 SendStatusMessage(1,kTRUE, TString::Format("Analysis Slave %s waiting for submit and start commands...",GetName()));
210 TGo4Slave::Stop(); // wait for command from master for start.
211 } else {
212 // in server mode, analysis slave will begin with analysis run
213 // before the master is connected. May not need master anyway!
214 // note: we do not recover preferences from file here anymore, all left to command line pars
215 SendStatusMessage(1,kTRUE, TString::Format("AnalysisSlave %s initializing analysis...",GetName()));
216 if(fxAnalysis->InitEventClasses()) {
217 if(IsCintMode()) {
218 SendStatusMessage(1,kTRUE, TString::Format("Analysis CINTServer %s in MainCycle suspend mode.",GetName()));
219 TGo4Slave::Stop(); // no UserPostLoop
220 } else {
221 SendStatusMessage(1,kTRUE, TString::Format("AnalysisSlave %s starting analysis...",GetName()));
222 Start(); // UserPreLoop execution here!
223 }
224 } else {
225 SendStatusMessage(2,kTRUE, TString::Format("AnalysisSlave %s failed initializing analysis!",GetName()));
227 }
228 } // if(!fbAutoStart)
229 SendAnalysisStatus(); // only send status if connections are up!
230 UpdateStatusBuffer(); // we need this for gui
231 //SendAnalysisClientStatus(); // JAM15 deadlock danger in analysis server mode!
232 SendStatusMessage(1,kFALSE, TString::Format("AnalysisClient %s has finished initialization.",GetName()));
233 return 0;
234}
235
236
238{
239 GO4TRACE((12,"TGo4AnalysisClient::UpdateStatus(TGo4TaskStatus *)",__LINE__, __FILE__));
240 TGo4Slave::UpdateStatus(state); // fill superclass attributes
241 TGo4AnalysisClientStatus* anstate = dynamic_cast<TGo4AnalysisClientStatus*> (state);
242 if (anstate) {
243 anstate->SetRates(fxRatemeter->GetRate(), fxRatemeter->GetAvRate(), fxRatemeter->GetCurrentCount(), fxRatemeter->GetTime());
244 // new: set true running state
245 anstate->SetRunning(fxAnalysis->IsRunning());
246 // new: set name of current eventsource
247 TGo4AnalysisStep *firststep = fxAnalysis->GetAnalysisStep(nullptr);
248 if(firststep) {
249 anstate->SetCurrentSource(firststep->GetEventSourceName());
250 fxRatemeter->SetCurrentSource(firststep->GetEventSourceName());
251 } else {
252 anstate->SetCurrentSource("- No event source -");
253 fxRatemeter->SetCurrentSource("- No event source -");
254 }
255 }
256}
257
259{
260 GO4TRACE((12,"TGo4AnalysisClient::CreateStatus()",__LINE__, __FILE__));
261 // note: ratemeter update done by mainthread loop
263 UpdateStatus(stat); // set the internals
264 return stat;
265}
266
268{
269 GO4TRACE((12,"TGo4AnalysisClient::Start()",__LINE__, __FILE__));
270 if(fxAnalysis->IsInitDone())
271 {
272 if(GetThreadHandler()) GetThreadHandler()->Start(fcMainName.Data()); // this is useful anyway...
273 if(!MainIsRunning()) fxAnalysis->PreLoop(); // only call once
275 fxRatemeter->Reset();
276 fdBufferUpdateTime = TTimeStamp().AsDouble();
277 SendStatusMessage(1,kTRUE, TString::Format("AnalysisClient %s has started analysis processing.",GetName()));
278 UpdateRate(-2); // fake rate to display green light :)
280 //SendAnalysisClientStatus(); // JAM15 deadlock danger in analysis server mode! never do this from main thread
281 }
282 else
283 {
284 // user did not initialize analysis, we do not start!
285 SendStatusMessage(2,kTRUE, TString::Format("Analysis %s was not initialized! Please SUBMIT settings first.",fxAnalysis->GetName()));
286 }
287}
288
290{
291 GO4TRACE((12,"TGo4AnalysisClient::SendAnalysisObject(const char *name)",__LINE__, __FILE__));
292 TNamed *ob = fxAnalysis->GetObject(name);
293 SendObject(ob);
294}
295
297{
298 GO4TRACE((12,"TGo4AnalysisClient::SendAnalysisStatus()",__LINE__, __FILE__));
299 TGo4Analysis *ana = GetAnalysis();
300 TGo4Log::Debug(" AnalysisClient - sending current analysis settings ");
301 if(ana) {
302 TGo4AnalysisStatus *state = ana->CreateStatus();
303 SendStatus(state);
304 delete state;
305 } else {
306 SendStatusMessage(3,kFALSE, "ERROR sending analysis status: no analysis ");
307 }
308}
309
310
312{
313 GO4TRACE((12,"TGo4AnalysisClient::SendAnalysisClientStatus()",__LINE__, __FILE__));
314
315 TGo4Log::Debug(" AnalysisClient - sending current analysis client status ");
317 //TGo4Log::SetIgnoreLevel(0);
318// TGo4Log::Debug("current rate:\t%f",fxRatemeter->GetRate());
319// TGo4Log::Debug("average rate:\t%f",fxRatemeter->GetAvRate());
320// TGo4Log::Debug("running time:\t%f",fxRatemeter->GetTime());
321// TGo4Log::Debug("event number:\t%d",fxRatemeter->GetCurrentCount());
322}
323
325{
326 GO4TRACE((12,"TGo4AnalysisClient::SendNamesList()",__LINE__, __FILE__));
327
328 fxAnalysis->UpdateNamesList();
329 TGo4AnalysisObjectNames *state= fxAnalysis->GetNamesList();
330 if(state)
331 {
332 TGo4Log::Debug(" AnalysisClient - sending names list ");
333 //SendStatus(state);
334 SendObject(state);
335 }
336 else
337 {
338 SendStatusMessage(3,kTRUE,"Analysis Client: Send Names List - ERROR: no nameslist !!! ");
339 }
340}
341
343{
344 GO4TRACE((12,"TGo4AnalysisClient::KillMain()",__LINE__, __FILE__));
346 // put dummy buffer to command queue. This will wake up the main thread from command wait.
347 if(GetTask()) GetTask()->WakeCommandQueue(); // note that the dummy command will not have the termination id here!
349 SendStatusMessage(2,kTRUE,TString::Format("AnalysisClient %s has killed main analysis thread.",GetName()));
350}
351
353{
354 GO4TRACE((12,"TGo4AnalysisClient::RestartMain()",__LINE__, __FILE__));
356 // put dummy buffer to command queue. This will wake up the main thread from command wait.
357 if(GetTask()) GetTask()->WakeCommandQueue(); // note that the dummy command will not have the termination id here!
358 if(GetThreadHandler()) {
361 }
362 fxRatemeter->Reset();
363 SendStatusMessage(2,kTRUE,TString::Format("AnalysisClient %s has killed and relaunched main analysis thread.",GetName()));
364}
365
367{
368 GO4TRACE((12,"TGo4AnalysisClient::Stop()",__LINE__, __FILE__));
369
370 if(MainIsRunning()) fxAnalysis->PostLoop(); // only call postloop once
371 TGo4Slave::Stop(); // will stop for command queue wait
372 SendStatusMessage(1,kTRUE, TString::Format("AnalysisClient %s has STOPPED analysis processing.",GetName()));
373 if(GetTask()->IsTerminating()) return; // do not update status buffer from terminating state
375 UpdateRate(-1);
377
378 //SendAnalysisClientStatus(); // JAM15 deadlock danger in analysis server mode! never do this from main thread
379
380// if (fxAnalysis && fxAnalysis->IsStopWorking()) {
381// if (IsCintMode()) {
382// fxAnalysis->ResumeWorking();
383// } else {
384// TGo4Log::StartTracing(); // debug
385// fxAnalysis->CloseAnalysis();
386// TGo4Log::CloseLogfile();
387// exit(0);
388// }
389// }
390}
391
393{
394 GO4TRACE((12,"TGo4AnalysisClient::UpdateRate(Int_t)",__LINE__, __FILE__));
395 if (fxRatemeter->Update(counts)) {
396
398 fxRatemeter->SetRunning(an ? an->IsRunning() : kFALSE);
399
400 TDatime dt;
401 fxRatemeter->SetDateTime(dt.AsSQLString());
402
403 auto sniff = fxAnalysis->GetSniffer();
404 if (sniff) sniff->RatemeterUpdate(fxRatemeter);
405
406 if (fbShowRate)
407 TGo4Log::PrintRate(fxRatemeter->GetCurrentCount(), fxRatemeter->GetRate());
408 }
409}
410
412{
413 return fxRatemeter->GetCurrentCount();
414}
415
417{
418 return fxRatemeter->TestUpdate();
419}
420
422{
423 Double_t currenttime = TTimeStamp().AsDouble();
424 Double_t deltatime = currenttime - fdBufferUpdateTime;
425 UInt_t currentcount = GetCurrentCount();
426 if( (currentcount && (currentcount % fguSTATUSUPDATE == 0) && (deltatime>0.1*fgdSTATUSTIMEOUT))
427 || (deltatime > fgdSTATUSTIMEOUT) ) {
428 // buffer shall be updated if certain number of events is processed or the time is up
429 fdBufferUpdateTime = currenttime;
430 return kTRUE;
431 }
432
433 return kFALSE;
434}
435
436
437void TGo4AnalysisClient::StartObjectServer(const char *basename, const char *passwd)
438{
439 StopObjectServer(); // shutdown existing one with old basename/passwd
440 fxHistoServer = new TGo4HistogramServer(this,basename,passwd,kFALSE);
441 // switch last boolean true if you want to use Go4 object server support
442 // default will only enable gsi histogram server JA 9/2005
443 //SendStatusMessage(1,kTRUE, TString::Format("AnalysisClient %s Started Object server.",GetName()));
444}
445
447{
448 if(fxHistoServer) {
449 delete fxHistoServer;
450 fxHistoServer = nullptr;
451 //SendStatusMessage(1,kTRUE, TString::Format("AnalysisClient %s: Object server was stopped.",GetName()));
452 }
453}
454
456{
457 Stop();
458 fxAnalysis->CloseAnalysis();
459}
460
462{
463 SetCintMode(kFALSE);
464 StopObjectServer(); // shutdown objectserver and its threads properly
465 if(GetTask())
466 GetTask()->TGo4ThreadManager::Terminate(termapp); // stops all remaining threads and sets termination flag
467}
468
470{
471 StopObjectServer(); // shutdown objectserver and its threads properly
472 TGo4Log::Debug("TGo4AnalysisClient::TerminateFast with delete analysis");
473 if(GetThreadHandler()) {
474 GetThreadHandler()->StopAll(); // this will not stop immediately, therefore:
476 GetThreadHandler()->Cancel(fcMainName.Data()); // maybe we not need this...
477 GetThreadHandler()->Cancel(GetTask()->GetTaskHandler()->GetDatName());
478 GetThreadHandler()->Cancel(GetTask()->GetTaskHandler()->GetStatName());
479 }
480 delete fxAnalysis;
481 fxAnalysis = nullptr;
482 gApplication->Terminate();
483}
484
486{
487 if(GetTask()) {
488 auto com = new TGo4ComServerQuit();
489 //TGo4Log::StartTracing(); // debug
490 GetTask()->SubmitLocalCommand(com); // shutdown will be performed in local command thread
491 }
492}
493
494void TGo4AnalysisClient::ExecuteString(const char *command)
495{
496 if(strstr(command,"ANHServStart")) {
497 TString buffer = command;
498 strtok((char *) buffer.Data(), ":"); // first find the command itself
499 TString base = strtok(nullptr, ":");
500 TString pass = strtok(nullptr, ":");
501 StartObjectServer(base.Data(), pass.Data());
502 } else if (!strcmp(command,"ANHServStop")) {
504 } else{
505 fxAnalysis->ExecuteLine(command); // all scripting is handled in analysis singleton
506 fflush(stdout);
507 }
508}
509
519
521{
523 if(GetThreadHandler()) {
526 }
527 return 0;
528}
529
531{
532 fbCintMode = on;
533
534 if (fbCintMode) {
535 gROOT->SetBatch(kFALSE);
536 fxAnalysis->SetAutoSave(kFALSE);
537 }
538}
539
540void TGo4AnalysisClient::SendStatusMessage(Int_t level, Bool_t printout, const TString &text)
541{
542 TGo4Slave::SendStatusMessage(level, printout, text);
543
544 auto sniff = fxAnalysis->GetSniffer();
545 if (sniff) sniff->StatusMessage(level, printout, text);
546}
#define TGo4LockGuard
#define GO4TRACE(X)
Definition TGo4Log.h:25
void SetCurrentSource(const char *name)
void SetRates(Double_t rate, Double_t average, ULong64_t counts, Double_t time)
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...
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...
list containing prototypes of all analysis command objects.
Main Runnable of the go4 analysis.
Contains the name (key) list of all objects in the analysis scope.
Status of the analysis instance.
Contains a single step of the analysis.
const char * GetEventSourceName() const
Access to name of currently active event source.
runnable performing control watcher functions of analysis client task: status of analysis is send to ...
The mother of all go4 analysis.
static TGo4Analysis * Instance()
return analysis instance
static const char * fgcDEFAULTSTATUSFILENAME
standard file name for analysis settings
Bool_t IsRunning() const
True if the analysis as controlled by slave process is running.
TGo4AnalysisStatus * CreateStatus()
Create a copy of the analysis internal state.
Server Command to quit (terminate) the server and the application all clients are removed before.
static TGo4CommandInvoker * Instance()
static void SetCommandList(TGo4CommandProtoList *list)
Application may exchange standard command list by own subclass with specialized commands,...
static void UnRegister(TGo4CommandReceiver *p)
static void Register(const char *name, TGo4CommandReceiver *p)
Handles a histogram server (mbs histogram protocol) for the histograms registered in the analysis.
static void PrintRate(ULong64_t cnt, double rate)
Printout rate and events count, handle redirection.
Definition TGo4Log.cxx:270
static void Debug(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 0.
Definition TGo4Log.cxx:281
static void Error(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 3.
Definition TGo4Log.cxx:320
Class containing event counter and ratemeter services.
virtual void Start()
General start method of slave application to be called from remote command; should be re-implemented ...
Definition TGo4Slave.cxx:63
virtual void SendStatusMessage(Int_t level, Bool_t printout, const TString &text)
Send message string in a status object to the gui.
void SendStatus(TGo4Status *stat, const char *receiver=nullptr)
Send status object via status channel to the server.
TGo4ThreadHandler * GetThreadHandler()
void SendStatusBuffer()
Send internal status buffer to the server.
virtual void UpdateStatus(TGo4TaskStatus *state)
method needed by method CreateStatus of any status subclasses to set the values of the clienttask spe...
void SendObject(TObject *obj, const char *receiver=nullptr)
Send object via data channel to the server.
Bool_t MainIsRunning() const
Definition TGo4Slave.h:98
virtual void Stop()
General stop method of slave application to be called from remote command; should be re-implemented b...
Definition TGo4Slave.cxx:70
void UpdateStatusBuffer()
Create status object and stream it into the status send buffer.
static void SetCtrlAccount(const char *name, const char *passwd)
Specify login name and password for controller account.
static void SetAdminAccount(const char *name, const char *passwd)
Specify login name and password for administrator account.
static void SetObservAccount(const char *name, const char *passwd)
Specify login name and password for observer account.
virtual Int_t StartWorkThreads()
Start the working threads of the task owner implementation; this method is used after the current con...
Bool_t IsServer() const
virtual Int_t StopWorkThreads()
stop the working threads of the task owne implementation; this method is used before the current conn...
TGo4Task * GetTask() const
const char * GetName() const
Task status.
Bool_t SubmitLocalCommand(TGo4Command *com)
Send given command to the current client task.
Definition TGo4Task.cxx:508
void WakeCommandQueue(Int_t id=0)
Put dummy object into command queue to wake up user threads which might wait for a command.
Definition TGo4Task.cxx:522
Go4 thread handler.
Int_t CancelAll()
Cancel all Threads in the thread list.
Int_t StopAll()
Start work function of all Threads in the thread list.
Bool_t NewThread(const char *name, TGo4Runnable *runnable)
Creates new internal Go4 Thread with name and adds it to the List External runnable is passed to spec...
Bool_t Start(const char *thname)
Starts work function of the Go4 Thread of name 'name'.
Bool_t Stop(const char *thname)
Stops work function of the Go4 Thread of name 'name'.
Bool_t Cancel(const char *thname)
Cancels the ROOT Thread specified by the Go4 Thread of name 'name'.
Bool_t ReCreate(const char *thname)
ReCreate (Cancel and Create) all Threads in the thread list.
void Launch()
This Method has to be called to create the startup threads and to turn on the application control tim...