ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
test.py
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file test.py
1 #!/usr/bin/env python
2 # ==================================================================
3 # python script for Geant4Py test
4 #
5 # gtest04
6 # - test for command tree and command information
7 # ==================================================================
8 from Geant4 import *
9 
10 def 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 # ==================================================================
33 root_tree= gUImanager.GetTree()
34 
35 DumpTree(root_tree)
36