PYTHIA  8.317
Public Member Functions | List of all members
PythiaCascade Class Reference

Intended flow: More...

#include <PythiaCascade.h>

Public Member Functions

 PythiaCascade ()=default
 Default constructor; all setup is done in init().
 
bool init (double eKinMinIn=0.3, double enhanceSDtargetIn=0.5, string initFile="../share/Pythia8/setups/InitDefaultMPI.cmnd", bool rapidDecaysIn=false, double smallTau0In=1e-10, bool slowDecays=true, bool listFinalOnlyIn=false)
 Initialize PythiaCascade for a given maximal incoming energy. More...
 
double nCollAvg (int A)
 
bool sigmaSetuphN (int idNowIn, Vec4 pNowIn, double mNowIn)
 
double sigmahA (int A)
 
EventnextColl (int Znow, int Anow, Vec4 vNow=Vec4())
 
EventnextDecay (int idNowIn, Vec4 pNowIn, double mNowIn, Vec4 vNow=Vec4())
 
void compress ()
 
void stat ()
 Summary of aborts, errors and warnings.
 
int nCollisions ()
 
int firstCollisionCode ()
 
int firstCollisionMPI ()
 
ParticleDataparticleData ()
 
Rndmrndm ()
 

Detailed Description

Intended flow:

Wrapper class for Pythia usage in cosmic ray or detector cascades. Here it is assumed that the user wants to control the full evolution. The complete event record is then kept somewhere separate from PYTHIA, and specific input on production and decay generates the next subevent. Kindly note non-negligible changes as of Pythia 8.316. This is related both to bug fixes in Angantyr, and to a better understanding of what it is supposed to do. The main difference is that elastic scatterings now are not simulated, it being assumed that they have no impact on the evolution of the cascade. As a consequence cross sections and event properties also change.- init sets up all generation, given a maximum energy. This may be time-consuming, less so if MPI initialization data can be reused. - sigmaSetuphN prepares a possible collision for a given hadron by calculating the hadron-nucleon inelastic cross section (if possible). Moderately time-consuming. - sigmahA uses the hN cross section calculated by sigaSetuphN and returns the hadron-ion inelastic cross section for a collision with a specified nucleus. It can be called several times to cover a mix of target nuclei, with minimal time usage. - nextColl performs the hadron-nucleus collision, as a sequences of hadron-nucleon ones. Can be quite time-consuming. - nextDecay can be used anytime to decay a particle. Each individual decay is rather fast, but there may be many of them. - After a nextColl three methods can give information about the collision just generated:

program. Note: when a hadron interacts with a medium particle, the latter is added to the event record. This program uses these additional status codes for target particles in the medium: 181: the first (or only) target nucleon in a collision. 182: nucleons from further subcollisions with the same target nucleus. Warning: the large boosts involved at the higher cosmic ray energies are not perfectly managed, which leads to non-negligible energy-momentum non-conservation. The worst (sub)events are caught and regenerated.

Member Function Documentation

void compress ( )
inline

Compress the event record by removing initial and intermediate particles. Keep line 0, since the += operator for event records only adds from 1 on.

Reference to the main event record. Original and new size.

Loop through all particles and move up the final ones to the top. Remove history information. Update event record size.

Shrink event record to new size.

bool init ( double  eKinMinIn = 0.3,
double  enhanceSDtargetIn = 0.5,
string  initFile = "../share/Pythia8/setups/InitDefaultMPI.cmnd",
bool  rapidDecaysIn = false,
double  smallTau0In = 1e-10,
bool  slowDecays = true,
bool  listFinalOnlyIn = false 
)
inline

Initialize PythiaCascade for a given maximal incoming energy.

Hadrons below the kinetic energy threshold eKinMin will not be allowed to interact with the medium. If reduced from the 0.3 GeV default then some inelastic interactions are still allowed, while others fail (but the run keeps going). The enhanceSDtarget provides an enhancement factor for target-side single diffraction, process codes 104 and 154, in subcollisions after the first. This gives topologies more similar to Angantyr ones. If 0 then no SD enhancement, if 1 only SD, with default in between. A larger value means a smaller multiplicity, and vice versa, so this is a quick way to obtain an envelope of hadronization uncertainties. The initFile, by default "../share/Pythia8/setups/InitDefaultMPI.cmnd", provides MPI initialization data over a range of CM-frame energies, where the upper edge sets the limit for allowed collisions. Use main424.cc to rerun if you change any of the parameters that affect the MPI rates, such as the pT0 parameter, its energy dependence, the alpha_strong value, and the choice parton distributions. Keep rapidDecays = false if you want to do every decay yourself, else all particle types with a tau0 below smallTau0 will be decayed immediately. The tau0 units are mm/c, so default gives c * tau0 = 1e-10 mm = 100 fm. Note that time dilation effects are not included, and they can be large, hence the low default value. The Pythia default setup for decaying particles is obtained for rapidDecays = true and smallTau0 = 1000. With slowDecays true the mu+-, pi+-, K+- and K0L are allowed to decay, as is expected in an atmospheric cascade but not for collider studies. Note that rapidDecays and smallTau0 still determine how those decays are handled, in the competition between interactions and decays. Keep listFinalOnly = false if you want to get back the full event record, else only the "final" particles of the collision or decay are returned.

