.. _[t-cross]: [ T-Cross ] section ================================================== This tally can be used to obtain the current or flux, actually the fluence, on any specified surface. In this tally, a particle crossing the surface simply adds 1 to the current and :math:`1/\cos\theta` to the flux, where :math:`\theta` is the angle between the direction of the particle trajectory and the normal vector to the surface. In PHITS, the current and flux are similar but distinct physical quantities; they differ in terms of the surface element used to calculate the number of the particles crossing per unit area. The current is evaluated by dividing by the area of the surface :math:`S` shown in :numref:`flux`; by contrast, the flux is calculated by dividing by :math:`S\cos\theta`. The value of :math:`S` is given in the mesh type subsection as **area** for **mesh=reg** and is calculated automatically for the **r-z** and **xyz** meshes. .. _flux: .. figure:: ./flux.png :alt: Relation between the areas S and S cos(theta). :width: 25em :align: center Relation between the areas :math:`S` and :math:`S\cos\theta`. As the flux in this tally is evaluated by weighting by :math:`1/\cos\theta`, the result is equivalent to that obtained from the **[t-track]** tally for an extremely thin region. Consequently, information on the detector response in the specified surface can be obtained from the **[t-cross]** tally. Multiplying the flux by a cross section, in units of cm^2, of the detector enables estimation of the number of counts in the response. .. rst-class:: no-caption-number .. list-table:: **mesh** :header-rows: 0 * - value - explanation * - **reg, r-z, xyz** - Mesh type. A mesh type subsection is required below this option. If a boundary of geometry coincides with a tally plane at a cylindrical surface in **r-z** mesh or at a rotated surface in **xyz** mesh, the tally results might be underestimated due to the problem of significant digits. In such cases, the mesh size should be changed slightly so that it does not coincide with the boundary plane. .. rst-class:: no-caption-number .. list-table:: **part** :header-rows: 0 * - value - explanation * - **all** (default), particle name - Tally particle. .. include:: ../commontally/e-type.rst .. rst-class:: no-caption-number .. list-table:: **e-unit** :header-rows: 0 * - value - explanation * - **MeV** (default), **keV**, **eV**, **nm**, **A0**, **keV/um** - Unit of energy mesh. **nm** specifies wavelength in nanometers, **A0** specifies wavelength in angstroms. For massive particles, the de Broglie wavelength is used. When using **nm** or **A0**, unit must be 1, 4, 11, or 14. **keV/um** converts the energy axis to LET (equivalent to eng2let=1). .. rst-class:: no-caption-number .. list-table:: **eng2let** :header-rows: 0 * - value - explanation * - (optional) - 0 (default): Do not convert energy defined by **e-type** to LET. 1: Convert energy to LET (keV/um). Set **eng2let=1** and **axis=let** when you want to output the results as a function of LET. .. include:: ../commontally/t-type.rst .. rst-class:: no-caption-number .. list-table:: **a-type** :header-rows: 0 * - value - explanation * - **1, 2, -1, -2** (optional) - Angle mesh, **=1,2** for cosine mesh and **=-1,-2** for angle mesh in units of degree. See :numref:`sec-mesh-type` for mesh subsection format. Required for **output=a-curr** or **output=oa-curr**. The current for a specified angle can be obtained using the angle mesh shown in :numref:`current-atype`. In cases where **unit=4,5,6,14,15,16**, the output is given as a quantity per solid angle, in steradians, calculated using the mesh size of the angle bin defined in the angle mesh subsection. .. _current-atype: .. figure:: ./current-atype.png :alt: Schematic of tally using angle mesh. :width: 20em :align: center Schematic of tally using angle mesh. .. rst-class:: no-caption-number .. list-table:: **iangform** :header-rows: 0 * - value - explanation * - 0 (default), 1, 2, 3 - Select the angle in **a-type** mesh. 0: The angle between the normal vector to the surface and the direction of the particle trajectory, :math:`\theta`. 1: The angle between the x-axis and the direction of the particle trajectory. 2: The angle between the y-axis and the direction of the particle trajectory. 3: The angle between the z-axis and the direction of the particle trajectory. .. rst-class:: no-caption-number .. list-table:: **unit** :header-rows: 0 * - value - explanation * - 1, 2, 3, 4, 5, 6 - 1: [1/cm^2/source] 2: [1/cm^2/MeV/source] 3: [1/cm^2/Lethargy/source] 4: [1/cm^2/sr/source] 5: [1/cm^2/MeV/sr/source] 6: [1/cm^2/Lethargy/sr/source] * - 11, 12, 13, 14, 15, 16 - 11: [1/cm^2/nsec/source] 12: [1/cm^2/MeV/nsec/source] 13: [1/cm^2/Lethargy/nsec/source] 14: [1/cm^2/sr/nsec/source] 15: [1/cm^2/MeV/sr/nsec/source] 16: [1/cm^2/Lethargy/sr/nsec/source] Lethargy in **unit=3,6,13,16** is the natural logarithmic unit of energy defined by :math:`\ln(E_{\rm ref}/E)` using a reference energy :math:`E_{\rm ref}` and the particle energy :math:`E`. Setting these units enables obtaining results in units of Lethargy, which are given as Lethargy widths, :math:`\ln(E_{\rm high}/E_{\rm low})`, for each energy bin in the energy mesh subsection. Here :math:`E_{\rm high}` and :math:`E_{\rm low}` are the maximum and minimum values of the energy bins, respectively. In **unit=4,5,6,14,15,16**, sr denotes steradians as the solid angle unit. .. rst-class:: no-caption-number .. list-table:: **axis** :header-rows: 0 * - value - explanation * - **eng, let, reg, x, y, z, r** - x axis value of output data. * - **cos, the, t** - Angle, cosine or :math:`\theta` in degree, and time mesh. * - **xy** - 2-dimensional. * - **yz, xz, rz** - 2-dimensional, only for **enclos=1**. .. include:: ../commontally/samepage.rst .. include:: ../commontally/file.rst .. include:: ../commontally/resfile.rst .. include:: ../commontally/factor.rst .. include:: ../commontally/title.rst .. include:: ../commontally/angel.rst .. include:: ../commontally/sangel.rst .. rst-class:: no-caption-number .. list-table:: **2d-type** :header-rows: 0 * - value - explanation * - 1, 2, 3, 4, 5, 6, 7 - Options for 2-dimensional plot. * - (optional, D=2) - .. rst-class:: no-caption-number .. list-table:: **output** :header-rows: 0 * - value - explanation * - **flux** - Flux at the surface. * - **current** - Current at the surface. * - **f-curr** - Forward current at the surface. * - **b-curr** - Backward current at the surface. The following options are not recommended after version 3.34. * - **o-curr** - Current without **e-type**. * - **of-curr** - Forward current without **e-type**. * - **ob-curr** - Backward current without **e-type**. * - **a-curr** - Current with **a-type**. * - **oa-curr** - Current with **a-type** but without **e-type**. * - **a-flux** - Flux with **a-type**. * - **oa-flux** - Flux with **a-type** but without **e-type**. The output options **output=f-curr**, **output=b-curr**, **output=of-curr**, and **output=ob-curr** can be used in either **xyz** or **r-z** meshes. Note that in **xyz** meshes these options are available only for the z-direction. .. include:: ../commontally/x-txt.rst .. include:: ../commontally/y-txt.rst .. include:: ../commontally/z-txt.rst .. include:: ../commontally/gshow.rst .. include:: ../commontally/resol.rst .. include:: ../commontally/width.rst .. rst-class:: no-caption-number .. list-table:: **epsout** :header-rows: 0 * - value - explanation * - 0 (default), 1, 2 - When **epsout=1**, results are plotted into eps files. The eps file is named by replacing the extension with ``.eps``. When **epsout=2**, error bars are also displayed in the eps file, except for the 2-dimensional type, **axis=xy**. .. include:: ../commontally/maxangel.rst .. include:: ../commontally/ctmin.rst .. include:: ../commontally/ctmax.rst .. include:: ../commontally/chmin.rst .. include:: ../commontally/chmax.rst When **in** or **out** is specified in **[counter]**, the counter value will change after the particle information has been tallied in **[t-cross]**. Therefore, if the counter value before the change is not specified, the information at the moment of crossing the boundary plane will not be tallied. .. include:: ../commontally/trcl.rst .. rst-class:: no-caption-number .. list-table:: **dump** :header-rows: 0 * - value - explanation * - Number of data - For **mesh=reg**, the information is dumped on the file. If **dump** is negative, data are written in ascii; if positive, in binary. * - next line: Data sequence - Define the data sequence. The history information, **nocas** and **nobch**, is necessary to use **idmpmode=1**. In the **[t-cross]** tally, the **dump** option can only be used with **reg** meshes and only on **axis=reg**. If the **dump** option is set, the **e-type**, **a-type**, and **t-type** meshes take on only the maximum and minimum values. The **output** option can be set as **current**, **a-curr**, or **oa-curr**. When using this **dump** parameter, **axis** and **file** are restricted to one axis and one file, and **unit** is always 1. The dumped data are written onto a file named ``***_dmp``, where ``***`` indicates the file name specified by **file=***. The normal output of the tally is written on ``***``. From this file, information on the total normalization factor can be obtained; doing so requires setting one mesh each for **e-type**, **a-type**, and **t-type**. Note that constraints based on the history counter, **chmin** and **chmax**, do not work with the dump function because the particle information is output to the dump file immediately after passing through the tally surface. The history information, **nocas** and **nobch**, is necessary to use **idmpmode=1** for continuous calculation using the dump file; in addition, both the dump file with ``_dmp`` and the normal output file specified by **file=** are required to use **idmpmode=1**. The option **dumpall** is not compatible with this dump tally option when shared memory parallelization is active. .. rst-class:: no-caption-number .. list-table:: **letmat** :header-rows: 0 * - value - explanation * - (optional) - Effective only when **eng2let=1**. Material id for LET, :math:`dE/dx`. If not defined, a real material is assumed. If a material not used in the geometry is selected, its material density must be defined in **[material]**. To calculate LET in water, define water with 1 g/cm^3 in **[material]**. When **letmat<0** is set, PHITS automatically calculates :math:`dE/dx` for water with 1 g/cm^3 for electrons and positrons. Please see ``ParticleTherapy`` in the recommendation setting for more details. .. rst-class:: no-caption-number .. list-table:: **gslat** :header-rows: 0 * - value - explanation * - 1 (default), 0 - 1: show lattice boundary in **gshow**. 0: no. .. include:: ../commontally/stdcut.rst .. rst-class:: no-caption-number .. list-table:: **multiplier** :header-rows: 0 * - value - explanation * - Number of material - Multiplier for each material. * - (optional) - A multiplier subsection is required below this parameter. See the multiplier subsection for detailed usage. From ver. 2.86, the **multiplier** option can be used in **[t-cross]** tally. .. rst-class:: no-caption-number .. list-table:: **enclos** :header-rows: 0 * - value - explanation * - 0 (default) - Define crossing surfaces on the z-axis and the r-axis for **mesh=r-z**, and define a crossing surface on the z-axis for **mesh=xyz**. * - 1 - Define crossing surfaces by enclosing surfaces of areas divided by mesh type. All surfaces enclosing an area are treated as a crossing surface. From ver. 3.10, crossing surfaces are defined by enclosing surfaces of areas divided by mesh type when **enclos=1** is set with **mesh=xyz** or **mesh=r-z**. All surfaces enclosing an area are treated as a crossing surface. For example, in the case of **mesh=xyz**, each crossing surface on the z-axis is used as a tally surface when **enclos=0**, and six surfaces of a rectangular solid defined by the xyz meshes are used as tally surfaces when **enclos=1**. The forward direction is defined as the incoming direction, and the backward direction is defined as the outgoing direction. The total area of the closed surface is used to calculate per unit area. Setting **mesh=reg** for the mesh type in this section requires defining the crossing surface by outgoing region number, **r-from**, incoming region number, **r-to**, and the area of the surface, **area** in units of cm^2, as shown in the example below. Before ver. 2.96, **r-in** and **r-out** were used instead of **r-from** and **r-to**, respectively. These old parameters can be used after ver. 2.97. Note that **in** and **out** are reversed in this definition. .. code-block:: text :caption: Example of **mesh=reg** definition in **[t-cross]**. mesh = reg reg = number of crossing surfaces r-from r-to area 2 8 10.0 3 8 5.0 ( 4 5 ) ( 4 5 ) 2.0 (13<5) (14<5) 7.0 (13<6) (14<6) 7.0 (13<7) (14<7) 7.0 ... ... .... ... ... .... In the next line of **mesh=reg**, give the number of crossing surfaces to tally by **reg=**. Furthermore, from the next line, the values of **r-from**, **r-to**, and **area** should be written in matrix format. The default order for this definition is **r-from r-to area**. The line of these column headers can be omitted. However, to change the order, rearrange and explicitly write the column headers as **r-from r-to area**. The skip operator **non** can also be used. When specifying the region number, the format **( 2 -5 8 9 )** can be used, as can the lattice and universe style **( 6 < 10[1 0 0] < u=3 )**. However, any value that is not single numeric must be enclosed by **( )**. If **mesh=reg** is set, the obtained current or flux is unidirectional from **r-from** to **r-to**; a bidirectional flux can be set in the third line of the above definition. Setting **mesh=r-z** defines the numbers of two crossing surface types: the number of ``nz+1`` crossing surfaces for :math:`z` defined by :math:`r_i-r_{i+1}` and the number of ``nr+1`` crossing surfaces for :math:`r` defined by :math:`z_i-z_{i+1}`. If an r-surface coincides with the surface of the outer void, the flux on this surface is not tallied. If **mesh=xyz** is set, the number of ``nz+1`` crossing surfaces on :math:`z` are defined by :math:`x_i-x_{i+1}` and :math:`y_j-y_{j+1}`. In this case, :math:`x` and :math:`y` crossing surfaces are not defined. Setting **mesh=r-z** or **mesh=xyz** causes crossing particles to be detected in both directions on the defined surface. The forward direction is defined as the positive direction on a :math:`z` surface and from the center to the exterior on an :math:`r` surface. From ver. 3.05, specification of **z-type=1** and **nz=0** is allowed to calculate fluences of particles passing through a certain surface.