Fast and full simulation - next-exp/nexus GitHub Wiki

In NEXUS there are two main ways of running a simulation: the full and the fast simulation.

In the full simulation scintillation photons and ionization electrons are generated and propagated through the detector, and the sensor response is registered in the output file. While the full simulation is more accurate, it is also very time-consuming and it can be unpractical for high energy events.

In the fast simulation, on the other hand, no scintillation photons, neither ionization electrons are produced and the output file stores only the true information of hits and particles.

Here you can find two examples of configuration files for both cases:

Full simulation

Example is generating Tl208 calibration events from Port1a saving events in the double escape peak

init file

# Physics Lists
/PhysicsList/RegisterPhysics G4EmStandardPhysics_option4
/PhysicsList/RegisterPhysics G4DecayPhysics
/PhysicsList/RegisterPhysics G4RadioactiveDecayPhysics 
/PhysicsList/RegisterPhysics G4StepLimiterPhysics
/PhysicsList/RegisterPhysics G4OpticalPhysics             # Important *
/PhysicsList/RegisterPhysics NexusPhysics

# Geometry and Generator
/nexus/RegisterGeometry Next100
/nexus/RegisterGenerator IonGenerator

# Actions
/nexus/RegisterRunAction      DefaultRunAction
/nexus/RegisterEventAction    DefaultEventAction
/nexus/RegisterTrackingAction DefaultTrackingAction
/nexus/RegisterSteppingAction DefaultSteppingAction      # Important **
/nexus/RegisterStackingAction DefaultStackingAction      # Important **

# Persistency
/nexus/RegisterPersistencyManager PersistencyManager
/nexus/RegisterMacro NEXT100_Tl208_Port1a_Full.config.mac

Notes:

*G4OpticalPhysics must be switched on when simulating optical photons modelling scintillation light -- important for S1/S2.

**DefaultSteppingAction and DefaultStackingAction should be included. These actions ensure that simulated events are only done for events in the energy range specified in the min/max energy range in the config file. (This feature is available from nexus tag v07_11_00)

config file

##### VERBOSITY #####
/run/verbose 0
/event/verbose 0
/tracking/verbose 0

/process/em/verbose 0

##### GEOMETRY #####
/Geometry/Next100/th_source new_source 

/Geometry/Next100/elfield true                         # Important *
/Geometry/Next100/max_step_size 1. mm
/Geometry/Next100/pressure 4.0 bar
/Geometry/Next100/gas depletedXe

/Geometry/PmtR11410/time_binning     25. nanosecond
/Geometry/Next100/sipm_time_binning  1. microsecond

# The parameters below are used in the full sim, you can adjust them as needed
/Geometry/Next100/drift_v            0.87 mm/microsecond
/Geometry/Next100/EL_drift_v         5.16 mm/microsecond

/Geometry/Next100/drift_transv_diff  2.01 mm/sqrt(cm)
/Geometry/Next100/drift_long_diff    0.58 mm/sqrt(cm)

/Geometry/Next100/ELtransv_diff      0.36 mm/sqrt(cm)
/Geometry/Next100/ELlong_diff        0.24 mm/sqrt(cm)

/Geometry/Next100/EL_field           8.8  kV/cm
/Geometry/Next100/e_lifetime         50   ms

##### GENERATOR #####
/Generator/IonGenerator/atomic_number 81
/Generator/IonGenerator/mass_number 208
/Generator/IonGenerator/region PORT_1a

/Actions/DefaultEventAction/min_energy 1.45 MeV
/Actions/DefaultEventAction/max_energy 1.65 MeV

##### PERSISTENCY #####
/nexus/persistency/output_file NEXT100_Tl208_Port1a_Full
/nexus/random_seed            1
/nexus/persistency/start_id   0

### PHYSICS
/PhysicsList/Nexus/clustering           true              # Important *
/PhysicsList/Nexus/drift                true              # Important *
/PhysicsList/Nexus/electroluminescence  true              # Important *

Notes:

*Switching on full simulation requires (1) efield to be set to true. This drifts the created ionization electrons. (2) clustering, drift, and electroluminescence to be set to true. These params are set to true by default.

Fast simulation

Example is generating Kr 83 events in the NEXT active volume

init file

# Physics Lists

# ** Make sure no G4OpticalPhysics is here **

/PhysicsList/RegisterPhysics G4EmStandardPhysics_option4
/PhysicsList/RegisterPhysics G4DecayPhysics
/PhysicsList/RegisterPhysics G4RadioactiveDecayPhysics 
/PhysicsList/RegisterPhysics G4StepLimiterPhysics

# Geometry and Generator
/nexus/RegisterGeometry Next100
/nexus/RegisterGenerator Kr83mGenerator

# Actions
/nexus/RegisterRunAction      DefaultRunAction
/nexus/RegisterEventAction    DefaultEventAction
/nexus/RegisterTrackingAction DefaultTrackingAction

# persistency
/nexus/RegisterPersistencyManager PersistencyManager
/nexus/RegisterMacro NEXT100_Kr83m.config.mac

config file

/control/verbose  0
/run/verbose      0
/event/verbose    0
/tracking/verbose 0

# generator
/Generator/Kr83mGenerator/region ACTIVE

# geometry
/Geometry/Next100/max_step_size  1.  mm
/Geometry/Next100/pressure       4 bar
/Geometry/Next100/elfield       false                      # Important *
/Geometry/Next100/gas           depletedXe

/Geometry/PmtR11410/time_binning     25. nanosecond
/Geometry/Next100/sipm_time_binning  1. microsecond

# persistency
/nexus/random_seed             1
/nexus/persistency/start_id    0
/nexus/persistency/output_file NEXT100_Kr83m

### PHYSICS
/PhysicsList/Nexus/clustering           false              # Important *
/PhysicsList/Nexus/drift                false              # Important *
/PhysicsList/Nexus/electroluminescence  false              # Important *

Notes:

*Switching off full simulation requires (1) efield to be set to false. This drifts the created ionization electrons. (2) clustering, drift, and electroluminescence to be set to false.

For more information on the parameters of the configuration files you can refer to the slides of the nexus course.