Store input for future usage.

Proton and neutron masses.

Main Pythia object for managing the cascade evolution in a nucleus. Can also do decays, but no hard processes.

Reduce statistics printout to relevant ones.

Initialize. Return if failure.

Secondary Pythia object for individual collisions, or decays. Reuse existing MPI initialization file. Failure if not found.

Variable incoming beam type and energy.

Initialization eCM energy according to initFile.

Must use the soft and low-energy QCD processes, except elastic.

Primary (single) decay to be done by pythiaColl, to circumvent limitTau0.

Secondary decays to be done by pythiaMain, respecting limitTau0.

Reduce printout and relax energy-momentum conservation. (Unusually large errors unfortunate consequence of large boosts.)

Redure statistics printout to relevant ones.

Initialize and done.

double nCollAvg ( int  A)
inline

Calculate the average number of inelastic hadron-nucleon (hN) collisions in a hadron-nucleus one, as a function of the inelastic hN cross section. Interpolate if not in table, assuming <n> - 1 propto A^{2/3}.

Studied nuclei by A number, with offset and slope of <nColl>(sigma): 1H, 2H, 4He, 9Be, 12C, 14N, 16O, 27Al, 40Ar, 56Fe, 63Cu, 84Kr, 107Ag, 129Xe, 197Au, 208Pb.

int nCollisions ( )
inline

Provide number of subcollisions, hardest subprocess, and whether elastic. The latter should always be false after the recent code changes.

Event& nextColl ( int  Znow,
int  Anow,
Vec4  vNow = Vec4() 
)
inline

Generate a collision, and return the event record. Input (Z, A) of nucleus, and optionally collision vertex.

References to the two event records. Clear main event record.

Restrict to allowed range 1 <= A <= 208.

Insert incoming particle in cleared main event record.

Set up for collisions on a nucleus.

Drop rate of geometric series. (Deuterium is special case.)

Loop over varying number of hit nucleons in target nucleus.

Pick incoming projectile: trivial for first subcollision, else ...

... find highest-pLongitudinal particle from latest subcollision.

No further subcollision if no particle with enough energy.

Pick one p or n from target.

Current subcollision four-vectors and CM energy.

Reject if process is only possible because projectile is off-shell. (Current kinematics handling assumes that "beam particles" are on the mass shell, but this could be changed eventually.)

Do a projectile-nucleon subcollision. Return empty event if failure. Optionally enhance secondary single diffractive on target side. for non-first collision, i.e. make more of codes 104 or 154.

Statistics.

Boost back collision to lab frame.

Insert target nucleon. Mothers are (0,iProj) to mark who it interacted with. Always use proton mass for simplicity.

Update full energy of the event with the target mass.

Insert secondary produced particles (but skip intermediate partons) into main event record and shift to correct production vertex.

Update daughters of colliding hadrons and other history.

End of loop over interactions in a nucleus.

Optionally do decays of short-lived particles.

Optionally compress event record.

Return generated collision.

Event& nextDecay ( int  idNowIn,
Vec4  pNowIn,
double  mNowIn,
Vec4  vNow = Vec4() 
)
inline

Generate a particle decay, and return the event record. You can allow sequential decays, if they occur rapidly enough.

Save incoming quantities. (Not needed, but by analogy with collisions.)

References to the event records. Clear them.

Insert incoming particle in cleared collision event record.

Decay incoming particle. Return empty event if fail. Copy event record.

Optionally do secondary decays of short-lived particles.

Optionally compress event record.

Return generated collision.

ParticleData& particleData ( )
inline

Possibility to access particle data and random numbers from pythiaMain.

double sigmahA ( int  A)
inline

Calculate the hadron-nucleus cross section for a given nucleon number A, using hN cross section from sigmaSetuphN. Interpolate where not (yet) available.

Restrict to allowed range 1 <= A <= 208.

Correction factor for number of h-nucleon collisions per h-nucleus one.

Done.

bool sigmaSetuphN ( int  idNowIn,
Vec4  pNowIn,
double  mNowIn 
)
inline

Calculate the hadron-nucleon (proton) inelastic collision cross section. Return false if not possible to find.

Cannot (or does not want to) handle low-energy hadrons.

Cannot handle hadrons above maximum energy set at initialization.

Save incoming quantities for reuse in later methods.

Calculate hadron-nucleon inelastic cross section. Check if cross section vanishes.

Done.


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