|
Geant4 VMC |
| Implementation | Source code documentation | Geometry descriptions |
Geant4 VMC represents the realisation of the Virtual Monte Carlo (VMC) for Geant4 . It can be also seen as a Geant4 application implemented via the VMC interfaces. It implements all Geant4 user mandatory classes and user action classes, which provide the default Geant4 VMC behaviour.
The VMC support two ways of geometry definition:
Since the version 2.0, user can choose between Geant4 native navigation and G4Root navigation, if geometry is define via TGeo. The choice of the navigation is done via the option specified with creating TG4RunConfiguration object (see examples for more details):
Below we shortly comment the implementation of these options:
As Geant4 does not support overlapping geometries, the positions with MANY option are not allowed with Geant4 navigation.
In case of geomVMCtoGeant4 option, user has a possibility
to identify all ONLY volumes that overlap with the MANY ones using TVirtualMC::Gsbool()
function for each overlap. This info is then used to perform automatically Boolean operations
on the concerned solids. The volume with a "MANY" position can have only this position
if Gsbool is used.
In case of geomRoottoGeant4 option, the MANY option is ignored and if present in geometry, Gean4 geometry will be incorrect.
There is no limitation on use of the MANY option with G4Root navigation (options geomVMCtoRoot, geomRoot .
Since the version 2.4, the default Geant4 VMC physics list has been removed and user can choose the physics list from the physics lists provided in Geant4 or include theit own physics list. The choice of the of the physics list is done via the option specified with creating TG4RunConfiguration object. This option is passed as second argument in TG4RunConfiguration constructor (see examples for more details):
The user VMC stack is used differently in Geant3 VMC and Geant4 VMC. Geant3 VMC pops both primary and secondary particles as they are provided by TVirtualMCStack::PopNextTrack(), while Geant4 VMC pops only primary particles using TVirtualMCStack::PopPrimaryForTracking() from the VMC stack. Stacking of secondary particles is then handled by Geant4 kernel and the user VMC stack only monitors this stacking.
The consequence of this is that, by default, the particles added to the VMC stack in other than TVirtualMCApplication::GeneratePrimaries() functions are ignored in Geant4 tracking. User has to activate the stack popper special process (see paragraph on Physics list selection), if he wants to add particles to the stack during tracking. The added particles are then handled as secondaries of the current track.
The stack classes in the VMC examples provide the same stacking mechanism for both Geant3 and Geant4 MCs and they are recommended to be used in a user application.
The default Geant4 VMC behaviour, defined by the Geant4 user mandatory classes
and user action classes implemented in Geant4 VMC, can be customized by a user
by providing his own class derived from TG4RunConfiguration.
Such customization is recommended for including a user own physics list;
an example of including user own physics list is provided in the VMC
example E03.
User has also the possibility to override detector construction and/or primary generation action classes and use an existing Geant4 geometry/primary generator definition with VMC. Including of user geometry construction is also demonstrated in the example E03.
In other cases, though the customisation is possible and allowed by the design, it has not been tested and so it is not recommended especially for the novice users.
By default, Geant3 defines cuts in kinetic energy while Geant4 cuts in range,
the corresponding values of cuts in kinetic energy are then calculated for each material.
The VMC provides a possibility for a user to define cuts in Geant3 way.
In order to activate these cuts in Geant4 VMC a user has to
switch on the special cuts process in his g4Config.C:
// Switch on special cuts (not activated by default)
TG4PhysicsListOptions options;
options.SetSpecialCutsPhysics(true);
runConfiguration->SetPhysicsListOptions(options);
Analogically user can switch on/off other physics options.
In case, a user has registered his own physics list, he has a possibility to register the special cuts physics constructor (class TG4PhysicsConstructorSpecialCuts) in his own modular physics list to get this functionality.
Geant4 VMC does not implement all TVirtualMC functions for visualization satisfactorily. User can better set visualization options directly using Geant4 visualization commands, as it is illustrated in the VMC examples in g4vis.in macro.
By default, Geant4 VMC supports only this VIS/UI setting:
OPENGLX, OPENGLXM, XM, TCSH .
In order to get supported all Geant4 visualization/UI drivers
user can customise the geant4_vmc/source/Makefile as described in the
comments in this file. All Geant4 graphics drivers and UIs
can be then used within Geant4 VMC, however not all these options were
tested in this environment and even though a correct behaviour is expected,
it is not guaranteed.
The VMC interface provides a common denominator for all implemented MC's and cannot cover all commands available in a Geant4 user session through Geant4 UI. Switching between the Root UI and the Geant4 UI gives a user the possibility of working with the native Geant4 UI when needed or desired.It is also possible to process a foreign command or a foreign macro in both UIs:
The geometry can be then browsed and visualized using GraXML tool .