Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:06:30

0001 // SigmaLowEnergy.h is a part of the PYTHIA event generator.
0002 // Copyright (C) 2024 Torbjorn Sjostrand.
0003 // PYTHIA is licenced under the GNU GPL v2 or later, see COPYING for details.
0004 // Please respect the MCnet Guidelines, see GUIDELINES for details.
0005 
0006 // Header file for cross sections for of energy hadron-hadron collisions.
0007 
0008 #ifndef Pythia8_SigmaLowEnergy_H
0009 #define Pythia8_SigmaLowEnergy_H
0010 
0011 #include "Pythia8/HadronWidths.h"
0012 #include "Pythia8/NucleonExcitations.h"
0013 #include "Pythia8/PhysicsBase.h"
0014 #include "Pythia8/SigmaTotal.h"
0015 
0016 namespace Pythia8 {
0017 
0018 //==========================================================================
0019 
0020 // Gets cross sections for hadron-hadron collisions at low energies.
0021 
0022 class SigmaLowEnergy : public PhysicsBase {
0023 
0024 public:
0025 
0026   // Initialize.
0027   void init(NucleonExcitations* nucleonExcitationsPtrIn);
0028 
0029   // Get the total cross section for the specified collision.
0030   double sigmaTotal(int idA, int idB, double eCM, double mA, double mB);
0031   double sigmaTotal(int idAIn, int idBIn, double eCMIn) {
0032     double mA0 = particleDataPtr->m0(idAIn), mB0 = particleDataPtr->m0(idBIn);
0033     return sigmaTotal(idAIn, idBIn, eCMIn, mA0, mB0); }
0034 
0035   // Get the partial cross section for the specified collision and process.
0036   // proc | 0: total; | 1: nondiff; | 2 : el; | 3: SD (XB); | 4: SD (AX);
0037   //      | 5: DD;  | 6: CD (AXB, not implemented)
0038   //      | 7: excitation | 8: annihilation | 9: resonant
0039   //      | >100: resonant through the specified resonance particle
0040   double sigmaPartial(int idA, int idB, double eCM,
0041     double mA, double mB, int proc);
0042   double sigmaPartial(int idAIn, int idBIn, double eCMIn, int proc) {
0043     double mA0 = particleDataPtr->m0(idAIn), mB0 = particleDataPtr->m0(idBIn);
0044     return sigmaPartial(idAIn, idBIn, eCMIn, mA0, mB0, proc); }
0045 
0046   // Gets all partial cross sections for the specified collision.
0047   // This is used when all cross sections are needed to determine which
0048   // process to execute. Returns false if no processes are available.
0049   bool sigmaPartial(int idA, int idB, double eCM, double mA, double mB,
0050     vector<int>& procsOut, vector<double>& sigmasOut);
0051 
0052   // Picks a process randomly according to their partial cross sections.
0053   int pickProcess(int idA, int idB, double eCM, double mA, double mB);
0054 
0055   // Picks a resonance according to their partial cross sections.
0056   int pickResonance(int idA, int idB, double eCM);
0057 
0058   // For NN / N Nbar / Nbar Nbar collisions explicit excitation states.
0059   // replace a generic smeared-out low-mass diffraction component.
0060   bool hasExcitation(int idAIn, int idBIn) const { return (abs(idAIn) == 2212
0061     || abs(idAIn) == 2112) && (abs(idBIn) == 2212 || abs(idBIn) == 2112); }
0062 
0063   // Update the list of internal resonances.
0064   void updateResonances();
0065 
0066   // Cross sections below threshold are assumed numerically equal to zero.
0067   static constexpr double TINYSIGMA = 1.e-9;
0068 
0069 private:
0070 
0071   NucleonExcitations* nucleonExcitationsPtr;
0072 
0073   // Masses and parameters.
0074   double mp, sp, s4p, mPi, mK,
0075          sEffAQM, cEffAQM, bEffAQM, fracEtass, fracEtaPss;
0076 
0077   // Flag for disabling inelastic cross sections.
0078   bool doInelastic;
0079 
0080   // Mode for calculating total cross sections for pi pi and pi K.
0081   bool useSummedResonances;
0082 
0083   // List of hadron pairs that are allowed to form resonances.
0084   set<pair<int, int> > resonatingPairs;
0085 
0086   // Current configuration.
0087   int idA, idB;
0088   double mA, mB, eCM;
0089   int collType;
0090   bool didFlipSign, didSwapIds;
0091 
0092   // Cached cross sections.
0093   double sigTot, sigND, sigEl, sigXB, sigAX, sigXX, sigAnn, sigEx, sigResTot;
0094   vector<pair<int, double>> sigRes;
0095 
0096   // Set current configuration, ordering inputs hadrons in a canonical way.
0097   void setConfig(int idAIn, int idBIn, double eCMIn, double mAIn, double mBIn);
0098 
0099   // Methods for computing cross sections.
0100   void calcTot();
0101   void calcRes();
0102   double calcRes(int idR) const;
0103   void calcEla();
0104   void calcEx();
0105   void calcDiff();
0106 
0107   // HPR1R2 fit for parameterizing certain total cross sections.
0108   double HPR1R2(double p, double r1, double r2, double mA, double mB, double s)
0109     const;
0110 
0111   // HERA/CERN fit for parameterizing certain elastic cross sections.
0112   double HERAFit(double a, double b, double n, double c, double d, double p)
0113     const;
0114 
0115   // Additive quark model for generic collisions and for scale factors.
0116   double nqEffAQM(int id) const;
0117   double factorAQM() const;
0118   double totalAQM() const;
0119   double elasticAQM() const;
0120 
0121   // LowEnergyProcess should have access to nqEffAQM for slope in t.
0122   friend class LowEnergyProcess;
0123 
0124 // Check whether the current configuration allows for explicit resonances.
0125   bool hasExplicitResonances() const;
0126   double meltpoint(int idX, int idM) const;
0127 
0128 };
0129 
0130 //==========================================================================
0131 
0132 // Get hadron-hadron cross sections, interpolating the low- and high-energy
0133 // behaviours in SigmaLowEnergy and SigmaSaSDL respectively.
0134 
0135 class SigmaCombined : public PhysicsBase {
0136 
0137 public:
0138 
0139   // Initialize.
0140   void init(SigmaLowEnergy* sigmaLowPtrIn);
0141 
0142   // Get total cross section.
0143   double sigmaTotal(int id1, int id2, double eCM12, double m1, double m2,
0144     int mixLoHi = 0);
0145 
0146   // Get partial cross sections.
0147   double sigmaPartial(int id1, int id2, double eCM12, double m1, double m2,
0148     int type, int mixLoHi = 0);
0149 
0150 private:
0151 
0152   // The main objects for low-and high-energy cross sections.
0153   SigmaLowEnergy* sigmaLowPtr = {};
0154   SigmaSaSDL sigmaSDL = {};
0155 
0156   // Initialization data.
0157   double eMinHigh, deltaEHigh, eMaxHigh;
0158 
0159   // Store proton mass.
0160   double mp;
0161 
0162   // Buffer recently used input and related output.
0163   int id1SDL = {}, id2SDL = {}, mixSDL = {};
0164   double eCM12SDL = {}, sigSDL[10] = {};
0165 
0166 };
0167 
0168 //==========================================================================
0169 
0170 } // end namespace Pythia8
0171 
0172 #endif // Pythia8_SigmaLowEnergy_H