5 #include "../src/collider.h"
12 #include "../src/nucleus.h"
14 using namespace trento;
22 {
"random-seed",
static_cast<int64_t
>(-1)},
23 {
"projectile", std::vector<std::string>{
"Pb",
"Pb"}},
26 {
"normalization", 1.},
27 {
"reduced-thickness", 0.},
31 {
"cross-section", 6.4},
32 {
"nucleon-width", 0.5},
33 {
"nucleon-min-dist", 0.},
36 std::vector<int> nevent,
npart;
37 std::vector<double> impact, mult;
47 while (std::getline(capture.
stream, line)) {
52 std::istringstream(line) >> nevent.back()
60 std::vector<int> sequence(N);
61 std::iota(sequence.begin(), sequence.end(), 0);
62 CHECK( nevent == sequence );
66 CHECK( impact >= std::vector<double>(N, 0.) );
67 CHECK( impact <= std::vector<double>(N, impact_max) );
70 CHECK( npart >= std::vector<int>(N, 2) );
71 CHECK( npart <= std::vector<int>(N, 416) );
74 CHECK( mult >= std::vector<double>(N, 0.) );
79 constexpr
auto bfixed = 4.;
84 {
"random-seed",
static_cast<int64_t
>(-1)},
85 {
"projectile", std::vector<std::string>{
"Au",
"Au"}},
88 {
"normalization", 1.},
89 {
"reduced-thickness", 0.},
93 {
"cross-section", 6.4},
94 {
"nucleon-width", 0.5},
95 {
"nucleon-min-dist", 0.2},
98 std::vector<double> impact;
104 collider.run_events();
107 while (std::getline(capture.
stream, line)) {
109 std::istringstream(line) >> x >>
x;
115 CHECK( std::all_of(impact.cbegin(), impact.cend(),
116 [&bfixed](
double b) {
return b == Approx(bfixed); }) );
120 std::vector<std::string>
output(5);
122 const auto seed =
static_cast<int64_t
>(std::random_device{}());
125 std::generate(output.begin(), output.end(),
128 {
"number-events", 3},
130 {
"random-seed",
seed},
131 {
"projectile", std::vector<std::string>{
"p",
"U"}},
134 {
"normalization", 1.},
135 {
"reduced-thickness", 0.},
139 {
"cross-section", 6.4},
140 {
"nucleon-width", 0.5},
141 {
"nucleon-min-dist", 0.4},
145 collider.run_events();
147 return capture.
stream.str();
151 CHECK( std::all_of(output.cbegin(), output.cend(),