######################
# Configuration file #
######################



### Simulation parameters:
Num_Threads 	{NUM_THREADS}		# Number of parallel calculation threads. Default: 0 = max available threads
RNG_Seed	{RNG_SEED}		# Seed for the random number generator (deterministic result only with single thread). Default: 0 = seed automaticly defined from run time
Num_Primaries 	{NUM_PRIMARIES}		# Minimum number of primary protons to simulate. Default: 1e7
E_Cut_Pro	{E_CUT_PRO}		# Energy cut (in MeV) below which heavy charged particles are locally absorbed. Default: 0.5
D_Max		{D_MAX}		# Maximum distance between two steps (cm). Default: 0.2
Epsilon_Max	{EPSILON_MAX}		# Fractional energy loss (dE/T) per step. Default: 0.25
Te_Min		{TE_MIN}		# Threshold energy (MeV) for the production of secondary electrons (currently locally absorbed). Default: 0.05
				# As a reference: 200 MeV protons can transfer a maximum energy of 0.5 MeV to δ-electrons which correspond to a range of 7 mm in lung tissues.

### Input files
CT_File 			{CT_FILE}				# Path to the CT file. Default: CT.mhd
HU_Density_Conversion_File	{HU_DENSITY_CONVERSION_FILE}	# Path to the file containing HU to density conversion data. Default: HU_Density_Conversion.txt
HU_Material_Conversion_File	{HU_MATERIAL_CONVERSION_FILE}	# Path to the file containing HU to material conversion data. Default: HU_Material_Conversion.txt
BDL_Machine_Parameter_File 	{BDL_MACHINE_PARAMETER_FILE}			# Path to the machine parameter file for the beam data library. Default: BDL.txt
BDL_Plan_File 			{BDL_PLAN_FILE}			# Path to the treatment plan file. Default: Plan.txt


### Physical parameters
Simulate_Nuclear_Interactions	{SIMULATE_NUCLEAR_INTERACTIONS}	# Enable/Disable the simulation of nuclear interactions. Default: True
Simulate_Secondary_Protons	{SIMULATE_SECONDARY_PROTONS}	# Enable/Disable the simulation of secondary protons (emitted during nuclear interactions). Default: True
Simulate_Secondary_Deuterons	{SIMULATE_SECONDARY_DEUTERONS}	# Enable/Disable the simulation of secondary deuterons (emitted during nuclear interactions). Default: True
Simulate_Secondary_Alphas	{SIMULATE_SECONDARY_ALPHAS}	# Enable/Disable the simulation of secondary alphas (emitted during nuclear interactions). Default: True


### 4D simulation
4D_Mode				{4D_MODE}		# Enable/Disable the 4D simulation mode. Default: False
4D_Dose_Accumulation		{4D_DOSE_ACCUMULATION}		# Enable/Disable the accumulation of the 4D dose on the reference phase. Default: False
Field_type			{FIELD_TYPE}	# Field type: Displacement or Velocity. Default: Velocity
Create_Ref_from_4DCT		{CREATE_REF_FROM_4DCT}		# Create the reference phase image from 4D CT images (True), or import the reference image (False). Default: False
Create_4DCT_from_Ref		{CREATE_4DCT_FROM_REF}		# Create 4D CT images by deforming the reference phase image (True), or import 4D CT images (False). Default: False
Dynamic_delivery		{DYNAMIC_DELIVERY}		# Enable/Disable simulation of dynamic delivery (interplay simulation). Default: False
Breathing_period		{BREATHING_PERIOD}		# Period (in seconds) of the breathing motion. Default: 7.0


