opentps.core.data.MCsquare package

Module contents

class BDL

Bases: object

Beam Delivery Line (BDL) class

Variables:
  • nozzle_isocenter (float (default 0.0)) – Nozzle exit to isocenter distance

  • smx (float (default 0.0)) – SMX to isocenter distance

  • smy (float (default 0.0)) – SMY to isocenter distance

  • isLoaded (int (default 0)) – 0 if the BDL is not loaded, 1 if it is loaded

  • nominalEnergy (list of float) – Nominal energy of the beam

  • meanEnergy (list of float) – Mean energy of the beam

  • energySpread (list of float) – Energy spread of the beam

  • protonsMU (list of float) – Number of protons per MU

  • weight1 (list of float) – Weight of the first gaussian

  • spotSize1x (list of float) – Spot size of the first gaussian in the x direction

  • divergence1x (list of float) – Divergence of the first gaussian in the x direction

  • correlation1x (list of float) – Correlation of the first gaussian in the x direction

  • spotSize1y (list of float) – Spot size of the first gaussian in the y direction

  • divergence1y (list of float) – Divergence of the first gaussian in the y direction

  • correlation1y (list of float) – Correlation of the first gaussian in the y direction

  • weight2 (list of float) – Weight of the second gaussian

  • spotSize2x (list of float) – Spot size of the second gaussian in the x direction

  • divergence2x (list of float) – Divergence of the second gaussian in the x direction

  • correlation2x (list of float) – Correlation of the second gaussian in the x direction

  • spotSize2y (list of float) – Spot size of the second gaussian in the y direction

  • divergence2y (list of float) – Divergence of the second gaussian in the y direction

  • correlation2y (list of float) – Correlation of the second gaussian in the y direction

  • rangeShifters (list of RangeShifter) – List of range shifters

computeMU2Protons(energy: float) float

Convert MU to number of protons

Parameters:

energy (float) – Energy of the beam in MeV

Returns:

Number of protons

Return type:

float

correlations(energy: float) Tuple[float, float]

Return the correlation of the beam in the x and y direction

Parameters:

energy (float) – Energy of the beam in MeV

Returns:

Correlation in the x and y direction

Return type:

Tuple[float, float]

divergences(energy: float) Tuple[float, float]

Return the divergence of the beam in the x and y direction

Parameters:

energy (float) – Energy of the beam in MeV

Returns:

Divergence in the x and y direction

Return type:

Tuple[float, float]

mcsquareFormatted(materials: Sequence[MCsquareMaterial] | None = None) str

Return a string formatted for MCsquare

Parameters:

materials (list of MCsquareMaterial (optional)) – List of materials used in the range shifters

Returns:

String formatted for MCsquare

Return type:

str

spotSizes(energy: float) Tuple[float, float]

Return the spot size of the beam in the x and y direction

Parameters:

energy (float) – Energy of the beam in MeV

Returns:

Spot size (sigma) in the x and y direction

Return type:

Tuple[float, float]

class BDLWithSpotTilt

Bases: BDL

class MCsquareConfig

Bases: object

Class to configure the MCsquare dose calculator. MCsquare is configured by a dictionary of key-value pairs. For the different parameters and their usage take a look at the ConfigTemplate.txt file in the opentps.core.data.MCsquare directory.

mcsquareFormatted() str

Returns the configuration file in the format used by MCsquare

Returns:

Template – Configuration file in the format used by MCsquare

Return type:

str