Physics

You can use one of the GAMOS physics list, use one of the Geant4 physics lists or write your own one, following the standard Geant4 way, i.e. by writing your C++ class inheriting from G4VUserPhysicsList.

GAMOS electromagnetic physics lists

Basic electromagnetic physics list

The GAMOS basic electromagnetic physics list defines electromagnetic particles: photons, electrons, positrons and optical photons. To use this physics list you have to use the command:

/gamos/physicsList GmEMPhysics

This physics list instantiates the most common processes for gammas, electrons and positrons, and also for optical photons. For gammas and electrons uses the low energy (based on Livermore data) models, while for positrons uses the standard models (no Livermore model exists). The detail of the processes and models used, plus the options of the models for which the defaults values are changed is the following(see Geant4 documentation for a better understanding of the physics of each process and model):

  • gamma:
    • photo-electric: G4PhotoElectricEffect using model G4LivermorePhotoElectricModel below 1 GeV and G4PEEffectFluoModel above.
    • Compton scattering: G4ComptonScattering using model G4LivermoreComptonModel below 1 GeV and G4KleinNishinaCompton above.
    • **Gamma conversion: G4GammaConversion using model G4LivermoreGammaConversionModel above 1 GeV and G4BetheHeitlerModel above.
    • **Rayleigh scattering: G4RayleighScattering using model G4LivermoreRayleighModel below 1 GeV and none above.
  • electron:
    • **ionisation: G4eIonisation using G4LivermoreIonisationModel with G4UniversalFluctuation below 1 GeV and G4MollerBhabhaModel above. The RoverRange and the finalRangeRequested of the step function are set to 0.2 and 0.1 mm.
    • **bremsstrahlung: G4eBremsstrahlung using GmLivermoreBremsstrahlungModel below 1 GeV and G4eBremsstrahlungRelModel above. The angular distribution is Tsai.
    • **ionisation: G4eIonisation using G4LivermoreIonisationModel with G4UniversalFluctuation below 1 GeV and G4MollerBhabhaModel above. The RoverRange and the finalRangeRequested of the step function are set to 0.2 and 0.1 mm.
    • **multiple scattering: G4VMultipleScattering using model G4UrbanMscModel. Step limit type is set to UseDistanceToBoundary.
  • positron:
    • ionisation: G4eIonisation using G4MollerBhabhaModel.
    • **bremsstrahlung: G4eBremsstrahlung using model G4SeltzerBergerModel below 1 GeV and G4eBremsstrahlungRelModel above.
    • **multiple scattering: G4VMultipleScattering using model G4UrbanMscModel.
    • **annihilation: GmAcollinearEplusAnnihilation using the G4eeToTwoGammaModel, but to properly treat the acollinearity of the two gammas emitted the distribution of the angular difference is given by Colombino et al. [biblio.Colombino]. The default Geant4 behaviour can be used if the parameter: /gamos/setParam GmPhysicsPositronStandard:ePlusAcollinearAnnihilation 0:
  • opticalphoton:
    • **scintillation: this process is activated for all particles, except short-lived ones. Process class is G4Scintillation with yield factor 1. the option to track secondaries before the primary track ends is activated by default. It may be changed with the parameter: /gamos/setParam GmPhysicsOpticalPhoton:TrackSecondariesFirst 0
    • **optical absorption: G4OpAbsorption.
    • **optical Rayleigh scattering: G4OpRayleigh
    • **optical boundary: G4OpBoundaryProcess with unified model.

The default physics models can be overridden by choosing among the three categories that Geant4 proposes for electromagnetic interactions: standard, low energy or Penelope models. This can be done with the command

/gamos/GmPhysics/replacePhysics PHYSICS_MODEL_NAME

where PHYSICS_MODEL_NAME is one of the names in the list below. The default options (those explained above) are underlined.

