StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SigmaTotal.h
1 // SigmaTotal.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2014 Torbjorn Sjostrand.
3 // PYTHIA is licenced under the GNU GPL version 2, see COPYING for details.
4 // Please respect the MCnet Guidelines, see GUIDELINES for details.
5 
6 // This file contains the class for cross section parametrizations.
7 // SigmaTotal: total and partial cross section in hadron-hadron collisions.
8 
9 #ifndef Pythia8_SigmaTotal_H
10 #define Pythia8_SigmaTotal_H
11 
12 #include "Pythia8/Info.h"
13 #include "Pythia8/ParticleData.h"
14 #include "Pythia8/PythiaStdlib.h"
15 #include "Pythia8/Settings.h"
16 
17 namespace Pythia8 {
18 
19 //==========================================================================
20 
21 // The SigmaTotal class contains parametrizations of total, elastic and
22 // diffractive cross sections, and of the respective slope parameter.
23 
24 class SigmaTotal {
25 
26 public:
27 
28  // Constructor.
29  SigmaTotal() : isCalc(false) {};
30 
31  // Store pointers and initialize data members.
32  void init(Info* infoPtrIn, Settings& settings,
33  ParticleData* particleDataPtrIn );
34 
35  // Calculate, or recalculate for new beams or new energy.
36  bool calc(int idA, int idB, double eCM);
37 
38  // Confirm that initialization worked.
39  bool hasSigmaTot() const {return isCalc;}
40 
41  // Read out total and partial cross sections.
42  double sigmaTot() const {return sigTot;}
43  double sigmaEl() const {return sigEl;}
44  double sigmaXB() const {return sigXB;}
45  double sigmaAX() const {return sigAX;}
46  double sigmaXX() const {return sigXX;}
47  double sigmaAXB() const {return sigAXB;}
48  double sigmaND() const {return sigND;}
49 
50  // Calculate cross sections in MBR model.
51  bool calcMBRxsecs(int idA, int idB, double eCM);
52 
53  // Get maximum of xi,dy distribution in MBR model (for event generation).
54  double ddpMax() const {return ddpmax;}
55  double sdpMax() const {return sdpmax;}
56  double dpepMax() const {return dpepmax;}
57 
58  // Read out slope b in exp(b*t) dependence.
59  double bSlopeEl() const {return bEl;}
60  double bSlopeXB(double sX) const { return 2.*bB + alP2 * log(s/sX) ;}
61  double bSlopeAX(double sX) const { return 2.*bA + alP2 * log(s/sX) ;}
62  double bSlopeXX(double sX1, double sX2) const {
63  return alP2 * log( exp(4.) + s * s0 / (sX1 * sX2) ) ;}
64 
65  // Read out parameters of diffractive mass spectra.
66  double mMinXB() const {return mMinXBsave;}
67  double mMinAX() const {return mMinAXsave;}
68  double mMinAXB() const {return mMinAXBsave;}
69  double cRes() const {return CRES;}
70  double mResXB() const {return mResXBsave;}
71  double mResAX() const {return mResAXsave;}
72  double sProton() const {return SPROTON;}
73 
74  // Read out parameters of trial t spectra.
75  double bMinSlopeXB() const { return max(2., 2. * bB);}
76  double bMinSlopeAX() const { return max(2., 2. * bA);}
77  double bMinSlopeXX() const { return alP2 * 4.;}
78 
79 private:
80 
81  // Decide whether default or MBR diffractive cross sections.
82  int PomFlux;
83 
84  // Constants: could only be changed in the code itself.
85  static const int IHADATABLE[], IHADBTABLE[], ISDTABLE[], IDDTABLE[];
86  static const double MMIN, EPSILON, ETA, X[], Y[], BETA0[], BHAD[],
87  ALPHAPRIME, CONVERTEL, CONVERTSD, CONVERTDD, MMIN0,
88  CRES, MRES0, CSD[10][8], CDD[10][9], SPROTON;
89 
90  // Integration of MBR cross sections and form factor approximation.
91  static const int NINTEG, NINTEG2;
92  static const double HBARC2, FFA1, FFA2,FFB1, FFB2;
93 
94  // Initialization data, normally only set once.
95  bool isCalc, setTotal, zeroAXB, doDampen, setElastic;
96  double sigAXB2TeV, sigTotOwn, sigElOwn, sigXBOwn, sigAXOwn, sigXXOwn,
97  sigAXBOwn, maxXBOwn, maxAXOwn, maxXXOwn, maxAXBOwn, bSlope, rho,
98  lambda, tAbsMin, alphaEM0, sigmaPomP, mPomP, pPomP;
99 
100  // Parameters of MBR model.
101  double MBReps, MBRalpha, MBRbeta0, MBRsigma0, m2min, dyminSDflux,
102  dyminDDflux, dyminCDflux, dyminSD, dyminDD, dyminCD,
103  dyminSigSD, dyminSigDD, dyminSigCD, sdpmax, ddpmax, dpepmax;
104 
105  // Pointer to various information on the generation.
106  Info* infoPtr;
107 
108  // Pointer to the particle data table.
109  ParticleData* particleDataPtr;
110 
111  // Store values found by calc.
112  double sigTot, sigEl, sigXB, sigAX, sigXX, sigAXB, sigND, bEl, s, bA, bB,
113  alP2, s0, mMinXBsave, mMinAXsave, mMinAXBsave, mResXBsave,
114  mResAXsave;
115 
116  // The error function erf(x) should normally be in your math library,
117  // but if not uncomment this simple parametrization by Sergei Winitzki.
118  //double erf(double x) { double x2 = x * x; double kx2 = 0.147 * x2;
119  // double tmp = sqrt(1. - exp(-x2 * (4./M_PI + kx2) / (1. + kx2)));
120  // return ((x >= 0.) ? tmp : -tmp); }
121 
122 };
123 
124 //==========================================================================
125 
126 } // end namespace Pythia8
127 
128 #endif // Pythia8_SigmaTotal_H