Forum: (Graphical) User Interfaces Not Logged In (login)
Show subscribers

Topics covering user interfaces, graphical user interfaces, and related messengers are discussed here.

The email gateway for this forum is: userinterface-g4hn@slac.stanford.edu


Inline Depth:
 0 0
 1 1
Add message: (add)

Question GUI problems in example N03  by Neoh <Neoh>,   Nov 03, 03:30
Hi,

As a newbie I have quite some things that I don't understand. I have compiled example N03 using GUIXm as GUI. In the terminal it shows this message:

You have successfully registered the following graphics systems.
Current available graphics systems are:

  ASCIITree (ATree)
  DAWNFILE (DAWNFILE)
  G4HepRep (HepRepXML)
  G4HepRepFile (HepRepFile)
  RayTracer (RayTracer)
  VRML1FILE (VRML1FILE)
  VRML2FILE (VRML2FILE)
  FukuiRenderer (DAWN)
  OpenGLImmediateX (OGLIX)
  OpenGLStoredX (OGLSX)
  OpenGLImmediateXm (OGLIXm)
  OpenGLStoredXm (OGLSXm)
  RayTracerX (RayTracerX)
  VRML1 (VRML1)
  VRML2 (VRML2)

My first question is: What are the differences between the four drivers starting with OpenGL, ie OGLIX, OGLSX, OGLIXm, and OGLSXm?

The example N03 pops out a default OGLIX window. It shows the detector and beams, but there is no panel to click on.
My second question is: Do I have to set up those control buttons myself if I want to continue using OGLIX?

So far the one driver with this interactive control capability is OGLSXm, but their panels eg rotation & panning panel just won't close when I supposedly click on the close button.
My third question is: how can I close the panels in OGLSXm after I opened them?

Thanks,


Neoh
None Re: GUI problems in example N03  by John Allison <John Allison>,   Nov 03, 04:12
Re: Question GUI problems in example N03 (Neoh)
Dear Neoh,

It is a user choice. This is because only the user can know what libraries are available on his/her machine.

So you have 4 OGL possibilities.

I = "immediate mode" - the viewer draws to the screen without storing the graphical information. This is probably best for a complex detector or a view with many trajectories because memory for graphical information can become a problem. But if you want to change views the viewer has to revisit the Geant4 kernel to regenerate the view, which can be slow.

S = "stored mode" - the viewer draws and stores. The graphical information is stored in OpenGL "display lists". It forms a sort of graphical database. These display lists are often stored in the graphics hardware so to regenerate a view, say from another viewpoint, can be very fast.

X = X windows. This window is not interactive except for picking (/vis/viewer/set/picking).

Xm = Motif, an interactive layer above X Windows. This gets you some pull down menues and interaction panels, as you have noticed.

Qt = another type of interactive layer. Currently the Geant4 driver is only available in beta release. You have to install Qt.

So for a simple detector with maximum interactivity in your case:

  /vis/open OGLSXm 600x600-0+0

(the 2nd argument (optional) places it in the top right corner, otherwise the window manager puts it where it likes.)

You can open as many viewers as you like.

I would advise against trying to close the windows and panels - we are not very good at handling such events. They will be closed when you exit Geant4.

You can use X and Xm from any session, even from a terminal. For Xm you get the interactive buttons in the viewer.

The user also has a choice of user interface, which we call a session. Again, you will see from exampleN03.cc how this choice is made - it depends on environment variables that are translated into cpp (C-pre-processor) names that are queried by the #ifdef statements. Anyway, you should arrange to instantiate only one either by editing exampleN03.cc or choosing your environment.

If you choose G4UIXm you get an interactive session and access to /gui/ commands. Again, you will see from exampleN03.cc that visTutor/gui.mac is executed for you in this case, but you could, if you like, remove that line from exampleN03.cc and execute it yourself in the command window at the bottom of the Xm session.

If you want OGLSQt you must choose a G4UIQt session (and, of course, you must have Qt installed).

I hope this helps.

None Re: GUI problems in example N03  by Neoh <Neoh>,   Nov 03, 06:01
Re: None Re: GUI problems in example N03 (John Allison)
Hi,

Thanks for the informative explanation. It helps a lot.