The following physics models are available:

  • gammas:
    • gamma-lowener: low energy, based on Livermore Evaluated Particle Data Library
    • gamma-standard: standard electromagnetic processes. photo-electric uses G4PEEffectFluoModel, Compton scattering uses G4KleinNishinaCompton, gamma conversion uses G4BetheHeitlerModel. No Rayleigh scattering.
    • gamma-penelope: processes a’ la Penelope [biblio.penelope]. Below 1 GeV photo-electric uses G4PenelopePhotoElectricModel, Compton scattering uses G4PenelopeComptonModel, gamma conversion uses G4PenelopeGammaConversionModel, above 1 GeV the standard models are used. Rayleigh scattering uses G4PenelopeRayleighModel.
  • electrons:
    • electron-lowener: low energy, based on Livermore Evaluated Particle Data Library.
    • electron-standard: standard electromagnetic processes. Ionisation uses G4MollerBhabhaModel, bremsstrahlung uses G4SeltzerBergerModel below 1 GeV and G4eBremsstrahlungRelModel above, multiple scattering uses G4UrbanMscModel.
    • electron-penelope: processes a’ la Penelope. Below 1 GeV ionisation uses G4PenelopeIonisationModel and bremsstrahlung uses G4PenelopeIonisationModel and bremsstrahlung, above 1 GeV the standard models are used. Multiple scattering uses G4UrbanMscModel.
  • positrons:
    • positron-standard: standard electromagnetic processes
    • positron-penelope: processes a’ la Penelope

For details on the physics implemented in each of these physics processes and models, please read the Geant4 physics manual [biblio.g4doc-physics] .

This physics list also switches on the atomic deexcitation, see section below.

GAMOS extended electromagnetic physics list

This physics list can be selected with the command

/gamos/physicsList GmEMExtendedPhysics

It creates all Geant4 particles, using the constructors G4BosonConstructor, G4LeptonConstructor, G4MesonConstructor, G4BaryonConstructor, G4IonConstructor, G4ShortLivedConstructor. For these particles the physics implemented is the following (see Geant4 Physics Reference manual for a detailed explanation of the physics options).

  • mu+, mu-: G4MuMultipleScattering, with G4WentzelVIModel, G4MuIonisation with SetStepFunction(0.2, 50*um), G4MuBremsstrahlung, G4MuPairProduction and G4CoulombScattering
  • alpha, He3: G4hMultipleScattering, G4ionIonisation with SetStepFunction(0.2, 50*um) and G4NuclearStopping
  • GenericIon: G4hMultipleScattering, G4ionIonisation with model G4IonParametrisedLossModel and SetStepFunction(0.1, 10*um)m, and G4NuclearStopping
  • pi+, pi-, kaon+, kaon-: G4hMultipleScattering, G4hIonisation with SetStepFunction(0.2, 50*um), G4hBremsstrahlung and G4hPairProduction. The minimum energy for the validity of G4hBremsstrahlung is set to 10 keV, instead of the default value 1 GeV.
  • Other charged particles: G4hMultipleScattering and G4hIonisation

This physics lists inherits from GmEMPhysics, so that the command /gamos/GmEMPhysics/replacePhysics can be used to change the physics models of the electromagnetic particles.

Geant4 electromagnetic physics list options

Geant4 offers several options of electromagnetic physics, which are used extensively in the Geant4 examples. Those options are named:

  • G4EmStandardPhysics
  • G4EmStandardPhysics_option1
  • G4EmStandardPhysics_option2
  • G4EmStandardPhysics_option3
  • G4EmStandardPhysics_GS
  • G4EmStandardPhysics_WVI
  • G4EmStandardPhysics_SS
  • G4EmLivermorePhysics
  • G4EmLivermorePolarizedPhysics
  • G4LowEPPhysics
  • G4PenelopePhysics

See http://www.geant4.org/geant4/collaboration/working_groups/electromagnetic/physlist.shtml for the documentation on these options.

To use these options can be done selecting the physics list:

/gamos/physicsList GmG4EMPhysics

By default the first option is selected, to change it the following command has to be used:

/gamos/EMStandardPhysics/replacePhysics OPTION

where OPTION may be emstandard_opt0, emstandard_opt1, emstandard_opt2 or emstandard_opt3 (default), emstandard_opt1, emstandard_GS, emstandard_WVI, emstandard_SS, emlivermore, emlivermore_polarized, emlowEP, empenelope.

Multiple scattering models

If you use any of the three GAMOS physics list described above you may use any of the multiple scattering models available in the current version of Geant4. This may be done with the following parameter:

/gamos/setParam GmMultipleScattering:Model:PARTICLE_NAME MODEL

where PARTICLE_NAME can be e-, e+, mu or hadron and MODEL can be Urban, WentzelVI or GoudsmitSaunderson (see the Geant4 User’s Guide for an explanation of each model). The default model for all particles is Urban. If your problem is in the micrometer or nanometer range this model may give incorrect results and we recommend you to use the GoudsmitSaunderson one.

Bremsstrahlung angular distributions

