Version: SMASH-3.3
smash::DynamicFluidizationFinder Class Reference

#include <dynamicfluidfinder.h>

Finder for dynamic fluidizations.

Loops through all particles and checks if they reach the energy density threshold. This happens at the end of every time step for all hadrons that participated in a fluidizable process. For string fragmentation products, fluidization happens only after the fraction of formation time of the particle, controlled by Formation_Time_Fraction.

Definition at line 32 of file dynamicfluidfinder.h.

Inheritance diagram for smash::DynamicFluidizationFinder:
smash::ActionFinderInterface

Public Member Functions

 DynamicFluidizationFinder (const RectangularLattice< EnergyMomentumTensor > &lattice, const std::map< int32_t, double > &background, const InitialConditionParameters &ic_params)
 Construct finder for fluidization action. More...
 
ActionList find_actions_in_cell (const ParticleList &search_list, double dt, double gcell_vol, const std::vector< FourVector > &beam_momentum) const override
 Find particles to fluidize, depending on the energy density around them. More...
 
ActionList find_actions_with_neighbors (const ParticleList &, const ParticleList &, const double, const std::vector< FourVector > &) const override
 Ignore the neighbor search for fluidization. More...
 
ActionList find_actions_with_surrounding_particles (const ParticleList &, const Particles &, double, const std::vector< FourVector > &) const override
 Ignore the surrounding searches for fluidization. More...
 
ActionList find_final_actions (const Particles &search_list) const override
 Prepare corona particles left in the IC for the afterburner. More...
 
bool above_threshold (const ParticleData &pdata) const
 Determine if fluidization condition is satisfied. More...
 
bool is_process_fluidizable (const HistoryData &history) const
 Checks if a given process type is in fluidizable_processes_. More...
 
- Public Member Functions inherited from smash::ActionFinderInterface
virtual ~ActionFinderInterface ()=default
 

Private Attributes

const RectangularLattice< EnergyMomentumTensor > & energy_density_lattice_
 Lattice where energy momentum tensor is computed. More...
 
const std::map< int32_t, double > & background_
 Background energy density at positions of particles, using the id as key. More...
 
const double energy_density_threshold_ = smash_NaN<double>
 Minimum energy density surrounding the particle to fluidize it. More...
 
const double min_time_ = smash_NaN<double>
 Minimum time (in lab frame) in fm to allow fluidization. More...
 
const double max_time_ = smash_NaN<double>
 Maximum time (in lab frame) in fm to allow fluidization. More...
 
const double formation_time_fraction_ = smash_NaN<double>
 Fraction of formation time after which a particles can fluidize. More...
 
const double smearing_kernel_at_0_ = smash_NaN<double>
 Smearing kernel at the position of the particle of interest. More...
 
const int fluid_cells_ = smash_NaN<int>
 Number of cells to interpolate the energy density. More...
 
const FluidizableProcessesBitSet fluidizable_processes_
 Processes that create a fluidizable particle. More...
 
const bool delay_initial_elastic_ = true
 Whether the first elastic interaction of an initial nucleon is fluidizable. More...
 
int particles_in_core_ = 0
 Accumulated number of core particles. More...
 
double energy_in_core_ = 0.
 Accumulated energy of core particles. More...
 

Constructor & Destructor Documentation

◆ DynamicFluidizationFinder()

smash::DynamicFluidizationFinder::DynamicFluidizationFinder ( const RectangularLattice< EnergyMomentumTensor > &  lattice,
const std::map< int32_t, double > &  background,
const InitialConditionParameters ic_params 
)
inline

Construct finder for fluidization action.

Parameters
[in]latticeLattice used for the energy density interpolation
[in]backgroundBackground map between particle indices and the corresponding background energy density
[in]ic_paramsParameters for dynamic fluidization
Note
energy_density_lattice and energy_density_background are both "in" parameters because the class stores references, but the values are non constant.

Definition at line 45 of file dynamicfluidfinder.h.

