Warning, /JETSCAPE/external_packages/trento/doc/usage.rst is written in an unsupported language. File is not indexed.
0001 Usage
0002 =====
0003 T\ :sub:`R`\ ENTo has a standard command-line interface.
0004 The basic syntax is ::
0005
0006 trento [options] projectile projectile [number-events = 1]
0007
0008 where the only required arguments are the two projectile names.
0009 For example, ``trento Pb Pb 10`` would run ten lead-lead events.
0010
0011 The remaining optional arguments may be given in any order, before or after the projectiles.
0012 Run ``trento --help`` for a brief summary of the options and see below for more detailed descriptions.
0013
0014 Specifying projectiles
0015 ----------------------
0016 The ``projectile`` arguments take species abbreviations, e.g. ``p``, ``Pb``, etc.
0017 The known species are
0018
0019 ========= ======== ============ ========
0020 Symbol Name No. nucleons Deformed
0021 ========= ======== ============ ========
0022 p proton 1 ---
0023 d deuteron 2 ---
0024 Cu copper 63 no
0025 Cu2 copper 63 yes
0026 Xe xenon 129 no
0027 Au gold 197 no
0028 Au2 gold 197 yes
0029 Pb lead 208 no
0030 U, U2, U3 uranium 238 yes
0031 ========= ======== ============ ========
0032
0033 For the deuteron, nucleon positions are sampled from the Hulthén wavefunction;
0034 for the heavy nuclei, positions are sampled from a `Woods-Saxon <https://en.wikipedia.org/wiki/Woods%E2%80%93Saxon_potential>`_ distribution, either spherically symmetric or deformed as indicated.
0035 Copper and gold are slightly deformed—slightly enough that a symmetric distribution is a reasonable approximation—therefore both symmetric (``Cu``, ``Au``) and deformed (``Cu2``, ``Au2``) versions are provided, where both versions have the same nuclear radius and surface thickness.
0036 There is no consensus on the uranium Woods-Saxon parameters, so three commonly used sets are provided:
0037
0038 ====== ==== ==== ===== =====
0039 Symbol *R* *a* |b2| |b4|
0040 ====== ==== ==== ===== =====
0041 U 6.81 0.60 0.280 0.093
0042 U2 6.86 0.42 0.265 0
0043 U3 6.67 0.44 0.280 0.093
0044 ====== ==== ==== ===== =====
0045
0046 .. |b2| replace:: *β*\ :sub:`2`
0047 .. |b4| replace:: *β*\ :sub:`4`
0048
0049 The ``U`` and ``U2`` sets are given in this recent `overview of particle production from PHENIX <http://inspirehep.net/record/1394433>`_.
0050 All other Woods-Saxon parameters (including ``U3``) and the Hulthén wavefunction parameters are from the `PHOBOS Glauber model <http://inspirehep.net/record/1310629>`_.
0051
0052 For Woods-Saxon nuclei, ``trento`` can impose a minimum nucleon-nucleon distance.
0053 See the :ref:`nucleon-min-dist <nucleon-min-dist>` option.
0054
0055 In addition, ``trento`` can read :ref:`arb-configs` saved in HDF5 files.
0056
0057 General options
0058 ---------------
0059 These are general options that don't fit in any other category.
0060
0061 ``-h, --help``
0062 Show the help message and exit.
0063
0064 ``--version``
0065 Print version number and exit.
0066
0067 ``--bibtex``
0068 Print bibtex entry and exit.
0069
0070 ``-c, --config-file FILE``
0071 Path to configuration file (see :ref:`config-files` below).
0072 May be given multiple times.
0073
0074
0075 Output options
0076 --------------
0077 The default output mode is to print event-by-event properties to stdout, in the following order::
0078
0079 event_number impact_param npart mult e2 e3 e4 e5
0080
0081 with one line for each event, where
0082
0083 - ``event_number`` is an integer counter,
0084 - ``impact_param`` is the collision impact parameter,
0085 - ``npart`` is the number of nucleon participants,
0086 - ``mult`` is the total initial entropy, and
0087 - the ``en`` are the eccentricity harmonics ɛ\ :sub:`n`.
0088
0089 This format is designed for easy parsing, redirection to files, etc.
0090 The output may be disabled with the ``-q/--quiet`` option.
0091
0092 By default, the actual initial entropy profiles (grids) are not output.
0093 There are two available output formats: text and HDF5 (if compiled).
0094
0095 In text mode, each event is written to a separate text file as a standard block-style grid, along with a commented header containing the event properties, like this::
0096
0097 # event 0
0098 # b = 2.964077155
0099 # npart = 380
0100 # mult = 168.603282
0101 # e2 = 0.01953253866
0102 # e3 = 0.08961920965
0103 # e4 = 0.1101683349
0104 # e5 = 0.1727159106
0105
0106 The header may be disabled with the ``--no-header`` option.
0107
0108 HDF5 is a high-performance, cross-platform binary format for large numerical datasets.
0109 Libraries are available in `most languages <https://en.wikipedia.org/wiki/Hierarchical_Data_Format#Interfaces>`_.
0110 HDF5 is significantly faster than text output:
0111 writing an event to a text file usually takes much longer than computing the actual event;
0112 writing to HDF5 incurs only a small overhead.
0113 Therefore, HDF5 is the recommended output format.
0114
0115 In HDF5 mode, all events are written to a single file with each event in a separate HDF5 dataset.
0116 Event properties are written to each dataset as HDF5 attributes with names ``b``, ``npart``, ``mult``, ``e2``, etc.
0117
0118 ``-q, --quiet``
0119 Disable printing event properties to stdout.
0120 Since both text and HDF5 output contain the event properties, it's often desirable to specify this option along with the output option.
0121
0122 ``-o, --output PATH``
0123 Path to output events.
0124 If the path has an HDF5-like extension (``.hdf5``, ``.hdf``, ``.hd5``, ``.h5``), then all events will be written to that HDF5 file.
0125 Otherwise, the path is interpreted as a directory and events will be written to numbered text files in the directory.
0126
0127 For text output, the directory will be created if it does not exist.
0128 If it does already exist, it must be empty (this is to avoid accidentally overwriting files or spewing thousands of files into an already-used location).
0129
0130 For HDF5 output, the file must not already exist.
0131 Each event will be written as a numbered dataset in the file, and the standard event properties will be written as dataset attributes.
0132
0133 Example:
0134
0135 - ``--output events`` will write to text files ``events/0.dat``, ``events/1.dat``, ...
0136 - ``--output events.hdf`` will write to HDF5 file ``events.hdf`` with dataset names ``event_0``, ``event_1``, ...
0137
0138 ``--no-header``
0139 Disable writing event headers to text files.
0140
0141 Physical options
0142 ----------------
0143 These options control the physical behavior of the model.
0144
0145 .. warning::
0146
0147 The physical options have reasonable defaults, however **the defaults are not in any way a best-fit to experimental data**.
0148 They are simply round numbers.
0149 It is entirely expected that the ideal parameters will change depending on the beam energy.
0150 In particular, **the cross section must be explicitly set for each beam energy**.
0151
0152 ``-p, --reduced-thickness FLOAT``
0153 Reduced thickness parameter *p*.
0154 The reduced thickness is defined as the `generalized mean <https://en.wikipedia.org/wiki/Generalized_mean>`_ of participant nuclear thickness
0155
0156 .. math::
0157
0158 T_R(p; T_A, T_B) = \biggl( \frac{T_A^p + T_B^p}{2} \biggr)^{1/p}
0159
0160 The default is *p* = 0, which corresponds to the geometric mean.
0161
0162 ``-k, --fluctuation FLOAT``
0163 `Gamma distribution <https://en.wikipedia.org/wiki/Gamma_distribution>`_ shape parameter *k* for nucleon fluctuations.
0164 Fluctuations are sampled from a gamma distribution with the scale parameter fixed so that the mean is one:
0165
0166 .. math::
0167
0168 P_k(x) = \frac{k^k}{\Gamma(k)} x^{k-1} e^{-kx}
0169
0170 The default is *k* = 1, which corresponds to an exponential distribution.
0171 For small *k*, the distribution has a long tail, leading to large fluctuations.
0172 For large *k*, the distribution becomes a narrow Gaussian, and eventually a delta function for very large values.
0173
0174 ``-w, --nucleon-width FLOAT``
0175 Gaussian nucleon width in fm:
0176
0177 .. math::
0178
0179 T_\text{nucleon}(x, y) = \frac{1}{2\pi w^2} \exp\biggl( -\frac{x^2 + y^2}{2w^2} \biggr)
0180
0181 The default is 0.5 fm.
0182
0183 .. _nucleon-min-dist:
0184
0185 ``-d, --nucleon-min-dist FLOAT``
0186 Minimum nucleon-nucleon distance (fm) for Woods-Saxon nuclei (spherical and deformed).
0187 When nonzero, if a sampled nucleon lands too close to a previously sampled nucleon, its angular position is resampled until it lands far enough away.
0188 The radius is *not* resampled, since this would effectively modify the Woods-Saxon distribution.
0189
0190 If a nucleon cannot be placed after a reasonable number of retries, the algorithm gives up and leaves the nucleon at the last sampled position.
0191 The failure rate is negligible for minimum distances of ~1 fm and below;
0192 it reaches roughly 1% at 1.7 fm for spherical nuclei and 1.5 fm for deformed.
0193
0194 The default is zero (no minimum distance).
0195
0196 .. versionadded:: 1.4
0197
0198 ``-x, --cross-section FLOAT``
0199 Inelastic nucleon-nucleon cross section |snn| in |fm2|.
0200 The default is 6.4 fm\ :sup:`2`, the approximate experimental value at LHC Pb+Pb energy, √s = 2.76 TeV.
0201 Here are some measurements of the cross section at common beam energies (all have approximately 0.5 |fm2| uncertainty):
0202
0203 +---------+---------------+---------------+
0204 |√s [TeV] | |snn| [|fm2|] | ref. |
0205 +=========+===============+===============+
0206 |0.200 | 4.23 | `1509.06727`_ |
0207 +---------+---------------+---------------+
0208 | | 6.4 | `1108.6027`_ |
0209 + 2.76 +---------------+---------------+
0210 | | 6.28 | `1208.4968`_ |
0211 +---------+---------------+---------------+
0212 |5.02 | 7.0 | `1210.3615`_ |
0213 +---------+---------------+---------------+
0214 |7 | 7.32 | `1208.4968`_ |
0215 +---------+---------------+---------------+
0216
0217 .. |snn| replace:: σ\ :sub:`NN`
0218 .. |fm2| replace:: fm\ :sup:`2`
0219 .. _1108.6027: https://inspirehep.net/record/925723
0220 .. _1210.3615: https://inspirehep.net/record/1190545
0221 .. _1208.4968: https://inspirehep.net/record/1181770
0222 .. _1509.06727: https://inspirehep.net/record/1394433
0223
0224 ``-n, --normalization FLOAT``
0225 Overall normalization factor.
0226 The default is 1.
0227
0228 ``--b-min FLOAT``
0229 Minimum impact parameter.
0230 The default is zero.
0231
0232 ``--b-max FLOAT``
0233 Maximum impact parameter.
0234 The default is to run minimum-bias collisions for the given collision system.
0235
0236 To run at fixed impact parameter, give the same value for both the min and the max.
0237
0238 ``--random-seed POSITIVE_INT``
0239 Primarily for testing and debugging.
0240
0241 Grid options
0242 ------------
0243 The thickness functions are discretized onto a square *N* × *N* grid centered at (0, 0).
0244 The grid can have a dramatic effect on code speed and precision, so should be set carefully.
0245 Computation time is roughly proportional to the number of grid cells (i.e. *N*\ :sup:`2`).
0246
0247 ``--grid-max FLOAT``
0248 *x* and *y* maximum of the grid in fm, i.e. the grid extends from -max to +max.
0249 The default is 10 fm, large enough to accommodate all collision systems.
0250 However, this should be set as small as possible, since an unnecessarily large grid slows down the code.
0251 For anything but uranium-uranium, 9 fm is sufficient.
0252 For pp and pA, 3 fm is usually a good choice.
0253
0254 ``--grid-step FLOAT``
0255 Size of grid cell in fm.
0256 The default is 0.2 fm, sufficient to achieve ~99.9% precision for the event properties.
0257 This can reasonably be increased as far as the nucleon width; beyond that and precision suffers significantly.
0258
0259 The grid will always be a square *N* × *N* array, with *N* = ceil(2*max/step).
0260 So e.g. the default settings (max = 10 fm, step = 0.2 fm) imply a 100 × 100 grid.
0261 The ceiling function ensures that the number of steps is always rounded up, so e.g. given max = 10 fm and step 0.3 fm, the grid will be 67 × 67.
0262 In this case, the actual grid max will be marginally increased (max = nsteps*step/2).
0263
0264 Regardless of the collision system, the code will always approximately center the overlap region on the grid.
0265
0266 .. _config-files:
0267
0268 Configuration files
0269 -------------------
0270 .. highlight:: ini
0271
0272 All options may be saved in configuration files and passed to the program via the ``-c, --config-file`` option.
0273 Config files follow a simple ``key = value`` syntax, and lines beginning with a ``#`` are comments.
0274 The key for each option is its long option without the ``--`` prefix.
0275 Here's an example including all options::
0276
0277 # specify the projectile option twice
0278 projectile = Pb
0279 projectile = Pb
0280 number-events = 1000
0281
0282 # don't print event properties to stdout, save to HDF5
0283 quiet = true
0284 output = PbPb.hdf
0285
0286 reduced-thickness = 0
0287 fluctuation = 1
0288 nucleon-width = 0.5
0289 cross-section = 6.4
0290 normalization = 1
0291
0292 # leave commented out for min-bias
0293 # b-min =
0294 # b-max =
0295
0296 grid-max = 10
0297 grid-step = 0.2
0298
0299 Multiple config files can be given and they will be merged, so options can be separated into modular groups.
0300 For example, one could have a file ``common.conf`` containing settings for all collision systems and files ``PbPb.conf`` and ``pp.conf`` for specific collision systems::
0301
0302 # common.conf
0303 reduced-thickness = 0.2
0304 fluctuation = 1.5
0305 nucleon-width = 0.6
0306
0307 # PbPb.conf
0308 projectile = Pb
0309 projectile = Pb
0310 number-events = 10000
0311 grid-max = 9
0312
0313 # pp.conf
0314 projectile = p
0315 projectile = p
0316 number-events = 100000
0317 grid-max = 3
0318
0319 .. highlight:: none
0320
0321 To be used like so::
0322
0323 trento -c common.conf -c PbPb.conf
0324 trento -c common.conf -c pp.conf
0325
0326 If an option is specified in a config file and on the command line, the command line overrides.
0327
0328 .. _arb-configs:
0329
0330 Arbitrary nuclear configurations
0331 --------------------------------
0332 .. versionadded:: 1.3
0333
0334 ``trento`` can read pre-generated nuclear configurations from HDF5 files.
0335
0336 The following files were created from publicly available data and can be input directly to ``trento``.
0337 They are redistributed with permission from the authors.
0338
0339 - |3He| configurations are from the `PHOBOS Glauber model <https://tglaubermc.hepforge.org>`_, created by Joe Carlson at LANL (`ref <http://journals.aps.org/rmp/abstract/10.1103/RevModPhys.70.743>`_).
0340 - |197Au| and |208Pb| configurations including realistic nucleon-nucleon correlations were created by Massimiliano Alvioli (`ref 1 <http://inspirehep.net/record/820666>`_, `ref 2 <http://inspirehep.net/record/1082705>`_) and are available on `his website <http://users.phys.psu.edu/~malvioli/eventgenerator>`_.
0341
0342 If you use these configurations in your research, please cite the original authors.
0343
0344 ======= =============== =========== ======= ============================================
0345 Species File No. configs Size sha1sum
0346 ======= =============== =========== ======= ============================================
0347 |3He| He3.hdf_ 13,699 484 KiB ``a50c22ad8999db185e50fa513adf8100c29fba8c``
0348 |197Au| Au197.hdf_ 1,820 4.2 MiB ``9124eeab163bb2fbc6a919cb96efd44b99cac6be``
0349 |208Pb| Pb208_10k.hdf_ 10,000 24 MiB ``4d5c76cb4b5535538b57864a1287a4695abc29d1``
0350 |208Pb| Pb208_100k.hdf_ 100,000 239 MiB ``d67f7aca2b14f8c705a4bfa0a8aeedcd3a816f6e``
0351 ======= =============== =========== ======= ============================================
0352
0353 .. |3He| replace:: :sup:`3`\ He
0354 .. |197Au| replace:: :sup:`197`\ Au
0355 .. |208Pb| replace:: :sup:`208`\ Pb
0356
0357 .. _He3.hdf: nuclear-configs/He3.hdf
0358 .. _Au197.hdf: nuclear-configs/Au197.hdf
0359 .. _Pb208_10k.hdf: nuclear-configs/Pb208_10k.hdf
0360 .. _Pb208_100k.hdf: nuclear-configs/Pb208_100k.hdf
0361
0362 Pb208_10k.hdf_ contains the same data as the first 10,000 configurations in Pb208_100k.hdf_.
0363 The smaller file is provided for convenience.
0364
0365 To use pre-generated configurations, specify a path to an appropriate file on the command line in place of a species abbreviation::
0366
0367 trento path/to/file1.hdf path/to/file2.hdf
0368
0369 Filenames must have an HDF5-like extension (``.hdf5``, ``.hdf``, ``.hd5``, ``.h5``).
0370 The files may be the same or different and may be mixed with standard species abbreviations.
0371 For each event, ``trento`` will choose a random configuration from the file and apply a random three-dimensional rotation.
0372 Hence, it is safe to run several events per pre-generated configuration.
0373
0374 For example, to run |3He|\ +Au events at RHIC, download He3.hdf_ and execute ::
0375
0376 trento --cross-section 4.2 He3.hdf Au2
0377
0378 Remember to set the appropriate cross section for the desired beam energy!
0379
0380 To run custom configurations, make an HDF5 file containing a single dataset of shape ``(number_configs, number_nucleons, 3)``, where the first dimension corresponds to each configuration, the second dimension to each nucleon, and the third dimension to the (x, y, z) coordinates of each nucleon.
0381 Note that ``trento`` will read the file as single-precision floats, not doubles.
0382
0383 .. highlight:: python
0384
0385 The easiest way to write an HDF5 file is with `h5py <http://www.h5py.org>`_::
0386
0387 import numpy as np
0388 import h5py
0389
0390 # generate random data for 10 configs of a nucleus with 100 nucleons
0391 configs = np.random.uniform(-1, 1, (10, 100, 3))
0392
0393 with h5py.File('nuclear_configs.hdf') as f:
0394 # the name of the dataset does not matter as long as there is only one
0395 f.create_dataset('configs', data=configs, dtype=np.float32)
0396