Problem 627 - problems with late loading of G4VIon
Summary: problems with late loading of G4VIon
Status: RESOLVED WONTFIX
Alias: None
Product: Geant4
Classification: Unclassified
Component: particles (show other problems)
Version: 6.0
Hardware: Other Other
: P2 normal
Assignee: kurasige
URL:
Depends on:
Blocks:
 
Reported: 2004-05-26 18:12 CEST by lerikson
Modified: 2004-06-07 09:07 CEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description lerikson 2004-05-26 18:12:34 CEST
Upon constructing a G4VIon at any time later than as a global variable (e.g. 'file scope')
then the particle either:
1) doesn't appear in a particle gun's canidate list or
2) it does appear and will cause a bus error when beam is activated.

If the G4VIon is constructed with file level scope then things work fine - however, my
application highly favors later construction of these objects.

Incidentially, particle guns constructed after the Ion do detect the existance of the Ion but
suffer from what appears to be an access violation.

Thank you for your time,
Luke Erikson
Comment 1 kurasige 2004-06-06 01:13:59 CEST
All ions derived from G4VIon are static class (such as G4Alpha, G4He3) same as
usual particles (i.e. proton, electron etc.) Objects of these classes are
created in global scope by using their static methods anywhere in your
application (Usually, XXXXDefinition() method is called in ConstructParticle()
method of PhysicsList. So, no way to create these particle objects dynamically
(i.e You can not use new nor declare variables in the local scope.)

Ions other than G4VIon (such as 12C, 60Co) are created dynamically by using the
G4ParticleTable::GetIon method.
Comment 2 lerikson 2004-06-07 08:39:59 CEST
Thank you for explaining the cause of the problem.  I don't see an explaination why you don't intend to
fix.  Why depend upon 'global' construction - the architechure clearly could be changed to remove this
requirement.
Comment 3 kurasige 2004-06-07 09:07:59 CEST
At the beggining of Geant4, we decided that particle definition class (such as
G4Proton, G4Alpha) is defined as static. Now we are studying possiblities that
all particle definition classes are created dynamically (not as static objects).
But this design change gives big impacts on many categries in Geant4. So I can
not say clear statements for the future release.