 |
Version: SMASH-1.8
|
|
Go to the documentation of this file.
27 static constexpr
int LNucleus = LogArea::Nucleus::id;
36 std::map<PdgCode, int> part = config.
take({
"Particles"});
40 config.
has_value({
"Saturation_Density"})) {
42 }
else if (!config.
has_value({
"Diffusiveness"}) &&
44 !config.
has_value({
"Saturation_Density"})) {
47 throw std::invalid_argument(
48 "Diffussiveness, Radius and Saturation_Density "
49 "required to manually configure the Woods-Saxon"
50 " distribution. Only one/two were provided. \n"
51 "Providing none of the above mentioned "
52 "parameters automatically configures the "
53 "distribution based on the atomic number.");
58 double total_mass = 0.;
60 total_mass += i->momentum().abs();
229 double prob_range1 = 1.0;
230 double prob_range2 = 3. / radius_scaled;
231 double prob_range3 = 2. * prob_range2 / radius_scaled;
232 double prob_range4 = 1. * prob_range3 / radius_scaled;
233 double ranges234 = prob_range2 + prob_range3 + prob_range4;
238 if (which_range < 0.0) {
242 if (which_range >= prob_range2) {
244 if (which_range >= prob_range2 + prob_range3) {
258 double position_scaled = t + radius_scaled;
268 for (
auto i =
begin(); i !=
end(); i++) {
270 i->set_4momentum(i->pole_mass(), 0.0, 0.0, 0.0);
336 }
else if (Z == 44) {
345 0.86 * std::pow(A, -1.0 / 3.0));
366 static_cast<double>(config.
take({
"Saturation_Density"})));
377 const int A = N_n + N_p;
378 constexpr
double pi2_3 = 3.0 * M_PI * M_PI;
380 logg[
LNucleus].debug() << N_n <<
" neutrons, " << N_p <<
" protons.";
383 for (
auto i =
begin(); i !=
end(); i++) {
387 logg[
LNucleus].warn() <<
"No rule to calculate Fermi momentum "
388 <<
"for particle " << i->
pdgcode();
392 const double r = (i->
position() - nucleus_center).abs3();
407 ptot += ith_3momentum;
409 logg[
LNucleus].debug() <<
"Particle: " << *i <<
", pF[GeV]: "
410 <<
hbarc * std::pow(pi2_3 * rho, 1.0 / 3.0)
416 assert(ptot.
x1() == 0.0 && ptot.
x2() == 0.0 && ptot.
x3() == 0.0);
421 for (
auto i =
begin(); i !=
end(); i++) {
431 double beta_squared = beta_scalar * beta_scalar;
432 double one_over_gamma = std::sqrt(1.0 - beta_squared);
433 double gamma = 1.0 / one_over_gamma;
441 for (
auto i =
begin(); i !=
end(); i++) {
447 this_position.
set_x3(this_position.
x3() * one_over_gamma);
448 i->set_4position(this_position);
455 i->set_4momentum(i->pole_mass(), mom_i.
x1(), mom_i.
x2(),
456 gamma * (beta_scalar * mom_i.
x0() + mom_i.
x3()));
463 for (
auto n = particle_list.cbegin();
n != particle_list.cend(); ++
n) {
465 double current_mass = current_type.
mass();
469 particles_.back().set_4momentum(current_mass, 0.0, 0.0, 0.0);
476 for (
auto i =
begin(); i !=
end(); i++) {
478 this_position.
set_x3(this_position.
x3() + z_offset);
479 this_position.
set_x1(this_position.
x1() + x_offset);
480 this_position.
set_x0(simulation_time);
481 i->set_4position(this_position);
482 i->set_formation_time(simulation_time);
488 external_particles->
insert(*
p);
495 centerpoint +=
p->position();
497 centerpoint /=
size();
514 return out <<
" #particles #testparticles mass [GeV] "
515 "radius [fm] diffusiveness [fm]\n"
516 <<
format(
n.number_of_particles(),
nullptr, 12)
518 <<
format(
n.get_nuclear_radius(),
nullptr, 14)
519 <<
format(
n.get_diffusiveness(),
nullptr, 20);
void set_3momentum(const ThreeVector &mom)
Set the momentum of the particle without modifying the energy.
void random_euler_angles()
Randomly generate Euler angles.
A nucleus is a collection of particles that are initialized, before the beginning of the simulation a...
double diffusiveness_
Diffusiveness of Woods-Saxon distribution of this nucleus in fm (for diffusiveness_ == 0,...
void fill_from_list(const std::map< PdgCode, int > &particle_list, int testparticles)
Adds particles from a map PDG code => Number_of_particles_with_that_PDG_code to the nucleus.
std::vector< ParticleData >::const_iterator cbegin() const
For const iterators over the particle list:
Nucleus()=default
default constructor
const FourVector & momentum() const
Get the particle's 4-momentum.
virtual void generate_fermi_momenta()
Generates momenta according to Fermi motion for the nucleons.
double pole_mass() const
Get the particle's pole mass ("on-shell").
size_t number_of_protons() const
Number of physical protons in the nucleus:
double default_nuclear_radius()
Default nuclear radius calculated as:
std::vector< ParticleData >::iterator begin()
For iterators over the particle list:
double woods_saxon(double x)
Woods-Saxon distribution.
double nuclear_radius_
Nuclear radius of this nucleus.
std::ostream & operator<<(std::ostream &out, const ActionPtr &action)
constexpr double nuclear_density
Ground state density of symmetric nuclear matter [fm^-3].
void distribute_isotropically()
Populate the object with a new direction.
double euler_theta_
Euler angel theta.
PdgCode pdgcode() const
Get the pdgcode of the particle.
void copy_particles(Particles *particles)
Copies the particles from this nucleus into the particle list.
bool has_value(std::initializer_list< const char * > keys) const
Returns whether there is a non-empty value behind the requested keys.
void align_center()
Shifts the nucleus so that its center is at (0,0,0)
virtual void arrange_nucleons()
Sets the positions of the nucleons inside a nucleus.
static constexpr int LNucleus
constexpr double hbarc
GeV <-> fm conversion factor.
size_t number_of_particles() const
Number of physical particles in the nucleus:
void set_4momentum(const FourVector &momentum_vector)
Set the particle's 4-momentum directly.
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > logg
An array that stores all pre-configured Logger objects.
virtual void set_parameters_automatic()
Sets the deformation parameters of the Woods-Saxon distribution according to the current mass number.
std::vector< ParticleData > particles_
Particles associated with this nucleus.
static const ParticleType & find(PdgCode pdgcode)
Returns the ParticleType object for the given pdgcode.
Interface to the SMASH configuration files.
size_t testparticles_
Number of testparticles per physical particle.
double euler_psi_
Euler angel psi.
FormattingHelper< T > format(const T &value, const char *unit, int width=-1, int precision=-1)
Acts as a stream modifier for std::ostream to output an object with an optional suffix string and wit...
void shift(double z_offset, double x_offset, double simulation_time)
Shifts the nucleus to correct impact parameter and z displacement.
void set_nuclear_radius(double rad)
Sets the nuclear radius.
const FourVector & position() const
Get the particle's position in Minkowski space.
virtual ThreeVector distribute_nucleon()
The distribution of return values from this function is according to a spherically symmetric Woods-Sa...
std::vector< ParticleData >::iterator end()
For iterators over the particle list:
FourVector center() const
Calculate geometrical center of the nucleus.
bool almost_equal(const N x, const N y)
Checks two numbers for relative approximate equality.
virtual void rotate()
Rotates the nucleus.
virtual void set_parameters_from_config(Configuration &config)
Sets the parameters of the Woods-Saxon according to manually added values in the configuration file.
void set_diffusiveness(double diffuse)
Sets the diffusiveness of the nucleus.
const ParticleData & insert(const ParticleData &p)
Inserts the particle into the list of particles.
size_t size() const
Number of numerical (=test-)particles in the nucleus:
ThreeVector threevec() const
double euler_phi_
Euler angel phi.
Value take(std::initializer_list< const char * > keys)
The default interface for SMASH to read configuration values.
void boost(double beta_scalar)
Boosts the nuclei into the computational frame, such that the nucleons have the appropriate momentum ...
Angles provides a common interface for generating directions: i.e., two angles that should be interpr...
virtual double nucleon_density(double r, double)
Return the Woods-Saxon probability density for the given position.
std::vector< ParticleData >::const_iterator cend() const
For const iterators over the particle list:
ThreeVector threevec() const
void set_saturation_density(double density)
Sets the saturation density of the nucleus.