### Robustness simulation
Robustness_Mode			{ROBUSTNESS_MODE} 		# Enable/Disable the robustness verification mode. Default: False
Scenario_selection		{SCENARIO_SELECTION}		# Method for scenario selection: All (simulate all 81 combinations of errors), ReducedSet (simulate 21 scenarios), Random (randomly sample scenarios). Default: All
Simulate_nominal_plan		{SIMULATE_NOMINAL_PLAN}		# Simulate the nominal plan (without any systematic or random uncertainty). Default: True
Num_Random_Scenarios		{NUM_RANDOM_SCENARIOS}		# Number of uncertainty scenarios to simulate in Random mode. Default: 100
Systematic_Setup_Error		{SYSTEMATIC_SETUP_ERROR}	# Systematic error for the patient setup along the XYZ axes (cm). Default: 0.25 0.25 0.25
Random_Setup_Error		{RANDOM_SETUP_ERROR}	# Standard deviation of the patient random setup error along the XYZ axes (cm). Default: 0.1 0.1 0.1
Systematic_Range_Error		{SYSTEMATIC_RANGE_ERROR}		# Systematic error in percent of the proton range (%). Default: 3.0
Systematic_Amplitude_Error	{SYSTEMATIC_AMPLITUDE_ERROR}		# Systematic error in percent of the breathing motion amplitude for 4D simulations. Default: 5.0
Random_Amplitude_Error		{RANDOM_AMPLITUDE_ERROR}		# Random error in percent of the breathing motion amplitude for 4D simulations. Default: 5.0
Systematic_Period_Error		{SYSTEMATIC_PERIOD_ERROR}		# Systematic error in percent of the breathing motion period for simulations of interplay with dynamic delivery. Default: 5.0
Random_Period_Error		{RANDOM_PERIOD_ERROR}		# Random error in percent of the breathing motion period for simulations of interplay with dynamic delivery. Default: 5.0


### Beamlet simulation
Beamlet_Mode			{BEAMLET_MODE} 	# Enable/Disable the beamlet computation mode. Default: False
Beamlet_Parallelization		{BEAMLET_PARALLELIZATION}	# Parallelization on beamlet level is sometimes faster for beamlet simulation. This requires more memory. Default: False


### Treatment plan optimization
Optimization_Mode		{OPTIMIZATION_MODE}	# Enable/Disable the optimization mode. Default: False


### Statistical noise and stopping criteria
Compute_stat_uncertainty	{COMPUTE_STAT_UNCERTAINTY}	# Enable/Disable the estimation of statistical uncertainty. Default: True
Stat_uncertainty 		{STAT_UNCERTAINTY}	# Maximum statistical uncertainty (in percent). Default: 0.0 = no maximum uncertainty (number of proton = Num_Primaries)
Ignore_low_density_voxels	{IGNORE_LOW_DENSITY_VOXELS}	# Ignore low density voxels (< 0.1 g/cm3) for the estimation of statistical uncertainty. Default: True
Export_batch_dose		{EXPORT_BATCH_DOSE}	# Export intermediate results after each batch calculation. Default: False
Max_Num_Primaries		{MAX_NUM_PRIMARIES}	# Maximum number of particles to simulate. Default: 0 = no limit
Max_Simulation_time		{MAX_SIMULATION_TIME}	# Time limit (in minutes) after which the simulation stops. Default: 0 = no limit


### Output parameters
Output_Directory		{OUTPUT_DIRECTORY}	# Path to the output directory. Default: Outputs

Energy_ASCII_Output		{ENERGY_ASCII_OUTPUT}	# Enable/Disable the output of Energy in ASCII format. Default: False
Energy_MHD_Output		{ENERGY_MHD_OUTPUT}	# Enable/Disable the output of Energy in MHD format. Default: False
Energy_Sparse_Output		{ENERGY_SPARSE_OUTPUT}	# Enable/Disable the output of Energy in Sparse matrix format. Default: False
Dose_ASCII_Output		{DOSE_ASCII_OUTPUT}	# Enable/Disable the output of Dose in ASCII format. Default: False
Dose_MHD_Output			{DOSE_MHD_OUTPUT}	# Enable/Disable the output of Dose in MHD format. Default: True
Dose_Sparse_Output		{DOSE_SPARSE_OUTPUT}	# Enable/Disable the output of Dose in Sparse matrix format. Default: False
LET_ASCII_Output		{LET_ASCII_OUTPUT}	# Enable/Disable the output of LET in ASCII format. Default: False
LET_MHD_Output			{LET_MHD_OUTPUT}	# Enable/Disable the output of LET in MHD format. Default: False
LET_Sparse_Output		{LET_SPARSE_OUTPUT}	# Enable/Disable the output of LET in Sparse matrix format. Default: False

