Version: SMASH-3.4
library.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2022,2024
4  * SMASH Team
5  *
6  * GNU General Public License (GPLv3 or later)
7  *
8  */
9 
10 #include <string>
11 #include <vector>
12 
13 #include "configuration.h"
14 #include "sha256.h"
15 
16 #ifndef SRC_INCLUDE_SMASH_LIBRARY_H_
17 #define SRC_INCLUDE_SMASH_LIBRARY_H_
18 
19 namespace smash {
20 
21 /* Free functions to interface with smash as a library,
22  * also used in smash main function. */
23 
24 /**
25  * Set up configuration and logging from input files and extra config
26  *
27  * \param[in] config_file Path to config input file
28  * \param[in] particles_file Path to particles input file.
29  * \param[in] decaymodes_file Path to decaymodes input file.
30  * \param[in] extra_config Extra config entries.
31  *
32  * \return Configuration object with particles, decaymodes and extra
33  * configs included.
34  *
35  * If no particles and decaymodes files are given the default files in
36  * the input directory are used.
37  */
38 Configuration setup_config_and_logging(
39  const std::string &config_file, const std::string &particles_file = {},
40  const std::string &decaymodes_file = {},
41  const std::vector<std::string> &extra_config = {});
42 
43 /**
44  * Wrapper over a function that initializes the particles and decays from the
45  * given configuration, and over another that tabulates the resonance integrals.
46  *
47  * \param[in] configuration Fully-setup configuration i.e. including
48  * particles and decaymodes.
49  * \param[in] version Current version of SMASH.
50  * \param[in] tabulations_dir Path where tabulations should be stored.
51  */
53  Configuration &configuration, const std::string &version,
54  const std::string &tabulations_dir = {});
55 
56 /**
57  * Initialize the particles and decays from the given configuration.
58  *
59  * \param[in] configuration Fully-setup configuration i.e. including
60  * particles and decaymodes.
61  * \param[in] version Current version of SMASH.
62  * \return hash of the version, particle list, and decay modes.
63  */
65  Configuration &configuration, const std::string &version);
66 
67 /**
68  * Tabulate the resonance integrals.
69  *
70  * \param[in] hash Hash of the SMASH version, particle list, and decay modes.
71  * \param[in] tabulations_dir Path where tabulations should be stored.
72  */
74  const std::string &tabulations_dir);
75 } // namespace smash
76 
77 #endif // SRC_INCLUDE_SMASH_LIBRARY_H_
std::array< uint8_t, HASH_SIZE > Hash
A SHA256 hash.
Definition: sha256.h:25
Definition: action.h:24
void initialize_particles_decays_and_tabulations(Configuration &configuration, const std::string &version, const std::string &tabulations_dir={})
Wrapper over a function that initializes the particles and decays from the given configuration,...
Definition: library.cc:46
void tabulate_resonance_integrals(const sha256::Hash &hash, const std::string &tabulations_dir)
Tabulate the resonance integrals.
Definition: library.cc:75
Configuration setup_config_and_logging(const std::string &config_file, const std::string &particles_file={}, const std::string &decaymodes_file={}, const std::vector< std::string > &extra_config={})
Set up configuration and logging from input files and extra config.
Definition: library.cc:34
sha256::Hash initialize_particles_decays_and_return_hash(Configuration &configuration, const std::string &version)
Initialize the particles and decays from the given configuration.
Definition: library.cc:54