The Geant4 low energy electromagnetic model of bremsstrahlung offers three different angular distributions, namely Tsai, 2BN and 2BS (see Geant4 Physics Reference Manual for an explanation of the difference between the three models). If you are using any of the three GAMOS physics lists above you may select among one of the three with the following parameter:

/gamos/setParam GmPhysicsElectron:Bremsstrahlung:AngularDistribution MODEL

where MODEL can be tsai (which is the default model), 2bn or 2bs.

You should nevertheless take into account that the 2bn distribution has an intrinsic kinematical limit of 1 MeV, so you should not set the upper energy limit to a higher value if you want to use it.

In the latest Geant4 release, it is also possible to change the bremsstrahlung angular distributions for standard processes. To do it use the same parameter as above. In this case the model is applied for all energies.

GAMOS hadrontherapy physics list

The GAMOS hadrontherapy physics list is based on the hadron-therapy Geant4 advanced example.

This physics list can be selected with the command

/gamos/physicsList HadrontherapyPhysics

The default physics options are those include in the Geant4 physics lists G4EmStandardPhysics_option3, G4DecayPhysics, G4RadioactiveDecayPhysics and QGSP_BIC_HP.

This default physics can be changed with the command

/HT/Physics/replacePhysics PHYSICS_LIST

where PHYSICS_LIST can be

  • standard_opt3: G4EmStandardPhysics_option3
  • LowE_Livermore: G4EmLivermorePhysics
  • LowE_Penelope:G4EmPenelopePhysics
  • local_ion_ion_inelastic: LocalIonIonInelasticPhysics
  • QGSP_BIC_EMY: QGSP_BIC_EMY

This list has several commands to select cuts:

/HT/Physics/setCuts VALUE UNIT : set the cuts for all volumes and particles

/HT/Physics/setGCut VALUE UNIT : set the cuts for gammas for all volumes

/HT/Physics/setECut VALUE UNIT : set the cuts for electrons for all volumes

/HT/Physics/setPCut VALUE UNIT : set the cuts for positrons for all volumes

Microdosimetry physics list

The DNA physics list defines the physics processes and models to simulate interactions of electrons of very low energy (down to 7 eV) in water. It is based on the physics list that can be found in the Geant4 example examples/examples/extended/medical/dna/microdosimetry/.

This physics list can be selected with the command

/gamos/physicsList GmDNAPhysics

More details of this physics list can be found at http://geant4-dna.org/

Other physics lists

You can easily use in GAMOS any of the Geant4 physics lists [biblio.g4phys-lists]. All you have to do to use a Geant4 physics list is to add in the file GAMOS_DIR/source/GamosCore/GamosPhysics/GamosOtherPhysicsList/src/plugin.cc (or in any other in GAMOS code or created by you, see Appendix on Creating your plug-in) two lines like these ones:

#include "QGSP.hh"
DEFINE_GAMOS_PHYSICS(QGSP);

Compile it and then you can use it in your command file with the line

/gamos/physicsList QGSP

As you can see looking at this file, all the physics list in the Geant4 source code are already included and therefore can be selected with a user command

There is also in GAMOS a GmDummyPhysicsList that defines all the particles, but only the process G4Transportation.

All the Geant4 physics list that can be found in the directory source/physics_lists. These are:

  • FTF_BIC
  • FTFP_BERT
  • FTFP_BERT_HP
  • FTFP_BERT_TRV
  • FTFP_BERT_ATL
  • FTFP_INCLXX
  • FTFP_INCLXX_HP
  • FTFP_QGSP_BERT
  • LBE
  • NuBeam
  • QGSP_BERT
  • QGSP_BERT_HP
  • QGSP_BIC
  • QGSP_BIC_HP
  • QGSP_BIC_AllHP
  • QGSP_FTFP_BERT
  • QGSP_INCLXX
  • QGSP_INCLXX_HP
  • QGS_BIC
  • Shielding
  • ShieldingLEND

Optical photons

You may add the physics of optical photons to any physics list including the command:

/gamos/physics/addPhysics opticalphoton

This will activate the scintillation process for all the particles and the G4OpAbsorption, G4OpRayleigh and G4OpBoundaryProcess processes for optical photons. To avoid blowing up the memory by the thousands of optical photons that may be created at one step, by default the secondary optical photons are tracked at the moment they are created; this means that the primary particle is stopped and later it is restarted. You may deactivate this option with the parameter

/gamos/setParam GmPhysicsOpticalPhoton:TrackSecondariesFirst 0

The yield factor, i..e the number of optical photons created per MeV, is set by default to 1, you may change it with the parameter

