source: HiSusy/trunk/Pythia8Sgluon/Sigma2SgluonSgluonBase.cxx @ 8

Last change on this file since 8 was 8, checked in by zerwas, 9 years ago

add Pythia8Sgluon generator

File size: 3.2 KB
Line 
1#include "Sigma2SgluonSgluonBase.h"
2#include <iostream>
3#include <cmath>
4
5Sigma2SgluonSgluonBase::Sigma2SgluonSgluonBase(){
6}
7Sigma2SgluonSgluonBase::Sigma2SgluonSgluonBase(int idResonanceIn): m_idsgluon(idResonanceIn), m_idsgluonBar(-idResonanceIn){
8}
9Sigma2SgluonSgluonBase::~Sigma2SgluonSgluonBase(){
10}
11double Sigma2SgluonSgluonBase::dsigmadcostheta(double ctp){
12  ctp=0;
13  std::cout << "ERROR YOU SHOULD NOT HAVE LANDED HERE: Sigma2SgluonSgluonBase::dsigmadcostheta " << std::endl;
14  return ctp;
15}
16double Sigma2SgluonSgluonBase::convFactordsigmadcostheta2dsigmadt(double sHat, double mass) {
17  return  sHat/2 * sqrtf(1.-4.*mass*mass/sHat);
18}
19double Sigma2SgluonSgluonBase::integrate(double A, double B, double EPS) {
20  double AA,BB,C1,C2,U,S8,S16;
21  //  bool MFLAG,RFLAG;
22  /*
23    C     ******************************************************************
24    C
25    C     ADAPTIVE DOUBLE PRECISION GAUSSIAN QUADRATURE.
26    C
27    C     DGAUSS IS SET EQUAL TO THE APPROXIMATE VALUE OF THE INTEGRAL OF
28    C     THE FUNCTION F OVER THE INTERVAL (A,B), WITH ACCURACY PARAMETER
29    C     EPS.
30    C
31    C     ******************************************************************
32    C
33  */
34  const double W[12]={ 0.1012285362903762591525313543e0,
35                       0.2223810344533744705443559944e0,
36                       0.3137066458778872873379622020e0,
37                       0.3626837833783619829651504493e0,
38                       0.2715245941175409485178057246e-1,
39                       0.6225352393864789286284383699e-1,
40                       0.9515851168249278480992510760e-1,
41                       0.1246289712555338720524762822e0,
42                       0.1495959888165767320815017305e0,
43                       0.1691565193950025381893120790e0,
44                       0.1826034150449235888667636680e0,
45                       0.1894506104550684962853967232e0};
46 
47  const double X[12]={ 0.9602898564975362316835608686e0,
48                       0.7966664774136267395915539365e0,
49                       0.5255324099163289858177390492e0,
50                       0.1834346424956498049394761424e0,
51                       0.9894009349916499325961541735e0,
52                       0.9445750230732325760779884155e0,
53                       0.8656312023878317438804678977e0,
54                       0.7554044083550030338951011948e0,
55                       0.6178762444026437484466717640e0,
56                       0.4580167776572273863424194430e0,
57                       0.2816035507792589132304605015e0,
58                       0.9501250983763744018531933543e-1};
59
60
61  //  START.
62  double result = 0.0e0;
63  if (B == A) return result;
64  double CONST = 0.005e0/(B-A);
65  BB=A;
66  //
67  //  COMPUTATIONAL LOOP
68 ONE: 
69  AA=BB;
70  BB=B;
71
72 TWO:   
73  C1=0.5e0*(BB+AA);
74  C2=0.5e0*(BB-AA);
75  S8=0.0e0;
76
77  for (unsigned int i=0; i<4; i++) {
78    U=C2*X[i];
79    S8=S8+W[i]*(dsigmadcostheta(C1+U)+dsigmadcostheta(C1-U));
80  }
81
82  S8=C2*S8;
83  S16=0.0e0;
84
85  for (unsigned int i=4; i<12; i++) {
86    U=C2*X[i];
87    S16=S16+W[i]*(dsigmadcostheta(C1+U)+dsigmadcostheta(C1-U));
88  }
89
90  S16=C2*S16;
91  if ( fabs(S16-S8) <= EPS*(1.+fabs(S16)) ) goto FIVE;
92  BB=C1;
93  if ( 1.e0+fabs(CONST*C2) != 1.e0) goto TWO;
94  result=0.0e0;
95
96  //  KERMTR("D103.1",LGFILE,MFLAG,RFLAG);
97  //  if (MFLAG) {
98  std::cout << "FUNCTION DGAUSS ... TOO HIGH ACCURACY REQUIRED" <<std::endl;
99    //  }
100    //  if ( !RFLAG) abend();
101  return result;
102 
103 FIVE: 
104  result=result+S16;
105  if (BB != B) goto ONE;
106  return result;
107}       
108//--------------------------------------------------------------------------
109
110
Note: See TracBrowser for help on using the repository browser.