10 #ifndef SRC_INCLUDE_SMASH_STRINGPROCESS_H_
11 #define SRC_INCLUDE_SMASH_STRINGPROCESS_H_
19 #include "Pythia8/Pythia.h"
27 static constexpr
int LPythia = LogArea::Pythia::id;
70 std::array<FourVector, 2>
plab_;
72 std::array<FourVector, 2>
pcom_;
287 typedef std::map<std::pair<int, int>, std::unique_ptr<Pythia8::Pythia>>
335 bool append_string(
const Pythia8::Vec4 &p_str,
const std::array<int, 2> &ends,
336 int color_tag,
bool use_projectile_axis,
337 bool random_flip_of_endpoints =
false);
425 double diquark_supp,
double popcorn_rate,
426 double stringz_a,
double stringz_b,
427 double string_sigma_T);
439 logg[
LPythia].debug(
"pythia_hadron_ : rndm is initialized with seed ",
546 return Pythia8::Vec4(
p.x1(),
p.x2(),
p.x3(),
p.x0());
607 std::optional<ParticleList>
hadronize(
const Pythia8::Event &string_evt);
621 double sqrts_threshold = 2. * (1. + 1.0e-6);
624 const int pdg_a_mod =
625 (std::abs(pdg_a) > 1000) ? pdg_a : 10 * (std::abs(pdg_a) / 10) + 3;
626 const int pdg_b_mod =
627 (std::abs(pdg_b) > 1000) ? pdg_b : 10 * (std::abs(pdg_b) / 10) + 3;
632 if (sqrt_s < sqrts_threshold) {
633 sqrt_s = sqrts_threshold;
709 void init(
const ParticleList &incoming,
double tcoll);
719 std::array<ThreeVector, 3> &evec_basis);
743 std::array<int, 5> &excess_quark,
744 std::array<int, 5> &excess_antiq);
767 std::array<int, 5> &excess_constituent);
783 std::array<int, 5> &nquark_total,
784 std::array<int, 5> &nantiq_total);
812 Pythia8::Event &event_intermediate, std::array<int, 5> &nquark_total,
813 std::array<int, 5> &nantiq_total,
bool sign_constituent,
814 std::array<std::array<int, 5>, 2> &excess_constituent);
844 std::array<std::array<int, 5>, 2> &excess_quark,
845 std::array<std::array<int, 5>, 2> &excess_antiq);
885 std::array<std::array<int, 5>, 2> &excess_quark,
886 std::array<std::array<int, 5>, 2> &excess_antiq);
913 Pythia8::Event &event_intermediate,
914 Pythia8::Event &event_hadronize);
947 Pythia8::Event &event_intermediate,
948 Pythia8::Event &event_hadronize);
972 Pythia8::Event &event_intermediate,
973 Pythia8::Event &event_hadronize);
993 for (
int ip = 2; ip <
event.size() - np_end; ip++) {
994 const double y_quark_current =
event[ip].y();
995 const double y_quark_forward =
event[iforward].y();
996 if ((find_forward && y_quark_current > y_quark_forward) ||
997 (!find_forward && y_quark_current < y_quark_forward)) {
1028 double additional_xsec_supp = 1.0,
1029 bool find_and_scale_leading =
true);
1040 ParticleList &intermediate_particles) {
1047 intermediate_particles.push_back(new_particle);
1060 if (pythia_id == 310 || pythia_id == 130) {
1109 ParticleList &outgoing_particles,
1111 double suppression_factor);
1127 static std::pair<int, int>
find_leading(
int nq1,
int nq2, ParticleList &list);
1142 double suppression_factor);
Interface to the SMASH configuration files.
The FourVector class holds relevant values in Minkowski spacetime with (+, −, −, −) metric signature.
ParticleData contains the dynamic information of a certain particle.
void set_4momentum(const FourVector &momentum_vector)
Set the particle's 4-momentum directly.
A pointer-like interface to global references to ParticleType objects.
static const ParticleTypePtr try_find(PdgCode pdgcode)
Returns the ParticleTypePtr for the given pdgcode.
static const ParticleType & find(PdgCode pdgcode)
Returns the ParticleType object for the given pdgcode.
PdgCode stores a Particle Data Group Particle Numbering Scheme particle type number.
String excitation processes used in SMASH.
Pythia8::StringFlav pythia_stringflav_
An object for the flavor selection in string fragmentation in the case of separate fragmentation func...
bool next_SDiff(bool is_AB_to_AX)
Single-diffractive process is based on single pomeron exchange described in Ingelman:1984ns .
pythia_map hard_map_
Map object to contain the different pythia objects.
void set_pmin_gluon_lightcone(double p_light_cone_min)
set the minimum lightcone momentum scale carried by gluon.
Pythia8::SigmaTotal pythia_sigmatot_
An object to compute cross-sections.
double pow_fgluon_beta_
parameter for the gluon distribution function
LeadingStatus
PYTHIA status codes used to track leading/valence ancestry.
@ FromLeadingDiquark
Custom status assigned to hadrons containing a leading diquark.
@ LeadingQuark
Custom status assigned to leading (valence) quarks.
@ NonLeadingParton
Standard PYTHIA status for non-leading partons that should be hadronized.
@ LeadingDiquark
Standard PYTHIA beam-remnant status used for leading diquarks.
@ FromLeadingQuark
Custom status assigned to hadrons containing a leading quark.
std::map< std::pair< int, int >, std::unique_ptr< Pythia8::Pythia > > pythia_map
Map containing PYTHIA objects for hard string routines.
std::vector< Pythia8::Event > string_parton_events_
PYTHIA event records containing string partons to be hadronized.
Pythia8::Event event_intermediate_
event record for intermediate partonic state in the hard string routine
std::array< PdgCode, 2 > PDGcodes_
PdgCodes of incoming particles.
double time_formation_const_
constant proper time in the case of constant formation time [fm]
double PNegB_
backward lightcone momentum p^{-} of incoming particle B in CM-frame [GeV]
void set_tension_string(double kappa_string)
set the string tension, which is used in form_intermediate_particles.
static FourVector make_smash_4vec(const Pythia8::Vec4 &p)
Convert a PYTHIA four-vector into a SMASH four-vector.
void find_junction_leg(bool sign_color, std::vector< int > &col, Pythia8::Event &event_intermediate, Pythia8::Event &event_hadronize)
Identify partons, which are associated with junction legs, from a given PYTHIA event record.
double pow_fquark_beta_
parameter for the quark distribution function
bool next_NDiffSoft()
Soft Non-diffractive process is modelled in accordance with dual-topological approach Capella:1978ig ...
bool next_DDiff()
Double-diffractive process ( A + B -> X + X ) is similar to the single-diffractive process,...
static int pdg_map_for_pythia(PdgCode &pdg)
Take pdg code and map onto particle specie which can be handled by PYTHIA.
double prob_proton_to_d_uu_
Probability of splitting a nucleon into the quark flavour it has only once and a diquark it has twice...
void set_pow_fquark(double alphapow, double betapow)
lightcone momentum fraction of quark is sampled according to probability distribution in non-diffrac...
Pythia8::RotBstMatrix to_cm_
Rotation/boost matrix to transform particles to the center-of-mass frame.
FourVector ucomAB_
velocity four vector of the center of mass in the lab frame
ThreeVector vcomAB_
velocity three vector of the center of mass in the lab frame
void compute_incoming_lightcone_momenta()
compute the lightcone momenta of incoming particles where the longitudinal direction is set to be sam...
double popcorn_rate_
popcorn rate
double pmin_gluon_lightcone_
the minimum lightcone momentum scale carried by a gluon [GeV]
bool splitting_gluon_qqbar(Pythia8::Event &event_intermediate, std::array< int, 5 > &nquark_total, std::array< int, 5 > &nantiq_total, bool sign_constituent, std::array< std::array< int, 5 >, 2 > &excess_constituent)
Take total number of quarks and check if the system has enough constituents that need to be converted...
static std::pair< int, int > find_leading(int nq1, int nq2, ParticleList &list)
Find the leading string fragments.
double PPosA_
forward lightcone momentum p^{+} of incoming particle A in CM-frame [GeV]
std::optional< ParticleList > hadronize(const Pythia8::Event &string_evt)
Hadronize a single partonic string configuration using Pythia8 and convert the produced hadrons into ...
double sqrtsAB_
sqrt of Mandelstam variable s of collision [GeV]
ParticleList final_state_
final state array which must be accessed after the collision
bool is_leading_from_quark(const Pythia8::Particle &p)
Check whether a particle is tagged as originating from a leading quark.
double PNegA_
backward lightcone momentum p^{-} of incoming particle A in CM-frame [GeV]
bool append_string(const Pythia8::Vec4 &p_str, const std::array< int, 2 > &ends, int color_tag, bool use_projectile_axis, bool random_flip_of_endpoints=false)
Append a single two-endpoint string as an independent PYTHIA event.
bool use_monash_tune_
Whether to use the monash tune Skands:2014pea for all string processes.
double soft_t_form_
factor to be multiplied to formation times in soft strings
static void make_string_ends(const PdgCode &pdgcode_in, int &idq1, int &idq2, double xi)
make a random selection to determine partonic contents at the string ends.
std::unique_ptr< Pythia8::Pythia > pythia_hadron_
PYTHIA object used in fragmentation.
double massA_
mass of incoming particle A [GeV]
bool next_Hard(ProcessType type)
Hard Non-diffractive process is based on PYTHIA 8 with partonic showers and interactions.
void common_setup_pythia(Pythia8::Pythia *pythia_in, double strange_supp, double diquark_supp, double popcorn_rate, double stringz_a, double stringz_b, double string_sigma_T)
Common setup of PYTHIA objects for soft and hard string routines.
double PPosB_
forward lightcone momentum p^{+} of incoming particle B in CM-frame [GeV]
std::array< ThreeVector, 3 > evecBasisAB_
Orthonormal basis vectors in the center of mass frame, where the 0th one is parallel to momentum of i...
std::vector< std::string > pythia_settings_
Additional Pythia 8 settings passed to each internal Pythia instance.
std::optional< double > mpi_initialization_sqrts_
Optional center-of-mass energy used to initialize MPI-capable Pythia objects.
bool restore_constituent(Pythia8::Event &event_intermediate, std::array< std::array< int, 5 >, 2 > &excess_quark, std::array< std::array< int, 5 >, 2 > &excess_antiq)
Take the intermediate partonic state from PYTHIA event with mapped hadrons and convert constituents i...
double string_sigma_T_
transverse momentum spread in string fragmentation
ParticleList get_final_state()
std::array< double, 3 > cross_sections_diffractive(int pdg_a, int pdg_b, double sqrt_s)
Interface to pythia_sigmatot_ to compute cross-sections of A+B-> different final states Schuler:1993w...
static void make_orthonormal_basis(ThreeVector &evec_polar, std::array< ThreeVector, 3 > &evec_basis)
compute three orthonormal basis vectors from unit vector in the longitudinal direction
int get_index_forward(bool find_forward, int np_end, Pythia8::Event &event)
Obtain index of the most forward or backward particle in a given PYTHIA event record.
bool is_leading_parton(const Pythia8::Particle &p)
Check whether a particle is tagged as a leading parton.
static void convert_KaonLS(int &pythia_id)
convert Kaon-L or Kaon-S into K0 or Anti-K0
double additional_xsec_supp_
additional cross-section suppression factor to take coherence effect into account.
static void assign_all_scaling_factors(int baryon_string, ParticleList &outgoing_particles, const ThreeVector &evecLong, double suppression_factor)
Assign a cross section scaling factor to all outgoing particles.
double damp_popcorn_
damp popcorn meson from diquark remnant endpoint rate
double strange_supp_
strange quark suppression factor
bool string_above_threshold(const Pythia8::Event &event)
Check whether all strings in a PYTHIA event are above fragmentation threshold.
std::array< PdgCode, 2 > get_PDGs()
static int diquark_from_quarks(int q1, int q2)
Construct diquark from two quarks.
std::array< FourVector, 2 > get_plab()
std::vector< bool > compute_beam_valence_flags(Pythia8::Pythia &pythia)
Compute flags identifying beam valence partons (quarks or diquarks) that act as leading partons after...
void replace_constituent(Pythia8::Particle &particle, std::array< int, 5 > &excess_constituent)
Convert a partonic PYTHIA particle into the desired species and update the excess of constituents.
double kappa_tension_string_
string tension [GeV/fm]
double pow_fquark_alpha_
parameter for the quark distribution function
bool is_leading(const Pythia8::Particle &p)
Check whether a particle is tagged as originating from a leading endpoint.
double stringz_b_leading_
parameter (StringZ:bLund) for the fragmentation function of leading baryon in soft non-diffractive st...
static bool append_intermediate_list(int pdgid, FourVector momentum, ParticleList &intermediate_particles)
append new particle from PYTHIA to a specific particle list
int leading_hadron_status_from_endpoint(const Pythia8::Particle &end)
Determine the custom leading-hadron status code from a string endpoint.
void set_pow_fgluon(double betapow)
lightcone momentum fraction of gluon is sampled according to probability distribution P(x) = 1/x * (1...
void set_mpi_initialization_sqrts(double sqrts)
Set the center-of-mass energy used to initialize MPI-capable Pythia objects.
bool next(ProcessType type)
Generate the next string process for a given process type.
bool mass_dependent_formation_times_
Whether the formation time should depend on the mass of the fragment according to Andersson:1983ia e...
double stringz_b_produce_
parameter (StringZ:bLund) for the fragmentation function of other (produced) hadrons in soft non-diff...
std::array< FourVector, 2 > get_pcom()
bool next_BBbarAnn()
Baryon-antibaryon annihilation process Based on what UrQMD Bass:1998ca , Bleicher:1999xi does,...
void set_color_by_type(Pythia8::Particle &p, int color)
Set the color or anticolor index of a particle according to its type.
StringProcess(Configuration &config)
Constructor, initializes PYTHIA.
void set_sigma_qperp_(double sigma_qperp)
set the average amount of transverse momentum transfer sigma_qperp_.
void tag_leading_hadrons(Pythia8::Event &event)
Tag leading hadrons in a hadronized string.
double stringz_a_leading_
parameter (StringZ:aLund) for the fragmentation function of leading baryon in soft non-diffractive st...
void init(const ParticleList &incoming, double tcoll)
initialization feed intial particles, time of collision and gamma factor of the center of mass.
bool is_leading_from_diquark(const Pythia8::Particle &p)
Check whether a particle is tagged as originating from a leading diquark.
double sigma_qperp_
Transverse momentum spread of the excited strings.
void rearrange_excess(std::array< int, 5 > &nquark_total, std::array< std::array< int, 5 >, 2 > &excess_quark, std::array< std::array< int, 5 >, 2 > &excess_antiq)
Take total number of quarks and check if the system has enough constituents that need to be converted...
static Pythia8::Vec4 make_pythia_4vec(const FourVector &p)
Convert a SMASH four-vector into a PYTHIA four-vector.
bool separate_fragment_baryon_
Whether to use a separate fragmentation function for leading baryons.
std::array< FourVector, 2 > plab_
momenta of incoming particles in the lab frame [GeV]
std::array< FourVector, 2 > pcom_
momenta of incoming particles in the center of mass frame [GeV]
double time_collision_
time of collision in the computational frame [fm]
void form_intermediate_particles(ParticleList &intermediate_particles, const FourVector &pString, const ThreeVector &evecLong, double additional_xsec_supp=1.0, bool find_and_scale_leading=true)
Set formation times and cross-section scaling factors for fragmented hadrons as described in Andersso...
double diquark_supp_
diquark suppression factor
static void find_excess_constituent(PdgCode &pdg_actual, PdgCode &pdg_mapped, std::array< int, 5 > &excess_quark, std::array< int, 5 > &excess_antiq)
Compare the valence quark contents of the actual and mapped hadrons and evaluate how many more consti...
double estimate_string_threshold(int p_left, int p_right)
Estimate the minimum invariant mass required for a string to fragment.
double massB_
mass of incoming particle B [GeV]
void compose_string_parton(bool find_forward_string, Pythia8::Event &event_intermediate, Pythia8::Event &event_hadronize)
Identify a set of partons, which are connected to form a color-neutral string, from a given PYTHIA ev...
void find_total_number_constituent(Pythia8::Event &event_intermediate, std::array< int, 5 > &nquark_total, std::array< int, 5 > &nantiq_total)
Compute how many quarks and antiquarks we have in the system, and update the correspoing arrays with ...
double stringz_a_produce_
parameter (StringZ:aLund) for the fragmentation function of other (produced) hadrons in soft non-diff...
void init_pythia_hadron_rndm()
Set PYTHIA random seeds to be desired values.
static void assign_scaling_factor(int nquark, ParticleData &data, double suppression_factor)
Assign a cross section scaling factor to the given particle.
void compose_string_junction(bool &find_forward_string, Pythia8::Event &event_intermediate, Pythia8::Event &event_hadronize)
Identify a set of partons and junction(s), which are connected to form a color-neutral string,...
static void quarks_from_diquark(int diquark, int &q1, int &q2, int °_spin)
find two quarks from a diquark.
The ThreeVector class represents a physical three-vector with the components .
Collection of useful constants that are known at compile time.
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > & logg
An array that stores all pre-configured Logger objects.
T uniform_int(T min, T max)
constexpr int maximum_rndm_seed_in_pythia
The maximum value of the random seed used in PYTHIA.
ProcessType
ProcessTypes are used to identify the type of the process.
std::string to_string(ThermodynamicQuantity quantity)
Convert a ThermodynamicQuantity enum value to its corresponding string.
static constexpr int LPythia