Version: SMASH-3.0
smash::ListBoxModus Class Reference

#include <listmodus.h>

ListBox: Provides a modus for running the SMASH Box with an external particle list,.

To use this modus, choose Modus: ListBox

General:
Modus: ListBox

in the configuration file.

Options for ListBox go in the "Modi"→"ListBox" section of the configuration:

Modi:
ListBox:
# options here

The ListBoxModus inherits all functionality from the ListModus. For more detailed configuring see List.

Since SMASH is searching for collisions in computational frame time 't', all particles need to be at the same time. If this is not the case in the list provided, the particles will be propagated backwards on straight lines ("anti-freestreaming"). To avoid unphysical interactions of these particles, the back-propagated particles receive a formation_time and zero cross_section_scaling_factor. The cross-sections are set to zero during the time, where the particle will just propagate on a straight line again to appear at the formation_time into the system.

Definition at line 270 of file listmodus.h.

Inheritance diagram for smash::ListBoxModus:
smash::ListModus smash::ModusDefault

Public Member Functions

 ListBoxModus (Configuration modus_config, const ExperimentParameters &parameters)
 Constructor (This is the same as for the ListModus) More...
 
bool is_box () const
 in the case of the ListBoxModus is_box has to be true More...
 
int impose_boundary_conditions (Particles *particles, const OutputsList &output_list={})
 Enforces that all particles are inside the box at the beginning of an event. More...
 
Grid< GridOptions::PeriodicBoundariescreate_grid (const Particles &particles, double min_cell_length, double timestep_duration, CollisionCriterion crit, const bool include_unformed_particles, CellSizeStrategy strategy=CellSizeStrategy::Optimal) const
 Creates the Grid with normal boundary conditions. More...
 
- Public Member Functions inherited from smash::ListModus
 ListModus (Configuration modus_config, const ExperimentParameters &parameters)
 Constructor. More...
 
 ListModus ()
 Construct an empty list. Useful for convenient JetScape connection. More...
 
double initial_conditions (Particles *particles, const ExperimentParameters &parameters)
 Generates initial state of the particles in the system according to a list. More...
 
void backpropagate_to_same_time (Particles &particles)
 Judge whether formation times are the same for all the particles; Don't do anti-freestreaming if all particles start already at the same time. More...
 
void try_create_particle (Particles &particles, PdgCode pdgcode, double t, double x, double y, double z, double mass, double E, double px, double py, double pz)
 Tries to add a new particle to particles and performs consistency checks: (i) The PDG code is legal and exists in SMASH. More...
 
bool is_list () const
 
void set_file_id (const double file_id_inh)
 set the file id when ListBoxModus is used More...
 
void set_particle_list_file_directory (std::string particle_list_file_directory_inh)
 set the particle_list_directory when ListBoxModus is used More...
 
void set_particle_list_file_prefix (std::string particle_list_file_prefix_inh)
 set the particle_list_prefix when ListBoxModus is used More...
 
void set_event_id (int event_id_inh)
 set the event_id when ListBoxModus is used More...
 
- Public Member Functions inherited from smash::ModusDefault
int impose_boundary_conditions (Particles *, const OutputsList &={})
 Enforces sensible positions for the particles. More...
 
bool is_collider () const
 
bool is_box () const
 
bool is_list () const
 
bool is_sphere () const
 
double sqrt_s_NN () const
 
double impact_parameter () const
 
void sample_impact () const
 sample impact parameter for collider modus More...
 
double velocity_projectile () const
 
double velocity_target () const
 
FermiMotion fermi_motion () const
 
double max_timestep (double) const
 
double equilibration_time () const
 
double length () const
 
double radius () const
 
bool calculation_frame_is_fixed_target () const
 
double nuclei_passing_time () const
 Get the passing time of the two nuclei in a collision. More...
 
Grid< GridOptions::Normalcreate_grid (const Particles &particles, double min_cell_length, double timestep_duration, CollisionCriterion crit, const bool include_unformed_particles, CellSizeStrategy strategy=CellSizeStrategy::Optimal) const
 Creates the Grid with normal boundary conditions. More...
 
std::unique_ptr< GrandCanThermalizercreate_grandcan_thermalizer (Configuration &conf) const
 Creates GrandCanThermalizer. More...
 

Private Attributes

const int shift_id_
 shift_id is the start number of file_id_ More...
 
const double length_
 Length of the cube's edge in fm. More...
 
int file_id_
 file_id_ is the id of the current file More...
 
int event_id_
 event_id_ = the unique id of the current event More...
 
std::string particle_list_file_directory_
 File directory of the particle list. More...
 
std::string particle_list_file_prefix_
 File prefix of the particle list. More...
 

Additional Inherited Members

- Protected Attributes inherited from smash::ListModus
double start_time_ = 0.
 Starting time for the List; changed to the earliest formation time. More...
 

Constructor & Destructor Documentation

◆ ListBoxModus()

smash::ListBoxModus::ListBoxModus ( Configuration  modus_config,
const ExperimentParameters parameters 
)
explicit

Constructor (This is the same as for the ListModus)

Gathers all configuration variables for the List.

Parameters
[in]modus_configThe configuration object that sets all initial conditions of the experiment.
[in]parametersUnused, but necessary because of templated initialization

Definition at line 256 of file listmodus.cc.

258  : shift_id_(modus_config.take({"ListBox", "Shift_Id"})),
259  length_(modus_config.take({"ListBox", "Length"})) {
260  std::string fd = modus_config.take({"ListBox", "File_Directory"});
262 
263  std::string fp = modus_config.take({"ListBox", "File_Prefix"});
265 
266  event_id_ = 0;
268 
269  // Set specific values in the ListModus class
274 
275  if (param.n_ensembles > 1) {
276  throw std::runtime_error("ListModus only makes sense with one ensemble");
277  }
278 }
const int shift_id_
shift_id is the start number of file_id_
Definition: listmodus.h:313
std::string particle_list_file_directory_
File directory of the particle list.
Definition: listmodus.h:325
int event_id_
event_id_ = the unique id of the current event
Definition: listmodus.h:322
const double length_
Length of the cube's edge in fm.
Definition: listmodus.h:316
std::string particle_list_file_prefix_
File prefix of the particle list.
Definition: listmodus.h:328
int file_id_
file_id_ is the id of the current file
Definition: listmodus.h:319
void set_particle_list_file_directory(std::string particle_list_file_directory_inh)
set the particle_list_directory when ListBoxModus is used
Definition: listmodus.h:149
void set_file_id(const double file_id_inh)
set the file id when ListBoxModus is used
Definition: listmodus.h:146
void set_particle_list_file_prefix(std::string particle_list_file_prefix_inh)
set the particle_list_prefix when ListBoxModus is used
Definition: listmodus.h:155
void set_event_id(int event_id_inh)
set the event_id when ListBoxModus is used
Definition: listmodus.h:161

Member Function Documentation

◆ is_box()

bool smash::ListBoxModus::is_box ( ) const
inline

in the case of the ListBoxModus is_box has to be true

Definition at line 286 of file listmodus.h.

286 { return true; }

◆ impose_boundary_conditions()

int smash::ListBoxModus::impose_boundary_conditions ( Particles particles,
const OutputsList &  output_list = {} 
)

Enforces that all particles are inside the box at the beginning of an event.

It checks if the particles were placed correctly inside the box at initialization and places them inside if they are not.

Parameters
[in]particlesparticles to check their position and possibly move it
[in]output_listoutput objects
Returns
The number of particles that were put back into the box

In BoxModus if a particle crosses the wall of the box, it is inserted from the opposite side. However these wall crossings are not performed by this function but in the Experiment constructor when the WallCrossActionsFinder are created. Wall crossings are written to collision output: this is where OutputsList is used.

Definition at line 280 of file listmodus.cc.

281  {
282  int wraps = 0;
283  for (ParticleData &data : *particles) {
284  FourVector position = data.position();
285  bool wall_hit = enforce_periodic_boundaries(position.begin() + 1,
286  position.end(), length_);
287  if (wall_hit) {
288  const ParticleData incoming_particle(data);
289  data.set_4position(position);
290  ++wraps;
291  ActionPtr action =
292  std::make_unique<WallcrossingAction>(incoming_particle, data);
293  for (const auto &output : output_list) {
294  if (!output->is_dilepton_output() && !output->is_photon_output()) {
295  output->at_interaction(*action, 0.);
296  }
297  }
298  }
299  }
300 
301  logg[LList].debug("Moved ", wraps, " particles back into the box.");
302  return wraps;
303 }
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > logg
An array that stores all pre-configured Logger objects.
Definition: logging.cc:39
static bool enforce_periodic_boundaries(Iterator begin, const Iterator &end, typename std::iterator_traits< Iterator >::value_type length)
Enforces periodic boundaries on the given collection of values.
Definition: algorithms.h:53
static constexpr int LList
Definition: listmodus.cc:36

◆ create_grid()

Grid<GridOptions::PeriodicBoundaries> smash::ListBoxModus::create_grid ( const Particles particles,
double  min_cell_length,
double  timestep_duration,
CollisionCriterion  crit,
const bool  include_unformed_particles,
CellSizeStrategy  strategy = CellSizeStrategy::Optimal 
) const
inline

Creates the Grid with normal boundary conditions.

Parameters
[in]particlesThe Particles object containing all particles of the currently running Experiment.
[in]min_cell_lengthThe minimal length of the grid cells.
[in]timestep_durationDuration of the timestep. It is necessary for formation times treatment: if particle is fully or partially formed before the end of the timestep, it has to be on the grid.
[in]critCollision criterion (decides if cell number can be limited)
[in]include_unformed_particlesinclude unformed particles from the grid (worsens runtime, necessary for IC output)
[in]strategyThe strategy to determine the cell size
Returns
the Grid object
See also
Grid::Grid

Definition at line 293 of file listmodus.h.

297  {
299  if (crit == CollisionCriterion::Stochastic) {
301  }
302  return {{{0, 0, 0}, {length_, length_, length_}},
303  particles,
304  min_cell_length,
305  timestep_duration,
306  limit,
307  include_unformed_particles,
308  strategy};
309  }
@ Stochastic
Stochastic Criteiron.
CellNumberLimitation
Identifies whether the number of cells should be limited.
Definition: grid.h:55
@ ParticleNumber
Limit the number of cells to the number of particles.
@ None
No cell number limitation.

Member Data Documentation

◆ shift_id_

const int smash::ListBoxModus::shift_id_
private

shift_id is the start number of file_id_

Definition at line 313 of file listmodus.h.

◆ length_

const double smash::ListBoxModus::length_
private

Length of the cube's edge in fm.

Definition at line 316 of file listmodus.h.

◆ file_id_

int smash::ListBoxModus::file_id_
private

file_id_ is the id of the current file

Definition at line 319 of file listmodus.h.

◆ event_id_

int smash::ListBoxModus::event_id_
private

event_id_ = the unique id of the current event

Definition at line 322 of file listmodus.h.

◆ particle_list_file_directory_

std::string smash::ListBoxModus::particle_list_file_directory_
private

File directory of the particle list.

Definition at line 325 of file listmodus.h.

◆ particle_list_file_prefix_

std::string smash::ListBoxModus::particle_list_file_prefix_
private

File prefix of the particle list.

Definition at line 328 of file listmodus.h.


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