I see Qt is among the popular choices of interfaces. To test it out I did try to install Qt from package repository (I'm using Debian GNU/Linux), but no matter what I install it just wouldn't find QtCore when I build Geant4:

checking for qglobal.h... /usr/include/qt4/QtCore/qglobal.h
checking Qt major version... 4
checking for QtGui headers... yes
checking for QtOpenGL headers... yes
checking for QtCore library... no
checking for moc... /usr/bin/moc-qt4

Autodetection failed to locate Qt3 or Qt4 in on your system.
Please enter the path to your Qt3 OR Qt4 install (i.e. if Qt4 is installed
in PATH/include/QT, PATH/include or PATH/include/qt4, enter PATH),
or type '-' to CANCEL the build of the Qt UI module.


I've installed all packages that include qt4 or qtcore. I even symbolic link the qtcore libraries into a single directory, but it just couldn't detect it. Must I install Qt externally from Trolltech?


Regards,

Neoh
More Re: GUI problems in example N03  by garnier <garnier>,   Nov 03, 08:18
Re: None Re: GUI problems in example N03 (Neoh)
Hi,

> checking for QtOpenGL headers... yes
> checking for QtCore library... no

The includes files were found in /usr/include/qt4/...

And this message means that it had not found the libraries for Qt I don't know more about Debian, but were are located the libraries for Qt on your system ?

> I've installed all packages that include qt4 or qtcore. I even symbolic
> link the qtcore libraries into a single directory, but it just couldn't
> detect it. Must I install Qt externally from Trolltech?

No it should detect them for you.

Laurent

None Re: GUI problems in example N03  by Neoh <Neoh>,   Nov 03, 14:45
Re: More Re: GUI problems in example N03 (garnier)
I attach two installed files for libqtcore4 and libqt4-dev

   Attachment:
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2009/11/03/14.43-77893-libqt4-dev_installed.txt
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2009/11/03/14.43-71672-libqtcore4_installed.txt

Maybe you can comment on packages that should be installed that should work?
Question gui/addMenu COMMAND NOT FOUND in example N03  by Neoh <Neoh>,   Nov 02, 08:33
Hi,

After compiling and running the novice example N03, when I type "control/execute visTutor/gui.mac" it gives the following error:

/gui/addMenu file File
***** COMMAND NOT FOUND </gui/addMenu file File> *****

***** Batch is interupted!! *****

I found several threads that have similar problem to this one, I have ensured the environment variable eg G4UI_USE_XM=1 are set properly before compiling the example, but still the problem persists.

I notice another quirk which I'm not sure is causing this problem. When I type "make clean" and "make" in my <G4INSTALL>/source/interface/basic/ directory, this is what I get:

Cleaning up ...
Making dependency for file src/G4VUIshell.cc ...
Making dependency for file src/G4UIXm.cc ...
Making dependency for file src/G4UIXaw.cc ...
Making dependency for file src/G4UIWin32.cc ...
Making dependency for file src/G4UIterminal.cc ...
Making dependency for file src/G4UItcsh.cc ...
Making dependency for file src/G4UIQt.cc ...
Making dependency for file src/G4UIcsh.cc ...
Making dependency for file src/G4UIArrayString.cc ...
Compiling G4UIArrayString.cc ...
Compiling G4UIcsh.cc ...
Compiling G4UIQt.cc ...
Compiling G4UItcsh.cc ...
Compiling G4UIterminal.cc ...
Compiling G4UIWin32.cc ...
Compiling G4UIXaw.cc ...
Compiling G4UIXm.cc ...
src/G4UIXm.cc: In constructor ‘G4UIXm::G4UIXm(int, char**)’:
src/G4UIXm.cc:134: warning: deprecated conversion from string constant to ‘char*’
src/G4UIXm.cc: In member function ‘void G4UIXm::Prompt(G4String)’:
src/G4UIXm.cc:205: warning: deprecated conversion from string constant to ‘char*’
src/G4UIXm.cc: In member function ‘virtual void G4UIXm::AddMenu(const char*, const char*)’:
src/G4UIXm.cc:320: warning: deprecated conversion from string constant to ‘char*’
Compiling G4VUIshell.cc ...
Creating/replacing object files in /home/neohys/geant4/geant4.9.2.p02/lib/Linux-g++/libG4UIbasic.a ...
ar: creating /home/neohys/geant4/geant4.9.2.p02/lib/Linux-g++/libG4UIbasic.a


It still compiles, but with warnings, and I feel uneasy about it. Can anyone shed light on how to eliminate those warnings?

Thanks

Neoh
None Re: gui/addMenu COMMAND NOT FOUND in example N03  by John Allison <John Allison>,   Nov 02, 14:15
Re: Question gui/addMenu COMMAND NOT FOUND in example N03 (Neoh)
In order for the /gui/ commands to be available you have to have instantiated a graphical user interface session. You cannot, for example, find /gui/ commands from a G4UIterminal session.

Make sure you have a G4UIXm session either by editing the main program, exampleN03.cc, or unsetting environment variables that cause it to instantiate something else, e.g.,

  unset G4UI_USE_TCSH

then force re-building of your application by "make clean; make". (You will notice that exampleN03.cc is written so that if a G4UIXm session is instantiated, "/control/execute visTutor/gui.mac" is executed so you don't need to type it yourself. The fact that you typed it yourself tells me you are typing it from a non-GUI session.)

/gui/ commands (should) work with G4UIXm and G4UIQt sessions.

I hope this helps. Let us know if not.

Idea Re: gui/addMenu COMMAND NOT FOUND in example N03  by Neoh <Neoh>,   Nov 03, 02:46
Re: None Re: gui/addMenu COMMAND NOT FOUND in example N03 (John Allison)
Thanks for the quick reply. I found that my problem is twofold. Your suggestion solves the first. I do the unset

unset G4UI_USE_TCSH

and recompile the example, but it still comes out with same error. Then I found the second reason to the problem.

Previously I did a symbolic link from the binary executable to the example directory because it complained cannot run macro file if they are not in the same directory. After that I just ran the program through the symbolically linked executable. For some reasons I don't know why the symbolic link was outdated. After I redo the symbolic link the motif GUI finally appears. In other words I did not run the correct executable previously all the time.

Now I have another situation with the GUI. I post it as another thread.


Thanks,

Neoh
Question Deleting a sub-G4UIdirectory deletes the entire hierarchy  by Kevin Lynch <Kevin Lynch>,   Oct 28, 12:23
In my application, I have volumes that I allow my users to turn on and off at run time through the Messenger framework. Works fine.

For some of those volumes, there are additional commands that should be present in the command hierarchy when the volume is enabled, and which I want to remove if the volume is disabled. So in one of my messengers, I have items like the following:

void octupoleMessenger::enable_field_messenger() {
  if( ofmess_ == 0 )
    ofmess_ = new octupoleFieldMessenger(this);
}

void octupoleMessenger::disable_field_messenger() {
  if( ofmess_ != 0 ){
    // FIXME ... this deletes the entire g2MIGTRACE hierarchy!
    delete ofmess_; 
    ofmess_ = 0;
  }
}

The enable_field_messenger call works just fine ... the whole sub-hierarchy appears as expected, and all the commands in it work fine.

The problem is the disable_field_messenger() call. For testing purposes, the destructor of ofmess_ is

octupoleFieldMessenger::~octupoleFieldMessenger(){
  delete ofDirectory_;
}

now, the constructor sets up ofDirectory_ as

  ofDirectory_ = new G4UIdirectory( "/g2MIGTRACE/octupole_coil/field/" );

When the destructor is called, the directory "/g2MIGTRACE" (and all its subdirectories and commands, of course) disappears entirely!

I'm using 4.9.2.p02, but I tried this back in the 4.8 days with the same results. Incidentally, this doesn't seem to be restricted to G4UIdirectory, but to the deletion of ANY G4UIcommand.

Am I doing something wrong, or is this a bug in the library?

More PATCH: Deleting a sub-G4UIdirectory deletes the entire hierarchy  by Kevin Lynch <Kevin Lynch>,   Oct 29, 18:17
Re: Question Deleting a sub-G4UIdirectory deletes the entire hierarchy (Kevin Lynch)
Well, I got annoyed enough at this issue that I beat my head on it today, and I think I've tracked down the problem. I traced lots of code, and got myself deep into G4UIcommandTree::RemoveCommand(). The bug that causes my problem occurs when you delete a directory "command" in the commandTree; this deletes a sub tree, and the code recurses all the way back up the tree to the root, deleting all subtrees that are empty. But the test for emptiness in the release is wrong - it only looks to see if a directory has zero "real" commands in it .... directories that only had sub directories in them (such as "/gMIGTRACE/" in my application) are considered empty, and are wiped out of the commandTree. The root ("/") is spared because it is a special instance that never gets looked at, so it isn't getting obliterated.

The fix turned out to be easy; consider a directory empty only if it's REALLY empty. I've attached a patch against the 4.9.2.p02 release for inclusion in future releases. Hopefully, someone in the Geant4 collaboration will vet this for correctness and add it to the code base.

   Attachment:
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2009/10/29/18.10-70136-G4UIcommandTree.patch.txt

More Re: PATCH: Deleting a sub-G4UIdirectory deletes the entire hierarchy  by Kevin Lynch <Kevin Lynch>,   Oct 29, 20:19
Re: More PATCH: Deleting a sub-G4UIdirectory deletes the entire hierarchy (Kevin Lynch)
I've submitted a bugzilla report (1087) with the patch attached.

Warning /control/execute not working, patch needed on G4VBasicShell.cc  by Luis Cardoso <Luis Cardoso>,   Oct 10, 11:55
I'd like to report what I think to be a bug and, happily, how I solved it.

In the graphical interfaces (Xm, Qt) commands strings that match some shorter commands are trimmed and executed as those shorter commands. For example: "/control/execute some_macro.mac" does not work because anything starting with "cont" is understood as the short for "continue".
I don't understand why the terminal UI doesn't get this mess, but the culprit is
/Geant/geant4.9.2.p02/source/interfaces/common/src/G4VBasicShell.cc
which I corrected, based on
/Geant/geant4.9.2.p02/source/interfaces/basic/src/G4UIterminal.cc
by replacing:

  } else if( command(0,2) == "cd" ) {
with
  } else if( command == "cd" || command(0,3) == "cd ") { // "cd"

  } else if( command(0,4) == "help" ) {
with
  } else if( command == "help" || command(0,5) == "help ") { // "help"

  } else if( command(0,4) == "hist" ) {
with
  } else if( command == "hist" || command == "history") { // "hist/history"

  } else if( command(0,4) == "cont" ) {
with
  } else if( command == "cont" || command == "continue"){ // "cont/continue"


Hope this helps someone!

Luis
Question G4UIterminal.hh and G4UItcsh.hh  by <lindx_lzu@hotmail.com>,   Sep 26, 19:39
Hi,friends, I am a freshman in this forum, and I got some problem in the examples/N02. When I tried to make N02 after osc-g4-vis,the error of G4UIterminal.hh and G4UItcsh.hh appeared. This is the step of my making: $osc-g4-vis (in the N02 directory) $unset CPPVERBOSE $make making dependency for file exampleN02.cc ... exampleN02.cc:44:27: error: G4UIterminal.hh: no such file or directory exampleN02.cc:45:23: error: G4UItcsh.hh: no such file or directory ..... .......

I have no idea how to deal with it. Could I ask for your help? Thank you very much in advance.

Darrell

Ok Re: G4UIterminal.hh and G4UItcsh.hh  by <lindx_lzu@hotmail.com>,   Sep 28, 01:41
Re: Question G4UIterminal.hh and G4UItcsh.hh
The problem has been solved. Thank Mr.Barrand and Mr.Perl. I should close this issue.

Ok Re: G4UIterminal.hh and G4UItcsh.hh  by <lindx_lzu@hotmail.com>,   Sep 28, 01:40
Re: Question G4UIterminal.hh and G4UItcsh.hh
The problem has been solved. Thank Mr.Barrand and Mr.Perl. I should close this issue.

None Re: G4UIterminal.hh and G4UItcsh.hh  by Guy Barrand <Guy Barrand>,   Sep 27, 04:50
Re: Question G4UIterminal.hh and G4UItcsh.hh
   Hi Darrell

  In your G4 installation, did you gather all the includes of G4 in one directory ?
 I suspect no. 

  For the moment the osc-g4-vis instrumentation of a G4 example assumes in the G4 installation :
  - gathering of the G4 .h in one directory.
  - the G4 globals libs.

  See the "osc-g4-vis" page in the OpenScientist web site to have that in your G4 installation.

   Cheers. Guy

None Re: G4UIterminal.hh and G4UItcsh.hh  by <lindx_lzu@hotmail.com>,   Sep 27, 06:53
Re: None Re: G4UIterminal.hh and G4UItcsh.hh (Guy Barrand)
Hi Guy,
  thank you for your reply. But there was another big problem when I treid to do like "osc-g4-vis" page.
And when I did make includes of geant4 in the source directory,some errors there are:

  ls: cannot access CLHEP_BASE_DIR --UNDEFINED:no such file or dictory
  ../config/architecture.gmk:325:../config/sys/.gmk:no such file or dictory
  make: ***No rule to make target '../config/sys/.gmk'. Stop.
So there is always empty in the include directory. 

None G4UItcsh  by donato grassi <donato grassi>,   Sep 02, 13:03
Hi! I have installed g4.9.1.p01 on MW with MVC++9.0. When I try to compile an example with the EV G4UI_USE_TCSH set, where this setting make sense, I get the error message C2061 syntax error : identifier 'identifier'The compiler found an identifier where it wasn't expected. Someone can help me to fix this problem? Thank You in advance.

Question Qt and Geant 4.9.2 integration  by Deepak Samuel <Deepak Samuel>,   01 Apr, 2009
Hi,
I am a beginner in Geant and have just installed Geant 4.9.2 with QT driver
options turned on. I could run some of the novice examples. I would like to
know if Geant can be used in a Qt application. That is, I have a GUI designed
using Qt and I have a Opengl widget embedded in that GUI and now I want all
the Geant visualization to be output to this Widget. Is this currently possible?
 To begin with I just added the main Geant header files (and nothing else)
namely
#include "G4RunManager.hh"
#include "G4UImanager.hh"
to my Qt application and using  pro files I generated the make file. While
compiling I get the following errors :

mysim.o(.text+0x6fa): In function `global constructors keyed to _ZN5mysimC2EP7QWidget': : undefined reference to `CLHEP::HepRandom::createInstance()' mysim.o(.gnu.linkonce.t._ZNK12G4VTouchable9GetVolumeEi+0x18): In function `G4VTouchable::GetVolume(int) const': : undefined reference to `G4Exception(char const*, char const*, G4ExceptionSeverity, char const*)' mysim.o(.gnu.linkonce.t._ZNK12G4VTouchable8GetSolidEi+0x18): In function `G4VTouchable::GetSolid(int) const': : undefined reference to `G4Exception(char const*, char const*, G4ExceptionSeverity, char const*)' mysim.o(.gnu.linkonce.t._ZNK12G4VTouchable16GetReplicaNumberEi+0x18): In function `G4VTouchable::GetReplicaNumber(int) const': : undefined reference to `G4Exception(char const*, char const*, G4ExceptionSeverity, char const*)' mysim.o(.gnu.linkonce.t._ZN12G4VTouchable13MoveUpHistoryEi+0x18): In function `G4VTouchable::MoveUpHistory(int)': : undefined reference to `G4Exception(char const*, char const*, G4ExceptionSeverity, char const*)' mysim.o(.gnu.linkonce.t._ZN12G4VTouchable14UpdateYourselfEP17G4VPhysicalVolumePK19G4NavigationHistory+0x18): In function `G4VTouchable::UpdateYourself(G4VPhysicalVolume*, G4NavigationHistory const*)': : undefined reference to `G4Exception(char const*, char const*, G4ExceptionSeverity, char const*)' mysim.o(.gnu.linkonce.t._ZNK12G4VTouchable15GetHistoryDepthEv+0x18): more undefined references to `G4Exception(char const*, char const*, G4ExceptionSeverity, char const*)' follow mysim.o(.gnu.linkonce.t._ZN11G4AllocatorI15G4CountedObjectI12G4VTouchableEEC1Ev+0xc): In function `G4Allocator<G4CountedObject<G4VTouchable> >::G4Allocator()': : undefined reference to `G4AllocatorPool::G4AllocatorPool(unsigned int)' mysim.o(.gnu.linkonce.t._ZN11G4AllocatorI15G4CountedObjectI12G4VTouchableEED1Ev+0xa): In function `G4Allocator<G4CountedObject<G4VTouchable> >::~G4Allocator()': : undefined reference to `G4AllocatorPool::~G4AllocatorPool()' collect2: ld returned 1 exit status gmake: *** [mysim] Error 1

My question is there anything that I need to add to the pro files to get rid of these. Geant has provided the make files for the examples only.How do I generate a makefile, or what else is required, in a case like mine ? Thanks and Regards, Deepak Samuel.

Feedback Re: Qt and Geant 4.9.2 integration  by garnier <garnier>,   20 Apr, 2009
Re: Question Qt and Geant 4.9.2 integration (Deepak Samuel)
On Wed, 01 Apr 2009 10:57:07 GMT, Deepak Samuel wrote:
> Hi,
> I am a beginner in Geant and have just installed Geant 4.9.2 with QT driver
> options turned on. I could run some of the novice examples. I would like to
> know if Geant can be used in a Qt application. That is, I have a GUI designed
> using Qt and I have a Opengl widget embedded in that GUI and now I want all
> the Geant visualization to be output to this Widget. Is this currently possible?

Yes, this is possible with Qt since your Geant4 4.9.2 version.

>  To begin with I just added the main Geant header files (and nothing else)
> namely
> #include "G4RunManager.hh"
> #include "G4UImanager.hh"
> to my Qt application and using  pro files I generated the make file. While
> compiling I get the following errors :

It seems that your .pro file have see nothing about Geant4 headers and libraries. I don't know much about that, but I'm sure someone will know how to link .pro files against a "external" package such as Geant4. Google ?

Laurent

Question Re: Qt and Geant 4.9.2 integration  by Thomas Kluge <Thomas Kluge>,   Sep 24, 06:04
Re: Feedback Re: Qt and Geant 4.9.2 integration (garnier)
> > I would like to
> > know if Geant can be used in a Qt application. That is, I have a GUI designed
> > using Qt and I have a Opengl widget embedded in that GUI and now I want all
> > the Geant visualization to be output to this Widget. Is this currently possible?
> 
> Yes, this is possible with Qt since your Geant4 4.9.2 version.
> 

Could you please give a hint how this can be done? Or could you provide a link where this is described?

None MOMO  by Ritika Garg <Ritika Garg>,   24 Mar, 2009
In the users guide for application developers, on page 19 its mentioned that: If MOMO.jar is in your CLASSPATH, it can be run by a command: %java -jar MOMO.jar

Does the line if MOMO.jar is in your CLASSPATH mean that the path where MOMO.jar is present,should be added to the environment variable CLASSPATH? In my case MOMO.jar is in geant4/geant4.8.1.p01/environment/MOMO

Also when I give the command :echo $CLASSPATH, nothing is displayed. Does that mean that there is no variable called CLASSPATH?

None Re: MOMO  by Joseph Perl <Joseph Perl>,   27 Mar, 2009
Re: None MOMO (Ritika Garg)
If you don't often use Java, you might not have a CLASSPATH variable defined already.

It is a variable used by Java to list standard directories in which it should look for Java code. So yes, just go ahead and create this variable.

Alternatively, you can just make sure that you specify exactly where the MOMO.jar file is in your java command. So, for example, if Java is in my directory

/mydirectory/mysubdirectory/MOMO.jar

I could run it with:

java -jar /mydirectory/mysubdirectoryMOMO.jar

Question GUI problem in Geant 4.9.1 on Suse Linux 11.0  by M Tariq Siddique <M Tariq Siddique>,   10 Sep, 2008
i am new in geant4 users. i have install the Geant4.9.1 code on suse linux 11.0 with motif (xm enabled) successfully. it gave no errors. later when i compile and execute the exampleN03 to observe the GUI it run with simple UIterminal. during run it gives the list of registered graphic system which is given below.

You have successfully registered the following graphics systems.
Current available graphics systems are:
  ASCIITree (ATree)
  DAWNFILE (DAWNFILE)
  G4HepRep (HepRepXML)
  G4HepRepFile (HepRepFile)
  RayTracer (RayTracer)
  VRML1FILE (VRML1FILE)
  VRML2FILE (VRML2FILE)
  OpenGLImmediateX (OGLIX)
  OpenGLStoredX (OGLSX)
  OpenGLImmediateXm (OGLIXm)
  OpenGLStoredXm (OGLSXm)
  RayTracerX (RayTracerX)

and when i try to run the gui.mac manually it gives following message

Idle> /control/execute visTutor/gui.mac /control/execute visTutor/gui.mac

#
# This file permits to customize, with commands,
# the menu bar of the G4UIXm, G4UIWin32 sessions.
# It has no effect with G4UIterminal.
#
# File :
/gui/addMenu file File ***** COMMAND NOT FOUND </gui/addMenu file File> *****

***** Batch is interupted!! *****

can some one tell me what is the problem and how to solve it for a working gui

None Re: GUI problem in Geant 4.9.1 on Suse Linux 11.0  by John Allison <John Allison>,   11 Sep, 2008
Re: Question GUI problem in Geant 4.9.1 on Suse Linux 11.0 (M Tariq Siddique)
As visTutor/gui.mac says, it for "G4UIXm, G4UIWin32 sessions. It has no effect with G4UIterminal." As you can see from exampleN03.cc, a G4UIXm session is started only if G4UI_USE_XM is defined*, in which case it also executes visTutor/gui.mac

1) Before compiling and building exampleN03, did you set your environment as specified in the Installation Guide?

2) Did you reply "yes" to the question posed by Configure when it asked if you wanted an Xm GUI? If not, the problem will be that the G4UIXm session will not have been built, so simply setting G4UI_USE_XM will not work (you may, of course, try). You may have to rebuild Geant4.

* With the standard Geant4 make system, setting an environment variable such as G4UI_USE_XM causes a C-pre-processor flag of the same name to be set. It is the latter that is used in the C++ code, as in exampleN03.cc.

More Re: GUI problem in Geant 4.9.1 on Suse Linux 11.0  by M Tariq Siddique <M Tariq Siddique>,   11 Sep, 2008
Re: None Re: GUI problem in Geant 4.9.1 on Suse Linux 11.0 (John Allison)
here is the config.sh file (given below) which i use to build the geant4 first time. i have set the 'g4ui_build_xm_session', 'g4ui_use_xm' and 'g4vis_build_openglxm_driver' as 'yes' during building the config.sh file and then build the geant4 code using same config.sh file. is there something additional need to be done to build the GUIXm session.

#!/bin/sh
#
# This file was produced by running the Configure script. It holds all the
# definitions figured out by Configure. Should you modify one of these values,
# do not forget to propagate your changes by running "Configure -der". You may
# instead choose to run each of the .SH files by yourself, or "Configure -S".
#

# Package name      : g4conf
# Source directory  : .
# Configuration time: Thu Oct 18 10:49:10 PKT 2007
# Configured by     : tariq
# Target system     : linux n11pc-205 2.6.18.8-0.5-default #1 smp fri jun 22 12:17:53 utc 2007 i686 i686 i386 gnulinux 

Author='' Date='' Header='' Id='' Locker='' Log='' RCSfile='' Revision='' Source='' State='' c='' cf_by='tariq' cf_time='Thu Oct 18 10:49:10 PKT 2007' contains='grep' d_portable='undef' eunicefix=':' g4_gmake='y' g4_gmake_version='GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

This program built for i686-pc-linux-gnu' g4_make='y' g4_make_version='GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

