v2.10-0 (21000JUN2005)

Go4AnalysisClient
Class TGo4AnalysisClient


class TGo4AnalysisClient
derived from TGo4Slave

Author:
J. Adamczewski
Since: 12/2000, last 5/2005

Field Summary
 private Bool_tfbAutoStart
          If true, this slave will initialize and start analysis
immediately without waiting for a submit/start command.
 private Bool_tfbCintMode
          If true, this slave runs to control CINT macro.
 private Text_t*fcMainName
          remember name of main thread
 private Text_t*fcWatchName
          remember name of watch thread
 private Double_tfdBufferUpdateTime
          absoulute time of the last status buffer update.
 const static const Text_t[]fgcMAINTHREAD
          suffix for main thread name
 const static const Text_t[]fgcWATCHTHREAD
          suffix for watch thread name
 const static const Double_tfgdSTATUSTIMEOUT
          Maximum time (in s) between two updates of the client status object.
 const static const UInt_tfguCINTTIMERPERIOD
          Timer period (in ms) for cint locking timer
 const static const UInt_tfguSTATUSUPDATE
          Number of mainloop runs between two updates of the client status object.
 private TGo4Analysis*fxAnalysis
          The analysis the client is working on.
 private TTimer*fxCintLockTimer
          For cintmode, we only allow to release the main
lock within a certain time window, triggered by this
timer
 private TGo4HistogramServer*fxHistoServer
           
 private TGo4InterruptHandler*fxInterruptHandler
          use to treat Ctrl-C interrupts in CINT mode
 private TGo4Ratemeter*fxRatemeter
           
 private TStopwatch*fxUpdateWatch
          Stopwatch controlling the buffer update time.

Constructor Summary
 TGo4AnalysisClient(const char * name, TGo4Analysis* analysis, const char * host, UInt_t negport, Bool_t histoserver, const char * basename, const char * passwd, Bool_t servermode, Bool_t autorun, Bool_t clientmode)
           
 TGo4AnalysisClient(int argc, char * * argv, TGo4Analysis* analysis, Bool_t histoserver, const char * basename, const char * passwd, Bool_t servermode, Bool_t autorun)
           
 private TGo4AnalysisClient()
           

Destructor Summary
 virtual synchronized ~TGo4AnalysisClient()
           

Method Summary
 private voidConstructor(Bool_t starthistserv, const char * basename, const char * passwd)
           
 virtual TGo4TaskStatus*CreateStatus()
          create a status object with information on the
current client state. this object may be sent to the
server or may be used to restore current status by
memento mechanism.
 virtual voidExecuteString(const Text_t* command)
          Execute string command.
 const TGo4Analysis*GetAnalysis()
           
 UInt_tGetCurrentCount()
          Number of currently processed events since last start.
 virtual Int_tInitialization()
          Override the ClientTask/ThreadManager Initialization used by AppControlTimer
to init event classes before the threads are started.
 Bool_t&IsCintMode()
           
 virtual voidKillMain()
          Kill the main thread; method to be called from
command, should be overridden in user implementation
 virtual voidRestartMain()
          Restart the main thread; method to be called from
command, should be overridden in user implementation
 voidSendAnalysisClientStatus()
          Send a complete status object of the analysis client via
the status queue.
 voidSendAnalysisObject(const Text_t* name)
          Fetch object of name from analysis instance and put
it into the data queue of the client.
 voidSendAnalysisStatus()
          Send a complete status object of the analysis via
the status queue.
 voidSendNamesList()
          Send the list of object names (folder structure) as status object to the gui.
 voidSetCintMode(Bool_t on)
           
 virtual voidStart()
           
 voidStartObjectServer(const Text_t* basename, const Text_t* passwd)
          Start the object (histogram) server.
 virtual Int_tStartWorkThreads()
          start the working threads of the slave implementation;
 virtual voidStop()
           
 voidStopObjectServer()
          Stop the object (histogram) server.
 virtual Int_tStopWorkThreads()
          stop the working threads of the slave implementation;
 virtual voidTerminate()
          Overwrites the Threadmanager Terminate to shutdown the objectserver properly
 virtual voidTerminateFast()
          Overwrites the Threadmanager TerminateFast to shutdown the objectserver properly
 Bool_tTestBufferUpdateConditions()
          Test if status buffer shall be updated now
 Bool_tTestRatemeter()
          Test if ratemeter has been updated.
 voidUpdateRate(Int_t counts)
          Update ratemeter.
 private voidUpdateStatus(TGo4TaskStatus* state)
          Method needed by method CreateStatus of any status subclasses to
set the values of the clienttask specific part of the status object.

Methods inherited from class Go4TaskHandler.TGo4Slave
GetThreadHandler, MainIsRunning, NextCommand, SendObject, SendStatus, SendStatusBuffer, SendStatusMessage, Terminate, UpdateStatusBuffer

Methods inherited from class Go4TaskHandler.TGo4TaskOwner
GetName, GetTask, IsConnected, IsServer, Quit, SetTask

Field Detail

fbAutoStart

private Bool_t fbAutoStart
If true, this slave will initialize and start analysis
immediately without waiting for a submit/start command.

fbCintMode

private Bool_t fbCintMode
If true, this slave runs to control CINT macro.
Will have effect on some initialization behaviour.

fcMainName

private Text_t* fcMainName
remember name of main thread

fcWatchName

private Text_t* fcWatchName
remember name of watch thread

fdBufferUpdateTime

private Double_t fdBufferUpdateTime
absoulute time of the last status buffer update. Reset by TestBufferUpdateCondition

fgcMAINTHREAD

public const static const Text_t[] fgcMAINTHREAD
suffix for main thread name

