PYTHIA  8.312
SigmaLowEnergy.h
1 // SigmaLowEnergy.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2024 Torbjorn Sjostrand.
3 // PYTHIA is licenced under the GNU GPL v2 or later, see COPYING for details.
4 // Please respect the MCnet Guidelines, see GUIDELINES for details.
5 
6 // Header file for cross sections for of energy hadron-hadron collisions.
7 
8 #ifndef Pythia8_SigmaLowEnergy_H
9 #define Pythia8_SigmaLowEnergy_H
10 
11 #include "Pythia8/HadronWidths.h"
12 #include "Pythia8/NucleonExcitations.h"
13 #include "Pythia8/PhysicsBase.h"
14 #include "Pythia8/SigmaTotal.h"
15 
16 namespace Pythia8 {
17 
18 //==========================================================================
19 
20 // Gets cross sections for hadron-hadron collisions at low energies.
21 
22 class SigmaLowEnergy : public PhysicsBase {
23 
24 public:
25 
26  // Initialize.
27  void init(NucleonExcitations* nucleonExcitationsPtrIn);
28 
29  // Get the total cross section for the specified collision.
30  double sigmaTotal(int idA, int idB, double eCM, double mA, double mB);
31  double sigmaTotal(int idAIn, int idBIn, double eCMIn) {
32  double mA0 = particleDataPtr->m0(idAIn), mB0 = particleDataPtr->m0(idBIn);
33  return sigmaTotal(idAIn, idBIn, eCMIn, mA0, mB0); }
34 
35  // Get the partial cross section for the specified collision and process.
36  // proc | 0: total; | 1: nondiff; | 2 : el; | 3: SD (XB); | 4: SD (AX);
37  // | 5: DD; | 6: CD (AXB, not implemented)
38  // | 7: excitation | 8: annihilation | 9: resonant
39  // | >100: resonant through the specified resonance particle
40  double sigmaPartial(int idA, int idB, double eCM,
41  double mA, double mB, int proc);
42  double sigmaPartial(int idAIn, int idBIn, double eCMIn, int proc) {
43  double mA0 = particleDataPtr->m0(idAIn), mB0 = particleDataPtr->m0(idBIn);
44  return sigmaPartial(idAIn, idBIn, eCMIn, mA0, mB0, proc); }
45 
46  // Gets all partial cross sections for the specified collision.
47  // This is used when all cross sections are needed to determine which
48  // process to execute. Returns false if no processes are available.
49  bool sigmaPartial(int idA, int idB, double eCM, double mA, double mB,
50  vector<int>& procsOut, vector<double>& sigmasOut);
51 
52  // Picks a process randomly according to their partial cross sections.
53  int pickProcess(int idA, int idB, double eCM, double mA, double mB);
54 
55  // Picks a resonance according to their partial cross sections.
56  int pickResonance(int idA, int idB, double eCM);
57 
58  // For NN / N Nbar / Nbar Nbar collisions explicit excitation states.
59  // replace a generic smeared-out low-mass diffraction component.
60  bool hasExcitation(int idAIn, int idBIn) const { return (abs(idAIn) == 2212
61  || abs(idAIn) == 2112) && (abs(idBIn) == 2212 || abs(idBIn) == 2112); }
62 
63  // Update the list of internal resonances.
64  void updateResonances();
65 
66  // Cross sections below threshold are assumed numerically equal to zero.
67  static constexpr double TINYSIGMA = 1.e-9;
68 
69 private:
70 
71  NucleonExcitations* nucleonExcitationsPtr;
72 
73  // Masses and parameters.
74  double mp, sp, s4p, mPi, mK,
75  sEffAQM, cEffAQM, bEffAQM, fracEtass, fracEtaPss;
76 
77  // Flag for disabling inelastic cross sections.
78  bool doInelastic;
79 
80  // Mode for calculating total cross sections for pi pi and pi K.
81  bool useSummedResonances;
82 
83  // List of hadron pairs that are allowed to form resonances.
84  set<pair<int, int> > resonatingPairs;
85 
86  // Current configuration.
87  int idA, idB;
88  double mA, mB, eCM;
89  int collType;
90  bool didFlipSign, didSwapIds;
91 
92  // Cached cross sections.
93  double sigTot, sigND, sigEl, sigXB, sigAX, sigXX, sigAnn, sigEx, sigResTot;
94  vector<pair<int, double>> sigRes;
95 
96  // Set current configuration, ordering inputs hadrons in a canonical way.
97  void setConfig(int idAIn, int idBIn, double eCMIn, double mAIn, double mBIn);
98 
99  // Methods for computing cross sections.
100  void calcTot();
101  void calcRes();
102  double calcRes(int idR) const;
103  void calcEla();
104  void calcEx();
105  void calcDiff();
106 
107  // HPR1R2 fit for parameterizing certain total cross sections.
108  double HPR1R2(double p, double r1, double r2, double mA, double mB, double s)
109  const;
110 
111  // HERA/CERN fit for parameterizing certain elastic cross sections.
112  double HERAFit(double a, double b, double n, double c, double d, double p)
113  const;
114 
115  // Additive quark model for generic collisions and for scale factors.
116  double nqEffAQM(int id) const;
117  double factorAQM() const;
118  double totalAQM() const;
119  double elasticAQM() const;
120 
121  // LowEnergyProcess should have access to nqEffAQM for slope in t.
122  friend class LowEnergyProcess;
123 
124 // Check whether the current configuration allows for explicit resonances.
125  bool hasExplicitResonances() const;
126  double meltpoint(int idX, int idM) const;
127 
128 };
129 
130 //==========================================================================
131 
132 // Get hadron-hadron cross sections, interpolating the low- and high-energy
133 // behaviours in SigmaLowEnergy and SigmaSaSDL respectively.
134 
135 class SigmaCombined : public PhysicsBase {
136 
137 public:
138 
139  // Initialize.
140  void init(SigmaLowEnergy* sigmaLowPtrIn);
141 
142  // Get total cross section.
143  double sigmaTotal(int id1, int id2, double eCM12, double m1, double m2,
144  int mixLoHi = 0);
145 
146  // Get partial cross sections.
147  double sigmaPartial(int id1, int id2, double eCM12, double m1, double m2,
148  int type, int mixLoHi = 0);
149 
150 private:
151 
152  // The main objects for low-and high-energy cross sections.
153  SigmaLowEnergy* sigmaLowPtr = {};
154  SigmaSaSDL sigmaSDL = {};
155 
156  // Initialization data.
157  double eMinHigh, deltaEHigh, eMaxHigh;
158 
159  // Store proton mass.
160  double mp;
161 
162  // Buffer recently used input and related output.
163  int id1SDL = {}, id2SDL = {}, mixSDL = {};
164  double eCM12SDL = {}, sigSDL[10] = {};
165 
166 };
167 
168 //==========================================================================
169 
170 } // end namespace Pythia8
171 
172 #endif // Pythia8_SigmaLowEnergy_H
Definition: LowEnergyProcess.h:28
static constexpr double TINYSIGMA
Cross sections below threshold are assumed numerically equal to zero.
Definition: SigmaLowEnergy.h:67
Definition: NucleonExcitations.h:23
Definition: PhysicsBase.h:27
Definition: SigmaLowEnergy.h:135
void updateResonances()
Update the list of internal resonances.
Definition: SigmaLowEnergy.cc:345
void init(NucleonExcitations *nucleonExcitationsPtrIn)
Initialize.
Definition: SigmaLowEnergy.cc:307
Gets cross sections for hadron-hadron collisions at low energies.
Definition: SigmaLowEnergy.h:22
double sigmaTotal(int idA, int idB, double eCM, double mA, double mB)
Get the total cross section for the specified collision.
Definition: SigmaLowEnergy.cc:370
Definition: SigmaTotal.h:294
ParticleData * particleDataPtr
Pointer to the particle data table.
Definition: PhysicsBase.h:84
bool hasExcitation(int idAIn, int idBIn) const
Definition: SigmaLowEnergy.h:60
double sigmaPartial(int idA, int idB, double eCM, double mA, double mB, int proc)
Gets the partial cross section for the specified process.
Definition: SigmaLowEnergy.cc:424
double m2(const Vec4 &v1)
The squared invariant mass of one or more four-vectors.
Definition: Basics.cc:605
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
int pickProcess(int idA, int idB, double eCM, double mA, double mB)
Picks a process randomly according to their partial cross sections.
Definition: SigmaLowEnergy.cc:634
int pickResonance(int idA, int idB, double eCM)
Picks a resonance according to their partial cross sections.
Definition: SigmaLowEnergy.cc:648