Geant4-11
test.py
Go to the documentation of this file.
1#!/usr/bin/env python
2# ==================================================================
3# python script for Geant4Py test
4#
5# gtest04
6# - test for command tree and command information
7# ==================================================================
8from Geant4 import *
9
10def DumpTree(atree):
11 print("@@", atree.GetPathName(), "::", atree.GetTitle())
12 ntree= atree.GetTreeEntry()
13 ncommand= atree.GetCommandEntry()
14
15 for i in range(1, ncommand+1):
16 icommand= atree.GetCommand(i)
17 print(" **", icommand.GetCommandPath())
18 print(" ", icommand.GetTitle())
19 x= icommand.GetStateList()
20
21 nparameter= icommand.GetParameterEntries()
22 for j in range(0, nparameter):
23 iparam= icommand.GetParameter(j)
24 print(" +", iparam.GetParameterName(), iparam.GetParameterType())
25
26 for i in range(1, ntree+1):
27 itree= atree.GetTree(i)
28 DumpTree(itree)
29
30# ==================================================================
31# main
32# ==================================================================
33root_tree= gUImanager.GetTree()
34
35DumpTree(root_tree)
36
void print(G4double elem)
def DumpTree(atree)
Definition: test.py:10