Message: Question on Geant4Py Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Question on Geant4Py 

Forum: Installation and Configuration
Date: Dec 14, 09:15
From: Keith Sloan <Keith Sloan>

Not sure what forum I should be asking this in but I am trying to get some help with Geant4Py.My program has the following code, loosly based on the example.

gdml_parser = G4GDMLParser()

gdml_parser.Read(filename) worldVol = gdml_parser.GetWorldVolume()

I got an error 
Geant4 - Import GDML file : /home/keith/GDML-Test-Files/test4.gdml
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/freecad/Mod/Geant4/importGDML.py", line 72, in open
    processGDML(filename)
  File "/usr/lib/freecad/Mod/Geant4/importGDML.py", line 244, in processGDML
    gdml_parser.Read(filename)
<class 'Boost.Python.ArgumentError'>: Python argument types in
    G4GDMLParser.Read(G4GDMLParser, unicode)
did not match C++ signature:
    Read(G4GDMLParser {lvalue}, G4String)
    Read(G4GDMLParser {lvalue}, G4String, bool)

So I changed it to

gdml_parser.Read(G4String(filename))
    worldVol = gdml_parser.GetWorldVolume()

But it did not make much difference.

Error report is now

Geant4 - Import GDML file : /home/keith/GDML-Test-Files/test4.gdml
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/freecad/Mod/Geant4/importGDML.py", line 72, in open
    processGDML(filename)
  File "/usr/lib/freecad/Mod/Geant4/importGDML.py", line 244, in processGDML
    gdml_parser.Read(G4String(filename))
<class 'Boost.Python.ArgumentError'>: Python argument types in
    G4String.__init__(G4String, unicode)
did not match C++ signature:
    __init__(_object*, char const*)
    __init__(_object*, G4String)
    __init__(_object*)

Where do I find out info about what I Should be using for unicode? Where do I find out what the two options True | false do on the G4Parser.Read? Where are the various G4xxxxx function calls documented? I am guessing that maybe I have to do something to the Python string to convert to a G4String

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Question on Geant4Py   (Keith Sloan - Dec 14, 12:58)
 Add Message Add Message
to: "Question on Geant4Py"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]