/gamos/setParam GmPhysicsOpticalPhoton:YieldFactor FACTOR

To define the optical properties of the medium, you must create a G4MaterialPropertiesTable which is linked to the G4Material in question (without it no optical photon will be created). All the properties can be managed in the geometry text file, using tags similar to those of the geometry text file utility. For details on the meaning of these parameters please refer to the Geant4 documentation. We describe here these tags with the parameters that should accompany them.

To define a new G4MaterialPropertiesTable you have to use the tag:

:MATE_PROPERTIES_TABLE

  • Table name

Then you can add different properties to the table. There are two kinds of properties: those that are defined by a single number (called constant properties in Geant4 notation) and those that are defined by a list of numbers, one associated to an energy.

To define a constant property the following tag must be used:

:MATEPT_ADD_CONST_PROPERTY

  • Material properties table name
  • Property name
  • Property value

To define non constant properties, you have to define first the list of energies that you will use to assign the different properties to the table:

:MATEPT_ADD_ENERGIES

  • Material properties table name
  • Energy 1
  • Energy 2
  • Energy N

Then to define a property:

:MATEPT_ADD_PROPERTY

  • Material properties table name
  • Property name
  • Value 1
  • Value 2
  • Value N

The material properties table can be attached to a material with the tag (use it several times to attach it to several materials:

:MATEPT_ATTACH_TO_MATERIAL

  • Material properties table name
  • Material name

You can create an optical surface with the tag:

:OPTICAL SURFACE

  • Name
  • Boundary process model. It can be - UNIFIED - GLISUR - LUT
  • Boundary process model. It can be - UNIFIED - GLISUR - LUT
  • Surface finish type. It can be - polishedfrontpainted - polishedbackpainted - ground - groundfrontpainted - groundbackpainted - polishedlumirrorair - polishedlumirrorglue - polishedair - polishedteflonair - polishedtioair - polishedtyvekair - polishedvm2000air - polishedvm2000glue - etchedlumirrorair - etchedlumirrorglue - etchedair - etchedteflonair - etchedtioair - etchedtyvekair - etchedvm2000air - etchedvm2000glue - groundlumirrorair - groundlumirrorglue - groundair - groundteflonair - groundtioair - groundtyvekair - groundvm2000air - groundvm2000glue
  • Surface type. It can be - dielectric_metal - dielectric_dielectric - dielectric_LUT

Optionally the polish value and the sigma alpha value can be set by adding two exta arguments:

The material properties table can be attached to a optical surface with the tag (use it several times to attach it to several optical surfaces:

:MATEPT_ATTACH_TO_OPTICAL SURFACE

  • Material properties table name
  • Optical surface name

You can create a logical border surface with the tag:

:LOGICAL_BORDER SURFACE

  • Material properties table name
  • First physical volume name
  • Second physical volume name
  • Optical surface name

You can create a logical skin surface with the tag:

:LOGICAL_SKIN SURFACE

  • Material properties table name
  • Logical volume name
  • Optical surface name

Using optical photons as primary generator

If you are using optical photons as primary generator particles, you may set the polarization using the parameter (see chapter on Generator):

/gamos/setParam SOURCE_NAME:Polarization POLARIZ_X POLARIZ_Y POLARIZ_Z

X-ray refraction

GAMOS offers the novelty of an X-ray refraction process, which implements a Snell’s law refraction and is based on the Geant4 refraction process for optical photons. You may instantiate it with the command:

/gamos/physics/addPhysics xray-refraction

always after the /run/initialize command. Is it also necessary to set the refraction indices for each material and for each energy. This can be done by using the command (you may use one command per material)

/gamos/geometry/setRefractionIndex MATERIAL_NAME ENERGY_1 REFRACTION_INDEX_1 ENERGY_2 REFRACTION_INDEX_2 …

the value for a given energy of a given material will be interpolated among these set of values. It is important that you give a refraction index for all possible energies in your problem, if not you will get a warning that the error is out of range.

If you use this code you should quote the following reference in your results:

Zhentian Wang,Zhifeng Huang,Li Zhang,Zhiqiang Chen,Kejun Kang. Implement X-ray refraction effect in Geant4 for phase contrast imaging. IEEE Nuclear Science Symposium Conference Record,2009,1082-3654.

Coulomb scattering

You may activate Coulomb scattering (also known as single scattering) for electrons and positrons by suing the command:

/gamos/physics/addPhysics CoulombScattering

Atomic deexcitation processes

The atomic deexcitation, i.e. the production of characteristic X-rays and Auger electrons, when the atoms are excited after an ionisation or photo electric process, is activated by default if one of the two GAMOS electromagnetic physics list is selected. To deactivate it you can use the parameter:

/gamos/setParam GmEMPhysicsList:AtomicDeexcitation 0

The default behaviour activates atomic deexcitation only for the default Geant4 region, DefaultRegionForTheWorld, which is created for volumes not associated to any region (see section on Production cuts by region). To activate it for list of regions you can use the parameter:

/gamos/setParam AtomicDeexcitation:Regions REGION_1 REGION_2 …

You may also want to change the production cuts, that is the minimum value of the energy of the characteristic X-rays or Auger electrons. This can be done independently for the secondary particles generated by ionisation and photo electric effect. The parameters to do it for ionisation are:

By default production of characteristic X-rays by fluorescence and Auger electrons is on, while PIXE is off. You can also select which process to activate with the parameters

/gamos/setParam AtomicDeexcitation:Fluorescence 1

/gamos/setParam AtomicDeexcitation:Auger 1

/gamos/setParam AtomicDeexcitation:PIXE 1

It is important to note, that the production of secondary gammas or electrons is affected by the same cuts than the production of bremsstrahlung gammas and ionisation electrons. This means that if these cuts are high, those particles will not be produced; although the atomic deexcitation processes will be active the energy of the secondary particles will be added to the energy deposited. We remind you that the production cuts are set by range in Geant4, but you can find the range to energy threshold conversion for each material at the beginning of your job.

Decay process

You can activate the decay process for all particles for which it is applicable with the user command:

/gamos/physics/addPhysics decay

Radioactive decay process

Each time an ion is created by a GAMOS command (to use is as primary particle, to create a filter to select it, …), the radioactive decay process is activated for it. You can avoid this by using the parameter

/gamos/setParam Physics:RadioactiveDecay 0

But if the ion is created by Geant4 and you want to activate the radioactive decay process to have to use command:

/gamos/physics/addPhysics radioactiveDecay

This command has to be used after the /run/initialize command, and activates automatically this process for all ions.

Cerenkov process

You can activate the Cerenkov processes for all charged particles with the user command:

/gamos/physics/addPhysics cerenkov

Several parameters can be set before this command to control the Cerenkov process:

/gamos/setParam GmPhysicsCerenkov:MaxNumPhotonsPerStep VALUE

limits the step size by specifying a maximum (average) number of Cerenkov photons created during the step. The default value is 0, i.e. no limit.

/gamos/setParam GmPhysicsCerenkov:TrackSecondariesFirst 1

serves to avoid blowing up the memory by the thousands of photons that may be created at one step. by tracking the secondary photons at the moment they are created; this means that the primary particle is stopped and later it is restarted.

/gamos/setParam GmPhysicsCerenkov:MaxBetaChange VALUE

sets the maximum allowed change in beta = v/c in % (perCent). The default value is 0, i.e. no limit.

Coulomb scattering

Coulomb scattering is an alternative to multiple scattering where the particles are transported colliding with an atom per step (instead of averaging multiple collisions). It is therefore a precise but slow process.

This process can be activated with the user command:

/gamos/physics/addPhysics CoulombScattering

You also have to remember to delete the multiple scattering process:

/gamos/physics/removeProcessesByName msc

Nuclear processes of electromagnetic particles

You can activate the nuclear process of gammas, electrons or positrons with one of the following user commands:

/gamos/physics/addPhysics gammaNuclear

/gamos/physics/addPhysics electronNuclear

/gamos/physics/addPhysics positronNuclear

Replacing electromagnetic process models

Replacing a set of process models

Whatever physics list you have chosen, you can replace part of the electromagnetic models of one of more particles by one of the three models (standard, low energy or Penelope) with the command:

/gamos/physics/replacePhysics MODELS_1 MODELS_2 …

where MODELS_i … may be: gamma-standard gamma-lowener gamma-penelope electron-standard electron-lowener electron-penelope positron-standard positron-penelope (there are no positron low energy models in Geant4).

Replacing one process model

Another command allows to replace only one model of one process, also independent of the physics list you have set:

/gamos/physics/replaceProcessModel PARTICLE_NAME PROCESS_NAME MODEL_NAME …

The following set of particles, process and model can be used:

  • gamma phot standard
  • gamma phot lowener
  • gamma phot penelope
  • gamma compt standard
  • gamma compt lowener
  • gamma compt penelope
  • gamma conv standard
  • gamma conv lowener
  • gamma conv penelope
  • gamma Rayl lowener
  • gamma Rayl penelope
  • electron eIoni standard
  • electron eIoni lowener
  • electron eIoni penelope
  • electron eBrem standard
  • electron eBrem lowener
  • electron msc Urban
  • electron msc WentzelVI
  • electron msc GoudsmitSounderson
  • positron eIoni penelope
  • positron eIoni standard
  • positron eIoni lowener
  • positron eBrem penelope
  • positron eBrem standard
  • positron eBrem lowener
  • positron annihil lowener
  • positron annihil penelope
  • positron msc Urban
  • positron msc WentzelVI
  • positron msc GoudsmitSounderson

Removing a process from a physics list

Several commands can be used to remove a process that is instantiated by a physics list without having to modify the C++ code and recompile

The process to be removed can be selected by name

/gamos/physics/removeProcessesByName PROCESS_NAME_1 PROCESS_NAME_2 …

To find the name that Geant4 gives to a process, you may use the commands:

/gamos/setParam GmCountProcessesUA:PrintProcList 1 /gamos/userAction GmCountProcessesUA

which will give yo a list of the process names attached to each particle in your physics list.

If you do not want to select all the processes give a given name, but only if they are attached to a particle, you can use the command

/gamos/physics/removeProcessesByParticleAndName PARTICLE_NAME_1 PROCESS_NAME_1 PARTICLE_NAME_2 PROCESS_NAME_2 …

Alternatively you may select all process of a given type

/gamos/physics/removeProcessesByType PROCESS_TYPE_1 PROCESS_TYPE_2 …

where the types are those defined by Geant4: Transportation,Electromagnetic, Optical, Hadronic, Photolepton_hadron, Decay, General, Parameterisation, UserDefined or NotDefined

Production thresholds (cuts)

Several physics processes, namely bremsstrahlung, ionisation from all charged particles and e+e- pair production from muons have very high cross sections at low energies. It is therefore necessary to implement a production cut so that all particles below it are not generated, but their energy is accounted as energy deposited. Geant4 uses production cuts in range, instead of in energy as used previously by GEANT3 and most Monte Carlo codes. A cut of for example 1. mm for photons means that no photon will be produced if the expected range in the current material is less than 1. mm.

If you use the GAMOS electromagnetic physics list, the default production cut value is 0.1 mm for all processes in all materials. The Geant4 command /run/setCut ‘value’ ‘unit’ set the cuts for all process to the desired value. But do not forget to use the command /run/initialize after setting the cuts, if you want that your change is effective. The Geant4 command /run/particle/dumpCutValues dumps the list of materials and for each one the list of cuts for each particle (in GAMOS it is printed by default).

One word of caution is due here: internally Geant4 converts the cuts for range in each material to cuts for energy and uses these for their computations. There is a low energy limit so that if the range cut you use is very small it will be converted to this energy value. The default value in Geant4 is 990 eV. You may change this value with the Geant4 user command:

/cuts/setLowEdge ENERGY ENERGY_UNIT

Production cuts by region

A region in Geant4 is a set of G4LogicalVolume’s that share common properties. You can define a region in the text file where you defined your geometry, by using the tag

:REGION REGION_NAME LOGICAL_VOLUME_NAME(s)

where REGION_NAME is the name that identifies the region and LOGICAL_VOLUME_NAME(s) is the list of G4LogicalVolume’s that belong to the region. For example:

:REGION myRegion Crystal Wall

Alternatively you can define a new region in your user script through a user command:

/gamos/geometry/createRegion REGION_NAME LOGICAL_VOLUME_NAME

Do not forget that in Geant4 when a logical volume belongs to a region automatically all its daughters belong to the same region, unless there is another region explicitly defined for some of the daughters.

Also do not forget that regions in Geant4 have to be set in a hierarchical way: if you place a volume A in the world and inside it you place a volume B, you cannot create a new region for B unless you have explicitly created a region for A.

Once you have defined a region, you may set a cut for the particles that traverse that region with the tag

:CUTS REGION_NAME  gamma_CUT e-_CUT e+_CUT

where REGION_NAME is the name of a previously defined region, gamma_CUT e-_CUT e+_CUT are the cuts for gamma, electrons and positrons (the cut for positron is optional; if not set it will take the one for electrons).

Alternatively you can set the cuts in your user script through a user command:

/gamos/physics/setCuts REGION_NAME gamma_CUT e-_CUT e+_CUT

Energy cuts to range cuts conversion

If you want to know the translation from an energy cut value to a range cut value for a given particle in a given material, you can do with the following instructions. First you have to instantiate the user action

/gamos/userAction GmCutsEnergy2RangeUA

and then you can use the command

/gamos/physics/ECuts2RangeCuts MATERIAL_NAME CUT_VALUE PARTICLE_NAME

You may use in the material name an ‘*’ if you want to name several materials at the same time. For the particle name only the following names have a meaning: gamma, e-, e+, e, **. This will produce a table with the conversion for each material and particle similar to the following one:

GmCutsEnergy2RangeUA:  MATERIAL:  G4_AIR  PART: gamma
ENERGY CUT: 0.1 (MeV)  = RANGE CUT: 286588
GmCutsEnergy2RangeUA:  MATERIAL:  G4_AIR  PART: e-
ENERGY CUT: 0.1 (MeV)  = RANGE CUT: 129.155
GmCutsEnergy2RangeUA:  MATERIAL:  G4_AIR  PART: e+
ENERGY CUT: 0.1 (MeV)  = RANGE CUT: 131.938
GmCutsEnergy2RangeUA:  MATERIAL:  G4_WATER  PART: gamma
ENERGY CUT: 0.1 (MeV)  = RANGE CUT: 334.152
GmCutsEnergy2RangeUA:  MATERIAL:  G4_WATER  PART: e-
ENERGY CUT: 0.1 (MeV)  = RANGE CUT: 0.134781
GmCutsEnergy2RangeUA:  MATERIAL:  G4_WATER  PART: e+
ENERGY CUT: 0.1 (MeV)  = RANGE CUT: 0.137686

Minimum and maximum production cuts

Geant4 has internal limits in the minimum and maximum energy of a production cuts. These values are by default 990 eV and 100 TeV. You may change these values with the command:

/gamos/physics/prodCutsEnergyLimits MIN_ENERGY MAX_ENERGY

Apply cuts for all processes

By default the production cuts are only applied to ionisation, bremsstrahlung and to electron-positron production by muons, but they may be applied to any process by using the command:

/gamos/physics/applyCutsForAllProcesses

You may observe that the behaviour of the two commands is indeed quite different. While the Geant4 electromagnetic process implements a mechanism to make use of the production cuts, the hadronic processes do not. Therefore the first command is executed at each process, not creating the corresponding secondary particles if their range is small. On the other side, the second command is implemented as a user stacking action, so that the tracks are created but killed before they are started to be tracked.

User limits

The user limits is a mechanism that Geant4 offers to limit the tracking of a particle. There are five types of user limits:

  • Limit the step size
  • Limit the track length
  • Limit the time of flight
  • Stop the particle when the kinetic energy is below a limit (and deposit its energy locally)
  • Stop the particle when the expected range is below a limit (and deposit its energy locally)

In GAMOS a user can set the user limits through simple user commands and user limits can be set independently for different particle types in the same or different logical volumes. The set of commands to set user limits are

  • /gamos/physics/userLimits/setUserLimits USER_LIMITS_NAME LOGICAL_VOLUME_NAME PARTICLE_NAME MAX_STEP MAX_TRK_LENGTH MAX_TOF MIN_KIN_E MIN_RANGE where USER_LIMITS_NAME is the name of the user limits (every user limits must have a name, so that new logical volumes and particles can be added with user commands later), MAX_STEP MAX_TRK_LENGTH MAX_TOF MIN_KIN_E and MIN_RANGE are the values of the five user limit types described above. If you want to set only one user limit type you can use one of the following commands:
  • /gamos/physics/userLimits/setMaxStep USER_LIMITS_NAME LOGICAL_VOLUME_NAME PARTICLE_NAME MAX_STEP
  • /gamos/physics/userLimits/setMaxTrkLen USER_LIMITS_NAME LOGICAL_VOLUME_NAME PARTICLE_NAME MAX_TRK_LENGTH
  • /gamos/physics/userLimits/setMaxTOF USER_LIMITS_NAME LOGICAL_VOLUME_NAME PARTICLE_NAME MAX_TOF
  • /gamos/physics/userLimits/setMinEKin USER_LIMITS_NAME LOGICAL_VOLUME_NAME PARTICLE_NAME MIN_KIN_E
  • /gamos/physics/userLimits/setMinRange USER_LIMITS_NAME LOGICAL_VOLUME_NAME PARTICLE_NAME MIN_RANGE

There is another command in GAMOS that serves to set the minimum range user limit using a distance value, but internally it is applied as a minimum kinetic energy limit. This permits to use range values but avoids the lengthy process of converting the kinetic energy at each step into range. For this you can use the command:

  • /gamos/physics/userLimits/setMinEKinByRange USER_LIMITS_NAME LOGICAL_VOLUME_NAME PARTICLE_NAME MIN_RANGE

Once a user limit is set, you may apply it to a new pair of logical volume and particle type with the following command:

  • /gamos/physics/userLimits/addLVAndParticle USER_LIMITS_NAME LOGICAL_VOLUME_NAME PARTICLE_NAME for the list of particle names in GAMOS, see section Particle names .

A last command serves to print the active user limits for each volume and each particle:

/gamos/physics/userLimits/print

Automatic optimisation of cuts

The production cuts and user limits are powerful methods to tune your simulation so that you can save a lot of CPU time by not tracking the particles that are not going to contribute to your results. Nevertheless the tuning of cuts for each particle and each process is usually a long and difficult task. We have developed in GAMOS a method to help the user to obtain the optimal value of the production cuts and user limits for her/his application in a single job. We describe here the basic idea of the method and then in the corresponding sections the details of its implementation for different cases.

To use this utility you have to define in a clear way which are the results you don’t want to change when cuts change, for example

  • Number of particles reaching a region
  • Dose distribution
  • Number/energy/spatial distribution of hits
  • Shower shape in a volume

For each track that contributes to your result GAMOS stores all its history: for the track itself and each of its ancestors stores energy, range, region, process and particle type. In the case of production cuts this information is stored at particle creation. In the case of user limits this information is stored at each step (for parents only the steps before the creation of the interesting track).

At the end of run you can can get for each region/process/particle a list of all the ranges or energies of all the particles created. Then you can easily know if you apply a cut how many particles are below it.

This is valid if you are only interested in counting how many particles you lose. For other cases another approach should be used. For example if you want to check how your dose distribution changes, you can build a set of filters, each one with a set of cut values. These filters do not really cut the particles but only serve to tag a particle if it would have been killed by the set of cuts in the filter. Therefore, for each track that contributes to your results, GAMOS can check if it (or any of its ancestors) would have been killed by each of these sets of cut values. If you build your results N times in a job, each one using only those tracks that pass one filter, you can compare each result to see how it changes with each set of cuts.

Although as mentioned above, the production cuts are only necessary for ionization and bremsstrahlung processes, this method allows to extend the production cuts to other processes. To do this we provide the above-mentioned numbers and plots separately for each process so that the cuts can be automatically set in an easy way. If you want to apply the same cuts to all processes you can use the GAMOS command

/gamos/GMphysics/applyCutsToAllProcesses

that will instantiate an object of type G4EmProcessOptions and invoke the method SetApplyCuts(true).

In the PET and Radiotherapy applications chapters you can see the details of how to apply this technique in these fields.

Range rejection

The range rejection technique consists on killing a particle at creation and depositing all its energy locally if it is not going to leave the current volume. To do this in practical terms, the particle is killed if the range is smaller than the distance to the volume boundary (although it would have a chance to exit the volume, this chance is considered negligible).

You can analyze which would be the effect of applying this technique by using the same user action as for the production cuts, e.g.:

/gamos/userAction GmProdCutsStudyUA RTCutsStudyFilter

It will produce a table with the number of tracks that would be killed by the range rejection and would not reach the target (the tracks themselves or any of their children). As for the production cuts, they are printed by region, by particle and by creator process type. To get a closer inside on this technique several plots are produced (one per each region, each particle and each creator process) representing the logarithm of the difference safety-range vs the logarithm of the range. To distinguish the cases where the range is bigger than the safety (no range rejection) those cases are plotted in the bins -15 to -5, while the cases where the range is smaller than the safety occupy the bins -5 to 5 (if there is a case, not likely for a radiotherapy simulation) where the log10(fabs(safety-range)) is smaller than -5 (of course before the -10 subtraction), it is set to -5 and if is bigger than 5 it is set to 5.

Building your physics list with C++ code

To build your physics list, first write it in the usual Geant4 way, that is, inheriting from G4VUserPhysicsList (see example in [biblio.g4doc-physics] ). After that you have to transform it into a plug-in. To learn how to do this, see the instructions in the section above, or the example in the PlugIn tutorial.