fgcWATCHTHREAD

public const static const Text_t[] fgcWATCHTHREAD
suffix for watch thread name

fgdSTATUSTIMEOUT

public const static const Double_t fgdSTATUSTIMEOUT
Maximum time (in s) between two updates of the client status object.

fguCINTTIMERPERIOD

public const static const UInt_t fguCINTTIMERPERIOD
Timer period (in ms) for cint locking timer

fguSTATUSUPDATE

public const static const UInt_t fguSTATUSUPDATE
Number of mainloop runs between two updates of the client status object.

fxAnalysis

private TGo4Analysis* fxAnalysis
The analysis the client is working on.
supplierCardinality 1
link aggregationByValue
clientCardinality 0..1

fxCintLockTimer

private TTimer* fxCintLockTimer
For cintmode, we only allow to release the main
lock within a certain time window, triggered by this
timer

fxHistoServer

private TGo4HistogramServer* fxHistoServer
supplierCardinality 1
histogram server (optional)
link aggregation

fxInterruptHandler

private TGo4InterruptHandler* fxInterruptHandler
use to treat Ctrl-C interrupts in CINT mode

fxRatemeter

private TGo4Ratemeter* fxRatemeter
supplierCardinality 1
link aggregation

fxUpdateWatch

private TStopwatch* fxUpdateWatch
Stopwatch controlling the buffer update time.
Constructor Detail

TGo4AnalysisClient

public TGo4AnalysisClient(const char * name, TGo4Analysis* analysis, const char * host, UInt_t negport, Bool_t histoserver, const char * basename, const char * passwd, Bool_t servermode, Bool_t autorun, Bool_t clientmode)

TGo4AnalysisClient

public TGo4AnalysisClient(int argc, char * * argv, TGo4Analysis* analysis, Bool_t histoserver, const char * basename, const char * passwd, Bool_t servermode, Bool_t autorun)

TGo4AnalysisClient

private TGo4AnalysisClient()
Method Detail

~TGo4AnalysisClient

public virtual synchronized ~TGo4AnalysisClient()
Method Detail

Constructor

private void Constructor(Bool_t starthistserv, const char * basename, const char * passwd)

CreateStatus

public virtual TGo4TaskStatus* CreateStatus()
create a status object with information on the
current client state. this object may be sent to the
server or may be used to restore current status by
memento mechanism. Overridden from superclass

ExecuteString

public virtual void ExecuteString(const Text_t* command)
Execute string command. Overrides base class implementation
to decouple some commands from analysis client.

GetAnalysis

public const TGo4Analysis* GetAnalysis()

GetCurrentCount

public UInt_t GetCurrentCount()
Number of currently processed events since last start.

Initialization

public virtual Int_t Initialization()
Override the ClientTask/ThreadManager Initialization used by AppControlTimer
to init event classes before the threads are started.

IsCintMode

public Bool_t& IsCintMode()

KillMain

public virtual void KillMain()
Kill the main thread; method to be called from
command, should be overridden in user implementation

RestartMain

public virtual void RestartMain()
Restart the main thread; method to be called from
command, should be overridden in user implementation

SendAnalysisClientStatus

public void SendAnalysisClientStatus()
Send a complete status object of the analysis client via
the status queue.

SendAnalysisObject

public void SendAnalysisObject(const Text_t* name)
Fetch object of name from analysis instance and put
it into the data queue of the client. Send an error status
object via status queue if there is no such object.

SendAnalysisStatus

public void SendAnalysisStatus()
Send a complete status object of the analysis via
the status queue.

SendNamesList

public void SendNamesList()
Send the list of object names (folder structure) as status object to the gui.

SetCintMode

public void SetCintMode(Bool_t on)

Start

public virtual void Start()

StartObjectServer

public void StartObjectServer(const Text_t* basename, const Text_t* passwd)
Start the object (histogram) server. Existing server will be stopped and replaced
by new server with different basename and password.

StartWorkThreads

public virtual Int_t StartWorkThreads()
start the working threads of the slave implementation;

Stop

public virtual void Stop()

StopObjectServer

public void StopObjectServer()
Stop the object (histogram) server.

StopWorkThreads

public virtual Int_t StopWorkThreads()
stop the working threads of the slave implementation;

Terminate

public virtual void Terminate()
Overwrites the Threadmanager Terminate to shutdown the objectserver properly

TerminateFast

public virtual void TerminateFast()
Overwrites the Threadmanager TerminateFast to shutdown the objectserver properly

TestBufferUpdateConditions

public Bool_t TestBufferUpdateConditions()
Test if status buffer shall be updated now

TestRatemeter

public Bool_t TestRatemeter()
Test if ratemeter has been updated.

UpdateRate

public void UpdateRate(Int_t counts)
Update ratemeter. To be used from main thread.

UpdateStatus

private void UpdateStatus(TGo4TaskStatus* state)
Method needed by method CreateStatus of any status subclasses to
set the values of the clienttask specific part of the status object.

Association Links

to Class TGo4Analysis

The analysis the client is working on.

Client Cardinality 0..1
Supplier Cardinality 1
Type aggregationByValue

to Class TStopwatch

Stopwatch controlling the buffer update time.

to Class TGo4Ratemeter

Supplier Cardinality 1
Type aggregation

to Class TGo4HistogramServer

Supplier Cardinality 1
histogram server (optional)
Type aggregation

to Class TTimer

For cintmode, we only allow to release the main
lock within a certain time window, triggered by this
timer

to Class TGo4InterruptHandler

use to treat Ctrl-C interrupts in CINT mode

J.Adamczewski, M.Al-Turany, D.Bertini, H.G.Essel, S.Linev

30-06-2005