Message: Re: How to turn off G4EXCEPTION warnings Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: How to turn off G4EXCEPTION warnings 

Forum: Physics List
Re: Question How to turn off G4EXCEPTION warnings (Bo Liu)
Re: None Re: How to turn off G4EXCEPTION warnings (Makoto Asai)
Date: 15 Oct, 2015
From: Bo Liu <Bo Liu>

Hello Makoto,

According to your instruction, I instantiate MyExceptionHandler after the G4RunManager. However, it doesnít work because I donít know how I can make the system recognize MyExceptionHandler instead of G4ExceptionHandler. Is there any function to register the MyExceptionHandler, something like SetUserInitialization?  

Thank you.

Best regards,
Bo

> On Oct 13, 2015, at 3:42 AM, Makoto Asai <asai@slac.stanford.edu> wrote:
> 
> 
> *** Discussion title: Physics List
> 
> Hi,
> 
> You need to have your own implementation of ExceptionHandler class.
> This is not a big deal. Copy G4ExceptionHandler.hh and
> G4ExceptionHandler.cc
> (that should be found in geant4/source/run/include and
> geant4/source/run/src)
> with your own class name (e.g. MyExceptionHandler.hh and
> MyExceptionHandler.cc)
> and change line #122 of the source file.
> 
> http://www-geant4.kek.jp/lxr/source/run/src/G4ExceptionHandler.cc#L122
> 
>  G4cout << ws_banner << message.str() << ....
> 
> should be changed to
> 
>  if(exceptionCode!="de0001") G4cout << ws_banner << message.str() <<
> ....
> 
> Then instantiate your MyExceptionHandler right after you instantiate
> G4RunManager (or G4MTRunManager). That's it.
> 
> Hope this helps,
> Makoto
> 
> -------------------------------------------------------------
> Visit this GEANT4 at hypernews.slac.stanford.edu message (to reply or unsubscribe) at: 
> http://hypernews.slac.stanford.edu/HyperNews/geant4/get/phys-list/913/1.html 

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

1 None: Re: How to turn off G4EXCEPTION warnings   (Makoto Asai - 15 Oct, 2015)
(_ None: Re: How to turn off G4EXCEPTION warnings   (Liu, Bo - 15 Oct, 2015)
 Add Message Add Message
to: "Re: How to turn off G4EXCEPTION warnings"

 Subscribe Subscribe

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


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