49  : energy_density_lattice_{lattice},
50  background_{background},
51  energy_density_threshold_{ic_params.energy_density_threshold.value()},
52  min_time_{ic_params.min_time.value()},
53  max_time_{ic_params.max_time.value()},
54  formation_time_fraction_{ic_params.formation_time_fraction.value()},
55  smearing_kernel_at_0_{ic_params.smearing_kernel_at_0.value()},
56  fluid_cells_{ic_params.num_fluid_cells.value()},
57  fluidizable_processes_{ic_params.fluidizable_processes.value()},
58  delay_initial_elastic_{ic_params.delay_initial_elastic.value()} {};
const RectangularLattice< EnergyMomentumTensor > & energy_density_lattice_
Lattice where energy momentum tensor is computed.
const double min_time_
Minimum time (in lab frame) in fm to allow fluidization.
const double formation_time_fraction_
Fraction of formation time after which a particles can fluidize.
const bool delay_initial_elastic_
Whether the first elastic interaction of an initial nucleon is fluidizable.
const std::map< int32_t, double > & background_
Background energy density at positions of particles, using the id as key.
const double max_time_
Maximum time (in lab frame) in fm to allow fluidization.
const FluidizableProcessesBitSet fluidizable_processes_
Processes that create a fluidizable particle.
const int fluid_cells_
Number of cells to interpolate the energy density.
const double energy_density_threshold_
Minimum energy density surrounding the particle to fluidize it.
const double smearing_kernel_at_0_
Smearing kernel at the position of the particle of interest.

Member Function Documentation

◆ find_actions_in_cell()

ActionList smash::DynamicFluidizationFinder::find_actions_in_cell ( const ParticleList &  search_list,
double  dt,
double  gcell_vol,
const std::vector< FourVector > &  beam_momentum 
) const
overridevirtual

Find particles to fluidize, depending on the energy density around them.

Parameters
[in]search_listList of candidate particles to fluidize.
[in]dtTime step duration in fm.
[in]gcell_volVolume of the grid cell in fm³,
[in]beam_momentumUnused.
Returns
List of fluidization actions that will happen at the corresponding formation time.

Implements smash::ActionFinderInterface.

Definition at line 19 of file dynamicfluidfinder.cc.

22  {
23  ActionList actions;
24 
25  for (const ParticleData &p : search_list) {
26  const double t0 = p.position().x0();
27  const double t_creation = p.begin_formation_time();
28  const double t_end = t0 + dt;
29  if (t_end < min_time_ || t0 > max_time_) {
30  break;
31  }
32  if (p.is_core()) {
33  continue;
34  }
35  const double fluidization_time =
36  t_creation +
37  formation_time_fraction_ * (p.formation_time() - t_creation);
38  if (fluidization_time >= t_end) {
39  continue;
40  }
41  if (!is_process_fluidizable(p.get_history())) {
42  continue;
43  }
44  if (above_threshold(p)) {
45  double time_until = (1 - p.xsec_scaling_factor() <= really_small)
46  ? 0
47  : std::max(fluidization_time - t0, 0.);
48  actions.emplace_back(
49  std::make_unique<FluidizationAction>(p, p, time_until));
50  }
51  } // search_list loop
52  return actions;
53 }
bool is_process_fluidizable(const HistoryData &history) const
Checks if a given process type is in fluidizable_processes_.
bool above_threshold(const ParticleData &pdata) const
Determine if fluidization condition is satisfied.
constexpr int p
Proton.
constexpr double really_small
Numerical error tolerance.
Definition: constants.h:41

◆ find_actions_with_neighbors()

ActionList smash::DynamicFluidizationFinder::find_actions_with_neighbors ( const ParticleList &  ,
const ParticleList &  ,
const double  ,
const std::vector< FourVector > &   
) const
inlineoverridevirtual

Ignore the neighbor search for fluidization.

Implements smash::ActionFinderInterface.

Definition at line 74 of file dynamicfluidfinder.h.

76  {
77  return {};
78  }

◆ find_actions_with_surrounding_particles()

ActionList smash::DynamicFluidizationFinder::find_actions_with_surrounding_particles ( const ParticleList &  ,
const Particles ,
double  ,
const std::vector< FourVector > &   
) const
inlineoverridevirtual

Ignore the surrounding searches for fluidization.

Implements smash::ActionFinderInterface.

Definition at line 81 of file dynamicfluidfinder.h.

83  {
84  return {};
85  }

◆ find_final_actions()

ActionList smash::DynamicFluidizationFinder::find_final_actions ( const Particles search_list) const
overridevirtual