Densities_Output		{DENSITIES_OUTPUT}	# Enable/Disable the export of the density map (converted from the CT image). Default: False
Materials_Output		{MATERIALS_OUTPUT}	# Enable/Disable the export of the map of materials (converted from the CT image). Default: False

Compute_DVH			{COMPUTE_DVH}	# Enable/Disable the computation and export of DVH based on RT-Struct binary masks. Default: False

Dose_Sparse_Threshold		{DOSE_SPARSE_THRESHOLD}	# The dose values above the threshold will be stored in the sparse matrix file. Default: 0
Energy_Sparse_Threshold		{ENERGY_SPARSE_THRESHOLD}	# The energy values above the threshold will be stored in the sparse matrix file. Default: 0
LET_Sparse_Threshold		{LET_SPARSE_THRESHOLD}	# The LET values above the threshold will be stored in the sparse matrix file. Default: 0

Score_PromptGammas		{SCORE_PROMPTGAMMAS}	# Enable/Disable the scoring of Prompt Gammas (emitted during nuclear interactions). Default: False
PG_LowEnergyCut 		{PG_LOWENERGYCUT}	# Disable the scoring of Prompt Gammas with energy below this value (MeV).  Default: 0.0
PG_HighEnergyCut		{PG_HIGHENERGYCUT}	# Disable the scoring of Prompt Gammas with energy above this value (MeV).  Default: 50.0
					# Typical gamma camera would be sensitive between 3.0 and 6.0 MeV
PG_Spectrum_NumBin 		{PG_SPECTRUM_NUMBIN}	# Number of bins to score the Prompt Gamma energy spectrum.  Default: 150
PG_Spectrum_Binning 		{PG_SPECTRUM_BINNING}	# Bin width (MeV) for the scoring of Prompt Gamma spectrum.  Default: 0.1

LET_Calculation_Method		{LET_CALCULATION_METHOD} # Select the method employed for the calculation of LET (DepositedEnergy, StopPow). Default: StopPow

Export_Beam_dose		{EXPORT_BEAM_DOSE}	# Export dose distribution for each beam (True) or entire plan (False). Default: Disable
Dose_to_Water_conversion	{DOSE_TO_WATER_CONVERSION} # Select the method employed to convert simulation results (dose to medium) to dose to water (Disabled, PostProcessing, OnlineSPR). Default: Disabled

Dose_Segmentation			{DOSE_SEGMENTATION}	# Enable/Disable a segmentation of the dose map based on a density thresholding (remove dose artifacts in the air). Default: False
Density_Threshold_for_Segmentation	{DENSITY_THRESHOLD_FOR_SEGMENTATION}	# Density threshold employed for the segmentation (in g/cm3). Default: 0.01

Independent_scoring_grid	{INDEPENDENT_SCORING_GRID}		# Enable/Disable the independent scoring grid with respect to the CT image grid. Default: False = dose grid with same resolution as input CT image
Scoring_origin			{SCORING_ORIGIN}	# Origin of the scoring grid (in cm) defined in the same reference frame as the CT image. Default: 0.0 0.0 0.0
Scoring_grid_size		{SCORING_GRID_SIZE}	# Define the number of voxels for each dimension of the scoring grid. Default: 100 100 100
Scoring_voxel_spacing		{SCORING_VOXEL_SPACING}	# Define the voxel spacing (in cm) for each dimension of the scoring grid. Default: 0.15 0.15 0.15
Dose_weighting_algorithm	{DOSE_WEIGHTING_ALGORITHM}		# Define the dose weighting algorithm (Volume weighting, or Mass weighting) used when the dose voxels contain multiple CT voxels. Default: Volume