This program built for i686-pc-linux-gnu' g4base='' g4bin='' g4clhep_base_dir='/usr/local/geant4/CLHEP' g4clhep_include_dir='/usr/local/geant4/CLHEP/include' g4clhep_lib='CLHEP' g4clhep_lib_dir='/usr/local/geant4/CLHEP/lib' g4compiler='g++' g4conf='/usr/local/geant4/geant4.9.1.p02/.config/bin/Linux-g++' g4data='/usr/local/geant4/data' g4debug='n' g4elasticdata='' g4final_install='/usr/local/geant4/geant4.9.1.p02' g4global='n' g4granular='y' g4include='' g4includes_flag='n' g4install='/usr/local/geant4/geant4.9.1.p02' g4ledata='/usr/local/geant4/data/G4EMLOW5.1' g4levelgammadata='/usr/local/geant4/data/PhotonEvaporation2.0' g4lib='/usr/local/geant4/geant4.9.1.p02/lib' g4lib_build_shared='n' g4lib_build_static='y' g4lib_use_dll='' g4lib_use_dyn='' g4lib_use_granular='y' g4lib_use_shared='n' g4lib_use_static='n' g4make='gmake' g4neutronhpcrosssections='/usr/local/geant4/data/G4NDL3.12' g4osname='Linux' g4radioactivedata='/usr/local/geant4/data/RadioactiveDecay3.2' g4system='Linux-g++' g4tmp='/usr/local/geant4/geant4.9.1.p02/tmp' g4ui_build_gag_session='y' g4ui_build_terminal_session='y' g4ui_build_win32_session='n' g4ui_build_xaw_session='n' g4ui_build_xm_session='y' g4ui_use_gag='y' g4ui_use_tcsh='y' g4ui_use_terminal='y' g4ui_use_win32='n' g4ui_use_xaw='n' g4ui_use_xm='y' g4ui_xawflags='' g4ui_xawhome='' g4ui_xawlibs='' g4vis_build_asciitree_driver='y' g4vis_build_dawn_driver='n' g4vis_build_dawnfile_driver='y' g4vis_build_oiwin32_driver='n' g4vis_build_oix_driver='n' g4vis_build_openglwin32_driver='n' g4vis_build_openglx_driver='y' g4vis_build_openglxm_driver='y' g4vis_build_raytracer_driver='y' g4vis_build_raytracerx_driver='y' g4vis_build_vrml_driver='n' g4vis_build_vrmlfile_driver='y' g4vis_oglhome='' g4vis_oivhome='' g4vis_use_asciitree='y' g4vis_use_dawn='n' g4vis_use_dawnfile='y' g4vis_use_oiwin32='n' g4vis_use_oix='n' g4vis_use_openglwin32='n' g4vis_use_openglx='y' g4vis_use_openglxm='y' g4vis_use_raytracer='y' g4vis_use_raytracerx='y' g4vis_use_vrml='n' g4vis_use_vrmlfile='y' g4vis_xmflags='' g4vis_xmflags='' g4vis_xmhome='' g4vis_xmhome='' g4vis_xmlibs='' g4vis_xmlibs='' g4w_use_g3tog4='n' g4w_use_zlib='n' g4wanalysis_build='' g4wanalysis_build_jas='' g4wanalysis_build_lab='' g4wanalysis_build_lizard='' g4wanalysis_use='n' g4wanalysis_use_jas='' g4wanalysis_use_lab='' g4wanalysis_use_lizard='' g4wlib_build_g3tog4='n' g4wlib_build_zlib='n' g4workdir='/usr/local/geant4/geant4.9.1.p02' hint='recommended' lns='/bin/ln -s' myuname='linux n11pc-205 2.6.18.8-0.5-default #1 smp fri jun 22 12:17:53 utc 2007 i686 i686 i386 gnulinux ' n='-n' osname='linux' osvers='2.6.18.8-0.5-default' package='g4conf' sh='/bin/sh' sharpbang='#!' shsharp='true' spackage='' spitshell='cat' src='.' startsh='#!/bin/sh' CONFIG=true

None Re: GUI problem in Geant 4.9.1 on Suse Linux 11.0  by John Allison <John Allison>,   12 Sep, 2008
Re: More Re: GUI problem in Geant 4.9.1 on Suse Linux 11.0 (M Tariq Siddique)
The build looks OK. Did you set your environment before compiling and building exampleN03 (question no. 1 of my previous reply)? To check your environment, in particular to check that G4UI_USE_XM has been set, printenv.

More Re: GUI problem in Geant 4.9.1 on Suse Linux 11.0  by M Tariq Siddique <M Tariq Siddique>,   14 Sep, 2008
Re: None Re: GUI problem in Geant 4.9.1 on Suse Linux 11.0 (John Allison)
i think yes when i type the printenv the following enviornment setting is displayed where it showes G4UI_USE_XM=1, you can also see below in detail.


muhammad@linux-Suse:/usr/local/geant4/geant4.9.1.p02> printenv
CLHEP_LIB_DIR=/usr/local/geant4/CLHEP/lib
G4LEVELGAMMADATA=/usr/local/geant4/data/PhotonEvaporation2.0
LESSKEY=/etc/lesskey.bin
INFODIR=/usr/local/info:/usr/share/info:/usr/info
MANPATH=/usr/local/man:/usr/local/share/man:/usr/share/man
NNTPSERVER=news
SSH_AGENT_PID=3469
HOSTNAME=linux-Suse
DM_CONTROL=/var/run/xdmctl
XKEYSYMDB=/usr/share/X11/XKeysymDB
G4INSTALL=/usr/local/geant4/geant4.9.1.p02
HOST=linux-Suse
SHELL=/bin/bash
TERM=xterm
PROFILEREAD=true
HISTSIZE=1000
XDM_MANAGED=/var/run/xdmctl/xdmctl-:0,maysd,mayfn,sched,rsvd,method=classic,auto
XDG_SESSION_COOKIE=7a0501a6c921a52616ec2e64484e7035-1221463729.666233-498518878
TMPDIR=/tmp
GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/usr/share/themes//QtCurve/gtk-2.0/gtkrc:/home/muhammad/.gt
krc-2.0-qtengine:/home/muhammad/.gtkrc-2.0
GS_LIB=/home/muhammad/.fonts
WINDOWID=25165832
MORE=-sl
QTDIR=/usr/lib/qt3
XSESSION_IS_UP=yes
KDE_FULL_SESSION=true
G4LEDATA=/usr/local/geant4/data/G4EMLOW5.1
GROFF_NO_SGR=yes
JRE_HOME=/usr/lib/jvm/jre
USER=muhammad
http_proxy=http://172.30.10.10:3128
LD_LIBRARY_PATH=:/usr/local/geant4/CLHEP/lib:/usr/local/geant4/CLHEP/lib
XMFLAGS= -I/include
LS_COLORS=no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:o
r=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:
*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00
;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00
;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.j
peg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;3
5:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01
;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:
DESKTOP_LAUNCH=kde-open
XNLSPATH=/usr/share/X11/nls
XMLIBS= -L/lib -lXm -lXpm
G4UI_BUILD_XM_SESSION=1
ENV=/etc/bash.bashrc
SSH_AUTH_SOCK=/tmp/ssh-GlOeu3298/agent.3298
G4NEUTRONHPDATA=/usr/local/geant4/data/G4NDL3.12
HOSTTYPE=i386
G4VIS_BUILD_OPENGLX_DRIVER=1
ftp_proxy=http://172.30.10.10:3128
FTP_PROXY=http://172.30.10.10:3128
SESSION_MANAGER=local/linux-Suse:@/tmp/.ICE-unix/3675,unix/linux-Suse:/tmp/.ICE-unix/3675
G4RADIOACTIVEDATA=/usr/local/geant4/data/RadioactiveDecay3.2
FROM_HEADER=
G4ABLADATA=/usr/local/geant4/data/G4ABLA3.0
PAGER=less
CSHEDIT=emacs
XDG_CONFIG_DIRS=/etc/xdg
KONSOLE_DCOP=DCOPRef(konsole-3694,konsole)
MINICOM=-c on
MAIL=/var/spool/mail/muhammad
PATH=/opt/kde3/bin:/home/muhammad/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/b
in:/usr/games:/usr/lib/jvm/jre/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/lib/qt3/bin:/home
/muhammad/geant4/bin/Linux-g++
DESKTOP_SESSION=default
G4LIB=/usr/local/geant4/geant4.9.1.p02/lib
CPU=i686
G4VIS_BUILD_RAYTRACERX_DRIVER=1
JAVA_BINDIR=/usr/lib/jvm/jre/bin
KDM_AUTOLOGIN=muhammad
G4VIS_BUILD_OPENGLXM_DRIVER=1
KONSOLE_DCOP_SESSION=DCOPRef(konsole-3694,session-1)
INPUTRC=/home/muhammad/.inputrc
PWD=/usr/local/geant4/geant4.9.1.p02
JAVA_HOME=/usr/lib/jvm/jre
XMODIFIERS=@im=local
G4LIB_BUILD_STATIC=1
CLHEP_BASE_DIR=/usr/local/geant4/CLHEP
LANG=en_US.UTF-8
KDE_SESSION_UID=1000
PYTHONSTARTUP=/etc/pythonstart
G4UI_USE_XM=1
https_proxy=http://172.30.10.10:3128
HTTPS_PROXY=http://172.30.10.10:3128
G4VIS_USE_OPENGLX=1
SSH_ASKPASS=/usr/lib/ssh/x11-ssh-askpass
G4UI_USE_TCSH=1
TEXINPUTS=:/home/muhammad/.TeX:/usr/share/doc/.TeX:/usr/doc/.TeX
G4LIB_USE_GRANULAR=1
G4VIS_USE_RAYTRACERX=1
CLHEP_INCLUDE_DIR=/usr/local/geant4/CLHEP/include
QT_SYSTEM_DIR=/usr/share/desktop-data
HOME=/home/muhammad
SHLVL=2
G4SYSTEM=Linux-g++
LESS_ADVANCED_PREPROCESSOR=no
OSTYPE=linux
XAWLIBS=
LS_OPTIONS=-N --color=tty -T 0
XCURSOR_THEME=DMZ
no_proxy=localhost, 127.0.0.1
WINDOWMANAGER=/usr/bin/startkde3
HTTP_PROXY=http://172.30.10.10:3128
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-15,CP1252
LESS=-M -I
MACHTYPE=i686-suse-linux
LOGNAME=muhammad
CVS_RSH=ssh
XDG_DATA_DIRS=/usr/share:/etc/opt/kde3/share:/opt/kde3/share
G4WORKDIR=/home/muhammad/geant4
LESSOPEN=lessopen.sh %s
USE_FAM=
INFOPATH=/usr/local/info:/usr/share/info:/usr/info
DISPLAY=:0
G4VIS_USE_OPENGLXM=1
CLHEP_LIB=CLHEP
XAUTHLOCALHOSTNAME=linux-Suse
XAWFLAGS=
LESSCLOSE=lessclose.sh %s %s
G_BROKEN_FILENAMES=1
JAVA_ROOT=/usr/lib/jvm/jre
COLORTERM=
_=/usr/bin/printenv

None Re: GUI problem in Geant 4.9.1 on Suse Linux 11.0  by John Allison <John Allison>,   15 Sep, 2008
Re: More Re: GUI problem in Geant 4.9.1 on Suse Linux 11.0 (M Tariq Siddique)
Your environment looks fine. As you can see from inspecting the code in exampleN03.cc, it *should* instantiate the G4UIXm session, which is a separate window, and execute the gui.mac. So something strange is happening. All I can ask you to do is investigate further yourself, by debugging with gdb or putting print statements in.

To be absolutely sure everything's clean, maybe you should re-install and re-build everything, being careful not to change the Geant4 environment at any time. (You get undefine behaviour if you change environment between building Geant4 libraries and building your application. Maybe that's the problem?)

Sorry not to be more helpful.

None geant4 and GUIRoot compilation error on MacOS X 10.5  Keywords: Cristian Bungau
by Cristian Bungau <Cristian Bungau>,   19 Apr, 2008

Hi,

When I compile my code (using Geant4.9.1.p01 and root 5.19) (on MacOSX 10.5) I get the following error:

Linking exampleN03 ...
Undefined symbols:
  "non-virtual thunk to G4RootTextFrame::ShowMembers(TMemberInspector&, char*)", referenced from:
      vtable for G4RootTextFramein libG4UIROOT.a(G4RootTextFrame.o)
  "G4RootMainFrame::Class()", referenced from:
      G4RootMainFrame::IsA() const in libG4UIROOT.a(G4RootMainFrame.o)
  "ROOT::GenerateInitInstance(G4RootMainFrame const*)", referenced from:
      __static_initialization_and_destruction_0(int, int)in libG4UIROOT.a(G4RootMainFrame.o)
  "non-virtual thunk to G4RootMainFrame::Streamer(TBuffer&)", referenced from:
      vtable for G4RootMainFramein libG4UIROOT.a(G4RootMainFrame.o)
  "ROOT::GenerateInitInstance(G4RootTextFrame const*)", referenced from:
      __static_initialization_and_destruction_0(int, int)in libG4UIROOT.a(G4RootTextFrame.o)
  "G4RootMainFrame::Streamer(TBuffer&)", referenced from:
      vtable for G4RootMainFramein libG4UIROOT.a(G4RootMainFrame.o)
  "G4RootTextFrame::ShowMembers(TMemberInspector&, char*)", referenced from:
      vtable for G4RootTextFramein libG4UIROOT.a(G4RootTextFrame.o)
  "non-virtual thunk to G4RootTextFrame::Streamer(TBuffer&)", referenced from:
      vtable for G4RootTextFramein libG4UIROOT.a(G4RootTextFrame.o)
  "G4RootTextFrame::Streamer(TBuffer&)", referenced from:
      vtable for G4RootTextFramein libG4UIROOT.a(G4RootTextFrame.o)
  "G4RootMainFrame::ShowMembers(TMemberInspector&, char*)", referenced from:
      vtable for G4RootMainFramein libG4UIROOT.a(G4RootMainFrame.o)
  "non-virtual thunk to G4RootMainFrame::ShowMembers(TMemberInspector&, char*)", referenced from:
      vtable for G4RootMainFramein libG4UIROOT.a(G4RootMainFrame.o)
  "G4RootTextFrame::Class()", referenced from:
      G4RootTextFrame::IsA() const in libG4UIROOT.a(G4RootTextFrame.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [/Users/cristian/geant4/bin/Darwin-g++/DarkMatter] Error 1

I would be very grateful if you could please let me know how to solve this.

Thanks,

Cristian

None The GUI problem of N03  Keywords: GUI
by <yfdeng@student.dlut.edu.cn>,   31 Mar, 2008

Hello, 
   I have a problem with the example N03. When I run the N03 first time, the program can get the GUI 
window and I can use it to control the program. Then I stop the program by the command "exit" in Idel state. 
But, it very disappointting that there is no a GUI window when I compile and run the N03 again. And I try to 
run the file "gui.mac" manually, but the system give a error as "***** COMMAND NOT FOUND </gui/addMenu> *****". 
The same error is given to other gui command.
   Who knows the reasons fot the problem? Can you help me? Thank you very much!

None Re: The GUI problem of N03  Keywords: GUI
by <yfdeng@student.dlut.edu.cn>,   06 Apr, 2008
Re: None The GUI problem of N03

Thank you very much! My problem has been resolved.

None Re: The GUI problem of N03  Keywords: GUI
by John Allison <John Allison>,   31 Mar, 2008
Re: None The GUI problem of N03

It can only be that the environment has changed. Use "Configure" to make a script - env.sh or env.csh - that you source (e.g., "source env.sh") before compiling your code. That ensures N03 is compiled with the same environment that was used to compile Geant4 itself. If you change any environment variable you must recompile any code that depends on it - this is a general rule. The file exampleN03.cc contains much that depends on C-preprocessor macros, such as G4UI_USE_XM, that in turn depend, via the makefiles, on the same-named environment variable.

None How to create ASCII output?  Keywords: ASCII
by Anil <Anil>,   14 Dec, 2007

Hello, I started using GEANT newly. Can I request you to tell me how to store the output of an example application in ASCII file?

None Re: How to create ASCII output?  Keywords: ASCII
by John Allison <John Allison>,   14 Dec, 2007
Re: None How to create ASCII output? (Anil)

Anything you write to G4cout, e.g.,

  G4cout << "Hello" << G4endl;

goes to the UI terminal. If you have specified G4UIterminal, this is the normal terminal from which you start your Geant4 job. In principle, therefore, you can capture the output with

  $ script
  $ exampleN02
  $ exit

(See "man script" for the manual that explains how script works.)

However, if, like me, you want particular information in a separate file, in your BeginOfRunAction you could open a file, then in your EndOfEventAction, write something to it, then close it in your EndOfRunAction. I have an "analysis manager" that handles the file opening, writing and closing as required by the above actions; the analysis manager is a "singleton" that simplyfies access from the different action classes. How to create actions is described in the documentation. examples/extended/analysis/A01 shows how to make a singleton analysis manager, It uses AIDA, but you could just use a file.

None Re: How to create ASCII output?  Keywords: ASCII
by David Oxley <David Oxley>,   16 Dec, 2007
Re: None Re: How to create ASCII output? (John Allison)

I have exactly the same problem and have tried to do what you just suggested, but struggled. Please forgive the stupid question as my programming is not very good:

how is it that the output file stream is recognized by all three of these functions?

Does it need to be passed back and forth between all three, or is it in some way globally defined?

Thanks for your patience

None Re: How to create ASCII output?  Keywords: ASCII
by John Allison <John Allison>,   16 Dec, 2007
Re: None Re: How to create ASCII output? (David Oxley)

Right! OK!

These issues are more to do with C++ and object oriented programming than with Geant4.

Creating an analysis manager is a way of being object oriented. In any function you can (using A01 as an example)

  A01AnalysisManager* am = A01AnalysisManager::GetInstance();
  am-><any-public-method-or-data-member-of-A01AnalysisManager>

So it's then up to you to write methods (functions) of the analysis manager or give access to data of the analysis manager that you want.

If you want to avoid the overheads of all this, C and C++ allows you to define a global object, say, myfile:

  #include <fstream>
  using namespace std;
  ofstream myfile("myfilename");

at the top before any functions, methods, etc., and use it

  myfile << whatever << endl;

anywhere. If you want to write to the same file with code that is in more than one C++ source file, put the above in one file, where the first output will come from, and

  #include <fstream>
  using namespace std;
  extern ofstream myfile;

in every other source file. This is allowed in C and C++, but it's generally thought to be bad practice to have global objects (you might get a confusion of names).

Another point is: one usually wants to postpone the decision about writing until the end of the event. I typically put stuff, e.g., energy deposited in each step, in containers in the analysis manager, then in EndOfEventAction write it all out if the event passes some selection criterion. If you really want to do this the proper way you should create hits (see examples/novice/N03 and following) and dump them to file in EndOfEventAction if you want, or even more professionaly, use Geant4 persistency classes. Hits have the advantage they can be viewed if you write a Draw method.

None Re: How to create ASCII output?  Keywords: ASCII
by David Oxley <David Oxley>,   17 Dec, 2007
Re: None Re: How to create ASCII output? (John Allison)

Thanks very much , that has (at least temporarily) solved my problem.

just out of interest, what are the consequences of the extern command? i.e. is there something I need to be aware of if it is bad practice?

I have some hit methods...draw, print. and one that writes to file now.

I dont quite understand your last point (sorry). I have hits, and some hit methods, draw, print.. and now a store (file dump).

I am just still using the global variable to dictate the stream.

Why is that bad practice?

Either way thank you very much for your help and patience. That has really helped me.

Dave

None Re: How to create ASCII output?  Keywords: ASCII
by Anil <Anil>,   02 Feb, 2008
Re: None Re: How to create ASCII output? (David Oxley)

Thanks alot. I could successfuly create an ASCII file.

Question problem linking G4Sample Openscientist package  by Emanuele Santovetti <emanuele.santovetti@roma2.infn.it>,   09 Oct, 2007

Dear geant4 users, compiling the OpenScientist geant4 interface (G4Sample), in the link phase I got the error: /home/santovet/OpenScientist/v16r1/G4Lab/v8r1p0/bin_obuild/libG4LabCore.so: undefined reference to `Geant4_SoAlternateRepAction::getGenerate() const' /home/santovet/OpenScientist/v16r1/G4Lab/v8r1p0/bin_obuild/libG4LabCore.so: undefined reference to `Geant4_SoAlternateRepAction::getClassTypeId()'. I installed and compiled geant4 with the OpenInventor graphic interface apparently without any error and OpenInventor seems to work properly on my machine (linux fc7). Has anybody some ideas to suggest? Thanks in advance, Emanuele Santovetti.

None Re: problem linking G4Sample Openscientist package  by Guy Barrand <Guy Barrand>,   15 Oct, 2007
Re: Question problem linking G4Sample Openscientist package (Emanuele Santovetti)
 After offline exchanges, it appears that Emanuele wants
to create an interactive environment over its G4 simulation
by using the OpenScientist way of doing.

 For that, the best is to follow instructions in the
section "Working with Geant4" in the OpenScientist pages
that had been added at the 16.1 release.

 In particular this section explains how to create such 
application by using a osc_vis (binary) kit and also
CLHEP and G4 installed in a usual standalone way (and
then not coming with an OpenScientist "all in one" 
osc_g4 kit).
Question Output text problem?  Keywords: G4cin, G4cout
by John <calculus7@gmail.com>,   29 Sep, 2007

I'm writing a program to take custom input from a user, just like with the standard cin and cout of C++. I tried using G4cout and G4cin in my RunAction class and in main. Both times I did not see the prompting text (i.e., the text I want to display using G4cout). When I tried to simulate, Geant4 started up and then halted with a blinking cursor. I realized that it was waiting for my input (G4cin) but strangely enough it had skipped my G4cin commands that came before it! Once I had entered in all the G4cin prompts the program finally showed the G4cout text. I just learned how to use messenger classes and I know that I could also use macros, but I really don't want to do that. I just want a simple input/output interface that a standard user (i.e., my professor) could use. I would appreciate any help on this matter. Thanks!

Warning Parameter range: operator * is not supported in G4UIcommand  Keywords: Parameter range: operator * is not supported in G4UIcommand
by Lam YiHua <LamYiHua@gmail.com>,   24 Jan, 2007

dear folks,

DMXDetectorMessenger::DMXDetectorMessenger
   (DMXDetectorConstruction* DC):detectorConstruction(DC) {
...
...
  EKineCutCmd->SetRange("ECut>=250.0*eV");
  RoomEKineCutCmd->SetRange("ECut>=250.0*eV");
...
...

Remove * in these two syntax

  EKineCutCmd->SetRange("ECut>=250.0*eV");
  RoomEKineCutCmd->SetRange("ECut>=250.0*eV");

else you will get error message Parameter range: operator * is not supported.

***** Illegal parameter (99) <XXX/MinEnergyCut  0.001 MeV>*****
***** Command ignored *****

regards,

YiHua

Question GAG and codepage problem  Keywords: encoding GAG
by Alain Ferragut <Alain Ferragut>,   14 Dec, 2006

Hi ! It seems that now, Red Hat Linux is using UTF-8 as codepage encoding. I have problems with french characters such as ŕ, é ...etc They are displayed by ugly squares in GAG graphical output. What can I do ??? thanks... Alain

None Re: GAG and codepage problem  Keywords: encoding GAG
by Alain Ferragut <Alain Ferragut>,   15 Dec, 2006
Re: Question GAG and codepage problem (Alain Ferragut)

I finally succeeded ! In my text editor, I had to save the C++ files with UTF-8 format, and re-compile my application. If this helps...

None /gun command directory disappearing  Keywords: gun, command, UI
by Jonathan <Jonathan>,   28 Sep, 2006

Hi all. Hopefully this is an easy one I am missing. When I first start the simulation, my default /gun UI directory is present and normal. After I execute once, it disappears. Therefore, all of my subsquent /gun commands I try to issue are invalid. I don't know what could be causing this. I didn't think the /gun commands were state dependent, and I haven't had this problem in other simulations. I have not defined my own messenger classes either, just wanted to rely on the default ones. Any help would be greatly appreciated!

Jon

None Re: /gun command directory disappearing  Keywords: gun, command, UI
by Makoto Asai <Makoto Asai>,   30 Sep, 2006
Re: None /gun command directory disappearing (Jonathan)
Please confirm your PrimaryGeneratorAction. You might 
delete G4ParticleGun. UI commands under "/gun" are
defined with G4ParticleGun and deleted along the deletion
of G4ParticleGun.
None Running my project and output to ROOT  Keywords: ROOT
by <huikinglam02@hotmail.com>,   20 Jul, 2006

Hello, this is the first time I am here I have written a code in Geant4.8.0.p01, and part of the code is to output the track information into a ROOT Tree. However, when I tried to make the file, it said to me the following error:

LINK: fatal error LNK1181: cannot open input file 'libMinuit.a'
I am using the Windows XP newest version of ROOT.And I believe I am configured all the necessary environment, like setting G4UI_ROOT to 1, and have included the libraries. Thanks for your help

None G4UIRoot w/ Root5.11 and Geant4.8.0.p01  by <jmorris@slac.stanford.edu>,   29 Jun, 2006
Has anyone got this combonation to work:

G4UIRoot, Root5.11, Geant4.8.0.p01

I'm having a hell of a time.  Currently I'm getting this error when I
try and compile an example:

/home/jmorris/geant4/geant4.8.0.p01/lib/Linux-g++/libG4UIROOT.so: undefined reference to `TGCompositeFrame::SetEditDisabled(bool)'
collect2: ld returned 1 exit status
make: *** [/home/jmorris/geant4/bin/Linux-g++/exampleN01] Error 1


What is the general procedure to debug this error? Is it an environment
variable missing?  Is it a configuration problem?

Thanks

Here's my environment:
On this machine the G4SYSTEM=Linux-g++
On this machine the G4INSTALL=/home/jmorris/geant4/geant4.8.0.p01
On this machine the G4INCLUDE=/home/jmorris/geant4/geant4.8.0.p01/include
On this machine the G4TMP=/home/jmorris/geant4/geant4.8.0.p01/tmp
On this machine the G4LIB=/home/jmorris/geant4/geant4.8.0.p01/lib
On this machine the G4LEVELGAMMADATA=/home/jmorris/geant4/geant4.8.0.p01/data/PhotonEvaporation
On this machine the G4RADIOACTIVEDATA=/home/jmorris/geant4/geant4.8.0.p01/data/RadiativeDecay
On this machine the G4LEDATA=/home/jmorris/geant4/geant4.8.0.p01/data/G4EMLOW3.0
On this machine the NeutronHPCrossSections=/home/jmorris/geant4/geant4.8.0.p01/data/G4NDL3.7
On this machine the G4ELASTICDATA=/home/jmorris/geant4/geant4.8.0.p01/data/G4ELASTIC1.1
On this machine the CLHEP_BASE_DIR=/usr/local
On this machine the CLHEP_INCLUDE_DIR=/usr/local/include
On this machine the CLHEP_LIB_DIR=/usr/local/lib
On this machine the CLHEP_LIB=CLHEP
On this machine the G4UI_BUILD_ROOT_SESSION=1
On this machine the G4UI_USE_ROOT=1
On this machine the G4VIS_BUILD_OPENGLX_DRIVER=1
On this machine the G4VIS_BUILD_OPENGLXM_DRIVER=1
On this machine the G4VIS_USE_OPENGLX=1
On this machine the G4VIS_USE_OPENGLXM=1
On this machine the G4LIB_BUILD_SHARED=1
On this machine the G4LIB_USE_GRANULAR=1
export ROOTSYS="/home/jmorris/geant4/root"
export PATH=$ROOTSYS/bin:$PATH
export LD_LIBRARY_PATH="/usr/local/lib:/usr/X11R6/lib64:/usr/X11R6/lib:$ROOTSYS/lib"
export LIBRARY_PATH="/usr/local/lib:/usr/X11R6/lib64"
None G4VVisPrim in Geant4.7.1 and G4VVisManager in Geant4.8.0  Keywords: G4VVisPrim G4VVisManager
by <zhongwl@ihep.ac.cn>,   29 Mar, 2006

Hello,

It seems that there is no Class G4VVisPrim in Geant4.8.0 any more. However there is a new class G4VVismanager in source/graphics_reps. Is it the replacer of G4VVisPrim in Geant4.7.1? But the G4VVisPrim is inherited from G4Visible, and G4VVisManager is inherited from G4VisManager.

The Class G4Polyhedron is inherited from G4Visible in Geant4.8.0, however it is inherited from G4VVisPrim in Geant4.7.1. If I want to modify a class inherited from G4Polyhedron of Geant4.8.0 which was inherited from G4Polyhedron of Geant4.7.1 before, what should I do? If my class is only inherite from G4Polyhedron, the visulization doesn't work. Need I let the class derive both from G4Polyhedron and G4VVisManager?

Thank you.

None Re: G4VVisPrim in Geant4.7.1 and G4VVisManager in Geant4.8.0  Keywords: G4VVisPrim G4VVisManager
by John Allison <John Allison>,   30 Mar, 2006
Re: None G4VVisPrim in Geant4.7.1 and G4VVisManager in Geant4.8.0

G4VVisPrim was removed for the sake of clarity. It was not doing anything and was not used. The class structure used to be

  G4Visible <- G4VVisPrim <- G4Polyhedron

but it is now

  G4Visible <- G4Polyhedron

If you inherit from G4Polyhedron, there should be no problem, except, of course, you should remove any reference to G4VVisPrim in your class, for example in an assignment operator.

I am intrigued to know why and how you are extending G4Polyhedron by inheritance. What is your motive?

Let us know if you continue to have problems.

None Re: G4VVisPrim in Geant4.7.1 and G4VVisManager in Geant4.8.0  Keywords: G4VVisPrim G4VVisManager
by <zhongwl@ihep.ac.cn>,   30 Mar, 2006
Re: None Re: G4VVisPrim in Geant4.7.1 and G4VVisManager in Geant4.8.0 (John Allison)

Thank you for your reply.

In the simulation package I have now, there is a class (pmtEllipsoid) inherited from G4CSGSolid. It is used to construct a new ellipsoid solid to describe the geometry of a PMT. In order to create a Polyhedron object in the method G4Polyhedron *CreatPolyhedron() with the new ellipsoid shape:

G4Polyhedron* pmtEllipsoid::CreatePolyhedron () const
{
    return new pmtPolyhedronEllipsoid (fRx, fRy, fRz, fZCut1, fZCut2);
}

Another class which is inherited from G4Polyhedron is defined in class pmtEllipsoid:

class pmtPolyhedronEllipsoid : public G4Polyhedron {
 public:
  pmtPolyhedronEllipsoid(G4double rx, G4double ry, G4double rz, G4double ZCut1,
                        G4double ZCut2);
  virtual G4Visible& operator=(const G4Visible &from)
    { return G4Visible::operator = (from); }
  virtual G4VVisPrim& operator=(const G4VVisPrim &from)
    { return G4VVisPrim::operator = (from); }
};

pmtPolyhedronEllipsoid::pmtPolyhedronEllipsoid(G4double rx, G4double ry,
                                             G4double rz, G4double ZCut1,
                                             G4double ZCut2)
{
........
}

According to your explain, is it enough to get rid of the two lines code?

  virtual G4VVisPrim& operator=(const G4VVisPrim &from)
    { return G4VVisPrim::operator = (from); }

None Re: G4VVisPrim in Geant4.7.1 and G4VVisManager in Geant4.8.0  Keywords: G4VVisPrim G4VVisManager
by John Allison <John Allison>,   31 Mar, 2006
Re: None Re: G4VVisPrim in Geant4.7.1 and G4VVisManager in Geant4.8.0

Yes, it is enough to eliminate the two lines that refer to G4VVisPrim. You may also remove the other assignment operator.

It is not mandatory to extend G4Polyhedron for each new solid. You may use the generic construction function HepPolyhedron::createPolyhedron, as, for example, for G4Tet:

  G4Polyhedron* G4Tet::CreatePolyhedron () const {
    G4Polyhedron *ph=new G4Polyhedron;
    G4double xyz[4][3];
    static G4int faces[4][4]={{1,3,2,0},{1,4,3,0},{1,2,4,0},{2,3,4,0}};
    xyz[0][0]=fAnchor.x(); xyz[0][1]=fAnchor.y(); xyz[0][2]=fAnchor.z();
    xyz[1][0]=fP2.x(); xyz[1][1]=fP2.y(); xyz[1][2]=fP2.z();
    xyz[2][0]=fP3.x(); xyz[2][1]=fP3.y(); xyz[2][2]=fP3.z();
    xyz[3][0]=fP4.x(); xyz[3][1]=fP4.y(); xyz[3][2]=fP4.z();
    ph->createPolyhedron(4,4,xyz,faces);
    return ph;
  }

None Re: G4VVisPrim in Geant4.7.1 and G4VVisManager in Geant4.8.0  Keywords: G4VVisPrim G4VVisManager
by <zhongwl@ihep.ac.cn>,   31 Mar, 2006
Re: None Re: G4VVisPrim in Geant4.7.1 and G4VVisManager in Geant4.8.0 (John Allison)

Hello Mr. Allison, Thank you very much. I have another question about FastSimulation.I post my message on the forum "FastSimulation", but there is no answer till now. G4VFastSimulation is also change its arguments in Geant4.8.0, from G4LogicalVolume to G4Region. After I change the argument to G4Region, there are some warnings, I don't know why. I want to do a Fast Simulation with a PMT logical volume, part of my code is:

  G4Region *PmtRegion = new G4Region("PMT-Region");
  PmtRegion->AddRootLogicalVolume(pmt_log);/*the pmt_log is the
 sensitive detector*/
  new PMTOpticalModel( "pmt_optical_model", pmt_phys);

and the class PMTOpticalModel is inherited from G4VFastSimulationModel, its constructor is:

PMTOpticalModel::PMTOpticalModel (G4String modelName,
                                  G4VPhysicalVolume* envelope_phys)
  : G4VFastSimulationModel(modelName, envelope_phys->GetLogicalVolume()
   ->GetRegion())
{......
}

the program runs well and the results seems right, and there are normal output information about the optical photons in the PMT Optical Model, but there are some warnings:

WARNING - G4Region::G4Region()
          Region PMT-Region already existing in store !

*** G4Exception : InvalidSetup
      issued by : G4Region::G4Region()
The region has NOT been registered !
*** This is just a warning message.
G4ProcessManager::GetAttribute(): particle[GenericIon]
  index out of range 
  #processes[2]  index [-1]
G4ProcessManager::GetAttribute(): particle[GenericIon]
  index out of range 
  #processes[2]  index [-1]

What's the meaning of the warnings? if the region isn't registered, why the FastSimulationProcess, PMTOpticalModel have functions on optical photons when they hit on the PMTs? And why we change the argument of G4VFastSimulation from G4LogicalVolume to G4Region? Because we can add several RoogLogicalVolume to one Region? Thank you again.

Question How to set ApplyCut to ON?  Keywords: ApplyCut
by <zhangqm@ihep.ac.cn>,   19 Dec, 2005

In the Geant4 User's Guide, The following content is mentioned: ....................................................................... ApplyCut is OFF: do nothing. All the secondaries are stacked (and then tracked later on), regardless of their initial energy. The Geant4 kernel respects the best that the physics can do, but neglects the overall coherence and the efficiency. Energy conservation is respected as far as the processes know how to handle correctly the particles they produced! ApplyCut in ON: the TrackingManager checks the range of each secondary against the production threshold and against the safety. The particle is stacked if range > min(cut,safety). ....................................................................... In the passage in this forum, the following content is mentioned: ..................................................................... The ApplyCut is Off by default, and needs to be On with /run/particle/applyCuts. ......................................................................

but I can't find the interface method in run.

None Re: How to set ApplyCut to ON?  Keywords: ApplyCut
by michel maire <michel maire>,   22 Dec, 2005
Re: Question How to set ApplyCut to ON?

 The command /run/particle/applyCuts  on-off is working

None Re: How to set ApplyCut to ON?  by <vnivanch@mail.cern.ch>,   19 Dec, 2005
Re: Question How to set ApplyCut to ON?
On Mon, 19 Dec 2005 zhangqm@ihep.ac.cn wrote:

> *** Discussion title: (Graphical) User Interfaces
> Email replies to PublicHyperNews@slac.stanford.edu must include:
>   In-Reply-To: <"/userinterface/36"@geant4-hn.slac.stanford.edu>
>   Subject: ...change this to be about your reply.
> 
> In the Geant4 User's Guide, The following content is mentioned:
> .......................................................................
> ApplyCut is OFF: do nothing. All the secondaries are stacked (and then
> tracked later on), regardless of their initial energy. The Geant4 kernel
> respects the best that the physics can do, but neglects the overall
> coherence and the efficiency. Energy conservation is respected as far as
> the processes know how to handle correctly the particles they produced!
> ApplyCut in ON: the TrackingManager checks the range of each secondary
> against the production threshold and against the safety. The particle is
> stacked if range > min(cut,safety).
> .......................................................................
> In the passage in this forum, the following content is mentioned:
> .....................................................................
> The ApplyCut is Off by default, and needs to be On with
> /run/particle/applyCuts.
> ......................................................................
> 
> but I can't find the interface method in run.
> 

Hello,

Thank you for pointing out to the problem in documentation - this part was 
not renewed at time.

The current situation is following:
- in G4 kernel cuts are applied only for gamma, e+, and e-
- processes with infrared divergence never produce secondaries below cuts 
but are using production thresholds (see Physics Reference Manual), so "ApplyCuts" 
option is not effective
- in contrary, processes, which can produce low energy gamma, e+, e- with 
relatively small cross section, may not use production thresholds and will 
produce low energy secondaries. For secondaries from this processes 
"ApplyCuts" option will be effective.
 
VI

Question Problems with G4UItcsh and Control-D  Keywords: G4UItcsh Control-D EOT
by Adrian Vogel <adrian.vogel@desy.de>,   07 Dec, 2005

Hello,

I'm using G4UItcsh and I see a strange problem: When I type Control-D (the end-of-text character in ASCII) at the Idle> prompt of my self-made application, the program exits as expected, but afterwards the behaviour of my shell is messed up – I don’t get an echo any more as I type. Only after calling the Unix command reset everything is okay again.

Moreover, when I hit Control-D in Mokka (the detector simulation for the ILC), I get nothing but a segmentation fault. The debugger says that this originates from:

#11 0x08097179 in main (argc=1, argv=0xbfffdc74) at Mokka.cc:171
#10 0x08368ecd in G4UIterminal::SessionStart ()
#9  0x08369712 in G4UIterminal::GetCommand ()
#8  0x08367f97 in G4UItcsh::GetCommandLine ()
#7  0x08367f2e in G4UItcsh::ReadLine ()
#6  0x407e4b0f in exit () from /lib/libc.so.6
#5  0x08ae0753 in __tcf_0 ()
#4  0x08add1c5 in G4LossTableManager::~G4LossTableManager ()
#3  0x08350ad4 in G4eIonisation::~G4eIonisation ()
#2  0x40764283 in operator delete (ptr=0x9464cd4) at /usr/src/packages/BUILD/gcc-3.3.3/libstdc++-v3/libsupc++/del_op.cc:39
#1  0x4082fa5f in free () from /lib/libc.so.6
#0  0x40830d68 in _int_free () from /lib/libc.so.6

I don’t think you can do a major mistake when instantiating a G4UIsession and calling G4UIsession::SessionStart(), so I suppose that Mokka is not to blame for the crash – at least not directly.

Has anybody else seen things like in the first and/or second case? What could be going wrong, and what can be done against it? I'm currently using Geant 4.7.1.p01 (but the same has occurred with earlier versions, too), gcc 3.2.3 20030502 (Red Hat Linux 3.2.3-14) (again, the same has also happened with another version of gcc), and bash 2.05b.0(1)-release (the problem with the missing echo does not occur in [t]csh, zsh, or ksh).

Cheers,
Adrian

More Re: Problems with G4UItcsh and Control-D  Keywords: G4UItcsh Control-D reset
by Adrian Vogel <adrian.vogel@desy.de>,   04 Dec, 2007
Re: Question Problems with G4UItcsh and Control-D (Adrian Vogel)

Hello again,

I’m using G4UItcsh and when I type Control-D at the Idle> prompt, my program exits as expected, but afterwards the behaviour of my shell is messed up – I don’t get an echo anymore as I type. Only after calling the Unix reset command, everything is okay again.

I have come across this problem once more after some time and I guess that the reason are a few missing lines in G4UItcsh.cc. Upon reception of Control-D, G4UItcsh::ReadLine simply calls exit(0) and that’s it. In comparison to that, the signal handler for SIGINT in G4UIterminal.cc first prints a short message, calls G4VUIshell::ResetTerminal, deletes the RunManager, and then finally exits. I suppose that adding these few statements to the Control-D handler would be the right thing.

Cheers,
Adrian

PS: While browsing through the code, I saw the condition if (cc == '[' || 'O') in line 569 of G4UItcsh.cc. Should that maybe read if (cc == '[' || cc == 'O') instead?

Note Re: Problems with G4UItcsh and Control-D  Keywords: G4UItcsh Control-D EOT
by Adrian Vogel <adrian.vogel@desy.de>,   09 Dec, 2005
Re: Question Problems with G4UItcsh and Control-D (Adrian Vogel)

Hello,

in the meantime I have found that the Mokka segmentation fault is not directly related to G4UItcsh, but to the call of the exit() system function. Which would then be the right HyperNews category to ask? (The debugger shows that physics processes are in some way involved in the crash – could that be of help?)

However, the thing with the behaviour of the shell still remains… (BTW: When I use the exit UI command, everything is fine.)

Thanks in advance, Adrian

None Pythonized interface (beta release) will soon be available.  Keywords: Puythonised interface root
by Hajime YOSHIDA <Hajime YOSHIDA>,   20 Nov, 2005
At the Geant4 Workshop 2005, we reported on the new
Pythonized interface of Geant4 developed by Koichi Murakami of KEK.
The beta version will be available soon from the Web site at KEK,
after some documentation works.
After serious test period, we hope it can be distributed in the
Geant4 public release. So your collaboration is welcome.
Please contact Koichi.Murakami@kek.jp or yoshidah@naruto-u.ac.jp.

You might be interested in its feature that PyROOT can be
connected on the common Python bus, which Koich demonstrated at the
workshop.


  hajime Yoshida
Question GEANT4.7.1 and GAG  Keywords: GAG
by Alain Ferragut <Alain Ferragut>,   29 Sep, 2005

Hello, has anybody tried last 7.1 G4 version with GAG ? Any comments ? No problems ?

Thanks,

Alain

None Re: GEANT4.7.1 and GAG  Keywords: GAG
by Hajime YOSHIDA <Hajime YOSHIDA>,   10 Nov, 2005
Re: Question GEANT4.7.1 and GAG (Alain Ferragut)
Hello Alain

Sorry for very delayed reply.

I confirmed your case. Nothin was changed in GAG nor G4UIGAG.
The origine of this incident is found in the new visualization/management
which has got much improvement. Only one line is concerned and I noticed
this to Vis coordinator and the developer. 
In the next release coming soon, this will be fixed.

But if you want an quick patch, I am willing to send to you the
relevant file. You have to recompile the whole vis category to 
make the new library.

Hajime Yoshida

yoshidah@naruto-u.ac.jp
Question problems with GAG and G4.7.1  Keywords: GAG
by Alain Ferragut <Alain Ferragut>,   05 Sep, 2005

Hi, I am currently using G4.7.1. I recompiled my application source code on G4.7.1. Before, I used G4.7.0. So I did not change the code. Unfortunately, I have a problem with the command "java gag". GAG is launched correctly, but when I try to launch my application with GAG, GAG seems to stop at the step :"Making command tree". Then the terminal screen comes back to the message "Welcome to Geant4 adaptative GUI". I know my application is working in batch mode, and the binary I made with G4.7.0 worked well with GAG. It looks as if GAG looses the communication with the user application. Any hints ? Thanks,

                  Alain

None Re: problems with GAG and G4.7.1  Keywords: GAG
by Alain Ferragut <Alain Ferragut>,   07 Sep, 2005
Re: Question problems with GAG and G4.7.1 (Alain Ferragut)

I recompiled the whole G4.7.1 kernel and checked all the environment variables. All is OK and the problem remains

None Re: problems with GAG and G4.7.1  Keywords: GAG
by Alain Ferragut <Alain Ferragut>,   06 Sep, 2005
Re: Question problems with GAG and G4.7.1 (Alain Ferragut)

And it does not work either on a simple example like ExampleN02. I just instanciated a G4UIGAG object, instead of a terminal session. Same problem : GAG dies when it comes to "Making command tree"

Thanks for your help,

Alain

Question Verbose level of examples/novice/N06  Keywords: verbose level
by Maria Lucia <lucia.magliozzi@iss.infn.it>,   29 Aug, 2005
Hello!!

Can I control via macro
the verbose level?

particulary in examples/novice/N06
can i "turn off" the output

...
Photon at Boundary!
 Old Momentum Direction: (0.81043764,-0.31648314,-0.49297998)
 Old Polarization:       (-0.31578235,0.47278573,-0.8226513)
 New Momentum Direction: (0.61116244,-0.42759883,-0.66606285)
 New Polarization:       (0.43935541,0.8832385,-0.16387978)
....

?????
In which way?

Thank you a lot


MLucia
None Geant4 with Root  Keywords: Geant4.7.0 Root 4.02
by Courtine Fabien <courtine@clermont.in2p3.fr>,   17 Jun, 2005
Hello,
I work on my pc with geant4.7.0,gcc3.2.3 and Root 4.02.
I write a few code and it works very well.
Then, i put all the code (geant4+root+my code) on a cluster with gcc3.2.3.
I compile geant4 and it 's ok.
But when I want to compile my code, i have got a probleme with link :
Using granular libraries ...
Linking Csaa ...
/users_local2/tl/courtine/users_local/work/geant4/tmp/Linux-g++/Csaa/libCsaa.so: undefined reference to `TROOT::TROOT[in-charge](char const*, char const*, void (**)())'
/users_local2/tl/courtine/users_local/work/geant4/tmp/Linux-g++/Csaa/libCsaa.so: undefined reference to `TStorage::ObjectAlloc(unsigned)'
/users_local2/tl/courtine/users_local/work/geant4/tmp/Linux-g++/Csaa/libCsaa.so: undefined reference to `TROOT::~TROOT [in-charge]()'
/users_local2/tl/courtine/users_local/work/geant4/tmp/Linux-g++/Csaa/libCsaa.so: undefined reference to `TNtuple::TNtuple[in-charge](char const*, char const*, char const*, int)'
/users_local2/tl/courtine/users_local/work/geant4/tmp/Linux-g++/Csaa/libCsaa.so: undefined reference to `TObject::operator delete(void*)'
/users_local2/tl/courtine/users_local/work/geant4/tmp/Linux-g++/Csaa/libCsaa.so: undefined reference to `TFile::TFile[in-charge](char const*, char const*, char const*, int)'
collect2: ld a retourné 1 code d'état d'exécution
gmake: *** [/users_local2/tl/courtine/users_local/work/geant4/bin/Linux-g++/Csaa] Erreur 1
I check that i have G4_BUILD_ROOT_SESSION, G4_UI_USE_ROOT, G4LIB_BUILD_SHARED and H4LIB_USE_SHARED set to 1.
I also check ROOTSYS and LD_LIBRARY_PATH (i add $G4WORKDIR/tmp/$G4SYSTEM/Csaa).
I don't understand why it fails when linking on this cluster.
Can anybody help me?
Thanks.
Fabien 
None Re: Geant4 with Root  Keywords: Geant4.7.0 Root 4.02
by S.Fonseca UERJ/Brazil <sfonseca@uerj.br>,   27 Oct, 2005
Re: None Geant4 with Root (Courtine Fabien)

Dear Courtine Fabien,

My suggestion for you is to install the G4UIROOT http://i.home.cern.ch/i/iglez/www/alice/G4UIRoot/#Installation in your framework with this tool you can use Root methods into geant4 class in your applications.

You can also find more information at http://root.cern.ch/root/HowtoMC.html

best regards,

Sandro Fonseca
UERJ/Brazil
 

None Help:"/usr/bin/ld: cannot find -lCLHEP"  by zhang <windstep@sohu.com>,   19 Mar, 2005

This is the first time i using the lib. There is a problem when i build the first example. Please help me:

[root@scu2 N01]# gmake Using granular libraries ... Linking exampleN01 ... /usr/bin/ld: cannot find -lCLHEP

collect2: ld returned 1 exit status
gmake: *** [/root/geant4/bin/Linux-g++/exampleN01] Error 1

I don't understand above message,for I have install the "clhep" lib and installed the geant4.

the env.csh file is:

# g4clhep.U
#
if ( X/usr/clhep != X ) then setenv CLHEP_BASE_DIR "/usr/clhep" echo "On this machine the CLHEP_BASE_DIR=$CLHEP_BASE_DIR" endif

#+ if ( X/usr/clhep/include != X ) then setenv CLHEP_INCLUDE_DIR "/usr/clhep/include" echo "On this machine the CLHEP_INCLUDE_DIR=$CLHEP_INCLUDE_DIR" endif

#+ if ( X/usr/clhep/lib != X ) then setenv CLHEP_LIB_DIR "/usr/clhep/lib" echo "On this machine the CLHEP_LIB_DIR=$CLHEP_LIB_DIR" endif

#+ if ( XCLHEP != X ) then

setenv CLHEP_LIB "CLHEP" echo "On this machine the CLHEP_LIB=$CLHEP_LIB" endif

thanks a log                                
                    

Feedback Re: Help:"/usr/bin/ld: cannot find -lCLHEP"  by <timtran@jlab.org>,   09 May, 2005
Re: None Help:"/usr/bin/ld: cannot find -lCLHEP" (zhang)

I encountered the problem very recently. The message says that the library libCLHEP.so could not be found.

In my situation, I compiled the library from source and the name given was not the one Genat4 was looking for.

So if you happen to compile the CLHEP library yourself, make sure you creat a link with a name "libCLHEP.so" to the 'real' library.

Tim

Question undefined reference to `G4UIGAG::G4UIGAG()'  Keywords: link problem with libG4UIGAG.so
by Kazuyoshi Furutaka <Kazuyoshi Furutaka>,   22 Jan, 2005
I'm using geant4 7.0 (CLHEP-1.8.1.0) on a Fedora Core 3
system (gcc/g++ ver.3.4.2, GNU Make 3.80, GNU ld ver.2.15.92.0.2).

When I tried to make the modified exampleN02 to use GAG
with the modification attached at the bottom of this message
(and G4UI_USE_GAG=1, G4UI_USE_TCSH is unset), the link failed
because of the lack of the reference to 'G4UIGAG::G4UIGAG()'.
# It was ok at the time of geant4 6.1.

The same code could be compiled by unsetting G4UI_USE_GAG
(and even with G4UI_USE_TCSH=1).

The 'libG4UIGAG.so' file exists in the $G4LIB/$G4SYSTEM directory
with the 'libG4UIbasic.so' and 'libG4UIcommon.so' files.

What's happening?
Is there anyone who can compile the modified code on the
same configuration (Fedora core 3 or the like)?
Any suggestion/comments are welcome.

Thanks in advance.

Kazuyoshi


--- exampleN02.cc       2004-12-18 01:07:12.000000000 +0900
+++ exampleN02GAG.cc    2005-01-22 18:16:02.534190180 +0900
@@ -45,6 +45,10 @@
 #include "ExN02VisManager.hh"
 #endif

+#ifdef G4UI_USE_GAG
+#include "G4UIGAG.hh"
+#endif
+
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

 int main(int argc,char** argv) {
@@ -85,6 +89,8 @@
     G4UIsession * session = 0;
 #ifdef G4UI_USE_TCSH
       session = new G4UIterminal(new G4UItcsh);
+#elif defined G4UI_USE_GAG
+      session = new G4UIGAG;
 #else
       session = new G4UIterminal();
 #endif
--- GNUmakefile 2004-12-18 01:07:12.000000000 +0900
+++ GNUmakefile.GAG     2005-01-22 18:13:55.765255783 +0900
@@ -3,7 +3,7 @@
 # GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
 # --------------------------------------------------------------

-name := exampleN02
+name := exampleN02GAG
 G4TARGET := $(name)
 G4EXLIB := true

None Re: undefined reference to `G4UIGAG::G4UIGAG()'  Keywords: link problem with libG4UIGAG.so
by John Allison <John Allison>,   23 Jan, 2005
Re: Question undefined reference to `G4UIGAG::G4UIGAG()' (Kazuyoshi Furutaka)

Looks like you have changed the environment without rebuilding Geant4. In principle, the Geant4 build depends on the environment. In your case, it might only be a case of rebuilding the library map.

  cd $G4INSTALL/source
  gmake libmap

but see Frequently Asked Questions, Visualization.

Ok Re: undefined reference to `G4UIGAG::G4UIGAG()'  Keywords: link problem with libG4UIGAG.so
by Kazuyoshi Furutaka <Kazuyoshi Furutaka>,   23 Jan, 2005
Re: None Re: undefined reference to `G4UIGAG::G4UIGAG()' (John Allison)
Hi John,

After doing `gmake libmap` in $G4INSTALL/source,
I could link the modified code.  Thanks!


I'd like to ask some more questions for future reference...

Does it mean that we should issue the `gmake libmap` command
everytime we change any of the environmental variables?
Or, does it depend on the variables?
The `gmake libmap` command is mentioned in the installation
guide, but not in the user's guilde for application developper,
although the latter refers 'libname.map'...

When should we rebuild all the toolkit?

(It may be better to post these questions to other forums.)


I'm a little bit wondering why I could make the code on a
SLC3 system without doing `gmake libmap` after (un)setting
environmental variables...


By the way, where can I find the "Frequently Asked Questions,
Visualization"?


Thanks again, John.

Kazuyoshi
None Re: undefined reference to `G4UIGAG::G4UIGAG()'  Keywords: link problem with libG4UIGAG.so
by John Allison <John Allison>,   23 Jan, 2005
Re: Ok Re: undefined reference to `G4UIGAG::G4UIGAG()' (Kazuyoshi Furutaka)

> Does it mean that we should issue the `gmake libmap` command
> everytime we change any of the environmental variables?
> Or, does it depend on the variables?

Depends on the variables. But in general, yes. "gmake libmap" scans your dependency files and produces a list of needed libraries.

> The `gmake libmap` command is mentioned in the installation
> guide, but not in the user's guilde for application developper,
> although the latter refers 'libname.map'...

I guess it's a shortcut really. The only safe general way is to rebuild Geant4 completely after any change in environment. But since that takes a long time, this shortcut gets mentioned in the FAQs and the forums. If you know which code is affected by the change of environment, I guess you can limit the rebuild, if you're smart, and rebuild the library map.

> By the way, where can I find the "Frequently Asked Questions,
> Visualization"?

From the Support button on the Geant4 home page.

Sad Re: undefined reference to `G4UIGAG::G4UIGAG()'  Keywords: link problem with libG4UIGAG.so
by Kazuyoshi Furutaka <Kazuyoshi Furutaka>,   23 Jan, 2005
Re: None Re: undefined reference to `G4UIGAG::G4UIGAG()' (John Allison)
John, thanks again for you detailed answers.

But I got another problem unfortunately...

After linking the modified exampleN02 (with GAG) successfully,
I've tried to use G4Plugin (Geant4, JAS3 and GAG).

I made symlinks of the G4Plugin cpp codes (G4Server.{cc,hh},
G4UIrmi.{cc,hh}, GAGServer.{cc,hh} and GNUmakefile) to suitable
places under $G4INSTALL/sources/interfaces/GAG/ directory.

Then, after removing $G4LIB/$G4SYSTEM/libG4UIGAG.so as well as 
all the files in $G4TMP/$G4SYSTEM/G4UIGAG/ directory, I did
`gmake` in the $G4INSTALL/source (which also do `gmake libmap`).

After that, linking the modified exampleN02 code failed again!

Looking into the $G4LIB/libname.map file, I found strange lines:
G4UIGAG^M:
source/interfaces/GAG/GNUmakefile

Restoring the original contents in the
$G4INSTALL/sources/interfaces/GAG/ directory and `gmake` in the
$G4INSTALL/source, the problem disappeard.
(i.e. the code could be linked with libG4UIGAG.so)
This time, the $G4LIB/libname.map contains the following lines:
G4UIGAG: G4globman G4intercoms G4UIcommon
source/interfaces/GAG/GNUmakefile

What's happening?
Did the 'liblist' program do wrong?
None Re: undefined reference to `G4UIGAG::G4UIGAG()'  Keywords: link problem with libG4UIGAG.so
by Hajime YOSHIDA <Hajime YOSHIDA>,   26 Jan, 2005
Re: Sad Re: undefined reference to `G4UIGAG::G4UIGAG()' (Kazuyoshi Furutaka)

Hi,

G4Plugin isn't officially supported by Geant4 collaboration. It is the customization made for Jas3 and its codes are maintained only at SLAC CVS repository.

So, please ask us (Victor Servo, Tony Johnson and I) via e-mail instaed of posting here.

When you want to use JAS3 + G4plugin + GAG, it is NOT G4UIGAG class but G4UIrmi class which connects geant4 executable and GAG and it requires JNI (Java Native Interface) header files. (This is why it isn't in the Geant4 distribution).

We havn't yet a good GNUmakefile to use G4UIrmi. If you follow the readme files in the G4plugin package, the GNUmakefile you used, put the library module libG4UIrmi.o together with the LibG4UIGAG.a(so).

To make independent library archive for G4UIrmi, we have to modify many config files.

regards
         Hajime Yoshida :  yoshidah@naruto-u.ac.jp

None Re: undefined reference to `G4UIGAG::G4UIGAG()'  Keywords: link problem with libG4UIGAG.so
by John Allison <John Allison>,   23 Jan, 2005
Re: Sad Re: undefined reference to `G4UIGAG::G4UIGAG()' (Kazuyoshi Furutaka)

Not sure I can explain that. Perhaps someone from the User Interface and/or Analysis groups can. I am surprised you need to make symbolic links. The usual way external packages are included in the build is by setting (more) emnvironment variables to point to include files and libraries. Perhaps that's why liblist had a problem. Check the documentation for building with the packages you want.

Note Re: undefined reference to `G4UIGAG::G4UIGAG()'  Keywords: link problem with libG4UIGAG.so
by Kazuyoshi Furutaka <Kazuyoshi Furutaka>,   23 Jan, 2005
Re: None Re: undefined reference to `G4UIGAG::G4UIGAG()' (John Allison)
Hi John,

The 'README' file for the G4Plugin package says
to COPY files, and I don't have to make symlinks.
But it's a convenient way to distinguish the original files
contained in Geant4 distribution from files of other add-on
packages, and I prefer symlinking to copying when I need to
copy files below $G4INSTALL.

I tried to see what happens if I copy files of G4Plugin rather
than to make symlinks:
Again, a strange "G4UIGAG^M:" line appeared.

Kazuyoshi
Ok Re: undefined reference to `G4UIGAG::G4UIGAG()'  Keywords: link problem with libG4UIGAG.so
by Kazuyoshi Furutaka <Kazuyoshi Furutaka>,   25 Jan, 2005
Re: Note Re: undefined reference to `G4UIGAG::G4UIGAG()' (Kazuyoshi Furutaka)
It's the GNUmakefile that came with G4Plugin
which cause the problem: it's a DOS text, i.e.
with CRLF line terminators.
The extra CR, remained in the libname.map starter
file, made the liblist working wrong.

After changing the line terminaters of the 
source/interfaces/GAG/GNUmakefile distributed
in the G4Plugin package from CRLF to LF,
the strange ^M character in the libname.map file
disappeared and everything went well.

Kazuyoshi
More Re: undefined reference to `G4UIGAG::G4UIGAG()'  Keywords: link problem with libG4UIGAG.so
by Kazuyoshi Furutaka <Kazuyoshi Furutaka>,   23 Jan, 2005
Re: Question undefined reference to `G4UIGAG::G4UIGAG()' (Kazuyoshi Furutaka)
The same code could be linked on a SLC3 system running as a
VMware guest on the same machine...
(g++ ver.3.2.3, GNU Make ver.3.79.1, GNU ld ver.2.14.90.0.4)

Well...
Question determining batch / interactive mode from within program  by Dipanjan Ray <DRay@lbl.gov>,   16 Nov, 2004
I was wondering what is the proper way to tell whether one is 
running in batch or interactive mode from within a Geant4 program.

Currently I am using RTTI as follows:


#include <typeinfo>
#include "G4UImanager.hh"
#include "G4UIsession.hh"
#include "G4UIbatch.hh"

<...>

   G4UIsession pSession =
      G4UImanager::GetUIpointer()->GetSession();
   if ( typeid(*pSession) == typeid(G4UIbatch) )  {
      /* batch mode */
   }
   else  {
      /* interactive mode */
   }


This seems to work OK, but I was wondering if there was a better way, 
if this will always work, etc.

None ROOT + GEANT4  by Jacek M. Holeczek <holeczek@us.edu.pl>,   05 Nov, 2004
Hi,
Maybe someone has met the following problem (root v4.00.08 / slc3,
geant4-06-02-patch-02).

When using the G4UI Xaw based session :
--------------------------------
### Run 0 start.
/vis/scene/notifyHandlers
Start Run processing.

---> Begin of event: 0

--------- Ranecu engine status ---------
 Initial seed (index) = 0
 Current couple of seeds = 9876, 54321
----------------------------------------
---> End of event: 0
Run terminated.
Run Summary
  Number of events processed : 1
  User=20s Real=25s Sys=3.2s
/vis/viewer/update

 *** Break *** segmentation violation
 Generating stack trace...
 0x01264961 in <unknown> from /usr/X11R6/lib/libX11.so.6
 0x01225893 in XFindContext + 0xc3 from /usr/X11R6/lib/libX11.so.6
 0x06258dea in <unknown> from /usr/X11R6/lib/libXaw.so.7
 0x0625b5b3 in <unknown> from /usr/X11R6/lib/libXaw.so.7
 0x0624ebaf in <unknown> from /usr/X11R6/lib/libXaw.so.7
 0x0423ba3a in <unknown> from /usr/X11R6/lib/libXt.so.6
 0x0423bf78 in <unknown> from /usr/X11R6/lib/libXt.so.6
 0x0423c573 in _XtTranslateEvent + 0x83 from /usr/X11R6/lib/libXt.so.6
 0x04214834 in XtDispatchEventToWidget + 0x184 from /usr/X11R6/lib/libXt.so.6
...
--------------------------------

When using the G4UI Xm based session :

--------------------------------
 *** Break *** segmentation violation
 Generating stack trace...
 0x011a4961 in <unknown> from /usr/X11R6/lib/libX11.so.6
 0x01165893 in XFindContext + 0xc3 from /usr/X11R6/lib/libX11.so.6
 0x085711de in _XmGetWidgetExtData + 0x4e from /usr/X11R6/lib/libXm.so.3
 0x0856c02f in _XmGetFocusData + 0x7f from /usr/X11R6/lib/libXm.so.3
 0x0856af95 in _XmNavigSetValues + 0x25 from /usr/X11R6/lib/libXm.so.3
 0x085686d8 in <unknown> from /usr/X11R6/lib/libXm.so.3
 0x031d56f3 in <unknown> from /usr/X11R6/lib/libXt.so.6
 0x031d56ac in <unknown> from /usr/X11R6/lib/libXt.so.6
 0x031d5c33 in XtSetValues + 0x323 from /usr/X11R6/lib/libXt.so.6
 0x08503a36 in <unknown> from /usr/X11R6/lib/libXm.so.3
 0x085965e4 in _XmSFUpdateNavigatorsValue + 0xa4 from /usr/X11R6/lib/libXm.so.3
 0x08522269 in _XmChangeVSB + 0x109 from /usr/X11R6/lib/libXm.so.3
 0x08522f69 in <unknown> from /usr/X11R6/lib/libXm.so.3
...
--------------------------------

It seems that it happens only when from inside of the Geant4 application I
make "new TApplication("Application", ((int *)0), ((char **)0));" and then
I create and draw a TCanvas.
Is it possible that the X11 handling by both the ROOT and G4UI is a
problem nowadays?

It is possibly worth of noting that ... in case of Xaw based G4UI it dies
AFTER the event is fully processed (the canvas has been created and
refreshed all the time as expected), while in case of Xm based G4UI it
dies shortly after the canvas is created and drawn (in the beginning of
the event processing).

Any ideas?
Thanks in advance,
Best regards,
Jacek.
None Re: ROOT + GEANT4  by Jacek M. Holeczek <holeczek@us.edu.pl>,   24 Feb, 2005
Re: None ROOT + GEANT4 (Jacek M. Holeczek)

Hi,
people interested in this topic should read the :
    http://root.cern.ch/root/roottalk/roottalk05/0408.html
together with the :
    http://root.cern.ch/root/HowtoMC.html
Hope it helps,
Best regards,
Jacek.

None Re: ROOT + GEANT4  by Guy Barrand <Guy Barrand>,   22 Dec, 2004
Re: None ROOT + GEANT4 (Jacek M. Holeczek)

  This is a promised summary of what had been said 
 in an exchange of mails between various interested people
 about the threading problem when mixing X11/Xt/Motif, ROOT and Geant4.

 The problem :
 -----------
  Problem araised from a user crash when running a main
 using Geant4 kernel, G4UIXm and AFTER using ROOT to create a TCanvas.
  People quickly discovered that ROOT, and its X11 driver,
 in this particular case, had been compiled with the thread options 
 and in particular that the Geant4 G4UIXm code did a XOpenDisplay prior to 
 an XInitThread done somehwere in ROOT.
  As mentionned in the X11 doc, if the threading of X11
 is used, a XInitThreads() should be done before ANY invocation
 of any X11 functions.
  The crash in the user application came from a non respect
 of this X11 recommendation. In the main(), a call to XInitThreads()
 prior everything cured the problem.

 Doing something in Geant4 ? 
 ------------------------- 
  Ok, fine. But some suggested that we should perhpas instrument 
 the Geant4 code related to X11 in order to take the X11 threading 
 into account. The proposal was to put in various X11 related places 
 something like :
#idef _REENTRANT
   XInitThreads() 
#endif

  On problem is that Geant4 is NOT an application. It is first
 of all a toolkit (a set of libraries) and it is in charge of a user 
 to build a program with the Geant4 kernel, plus some of the G4UI, 
 some of the G4 vis drivers and perhpas by mixing with other products 
 and tools around.

  It appears that X11, in Geant4, is indirectly present in various 
 GUI "sessions" and various visualization drivers ; each of them
 may be put or not in a program quite indepandantly.
  Moreover all these drivers may rely on products that may be or may
 be not constructed to support thread on the user platform.

  This being said, it seems more natural to let the Geant4 X11 related
 code "clean" related the threading and let the assembler programmer
 of an application using Geant4 to decide to put in its main() an
 XInitThread() according to what he is going to use in his application.

  Then, at least in the Geant4-7.0 release, it had been decided to NOT
 put the upper code in G4Xt.cc, G4OpenGLXm.cc, G4OpenInventorXt.cc, etc...
 (Moreover this problem came very lately concerning the release process
 for the 7.0).

 Geant4 had not been forseen to be multi thread for the moment :
 -------------------------------------------------------------
  And a direct consequence of that is that there is no threading options
 in the G4 makefile system for the moment. So, even if we had decided 
 to put the upper #ifdef _REENTRANT in the UI and vis X11 codes, we had no way 
 for the moment to raise the threading compilation options at the level of the 
 Geant4 make system.
  (Clearly the idea here is to say ; let first Geant4 kernel be threadable
 and then see to be sure to have the UI and vis drivers be threadable).

 Some recommendations :
 -------------------- 
  This being said, it appears that the mixing of Geant4 + ROOT-threaded + 
 Geant4 UI Motif session worked and from various user experiences we can anyway
 come with some simple guidelines :
 - first check that the various used producted are thread safe 
   (X11 is ok from X11R6, Motif is ok from 2.1 and recent XFree86/OpenGL 
    are ok too). 
 - be sure that the various products had been built with
   thread options on the targeted running machine. 
   (for example, if using Qt, it is not because Qt is thread safe 
   that you have linked your application with -lqt-mt !!!).
 - for X11, then check that a XInitThreads() is done prior
   to any direct or indirect X11 call. Note that at least if using
   XFree86 implementation, someone can call multiple time XInitThreads() ;
   only the first one count.
 - take care of the hidden X11 calls ; for example there is 
   X11/Motif behind java/awt or tcl/tk !!!

  At least, for what concerns X11/Xt/Motif/OpenGL, someone can 
 in principle, by pairing attention to the uppers, build now a 
 thread safe program with them ; and the author is quite confident
 that most of the G4 UI and vis X11 related drivers are in fact already 
 thread safe.

None Re: ROOT + GEANT4  by Guy Barrand <Guy Barrand>,   07 Nov, 2004
Re: None ROOT + GEANT4 (Jacek M. Holeczek)
   Hello Jacek

 Below there is a simple Motif program that inits Xt, creates a similar widget tree
than the G4UIXm and before entering the XtMainLoop (that steers the X11 events) does 
an init of ROOT, creates a TH1, creates a TApplication and a TCanvas that plots the TH.

  With ROOT/3.10.02 this programs maps the Motif Window and the TCanvas
(that then plots the TH1) and gives control to the Motif GUI so that someone
can exit with the File/Exit button. And this without crash.

  With ROOT/4.00.08 this programs crashes in the XtMainLoop with the below 
traceback :

Program received signal EXC_BAD_ACCESS, Could not access memory.
0x90002038 in pthread_mutex_lock ()
(gdb) where
#0  0x90002038 in pthread_mutex_lock ()
#1  0x85ef162c in XFindContext ()
#2  0x023ca4c8 in GetDisplay ()
#3  0x023ca6e8 in XmGetXmDisplay ()
#4  0x023c9804 in _XmGetDragProtocolStyle ()
#5  0x02286610 in _XmIEndUpdate ()
#6  0x8584c120 in DoOtherSources ()
#7  0x8584c480 in XtAppNextEvent ()
#8  0x85840ca4 in XtAppMainLoop ()
#9  0x00002dec in main ()
#10 0x00002594 in _start (argc=1, argv=0xbfffeb84, envp=0xbfffeb8c) at /SourceCache/Csu/Csu-46/crt.c:267

then the presence of ROOT/X11 things screws up the X11 steering of Xt !!!! Don't know
what these guys are doing. (I would probably jump to the ceil, once more, if knowing it).

  Then the problem is not on Geant4 side. You can convince yourself, by commmenting
the ROOT things, that this program (then using pure Motif/Xt) works fine. Then the problem
is clearly around ROOT/4.00.08.
  Perhaps the way to init ROOT relative to Xt in the below program is not the right way to do.

  I let you play with the below program and send a bug report to the ROOT (of EVERYTHING)
 team.

  Note that I have tested on a Mac with g++-3.3. Here is my program :

#include <X11/StringDefs.h>

#include <Xm/Xm.h>
#include <Xm/Command.h>
#include <Xm/RowColumn.h>
#include <Xm/Form.h>
#include <Xm/PushB.h>
#include <Xm/CascadeB.h>
#include <Xm/Text.h>

#include <stdlib.h>

// The ROOT of EVERYTHING :
#ifdef WIN32
#include <Windows4Root.h>
#endif
#include <TROOT.h>

#include <TRandom.h>
#include <TH1.h>
#include <TCanvas.h>
#include <TApplication.h>

static XtAppContext appContext = 0;
static Widget menuBar = 0;

/***************************************************************************/
static void ButtonCallback(
 Widget
,XtPointer
,XtPointer
)
/***************************************************************************/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
{
  XtAppSetExitFlag(appContext);
}
/***************************************************************************/
static Widget AddMenu(
 const char* a_name
,const char* a_label
)
/***************************************************************************/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
{
  if(menuBar==NULL) return 0;
  if(a_name==NULL) return 0;
  if(a_label==NULL) return 0;
  XtManageChild (menuBar);
  // Pulldown menu :
  Widget menu = XmCreatePulldownMenu (menuBar,(char*)a_name,NULL,0);
  // Cascade button :
  Arg args[2];
  XmString cps = XmStringLtoRCreate((char*)a_label,XmSTRING_DEFAULT_CHARSET);
  XtSetArg (args[0],XmNlabelString,cps);
  XtSetArg (args[1],XmNsubMenuId,menu);
  Widget widget = XmCreateCascadeButton (menuBar,(char*)a_name,args,2);
  XmStringFree (cps);
  XtManageChild (widget);
  return menu;
}
/***************************************************************************/
static void AddButton (
 Widget a_menu
,const char* a_label
,const char* a_command
)
/***************************************************************************/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
{
  if(a_menu==NULL) return;
  if(a_label==NULL) return;
  if(a_command==NULL) return;
  Widget widget = XmCreatePushButton(a_menu,(char*)a_label,NULL,0);
  XtManageChild (widget);
  XtAddCallback (widget,XmNactivateCallback,ButtonCallback,(XtPointer)0);
}
/***************************************************************************/
int main (
 int   a_argn
,char* a_args[]
)
/***************************************************************************/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
{
#if XtSpecificationRelease == 4
  Cardinal argn = (Cardinal)a_argn;
#else
  int argn = a_argn;
#endif
  Arg args[10];
  XtSetArg(args[0],XtNgeometry,XtNewString("400x400"));
  XtSetArg(args[1],XtNborderWidth,0);
  Widget top = XtAppInitialize(&appContext,"XmPushBT",
                               NULL,(Cardinal)0,
                               &argn,a_args,NULL,
                               args,2);

  Widget form = XmCreateForm (top,(char*)"form",NULL,0);
  XtManageChild (form);

  XtSetArg(args[0],XmNtopAttachment   ,XmATTACH_FORM);
  XtSetArg(args[1],XmNleftAttachment  ,XmATTACH_FORM);
  XtSetArg(args[2],XmNrightAttachment ,XmATTACH_FORM);
  menuBar = XmCreateMenuBar (form,(char*)"menuBar",args,3);

  Widget menu = AddMenu("File","File");
  AddButton(menu,"Exit","Exit");

  XtSetArg(args[0],XmNtopAttachment      ,XmATTACH_NONE);
  XtSetArg(args[1],XmNleftAttachment     ,XmATTACH_FORM);
  XtSetArg(args[2],XmNrightAttachment    ,XmATTACH_FORM);
  XtSetArg(args[3],XmNbottomAttachment   ,XmATTACH_FORM);
  Widget command = XmCreateCommand (form,(char*)"command",args,4);
  XtManageChild (command);

  XtSetArg(args[0],XmNtopAttachment   ,XmATTACH_NONE);
  XtSetArg(args[1],XmNleftAttachment  ,XmATTACH_FORM);
  XtSetArg(args[2],XmNrightAttachment ,XmATTACH_FORM);
  XtSetArg(args[3],XmNbottomAttachment,XmATTACH_WIDGET);
  XtSetArg(args[4],XmNbottomWidget    ,command);
  XmString cps = XmStringLtoRCreate((char*)"Clear",XmSTRING_DEFAULT_CHARSET);
  XtSetArg (args[5],XmNlabelString,cps);
  Widget clearButton = XmCreatePushButton(form,(char*)"clearButton",args,6);
  XmStringFree (cps);
  XtManageChild (clearButton);

  XtSetArg(args[0],XmNtopAttachment   ,XmATTACH_WIDGET);
  XtSetArg(args[1],XmNtopWidget       ,menuBar);
  XtSetArg(args[2],XmNleftAttachment  ,XmATTACH_FORM);
  XtSetArg(args[3],XmNrightAttachment ,XmATTACH_FORM);
  XtSetArg(args[4],XmNbottomAttachment,XmATTACH_WIDGET);
  XtSetArg(args[5],XmNbottomWidget    ,clearButton);
  XtSetArg(args[6],XmNeditMode        ,XmMULTI_LINE_EDIT);
  XtSetArg(args[7],XmNrows            ,12);
  XtSetArg(args[8],XmNcolumns         ,80);
  Widget text = XmCreateScrolledText (form,(char*)"text",args,9);
  XtManageChild (text);

/*
  XtAddCallback(clearButton,XmNactivateCallback,
		clearButtonCallback,(XtPointer)text);
  XtAddCallback(command,XmNcommandEnteredCallback,
		commandEnteredCallback,(XtPointer)this);
*/

  XtRealizeWidget (top);


  /////////////////////////////
  // begin ROOT specific part
  /////////////////////////////
  // ROOT part :
  TROOT root("Mangrove_Xm_test","Mangrove_Xm_test");
  TH1D* histogram = new TH1D("name","title",100,-5,5);
  for(int count=0;count<10000;count++)  
    histogram->Fill(gRandom->Gaus(0,1));

  TApplication* app = new TApplication("Mangrove_Xm_test",0,0);

  TCanvas* canvas = new TCanvas("canvas","TH1D",10,10,800,600);
  histogram->Draw();                                 
  canvas->Update();

  /////////////////////////////
  // end ROOT specific part
  /////////////////////////////

  XtAppMainLoop   (appContext);

  return          EXIT_SUCCESS;
}

   Good luck....


Question Retrieving numerical values from G4UIcommand  by Dmitry Onoprienko <Dmitry Onoprienko>,   11 Apr, 2004
I have couple questions regarding G4UIcommand and G4UIparameter
classes.

First it looks like G4UIcommand doesn't provide any convenient
methods for retrieving double and integer values of its parameters
(like those provided by its subclasses, GetNewDoubleValue(...)
in G4UIcmdWithADouble, for example). Since G4UIcommand does know
types of its parameters and is capable of doing range checking,
the code for conversion from strings to numbers seems to be there,
but there are no public access methods. Or am I missing something
here ?

Second question - is there any way to add multi-line guidance to
parameters (not to the command itself) ?
Question Untitled  Keywords: UI
by Phil Matvey <phmatvey@yahoo.com>,   31 Mar, 2004
I would like to automatically execute a "login" 
macro file that would define a few aliases (among 
other things)at the start of an interactive Geant 
session. Could not figure out how to do this.
None Re: Untitled  Keywords: UI
by Makoto Asai <Makoto Asai>,   31 Mar, 2004
Re: Question Untitled (Phil Matvey)
You can find it in examples, typically in exampleN03.
In exampleN03.cc, "vis.mac" macro file is executed before
interactive session starts.
Question Why not integrate G4UIRoot into the Geant4 offical releases?  Keywords: G4UIRoot
by Exaos Lee <Exaos Lee>,   23 Jan, 2004
Body-URL: http://i.home.cern.ch/i/iglez/www/alice/G4UIRoot/
Host unknown: i.home.cern.ch
None Re: Why not integrate G4UIRoot into the Geant4 offical releases?  Keywords: G4UIRoot
by Guy Barrand <Guy Barrand>,   23 Jan, 2004
Re: Question Why not integrate G4UIRoot into the Geant4 offical releases? (Exaos Lee)
Why not integrate G4UIRoot into the ROOT official releases ?
More Root Interface (G4UIRoot)  Keywords: Root Interface
by valerie <valerie>,   26 Jan, 2004
Re: None Re: Why not integrate G4UIRoot into the Geant4 offical releases? (Guy Barrand)
The above slows down the simulation, I was forced to drop it. 
Just add something like this to your GNUmakefile and all 
features of root will be accessible:

ifdef ROOTSYS
ifdef G4UI_USE_ROOT
CPPFLAGS += -DG4ANALYSIS_USE_ROOT $(shell $(ROOTSYS)/bin/root-config --cflags)
ROOTLIBS = $(shell $(ROOTSYS)/bin/root-config --glibs) -lMinuit -lHtml
ROOTLIBS := $(filter-out -lNew,$(ROOTLIBS))
ROOTLIBS := $(filter-out -lThread,$(ROOTLIBS))
ROOTLIBS := $(filter-out -lpthread,$(ROOTLIBS))
LDLIBS += $(ROOTLIBS)
endif
endif

plus make sure the two variables are defined correctly:
ROOTSYS & G4UI_USE_ROOT.

V.
None Re: Why not integrate G4UIRoot into the Geant4 offical releases?  Keywords: G4UIRoot
by Exaos Lee <Exaos Lee>,   23 Jan, 2004
Re: None Re: Why not integrate G4UIRoot into the Geant4 offical releases? (Guy Barrand)

It's an interesting question. Maybe I should ask your question again in the ROOT community.

Question Query regd. Importing solid models from CAD to GEANT4 via STEP  Keywords: Importing solid models, CAD,STEP Interface
by sowjanya <sowjanya.v@ge.com>,   04 Sep, 2003

Hi,

I want to know the feasibility of the process of Importing Solid models from CAD to GEANT4 via STEP interface. In the user guide, some limitations are mentioned regarding that. i want to know whether we can import solid models from CAD systems to GEANT4 successfully in all cases, if not in what cases it may fail?

Thankyou, Regards, Sowjanya.V

 

None How to put geant4's results into ntuple or Root files?  by Zhihong Li <Zhihong Li>,   03 Sep, 2003

Is the CERNLIB and ROOT library need to save geant4's simulation results to Ntuple and ROOT files?

None link to GGE broken  by Colleen A. Wilson <colleen.a.wilson-hodge@nasa.gov>,   01 Aug, 2003

Hi,
 I would like to try using GGE Geant4 Geometry Editor, since it sounds
like exactly what I need. How do I download it and the other GUI
interfaces? The link in the application developer's guide is broken.
Colleen

Question Scrambled characters on display using Gain with java web start  Keywords: java web start Gain
by Alain Ferragut <Alain Ferragut>,   30 Apr, 2003

Hi,
I have G4 running on a server computer. The problem is when I want
to connect with a client machine running on winNT using java web start
and Gain. I can connect properly to the server where G4 is installed.
But the window on the client computer showing the whole directory tree is unreadable. The
file names look like "L%$-&#-g++" instead of "Linux-g++". So I can't
read anything. 
On the other hand, I can run properly the demo applications on the 
sun web site. Why ?
Some details about the server configuration :
       --> OS : Linux Mandrake9.0

Thank you very much,

                     Alain

None help on Java  Keywords: Help
by june <alantisjun@hotmail.com>,   16 Dec, 2002

Could anyone help me? I am facing this problem. I went to delete the folder in /usr/java and i found i couldnt run java anymore. But i went to download the java file again, its in .sh after installing i place the folder in /usr but after which when i type java command, i get this error: Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object

CAn anyone help me please??

Warning G4ApplicationState has been changed   Keywords: G4ApplicationState
by Makoto Asai <Makoto Asai>,   13 Dec, 2002
Dear Geant4 users,

 At Geant4 5.0 released on December 13th, 2002, definition of 
the state IDs in G4ApplicationState have changed to prepend the 
"G4State_" prefix to the original state ID (i.e. "Idle" becomes 
"G4State_Idle", "Init" becomes "G4State_Init", and so on...).
The user code (particularly, user defined messengers defining state
dependent commands) will need to migrate to this new convention.

 This change was originated by the users requirement. The old
state IDs were too simple so that they made serious conflicts
against some external packages. 

                                               Makoto Asai
                                               SLAC

None Dawn and GV  Keywords: visualization
by <znnx@yahoo.com>,   31 Oct, 2002

Hi,

we have problems with interface of dawn and ghostview; our new machine has Linux OS (Red Hat 7.3, Japanese Version).

whenever we run some Geant4 examples, we can see the window from dawn: camera, draw axes, solid wire, RGB, etc... But when when we click "ok" under this same window, our system is always complaning about "font".

The message at the "gv" viewer is like this:

Error:/ invalidfont in findfont Operand stack

Execution stack % interp-exit .runexec2 --nostringual -- ..... ........ ........ Dictionary stack. --dict : 1047/1123 (ro)(G) ...... ........ current allocation mode is local Last OS error: 2 Current file position is 139 GNU Ghostscript 7.0.5 : Unrecoverable error, exit code 1

The version of "gv" is 3.5.8.. and dawn is 3.85c

What is the cause odf this error? How do we correct this error? So that that we can have visualization of our detector.

Thank you very much....

Zaldy

None Usage of /control/loop  by Frank Gaede <Frank Gaede>,   16 Oct, 2002

Hi,
could so. tell me or point me to some documentation on the usage of the
/control/loop command. In particular I don't know how to use the aliased 
loop variable in the called macro.
 Thanx, Frank.

None Re: Usage of /control/loop  Keywords: /control/alias
by Makoto Asai <Makoto Asai>,   16 Oct, 2002
Re: None Usage of /control/loop (Frank Gaede)
I would invite you to the Web page of Geant4 Users 
Workshop held at SLAC last February
  http://geant4.slac.stanford.edu/UsersWorkshop/
and follow the link of "workshop schedule". Then find
a tutorial presentation in the morning of Tuesday for
"User Commands".

None DAWN and Suze Linux  Keywords: DAWN
by roccaz <roccaz@csnsm.in2p3.fr>,   11 Apr, 2002

Hi to everyone.

I've installed Geant and Dawn on my PC which runs with Suze Linux 7.2. Geant conpiles well, but when i want to vizualize with dawn, that viewer stay blocked. I wonder if DAWN can really work with my Linux release.

Feedback Re: DAWN and Suze Linux  Keywords: DAWN
by Satoshi Tanaka <Satoshi Tanaka>,   29 Apr, 2002
Re: None DAWN and Suze Linux (roccaz)

Dear Raccaz,

This is Satoshi Tanaka, the developer of DAWN. Sorry for delay of my response.

Thank you for trying to use DAWN. I wll see the problem. Temporarily, I advice you to set an environmental variable:

  % setenv  DAWN_DEVICE  "3"

which switch the mode to EPS-file generation mode from the default X-window mode.

If you use DAWN with Geant4, DAWN runs with the EPS-file mode automatically, anyway.

You may also have to set another variable to set your viewer name.
For example, 
  setenv  DAWN_PS_PREVIEWER          "gv"

You shoud better to clean up old parameters before invoking DAWN again.

  % dawn  -c                 // clean up!
  % dawn primitives.prim

                                                        Satoshi Tanaka

PS My address changed to "stanaka@cs.ritsumei.ac.jp"

None Re: DAWN and Suze Linux  Keywords: DAWN
by roccaz <roccaz@csnsm.in2p3.fr>,   30 Apr, 2002
Re: Feedback Re: DAWN and Suze Linux (Satoshi Tanaka)

Oops I'm sorry, i didn't realized that you've answered to that old thread..I have no prob anymore with DAWN, i should have closed that thred, really sorry.

None Re: DAWN and Suze Linux  by Jerome Roccaz <roccaz@csnsm.in2p3.fr>,   29 Apr, 2002
Re: Feedback Re: DAWN and Suze Linux (Satoshi Tanaka)
On Mon, 29 Apr 2002, Satoshi Tanaka wrote:



I will try this...but according to John (and i agree with him) prob may
come from my geometry.

Thanks anyway ,

Jerome

None Java Installation  by Mike Bailey <Mike-Kez@bigpond.com>,   30 Jan, 2002
How do I install JSDK1.3?
The instruction on the Sun website tell me how to download 
but not how to configure?
Any help please?
Cheers,
Michael Bailey
None Re: Java Installation  by Hajime YOSHIDA <Hajime YOSHIDA>,   02 Feb, 2002
Re: None Java Installation (Mike Bailey)
Q1) what is your platform?
   - Linux (Intel based)
   - solaris
   - windows (Intel based)
Q2) If Unixen/Linuxen platform, do you have the root permission?
   - yes
   - no

A1) Linux and root
    download the RPM file and install it #rpm -ivh j2sdkxxxxxxx.rpm
       the JDK1.3 is installed in /usr/java/. set path to bin.
A2) Linux non-root
    download taz (tar zipped) file, tar fvxz it under the directory 
      of your choice. Then set path to jdk1.3/bin