Prepare corona particles left in the IC for the afterburner.

  • Remove core particles.
  • Move corona particles back to their last interaction point so they start at the correct spacetime position for afterburner rescattering with hadrons sampled from the fluid.
  • Do not modify spectators.
Parameters
[in]search_listAll particles at the end of the simulation.
Returns
ActionList with removals and backpropagation steps.
Note
The backpropagation is encoded as two FreeForAll actions: remove the corona particle, then add it at the target spacetime point. This will appear in the Collisions output.

Implements smash::ActionFinderInterface.

Definition at line 113 of file dynamicfluidfinder.cc.

114  {
115  ActionList actions;
116  const bool are_there_core_particles =
117  std::any_of(search_list.begin(), search_list.end(),
118  [](const ParticleData &p) { return p.is_core(); });
119  if (are_there_core_particles) {
120  for (auto &p : search_list) {
121  if (p.is_core()) {
122  actions.emplace_back(std::make_unique<FreeforallAction>(
123  ParticleList{p}, ParticleList{}, p.position().x0()));
125  energy_in_core_ += p.momentum()[0];
126  }
127  }
128  } else {
129  for (auto &original : search_list) {
130  if (original.get_history().collisions_per_particle == 0) {
131  // Spectators are not propagated back.
132  continue;
133  }
134  const double t = original.position().x0();
135  double corona_time = original.get_history().time_last_collision;
136  if (t == corona_time) {
137  continue;
138  }
139  // This prevents particles from decays or strings from ending up at the
140  // same position
141  corona_time += 0.01;
142  const ThreeVector r = original.position().threevec() -
143  (t - corona_time) * original.velocity();
144  ParticleData backpropagated{original.type()};
145  backpropagated.set_4position(FourVector(corona_time, r));
146  backpropagated.set_4momentum(original.momentum());
147  // This is done so no further actions can be found for this particle
148  backpropagated.set_formation_time(t);
149  backpropagated.set_cross_section_scaling_factor(0.0);
150  actions.emplace_back(std::make_unique<FreeforallAction>(
151  ParticleList{original}, ParticleList{}, t));
152  actions.emplace_back(std::make_unique<FreeforallAction>(
153  ParticleList{}, ParticleList{backpropagated}, corona_time));
154  }
155  logg[LFluidization].info()
156  << particles_in_core_ << " particles were part of the core with energy "
157  << energy_in_core_ << " GeV.";
158  }
159  return actions;
160 }
int particles_in_core_
Accumulated number of core particles.
double energy_in_core_
Accumulated energy of core particles.
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > logg
An array that stores all pre-configured Logger objects.
Definition: logging.cc:40
static constexpr int LFluidization

◆ above_threshold()

bool smash::DynamicFluidizationFinder::above_threshold ( const ParticleData pdata) const

Determine if fluidization condition is satisfied.

Parameters
[in]pdataParticle to be checked for fluidization.
Returns
Whether energy density around pdata is high enough.

Definition at line 55 of file dynamicfluidfinder.cc.

56  {
57  EnergyMomentumTensor Tmunu;
58  // value_at returns false if pdata is out of bounds
59  const bool inside =
60  energy_density_lattice_.value_at(pdata.position().threevec(), Tmunu);
61  if (inside) {
62  // If the particle is not in the map, the background evaluates to 0
63  const double background =
64  background_.count(pdata.id()) ? background_.at(pdata.id()) : 0;
65  const double e_den_particles =
66  Tmunu.boosted(Tmunu.landau_frame_4velocity())[0];
67  if (e_den_particles + background >=
68  energy_density_threshold_ + pdata.pole_mass() * smearing_kernel_at_0_) {
69  logg[LFluidization].debug()
70  << "Fluidize " << pdata.id() << " with " << e_den_particles << "+"
71  << background << " GeV/fm^3 at " << pdata.position().x0()
72  << " fm, formed at " << pdata.formation_time() << " fm";
73  return true;
74  }
75  }
76  return false;
77 }

◆ is_process_fluidizable()

bool smash::DynamicFluidizationFinder::is_process_fluidizable ( const HistoryData history) const

Checks if a given process type is in fluidizable_processes_.

In particular, initially sampled hadrons are not fluidizable and have ProcessType::None, which falls in the default case for the switch.

Returns
whether the process is fluidizable

Definition at line 79 of file dynamicfluidfinder.cc.

