 |
Version: SMASH-2.0
|
|
Go to the documentation of this file.
23 static constexpr
int LNucleus = LogArea::Nucleus::id;
32 std::map<PdgCode, int> part = config.
take({
"Particles"});
36 config.
has_value({
"Saturation_Density"})) {
38 }
else if (!config.
has_value({
"Diffusiveness"}) &&
40 !config.
has_value({
"Saturation_Density"})) {
43 throw std::invalid_argument(
44 "Diffussiveness, Radius and Saturation_Density "
45 "required to manually configure the Woods-Saxon"
46 " distribution. Only one/two were provided. \n"
47 "Providing none of the above mentioned "
48 "parameters automatically configures the "
49 "distribution based on the atomic number.");
54 double total_mass = 0.;
56 total_mass += i->momentum().abs();
225 double prob_range1 = 1.0;
226 double prob_range2 = 3. / radius_scaled;
227 double prob_range3 = 2. * prob_range2 / radius_scaled;
228 double prob_range4 = 1. * prob_range3 / radius_scaled;
229 double ranges234 = prob_range2 + prob_range3 + prob_range4;
234 if (which_range < 0.0) {
238 if (which_range >= prob_range2) {
240 if (which_range >= prob_range2 + prob_range3) {
254 double position_scaled = t + radius_scaled;
264 for (
auto i =
begin(); i !=
end(); i++) {
266 i->set_4momentum(i->pole_mass(), 0.0, 0.0, 0.0);
332 }
else if (Z == 44) {
341 0.86 * std::pow(A, -1.0 / 3.0));
362 static_cast<double>(config.
take({
"Saturation_Density"})));
373 const int A = N_n + N_p;
374 constexpr
double pi2_3 = 3.0 * M_PI * M_PI;
376 logg[
LNucleus].debug() << N_n <<
" neutrons, " << N_p <<
" protons.";
379 for (
auto i =
begin(); i !=
end(); i++) {
383 logg[
LNucleus].warn() <<
"No rule to calculate Fermi momentum "
384 <<
"for particle " << i->
pdgcode();
388 const double r = (i->
position() - nucleus_center).abs3();
403 ptot += ith_3momentum;
405 logg[
LNucleus].debug() <<
"Particle: " << *i <<
", pF[GeV]: "
406 <<
hbarc * std::pow(pi2_3 * rho, 1.0 / 3.0)
412 assert(ptot.
x1() == 0.0 && ptot.
x2() == 0.0 && ptot.
x3() == 0.0);
417 for (
auto i =
begin(); i !=
end(); i++) {
427 double beta_squared = beta_scalar * beta_scalar;
428 double one_over_gamma = std::sqrt(1.0 - beta_squared);
429 double gamma = 1.0 / one_over_gamma;
437 for (
auto i =
begin(); i !=
end(); i++) {
443 this_position.
set_x3(this_position.
x3() * one_over_gamma);
444 i->set_4position(this_position);
451 i->set_4momentum(i->pole_mass(), mom_i.
x1(), mom_i.
x2(),
452 gamma * (beta_scalar * mom_i.
x0() + mom_i.
x3()));
459 for (
auto n = particle_list.cbegin();
n != particle_list.cend(); ++
n) {
461 double current_mass = current_type.
mass();
465 particles_.back().set_4momentum(current_mass, 0.0, 0.0, 0.0);
472 for (
auto i =
begin(); i !=
end(); i++) {
474 this_position.
set_x3(this_position.
x3() + z_offset);
475 this_position.
set_x1(this_position.
x1() + x_offset);
476 this_position.
set_x0(simulation_time);
477 i->set_4position(this_position);
478 i->set_formation_time(simulation_time);
484 external_particles->
insert(*
p);
491 centerpoint +=
p->position();
493 centerpoint /=
size();
510 return out <<
" #particles #testparticles mass [GeV] "
511 "radius [fm] diffusiveness [fm]\n"
512 <<
format(
n.number_of_particles(),
nullptr, 12)
514 <<
format(
n.get_nuclear_radius(),
nullptr, 14)
515 <<
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) const
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.