A3) Windows administrator
     download and install by a simple click of the mouse button.
     set path as indicated in the document. 

   cheers
         Hajime
Question Compilation of Geant4 with JAS  Keywords: JAS
by sylvian kahane <skahane@bgumail.bgu.ac.il>,   21 Sep, 2001

I am trying to compile Geant4.3.2 with JAS interface. The compiler (or the dependence checker) keeps complaining that it does not find the file "jni.h".

Where this file is supposed to be ?

Note Re: Compilation of Geant4 with JAS, Suggestion  Keywords: JAS Java
by valerie <valerie>,   26 Sep, 2001
Re: Question Compilation of Geant4 with JAS (sylvian kahane)

If you can visit the link below, you can get all that you need. The file you are missing is actual part of java JDK package which should be installed.

Cheers

None Re: Compilation of Geant4 with JAS, Suggestion  Keywords: JAS Java
by <skahane@bgumail.bgu.ac.il>,   01 Oct, 2001
Re: Note Re: Compilation of Geant4 with JAS, Suggestion (valerie)

Well I took the include files from jdk 1.3.1 for Windows and I tried to compile with Win32-VC but, to my amazement, it keeps compaining that the "jlong" definition is wrong.

More Re: Compilation of Geant4 with JAS, link!!!  Keywords: JAS JAG
by valerie <valerie>,   26 Sep, 2001
Re: Note Re: Compilation of Geant4 with JAS, Suggestion (valerie)

The link and look at download:(

http://erpc1.naruto-u.ac.jp/~geant4

 Add Message Add Message
to: "(Graphical) User Interfaces"

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 ]