Geant4-11
Functions | Variables
g4zmq Namespace Reference

Functions

def apply (command)
 
def beamOn (nevent)
 
def cd (dir="")
 
def connect (endpoint="tcp://127.0.0.1:5555")
 
def cwd ()
 
def debug (dflag)
 
def execute (command)
 
def exit ()
 
def getvalue (target="")
 
def help (target="")
 
def history ()
 
def lc (target="")
 
def ls (target="")
 
def ping ()
 
def pwd ()
 

Variables

string charset = 'utf-8'
 
 context = zmq.Context(1)
 
 socket = context.socket(zmq.REQ)
 

Function Documentation

◆ apply()

def g4zmq.apply (   command)

Definition at line 38 of file g4zmq.py.

38def apply(command) :
39 cmd_str= command.encode(charset)
40 socket.send(cmd_str)
41 output = socket.recv()
42 print(output.decode(charset))
43
void print(G4double elem)
def apply(command)
Definition: g4zmq.py:38

References print().

Referenced by beamOn(), and execute().

◆ beamOn()

def g4zmq.beamOn (   nevent)

Definition at line 89 of file g4zmq.py.

89def beamOn(nevent) :
90 cmd = "/run/beamOn " + str(nevent)
91 apply(cmd)
92
def beamOn(nevent)
Definition: g4zmq.py:89

References apply().

◆ cd()

def g4zmq.cd (   dir = "")

Definition at line 57 of file g4zmq.py.

57def cd(dir="") :
58 cmd = "cd " + dir
59 socket.send(cmd.encode(charset))
60 output = socket.recv()
61 print(output.decode(charset))
62
static const G4double cd

References print().

◆ connect()

def g4zmq.connect (   endpoint = "tcp://127.0.0.1:5555")

◆ cwd()

def g4zmq.cwd ( )

Definition at line 52 of file g4zmq.py.

52def cwd() :
53 socket.send(b"cwd")
54 output = socket.recv()
55 print(output.decode(charset))
56
def cwd()
Definition: g4zmq.py:52

References print().

Referenced by MCGIDI_misc_getAbsPath(), and xDataTOMMisc_getAbsPath().

◆ debug()

def g4zmq.debug (   dflag)

Definition at line 30 of file g4zmq.py.

30def debug(dflag) :
31 if dflag :
32 socket.send(b"@@debug")
33 else :
34 socket.send(b"@@nodebug")
35 output = socket.recv()
36 print(output.decode(charset))
37
def debug(dflag)
Definition: g4zmq.py:30

References print().

Referenced by G4BinaryLightIonReaction.ApplyYourself(), G4BinaryCascade.DoTimeStep(), G4BinaryCascade.GetExcitationEnergy(), main(), and G4BinaryCascade.Propagate().

◆ execute()

def g4zmq.execute (   command)

Definition at line 44 of file g4zmq.py.

44def execute(command) :
45 apply(command)
46
def execute(command)
Definition: g4zmq.py:44

References apply().

Referenced by G4ToolsSGQtViewer.Initialise().

◆ exit()

def g4zmq.exit ( )

Definition at line 99 of file g4zmq.py.

99def exit() :
100 socket.send(b"exit")
101 output = socket.recv()
102 print(output.decode(charset))
103
104# ===============================================================
def exit()
Definition: g4zmq.py:99

References print().

Referenced by G4PenelopeOscillatorManager.BuildOscillatorTable(), G4DNAPTBAugerModel.ComputeAugerEffect(), G4Profiler.Configure(), CLHEP::NonRandomEngine.flat(), main(), nfu_printErrorMsg(), parsedir(), G4DNAPTBIonisationModel.RandomizeEjectedElectronEnergyFromCumulated(), G4DNAPTBIonisationModel.SampleSecondaries(), G4UIQt.SessionTerminate(), and windef.usage().

◆ getvalue()

def g4zmq.getvalue (   target = "")

Definition at line 93 of file g4zmq.py.

93def getvalue(target="") :
94 cmd = "?" + target
95 socket.send(cmd.encode(charset))
96 output = socket.recv()
97 print(output.decode(charset))
98
def getvalue(target="")
Definition: g4zmq.py:93

References print().

◆ help()

def g4zmq.help (   target = "")

Definition at line 75 of file g4zmq.py.

75def help(target="") :
76 if ( target == "" ) :
77 raise SyntaxWarning("*** no command specified.")
78 else :
79 cmd = "help " + target
80 socket.send(cmd.encode(charset))
81 output = socket.recv()
82 print(output.decode(charset))
83
def help(target="")
Definition: g4zmq.py:75

References print().

◆ history()

def g4zmq.history ( )

◆ lc()

def g4zmq.lc (   target = "")

Definition at line 63 of file g4zmq.py.

63def lc(target="") :
64 cmd = "lc " + target
65 socket.send(cmd.encode(charset))
66 output = socket.recv()
67 print(output.decode(charset))
68
def lc(target="")
Definition: g4zmq.py:63

References print().

Referenced by _tr_tally(), compress_block(), and gl2psPrintPDFLineCap().

◆ ls()

def g4zmq.ls (   target = "")

Definition at line 69 of file g4zmq.py.

69def ls(target="") :
70 cmd = "ls " + target
71 socket.send(cmd.encode(charset))
72 output = socket.recv()
73 print(output.decode(charset))
74
def ls(target="")
Definition: g4zmq.py:69

References print().

Referenced by G4QuasiElRatios.GetQF2IN_Ratio().

◆ ping()

def g4zmq.ping ( )

Definition at line 20 of file g4zmq.py.

20def ping() :
21 socket.send(b"@@ping")
22 poller = zmq.Poller()
23 poller.register(socket, zmq.POLLIN)
24 if poller.poll(1*1000) :
25 output = socket.recv()
26 print ("@@ G4ZMQ server connected.")
27 else :
28 raise ConnectionError("*** connection timeout")
29

Referenced by connect().

◆ pwd()

def g4zmq.pwd ( )

Definition at line 47 of file g4zmq.py.

47def pwd() :
48 socket.send(b"pwd")
49 output = socket.recv()
50 print(output.decode(charset))
51
def pwd()
Definition: g4zmq.py:47

References print().

Variable Documentation

◆ charset

string g4zmq.charset = 'utf-8'

Definition at line 10 of file g4zmq.py.

Referenced by XmConvertCompoundStringToString().

◆ context

g4zmq.context = zmq.Context(1)

◆ socket

g4zmq.socket = context.socket(zmq.REQ)

Definition at line 12 of file g4zmq.py.

Referenced by G4ZMQServer.SessionStart().