Presentation is loading. Please wait.

Presentation is loading. Please wait.

Improvement of G4Exception (and an announcement on G4ApplicationState) Makoto Asai (SLAC) on behalf of Architecture team.

Similar presentations


Presentation on theme: "Improvement of G4Exception (and an announcement on G4ApplicationState) Makoto Asai (SLAC) on behalf of Architecture team."— Presentation transcript:

1 Improvement of G4Exception (and an announcement on G4ApplicationState) Makoto Asai (SLAC) on behalf of Architecture team

2 03/Nov/2002Improvement of G4Exception - M.Asai 2 Motivation Guess how many G4Exception are implemented in our release code. Almost 1,600 !!! Guess how many of them are documented in our manual. Almost nothing. At least NO INDEX !!! There are strong user ’ s requirements Stability Avoid unnecessary core dump after thousands of events Just aborting an event could be enough for many cases “ Easy to use ” index of exceptions Much more explanation / information What ’ s wrong? How to fix?

3 03/Nov/2002Improvement of G4Exception - M.Asai 3 Proposal of improvement All exceptions MUST be registered to a Database So that we can maintain the document Change (not add) the syntax of G4Exception to enforce the improvement Exception name – used as the key of index Severity – to control the behavior of G4 Class and method name Description

4 03/Nov/2002Improvement of G4Exception - M.Asai 4 Severity Fatal exception – core dump Trivial error, e.g. file it not found or mandatory class is missing Fatal error in argument – core dump Trivial error in methods argument(s), e.g. negative value for a size of solid Run must be aborted Errors in geometrical setup, etc., which happen typically during the geometry closing / optimization Event must be aborted Errors in GPIL, DoIt, etc., which happen during an event loop Expected not to affect to another event Just a warning message

5 03/Nov/2002Improvement of G4Exception - M.Asai 5 G4Exception for warning messages A block of G4cerr warning messages could be sent to G4Exception with “ JustWarning ” severity. This allows us to book the warning messages in our indexed error message document. On the other hand, use of G4cerr is still encouraged for writing information just before issuing G4Exception of all severities. StringStream operation is useful to inform problematic values.

6 03/Nov/2002Improvement of G4Exception - M.Asai 6 Syntax of new G4Exception void G4Exception(const char* originOfException, const char* exceptionCode, G4ExceptionSeverity severity, const char* description); enum G4ExceptionSeverity {FatalException, FatalErrorInArgument, RunMustBeAborted, EventMustBeAborted, JustWarning}; Syntax of exceptionCode : XXX- where XXX is abridged category name

7 03/Nov/2002Improvement of G4Exception - M.Asai 7 Preparation of this improvement New G4Exception method and a handler of run/event abortion have already been committed to CVS. G4Event now has a flag of event abortion It is ready to use. Registration Web page is ready to use. Douglas Smith (SLAC) will maintain this page Utilizing Oracle database system Automatic generation of index is in preparation We are ready to start modifying our code!

8 03/Nov/2002Improvement of G4Exception - M.Asai 8 Registration Web pages It allows you to register, list, edit and delete exceptions. It automatically generates a document of exceptions with an index. This document will be attached to the user ’ s guide. Listing capability will be publicized to the user. At 5.0 release http://www.slac.stanford.edu/cgi-wrap/geant/g4exceptions/list

9 03/Nov/2002Improvement of G4Exception - M.Asai 9 Number of G4Exception in each category Event : 10 G3toG4 : 39 Global : 50 Intercoms : 5 Material : 34 Particle : 36 Parameterisation : 6 Persistency : 40 Run : 7 Track : 10 Tracking : 6 Geometry/solid : 174 Geometry/other : 178 Processes/electromagnetic/lowenergy : 123 Processes/electromagnetic/other : 15 Processes/hadronics : 719 Processes/other : 41 Visualization : 35 Example/novice : 3 Example/extended : 41 Example/advanced : 3 Test : 1

10 03/Nov/2002Improvement of G4Exception - M.Asai 10 Don ’ t be scared! Registration Web pages assist you. To be continued Almost all characters are accepted but no tab/space. 30 characters maximum.

11 03/Nov/2002Improvement of G4Exception - M.Asai 11 Once you register an exception … Description will appear on the screen once G4Exception occurs. Suggestion will be booked in a document, but will not appear on the screen.

12 03/Nov/2002Improvement of G4Exception - M.Asai 12 You ’ ll see a code fragment Ready to just copy & paste to your code

13 03/Nov/2002Improvement of G4Exception - M.Asai 13 Proposed schedule Kernel categories By 5.0 release Geometry/solid, concrete processes, visualization By 5.1 release By 5.1 release, old syntax of G4Exception will be eliminated. Code with old syntax will not be able to compile! Converting G4cout warning message to G4Exception Best effort bases but encouraged to be done by 5.1 START NOW!! http://www.slac.stanford.edu/cgi-wrap/geant/g4exceptions/list

14 03/Nov/2002Improvement of G4Exception - M.Asai 14 Announcement on G4ApplicationState Incident : Bug report #404 Enumeration of G4ApplicationState is too simple and it conflicts with an external package. I confirmed with simple two lines of code enum anEnum {goodDay, goodNight}; int goodDay(int i) {return 2*i;} causes a compilation error “previous non-function declaration conflicts with function declaration”

15 03/Nov/2002Improvement of G4Exception - M.Asai 15 Announcement on G4ApplicationState G4ApplicationState will be modified to enum G4ApplicationState { G4State_PreInit, G4State_Init, G4State_Idle, G4State_GeomClosed, G4State_EventProc, G4State_Quit, G4State_Abort }; Given this modification affects on many classes, changes are to be scheduled during the release phase of 5.0, with blocking the access to CVS. Hopefully automated by a script NOTE : Users’ messenger classes may also be affected Small work may be needed for (G)UI’s, which utilize state name as prompt characters.


Download ppt "Improvement of G4Exception (and an announcement on G4ApplicationState) Makoto Asai (SLAC) on behalf of Architecture team."

Similar presentations


Ads by Google