80  {
81  const ProcessType &type = history.process_type;
82  if (is_string_soft_process(type)) {
85  }
86  switch (type) {
88  if (history.collisions_per_particle == 1 && delay_initial_elastic_) {
89  return false;
90  }
92  case ProcessType::Decay:
108  default:
109  return false;
110  }
111 }
@ From_HardString
@ From_Inelastic
@ From_Elastic
@ From_SoftString
@ From_Decay
ProcessType
ProcessTypes are used to identify the type of the process.
Definition: processbranch.h:39
@ TwoToOne
See here for a short description.
@ MultiParticleThreeToTwo
See here for a short description.
@ Decay
See here for a short description.
@ TwoToFive
See here for a short description.
@ TwoToTwo
See here for a short description.
@ Elastic
See here for a short description.
@ TwoToFour
See here for a short description.
@ MultiParticleThreeMesonsToOne
See here for a short description.
@ MultiParticleFourToTwo
See here for a short description.
@ StringHard
See here for a short description.
@ TwoToThree
See here for a short description.
@ MultiParticleFiveToTwo
See here for a short description.
bool is_string_soft_process(ProcessType p)
Check if a given process type is a soft string excitation.

Member Data Documentation

◆ energy_density_lattice_

const RectangularLattice<EnergyMomentumTensor>& smash::DynamicFluidizationFinder::energy_density_lattice_
private

Lattice where energy momentum tensor is computed.

Note
It must be a reference so that it can be updated outside the class, without creating a new Finder object.

Definition at line 129 of file dynamicfluidfinder.h.

◆ background_

const std::map<int32_t, double>& smash::DynamicFluidizationFinder::background_
private

Background energy density at positions of particles, using the id as key.

Note
It is a reference so that it can be updated outside the class, e.g. by an external manager using SMASH as a library.

Definition at line 136 of file dynamicfluidfinder.h.

◆ energy_density_threshold_

const double smash::DynamicFluidizationFinder::energy_density_threshold_ = smash_NaN<double>
private

Minimum energy density surrounding the particle to fluidize it.

Definition at line 138 of file dynamicfluidfinder.h.

◆ min_time_

const double smash::DynamicFluidizationFinder::min_time_ = smash_NaN<double>
private

Minimum time (in lab frame) in fm to allow fluidization.

Definition at line 140 of file dynamicfluidfinder.h.

◆ max_time_

const double smash::DynamicFluidizationFinder::max_time_ = smash_NaN<double>
private

Maximum time (in lab frame) in fm to allow fluidization.

Definition at line 142 of file dynamicfluidfinder.h.

◆ formation_time_fraction_

const double smash::DynamicFluidizationFinder::formation_time_fraction_ = smash_NaN<double>
private

Fraction of formation time after which a particles can fluidize.

Definition at line 144 of file dynamicfluidfinder.h.

◆ smearing_kernel_at_0_

const double smash::DynamicFluidizationFinder::smearing_kernel_at_0_ = smash_NaN<double>
private

Smearing kernel at the position of the particle of interest.

Definition at line 146 of file dynamicfluidfinder.h.

◆ fluid_cells_

const int smash::DynamicFluidizationFinder::fluid_cells_ = smash_NaN<int>
private

Number of cells to interpolate the energy density.

Definition at line 148 of file dynamicfluidfinder.h.

◆ fluidizable_processes_

const FluidizableProcessesBitSet smash::DynamicFluidizationFinder::fluidizable_processes_
private

Processes that create a fluidizable particle.

Definition at line 150 of file dynamicfluidfinder.h.

◆ delay_initial_elastic_

const bool smash::DynamicFluidizationFinder::delay_initial_elastic_ = true
private

Whether the first elastic interaction of an initial nucleon is fluidizable.

Definition at line 152 of file dynamicfluidfinder.h.

◆ particles_in_core_

int smash::DynamicFluidizationFinder::particles_in_core_ = 0
mutableprivate

Accumulated number of core particles.

Definition at line 155 of file dynamicfluidfinder.h.

◆ energy_in_core_

double smash::DynamicFluidizationFinder::energy_in_core_ = 0.
mutableprivate

Accumulated energy of core particles.

Definition at line 157 of file dynamicfluidfinder.h.


The documentation for this class was generated from the following files: