Version: SMASH-3.4
particledata.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2020,2022-2026
3  * SMASH Team
4  *
5  * GNU General Public License (GPLv3 or later)
6  */
7 #ifndef SRC_INCLUDE_SMASH_PARTICLEDATA_H_
8 #define SRC_INCLUDE_SMASH_PARTICLEDATA_H_
9 
10 #include <limits>
11 #include <utility>
12 
13 #include "forwarddeclarations.h"
14 #include "fourvector.h"
15 #include "particletype.h"
16 #include "pdgcode.h"
17 #include "processbranch.h"
18 
19 namespace smash {
20 
21 enum class BelongsTo : uint8_t {
22  Nothing = 0,
23  Projectile = 1,
24  Target = 2,
25 };
26 
27 /**
28  * A structure to hold information about the history of the particle,
29  * e.g. the last interaction etc.
30  */
31 struct HistoryData {
32  /// Collision counter per particle, zero only for initially present particles
34  /// id of the last action
35  int32_t id_process = 0;
36  /// type of the last action
38  /**
39  * Time of the last action (excluding walls), time of kinetic freeze_out
40  * for HBT analysis this time should be larger or equal to the formation
41  * time of the particle, since only formed particles can freeze out
42  * The full coordinate space 4-vector can be obtained by back-propagation
43  */
44  double time_last_collision = smash_NaN<double>;
45  /// PdgCode of the first parent particles
46  PdgCode p1 = 0x0;
47  /// PdgCode of the second parent particles
48  PdgCode p2 = 0x0;
49 };
50 
51 /**
52  * \ingroup data
53  *
54  * ParticleData contains the dynamic information of a certain particle.
55  *
56  * Each particle has its momentum, position and other relevant physical
57  * data entry.
58  */
59 class ParticleData {
60  public:
61  /**
62  * Create a new particle with the given \p particle_type and optionally a
63  * specific \p unique_id.
64  *
65  * All other values are initialized to unphysical values.
66  *
67  * \param[in] particle_type Type of particle to be created
68  * \param[in] unique_id id of particle to be created
69  */
70  explicit ParticleData(const ParticleType &particle_type, int unique_id = -1)
71  : id_(unique_id), type_(&particle_type) {}
72 
73  /**
74  * Get the id of the particle
75  * \return particle id
76  */
77  int32_t id() const { return id_; }
78  /**
79  * Set id of the particle
80  * \param[in] i id to be assigned to the particle
81  */
82  void set_id(int i) { id_ = i; }
83 
84  /**
85  * Get the pdgcode of the particle
86  * \return pdgcode of the particle
87  */
88  PdgCode pdgcode() const { return type_->pdgcode(); }
89 
90  // Convenience accessors to PdgCode:
91  /// \copydoc PdgCode::is_hadron
92  bool is_hadron() const { return type_->is_hadron(); }
93 
94  /// \copydoc PdgCode::is_baryon
95  bool is_baryon() const { return pdgcode().is_baryon(); }
96 
97  /// \copydoc PdgCode::is_nucleus
98  bool is_nucleus() const { return pdgcode().is_nucleus(); }
99 
100  /// \copydoc PdgCode::is_rho
101  bool is_rho() const { return type_->is_rho(); }
102 
103  /// \copydoc PdgCode::is_proton
104  bool is_proton() const { return pdgcode().is_proton(); }
105 
106  /// \copydoc PdgCode::is_neutron
107  bool is_neutron() const { return pdgcode().is_neutron(); }
108 
109  /// \copydoc PdgCode::is_pion
110  bool is_pion() const { return pdgcode().is_pion(); }
111 
112  /// \copydoc PdgCode::is_Sigmastar
113  bool is_sigmastar() const { return pdgcode().is_Sigmastar(); }
114 
115  /**
116  * Get the particle's pole mass ("on-shell").
117  * \return pole mass of the particle [GeV]
118  */
119  double pole_mass() const { return type_->mass(); }
120  /**
121  * Get the particle's effective mass
122  *
123  * Determined from the 4-momentum \f$m=\sqrt{p_\mu p^\mu}\f$.
124  * Possibly "off-shell".
125  * \return Effective mass [GeV]
126  */
127  double effective_mass() const;
128  /**
129  * Get the type of the particle
130  * \return ParticleType object associated to this particle.
131  */
132  const ParticleType &type() const { return *type_; }
133 
134  /**
135  * Get the id of the last action
136  * \return id of particle's latest collision
137  */
138  uint32_t id_process() const { return history_.id_process; }
139  /**
140  * Get history information
141  * \return particle history struct
142  */
143  HistoryData get_history() const { return history_; }
144  /**
145  * Set history_ from rvalue reference. Meant to be used only in
146  * special situations e.g. in the ListModus, where a temporary HistoryData
147  * is constructed from the user input.
148  *
149  * \param[in] history object to be moved from.
150  */
151  void set_history(HistoryData &&history) { history_ = std::move(history); }
152 
153  /**
154  * Store history information
155  *
156  * The history contains the type of process and possibly the
157  * PdgCodes of the parent particles (\p plist). Note that history is not set
158  * for dileptons and photons.
159  * \param[in] ncoll particle's number of collisions
160  * \param[in] pid id of the particle's latest process
161  * \param[in] pt process type of the particle's latest process
162  * \param[in] time_last_coll time of latest collision [fm]
163  * \param[in] plist list of parent particles */
164  void set_history(int ncoll, uint32_t pid, ProcessType pt,
165  double time_last_coll, const ParticleList &plist);
166 
167  /**
168  * Get the particle's 4-momentum
169  * \return particle's 4-momentum [GeV]
170  */
171  const FourVector &momentum() const { return momentum_; }
172 
173  /**
174  * Set the particle's 4-momentum directly
175  * \param[in] momentum_vector 4-vector \f$p^\mu = (E,\mathbf{p})^T\f$
176  */
177  void set_4momentum(const FourVector &momentum_vector) {
178  momentum_ = momentum_vector;
179  }
180 
181  /**
182  * Set the momentum of the particle given its mass and momentum three-vector.
183  *
184  * \param[in] mass the mass of the particle (without E_kin contribution) [GeV]
185  * \param[in] mom the three-momentum of the particle [GeV]
186  */
187  void set_4momentum(double mass, const ThreeVector &mom) {
188  momentum_ = FourVector(std::sqrt(mass * mass + mom * mom), mom);
189  }
190 
191  /**
192  * Set the momentum of the particle.
193  *
194  * \param[in] mass the mass of the particle (without E_kin contribution) [GeV]
195  * \param[in] px x-component of the momentum [GeV]
196  * \param[in] py y-component of the momentum [GeV]
197  * \param[in] pz z-component of the momentum [GeV]
198  */
199  void set_4momentum(double mass, double px, double py, double pz) {
200  momentum_ = FourVector(std::sqrt(mass * mass + px * px + py * py + pz * pz),
201  px, py, pz);
202  }
203  /**
204  * Set the momentum of the particle without modifying the energy.
205  *
206  * WARNING: Mass gets modified.
207  * \param[in] mom momentum 3-vector [GeV]
208  */
209  void set_3momentum(const ThreeVector &mom) {
210  momentum_ = FourVector(momentum_.x0(), mom);
211  }
212 
213  /**
214  * Get the particle's position in Minkowski space
215  * \return particle's position 4-vector
216  */
217  const FourVector &position() const { return position_; }
218  /**
219  * Set the particle's 4-position directly
220  * \param[in] pos position 4-vector
221  */
222  void set_4position(const FourVector &pos) { position_ = pos; }
223  /**
224  * Set particle's 3-position
225  *
226  * The time component is not changed
227  * \param[in] pos position 3-vector
228  */
229  void set_3position(const ThreeVector &pos) {
230  position_ = FourVector(position_.x0(), pos);
231  }
232 
233  /**
234  * Translate the particle position
235  * \param[in] delta 3-vector by which the particle is translated [fm]
236  */
237  ParticleData translated(const ThreeVector &delta) const {
238  ParticleData p = *this;
239  p.position_[1] += delta[0];
240  p.position_[2] += delta[1];
241  p.position_[3] += delta[2];
242  return p;
243  }
244 
245  /**
246  * Get the absolute formation time of the particle
247  * \return particle's formation time
248  */
249  double formation_time() const { return formation_time_; }
250  /**
251  * Get the absolute time, where the cross section scaling factor slowly
252  * starts increasing from the given scaling factor to 1
253  * \return time, when scaling factor starts increasing
254  */
255  double begin_formation_time() const { return begin_formation_time_; }
256 
257  /**
258  * Set the absolute formation time
259  *
260  * The particle's cross section scaling factor will be a Heavyside fuction
261  * of time.
262  * \param[in] form_time absolute formation time
263  */
264  void set_formation_time(double form_time) {
265  formation_time_ = form_time;
266  // cross section scaling factor will be a step function in time
267  begin_formation_time_ = form_time;
268  // if time of the last collision is NaN set it to the formation time
269  if (std::isnan(history_.time_last_collision)) {
270  history_.time_last_collision = form_time;
271  }
272  }
273  /**
274  * Set the time, when the cross section scaling factor begins, and finishes
275  * to increase from the given cross section scaling factor to 1.
276  *
277  * The cross section will only grow slowly, if the option is used.
278  *
279  * \param[in] begin_form_time time when the cross section starts to increase
280  * \param[in] form_time time when the cross section reaches 1
281  */
282  void set_slow_formation_times(double begin_form_time, double form_time) {
283  begin_formation_time_ = begin_form_time;
284  formation_time_ = form_time;
285  if (std::isnan(history_.time_last_collision)) {
286  history_.time_last_collision = form_time;
287  }
288  }
289 
290  /**
291  * Get the initially assigned cross section scaling factor.
292  *
293  * Depending on the config, the cross section scaling factor might change
294  * with time, while this value will not be updated.
295  *
296  * \return particle's initially assigned cross section scaling factor
297  */
298  const double &initial_xsec_scaling_factor() const {
300  }
301  /**
302  * Set the particle's initial cross_section_scaling_factor
303  *
304  * All cross sections of this particle are scaled down by this factor until
305  * the formation time is over.
306  *
307  * If the particle formation power is set to be positive, this will only be
308  * the initial scaling factor, while the actual scaling factor grows with
309  * time.
310  *
311  * \param[in] xsec_scal cross section scaling factor
312  */
313  void set_cross_section_scaling_factor(const double &xsec_scal) {
314  initial_xsec_scaling_factor_ = xsec_scal;
315  }
316 
317  /**
318  * Get the velocity 3-vector
319  * \return 3-velocity of the particle
320  */
321  ThreeVector velocity() const { return momentum_.velocity(); }
322 
323  /**
324  * Get the inverse of the gamma factor from the current velocity of the
325  * particle.
326  *
327  * \f[\frac{1}{\gamma}=\sqrt{1-v^2}\f]
328  *
329  * This functions is more efficient than calculating the gamma factor from
330  * \ref velocity, since the \ref velocity function must execute three
331  * divisions (for every space component of the momentum vector).
332  *
333  * \returns inverse gamma factor
334  */
335  double inverse_gamma() const {
336  return std::sqrt(1. - momentum_.sqr3() / (momentum_.x0() * momentum_.x0()));
337  }
338 
339  /**
340  * Apply a full Lorentz boost of momentum and position
341  * \param[in] v boost 3-velocity
342  */
343  void boost(const ThreeVector &v) {
346  }
347 
348  /**
349  * Apply a Lorentz-boost to only the momentum
350  * \param[in] v boost 3-veloctity
351  */
352  void boost_momentum(const ThreeVector &v) {
354  }
355  /**
356  * Get the (maximum positive) spin s of a particle in multiples of 1/2.
357  * E.g. for a spin-1 particle s=2.
358  * \return particle's spin in multiples of 1/2
359  */
360  int spin() const { return pdgcode().spin(); }
361  /**
362  * Get the mean spin 4-vector (Pauli–Lubanski vector) of the particle (const
363  * reference, no copy). \return particle's mean spin 4-vector
364  */
365  const FourVector &spin_vector() const { return spin_vector_; }
366  /**
367  * Get the mean spin 4-vector (Pauli–Lubanski vector) of the particle (non
368  * const reference). \return particle's mean spin 4-vector
369  */
371  /**
372  * Set the mean spin 4-vector (Pauli–Lubanski vector) of the particle.
373  * \param[in] s particle's mean spin 4-vector
374  */
375  void set_spin_vector(const FourVector &s) { spin_vector_ = s; }
376  /**
377  * Set a single component of the mean spin 4-vector (Pauli-Lubanski vector).
378  * \param[in] index component index (0-3)
379  * \param[in] value component value
380  */
381  void set_spin_vector_component(int index, double value) {
382  if (index < 0 || index > 3) {
383  throw std::out_of_range("Invalid spin vector component index");
384  }
385  spin_vector_[index] = value;
386  }
387 
388  /**
389  * Set the 4 components of the spin vector such that the particle is
390  * unpolarized. This function is used only to initialize the spin vector of
391  * particles at creation.
392  */
394  /// Setter for belongs_to label
395  void set_belongs_to(BelongsTo label) { belongs_to_ = label; }
396  /// Getter for belongs_to label
397  BelongsTo belongs_to() const { return belongs_to_; }
398 
399  /// Fluidize the particle
400  void fluidize() { core_ = true; }
401  /// Check whether the particle is core
402  bool is_core() const { return core_; }
403  /// Particle \f$tau\f$ (hyperbolic time)
404  double hyperbolic_time() const { return position_.tau(); }
405  /// Particle spacetime rapidity \f$\eta_s\f$
406  double spatial_rapidity() const { return position_.eta(); }
407  /// Particle \f$m_T\f$
408  double transverse_mass() const { return momentum_.tau(); }
409  /// Particle momentum rapidity \f$y_\mathrm{rap}\f$
410  double rapidity() const { return momentum_.eta(); }
411 
412  /**
413  * Set the perturbative weight
414  */
415  void set_perturbative_weight(const double weight) {
416  perturbative_weight_ = weight;
417  }
418  /**
419  * Get the perturbative weight
420  */
421  double perturbative_weight() const { return perturbative_weight_; }
422 
423  /**
424  * Check whether two particles have the same id
425  * \param[in] a particle to compare to
426  * \return whether the particles have the same id
427  */
428  bool operator==(const ParticleData &a) const { return this->id_ == a.id_; }
429  /**
430  * Check if this particle has a smaller id than another particle
431  * \param[in] a particle to compare to
432  * \return whether this particle has a smaller id than other particle
433  */
434  bool operator<(const ParticleData &a) const { return this->id_ < a.id_; }
435 
436  /**
437  * Check if the particle has a given id
438  * \param[in] id_a id to compare to
439  * \return whether the particle has the given id
440  */
441  bool operator==(int id_a) const { return this->id_ == id_a; }
442  /**
443  * Check whether the particle's id is smaller than the given id
444  * \param[in] id_a number to compare particle's id to
445  */
446  bool operator<(int id_a) const { return this->id_ < id_a; }
447 
448  /**
449  * Construct a particle with the given type, id and index in Particles.
450  *
451  * This constructor may only be called (directly or indirectly) from
452  * Particles. This constructor should be private, but can't be in order to
453  * support vector::emplace_back.
454  * \param[in] ptype Type of the particle to be constructed
455  * \param[in] uid id of the particle to be constructed
456  * \param[in] index index of the particle to be constructed
457  */
458  ParticleData(const ParticleType &ptype, int uid, int index)
459  : id_(uid), index_(index), type_(&ptype) {}
460 
461  /**
462  * Return the cross section scaling factor at a given time.
463  *
464  * \param[in] delta_time scaling factor at current time plus
465  * this time will be returned.
466  * \return the cross section scaling factor at a specified time.
467  */
468  double xsec_scaling_factor(double delta_time = 0.) const;
469 
470  /// Power with which the cross section scaling factor grows in time.
471  static double formation_power_;
472 
473  private:
474  friend class Particles;
475  /// Default constructor.
476  ParticleData() = default;
477 
478  /**
479  * Copies some information of the particle to the given particle \p dst.
480  *
481  * Specifically it avoids to copy id_, index_, and type_.
482  * \param[in] dst particle values are copied to
483  */
484  void copy_to(ParticleData &dst) const {
485  dst.history_ = history_;
486  dst.momentum_ = momentum_;
487  dst.position_ = position_;
492  dst.belongs_to_ = belongs_to_;
493  dst.core_ = core_;
495  }
496 
497  /**
498  * Each particle has a unique identifier. This identifier is used for
499  * identifying the particle in the output files. It is specifically not used
500  * for searching for ParticleData objects in lists of particles, though it may
501  * be used to identify two ParticleData objects as referencing the same
502  * particle. This is why the comparison operators depend only on the id_
503  * member.
504  */
505  int32_t id_ = -1;
506 
507  /**
508  * Internal index in the \ref Particles list. This number is used to find the
509  * Experiment-wide original of this copy.
510  *
511  * The value is read and written from the Particles class.
512  *
513  * \see Particles::data_
514  */
515  unsigned index_ = std::numeric_limits<unsigned>::max();
516 
517  /**
518  * A reference to the ParticleType object for this particle (this contains
519  * all the static information). Default-initialized with an invalid index.
520  */
522 
523  // this leaves us two Bytes padding to use for "free"
524  static_assert(sizeof(ParticleTypePtr) == 2, "");
525  // make sure we don't exceed that space
526  static_assert(sizeof(bool) <= 2, "");
527  /**
528  * If \c true, the object is an entry in Particles::data_ and does not hold
529  * valid particle data. Specifically iterations over Particles must skip
530  * objects with `hole_ == true`. All other ParticleData instances should set
531  * this member to \c false.
532  *
533  * \see Particles::data_
534  */
535  bool hole_ = false;
536 
537  /// If the particle is part of a pseudofluid.
538  // A particle cannot be un-core, and any children it produces inherits
539  // this trait.
540  bool core_ = false;
541 
542  /// momenta of the particle: x0, x1, x2, x3 as E, px, py, pz
544  /// position in space: x0, x1, x2, x3 as t, x, y, z
546  /**
547  * Pauli-Lubanski vector (mean spin 4-vector) of the particle. Each
548  * component is initialized with NaN (double) to indicate that the spin vector
549  * has not been set.
550  */
551  FourVector spin_vector_ = FourVector(smash_NaN<double>, smash_NaN<double>,
552  smash_NaN<double>, smash_NaN<double>);
553  /** Formation time at which the particle is fully formed
554  * given as an absolute value in the computational frame
555  */
556  double formation_time_ = smash_NaN<double>;
557  /// time when the cross section scaling factor starts to increase to 1
558  double begin_formation_time_ = smash_NaN<double>;
559  /**
560  * Initial cross section scaling factor.
561  * 1 by default, since a particle is fully formed in this case.
562  */
564  /// Perturbative weight attributed to heavy flavor particles
565  double perturbative_weight_ = 1.0;
566  /// history information
568  /// is it part of projectile or target nuclei?
570 };
571 
572 /**
573  * \ingroup logging
574  * Writes the state of the particle to the output stream.
575  */
576 std::ostream &operator<<(std::ostream &s, const ParticleData &p);
577 
578 /**
579  * \ingroup logging
580  * Writes a compact overview over the particles in the \p particle_list argument
581  * to the stream.
582  */
583 std::ostream &operator<<(std::ostream &out, const ParticleList &particle_list);
584 
585 /**
586  * \ingroup logging
587  * \internal
588  * Helper type to attach the request for detailed printing to the type.
589  */
591  /// Particle list
592  const ParticleList &list;
593 };
594 /**
595  * \ingroup logging
596  * Request the ParticleList to be printed in full detail (i.e. one full
597  * ParticleData printout per line).
598  */
599 inline PrintParticleListDetailed detailed(const ParticleList &list) {
600  return {list};
601 }
602 
603 /**
604  * \ingroup logging
605  * Writes a detailed overview over the particles in the \p particle_list
606  * argument
607  * to the stream. This overload is selected via the function detailed.
608  */
609 std::ostream &operator<<(std::ostream &out,
610  const PrintParticleListDetailed &particle_list);
611 
612 /**
613  * This function creates a SMASH particle validating the provided information.
614  *
615  * - The input position and momentum is checked for nan values.
616  * - A particle is first created using the given PDG code, setting its
617  * 4-momentum to the given one.
618  * - Afterwards, if stable, its mass is compared to the given one and, if these
619  * do not match (up to numeric rounding), the internal SMASH value (i.e. that
620  * from the particles file) is used to put the particle on the SMASH mass
621  * shell.
622  * - Finally, for unstable particles or if the previous mass check passed, the
623  * particle is checked to be on its mass shell and, if not, its energy is
624  * adjusted to put the particle on its mass shell.
625  *
626  * This function possibly warns the user, if requested.
627  *
628  * \param[in] pdgcode PdgCode of the particle which is supposed to be checked
629  * \param[in] mass Mass of the new particle
630  * \param[in] four_position Position four vector of the new particle
631  * \param[in] four_momentum Momentum four vector of the new particle
632  * \param[in] log_area Logging area for the warning
633  * \param[inout] mass_warning Whether to warn about mass discrepancies
634  * \param[inout] on_shell_warning Whether to warn about off-shell particles
635  * \return Valid SMASH particle matching all given input quantities
636  *
637  * \note The boolean flags are passed by reference, since we want to allow
638  * client code to warn the user only once per flag. Hence, this function is
639  * turning the flags to \c false after having warned the user.
640  */
642  PdgCode pdgcode, double mass, const FourVector &four_position,
643  const FourVector &four_momentum, int log_area, bool &mass_warning,
644  bool &on_shell_warning);
645 
646 /**
647  * Utility function to compare two \c ParticleData instances with respect to
648  * their PDG code, 4-position and 4-momenta.
649  *
650  * The particles are propagated to the given time before being compared.
651  * 4-vectors are compared using the \c FourVector::operator== overload.
652  *
653  * @param p1 The first particle
654  * @param p2 The second particle
655  * @param time The time at which the comparison should take place
656  * @return \c true if the two particles have the same PDG codes, 4-position and
657  * 4-momentum;
658  * @return \c false otherwise.
659  */
660 bool are_particles_identical_at_given_time(const ParticleData &p1,
661  const ParticleData &p2, double time);
662 
663 } // namespace smash
664 
665 #endif // SRC_INCLUDE_SMASH_PARTICLEDATA_H_
The FourVector class holds relevant values in Minkowski spacetime with (+, −, −, −) metric signature.
Definition: fourvector.h:33
FourVector lorentz_boost(const ThreeVector &v) const
Returns the FourVector boosted with velocity v.
Definition: fourvector.cc:17
double sqr3() const
calculate the square of the spatial three-vector
Definition: fourvector.h:474
double x0() const
Definition: fourvector.h:313
ThreeVector velocity() const
Get the velocity (3-vector divided by zero component).
Definition: fourvector.h:333
double eta() const
calculate the space-time rapidity from the given four vector
Definition: fourvector.h:482
double tau() const
calculate the proper time from the given four vector
Definition: fourvector.h:478
ParticleData contains the dynamic information of a certain particle.
Definition: particledata.h:59
double formation_time_
Formation time at which the particle is fully formed given as an absolute value in the computational ...
Definition: particledata.h:556
PdgCode pdgcode() const
Get the pdgcode of the particle.
Definition: particledata.h:88
void set_history(HistoryData &&history)
Set history_ from rvalue reference.
Definition: particledata.h:151
unsigned index_
Internal index in the Particles list.
Definition: particledata.h:515
void set_4momentum(const FourVector &momentum_vector)
Set the particle's 4-momentum directly.
Definition: particledata.h:177
bool core_
If the particle is part of a pseudofluid.
Definition: particledata.h:540
bool is_proton() const
Definition: particledata.h:104
const ParticleType & type() const
Get the type of the particle.
Definition: particledata.h:132
BelongsTo belongs_to_
is it part of projectile or target nuclei?
Definition: particledata.h:569
void set_3position(const ThreeVector &pos)
Set particle's 3-position.
Definition: particledata.h:229
double inverse_gamma() const
Get the inverse of the gamma factor from the current velocity of the particle.
Definition: particledata.h:335
bool is_pion() const
Definition: particledata.h:110
ParticleData translated(const ThreeVector &delta) const
Translate the particle position.
Definition: particledata.h:237
int32_t id_
Each particle has a unique identifier.
Definition: particledata.h:505
double begin_formation_time_
time when the cross section scaling factor starts to increase to 1
Definition: particledata.h:558
void set_4position(const FourVector &pos)
Set the particle's 4-position directly.
Definition: particledata.h:222
bool is_nucleus() const
Definition: particledata.h:98
double xsec_scaling_factor(double delta_time=0.) const
Return the cross section scaling factor at a given time.
double hyperbolic_time() const
Particle (hyperbolic time)
Definition: particledata.h:404
bool operator<(int id_a) const
Check whether the particle's id is smaller than the given id.
Definition: particledata.h:446
bool is_hadron() const
Definition: particledata.h:92
static double formation_power_
Power with which the cross section scaling factor grows in time.
Definition: particledata.h:471
bool hole_
If true, the object is an entry in Particles::data_ and does not hold valid particle data.
Definition: particledata.h:535
uint32_t id_process() const
Get the id of the last action.
Definition: particledata.h:138
ParticleData(const ParticleType &particle_type, int unique_id=-1)
Create a new particle with the given particle_type and optionally a specific unique_id.
Definition: particledata.h:70
double begin_formation_time() const
Get the absolute time, where the cross section scaling factor slowly starts increasing from the given...
Definition: particledata.h:255
bool is_sigmastar() const
Definition: particledata.h:113
void set_id(int i)
Set id of the particle.
Definition: particledata.h:82
bool is_core() const
Check whether the particle is core.
Definition: particledata.h:402
const FourVector & momentum() const
Get the particle's 4-momentum.
Definition: particledata.h:171
BelongsTo belongs_to() const
Getter for belongs_to label.
Definition: particledata.h:397
void copy_to(ParticleData &dst) const
Copies some information of the particle to the given particle dst.
Definition: particledata.h:484
bool operator==(int id_a) const
Check if the particle has a given id.
Definition: particledata.h:441
FourVector momentum_
momenta of the particle: x0, x1, x2, x3 as E, px, py, pz
Definition: particledata.h:543
double formation_time() const
Get the absolute formation time of the particle.
Definition: particledata.h:249
bool is_neutron() const
Definition: particledata.h:107
ThreeVector velocity() const
Get the velocity 3-vector.
Definition: particledata.h:321
double initial_xsec_scaling_factor_
Initial cross section scaling factor.
Definition: particledata.h:563
bool is_baryon() const
Definition: particledata.h:95
FourVector & spin_vector()
Get the mean spin 4-vector (Pauli–Lubanski vector) of the particle (non const reference).
Definition: particledata.h:370
FourVector spin_vector_
Pauli-Lubanski vector (mean spin 4-vector) of the particle.
Definition: particledata.h:551
bool is_rho() const
Definition: particledata.h:101
bool operator<(const ParticleData &a) const
Check if this particle has a smaller id than another particle.
Definition: particledata.h:434
double effective_mass() const
Get the particle's effective mass.
Definition: particledata.cc:25
void set_formation_time(double form_time)
Set the absolute formation time.
Definition: particledata.h:264
int32_t id() const
Get the id of the particle.
Definition: particledata.h:77
ParticleData()=default
Default constructor.
double perturbative_weight_
Perturbative weight attributed to heavy flavor particles.
Definition: particledata.h:565
const FourVector & spin_vector() const
Get the mean spin 4-vector (Pauli–Lubanski vector) of the particle (const reference,...
Definition: particledata.h:365
double perturbative_weight() const
Get the perturbative weight.
Definition: particledata.h:421
HistoryData get_history() const
Get history information.
Definition: particledata.h:143
void fluidize()
Fluidize the particle.
Definition: particledata.h:400
const double & initial_xsec_scaling_factor() const
Get the initially assigned cross section scaling factor.
Definition: particledata.h:298
void set_4momentum(double mass, double px, double py, double pz)
Set the momentum of the particle.
Definition: particledata.h:199
void set_cross_section_scaling_factor(const double &xsec_scal)
Set the particle's initial cross_section_scaling_factor.
Definition: particledata.h:313
void set_spin_vector_component(int index, double value)
Set a single component of the mean spin 4-vector (Pauli-Lubanski vector).
Definition: particledata.h:381
FourVector position_
position in space: x0, x1, x2, x3 as t, x, y, z
Definition: particledata.h:545
double pole_mass() const
Get the particle's pole mass ("on-shell").
Definition: particledata.h:119
bool operator==(const ParticleData &a) const
Check whether two particles have the same id.
Definition: particledata.h:428
double rapidity() const
Particle momentum rapidity .
Definition: particledata.h:410
int spin() const
Get the (maximum positive) spin s of a particle in multiples of 1/2.
Definition: particledata.h:360
ParticleTypePtr type_
A reference to the ParticleType object for this particle (this contains all the static information).
Definition: particledata.h:521
void set_3momentum(const ThreeVector &mom)
Set the momentum of the particle without modifying the energy.
Definition: particledata.h:209
void set_slow_formation_times(double begin_form_time, double form_time)
Set the time, when the cross section scaling factor begins, and finishes to increase from the given c...
Definition: particledata.h:282
void set_spin_vector(const FourVector &s)
Set the mean spin 4-vector (Pauli–Lubanski vector) of the particle.
Definition: particledata.h:375
double transverse_mass() const
Particle .
Definition: particledata.h:408
void boost_momentum(const ThreeVector &v)
Apply a Lorentz-boost to only the momentum.
Definition: particledata.h:352
ParticleData(const ParticleType &ptype, int uid, int index)
Construct a particle with the given type, id and index in Particles.
Definition: particledata.h:458
double spatial_rapidity() const
Particle spacetime rapidity .
Definition: particledata.h:406
void set_belongs_to(BelongsTo label)
Setter for belongs_to label.
Definition: particledata.h:395
HistoryData history_
history information
Definition: particledata.h:567
void set_unpolarized_spin_vector()
Set the 4 components of the spin vector such that the particle is unpolarized.
Definition: particledata.cc:92
void boost(const ThreeVector &v)
Apply a full Lorentz boost of momentum and position.
Definition: particledata.h:343
const FourVector & position() const
Get the particle's position in Minkowski space.
Definition: particledata.h:217
void set_perturbative_weight(const double weight)
Set the perturbative weight.
Definition: particledata.h:415
void set_4momentum(double mass, const ThreeVector &mom)
Set the momentum of the particle given its mass and momentum three-vector.
Definition: particledata.h:187
A pointer-like interface to global references to ParticleType objects.
Definition: particletype.h:731
Particle type contains the static properties of a particle species.
Definition: particletype.h:100
PdgCode pdgcode() const
Definition: particletype.h:159
bool is_rho() const
Definition: particletype.h:230
bool is_hadron() const
Definition: particletype.h:200
double mass() const
Definition: particletype.h:147
The Particles class abstracts the storage and manipulation of particles.
Definition: particles.h:33
PdgCode stores a Particle Data Group Particle Numbering Scheme particle type number.
Definition: pdgcode.h:108
unsigned int spin() const
Definition: pdgcode.h:691
bool is_pion() const
Definition: pdgcode.h:471
bool is_Sigmastar() const
Definition: pdgcode.h:458
bool is_nucleus() const
Definition: pdgcode.h:361
bool is_proton() const
Definition: pdgcode.h:410
bool is_baryon() const
Definition: pdgcode.h:398
bool is_neutron() const
Definition: pdgcode.h:416
The ThreeVector class represents a physical three-vector with the components .
Definition: threevector.h:31
std::ostream & operator<<(std::ostream &out, const ActionPtr &action)
Convenience: dereferences the ActionPtr to Action.
Definition: action.h:546
PrintParticleListDetailed detailed(const ParticleList &list)
Request the ParticleList to be printed in full detail (i.e.
Definition: particledata.h:599
constexpr int p
Proton.
Definition: action.h:24
ProcessType
ProcessTypes are used to identify the type of the process.
Definition: processbranch.h:39
@ None
See here for a short description.
bool are_particles_identical_at_given_time(const ParticleData &p1, const ParticleData &p2, double time)
Utility function to compare two ParticleData instances with respect to their PDG code,...
ParticleData create_valid_smash_particle_matching_provided_quantities(PdgCode pdgcode, double mass, const FourVector &four_position, const FourVector &four_momentum, int log_area, bool &mass_warning, bool &on_shell_warning)
This function creates a SMASH particle validating the provided information.
A structure to hold information about the history of the particle, e.g.
Definition: particledata.h:31
double time_last_collision
Time of the last action (excluding walls), time of kinetic freeze_out for HBT analysis this time shou...
Definition: particledata.h:44
int32_t id_process
id of the last action
Definition: particledata.h:35
PdgCode p2
PdgCode of the second parent particles.
Definition: particledata.h:48
PdgCode p1
PdgCode of the first parent particles.
Definition: particledata.h:46
int32_t collisions_per_particle
Collision counter per particle, zero only for initially present particles.
Definition: particledata.h:33
ProcessType process_type
type of the last action
Definition: particledata.h:37
const ParticleList & list
Particle list.
Definition: particledata.h:592