6 #ifndef Pythia8_HadronScatter_H
7 #define Pythia8_HadronScatter_H
9 #include "Pythia8/Event.h"
10 #include "Pythia8/Info.h"
11 #include "Pythia8/ParticleData.h"
12 #include "Pythia8/PythiaStdlib.h"
13 #include "Pythia8/PythiaComplex.h"
19 class SigmaPartialWave {
22 bool init(
int,
string,
string, Info *, ParticleData *, Rndm *);
25 bool readFile(
string,
string);
28 bool setSubprocess(
int);
29 bool setSubprocess(
int,
int);
32 double sigmaEl(
double Wcm) {
return sigma(0, Wcm); }
33 double sigmaTot(
double Wcm) {
return sigma(1, Wcm); }
34 double dSigma(
double Wcm,
double cTheta) {
return sigma(2, Wcm, cTheta); }
37 double pickCosTheta(
double);
40 double getSigmaElMax() {
return sigElMax; }
46 ParticleData *particleDataPtr;
50 static const int LSHIFT, ISHIFT, SUBBIN, ITER;
51 static const double CONVERT2MB, WCMBIN, CTBIN, MASSSAFETY, GRIDSAFETY;
52 static const complex BINEND;
55 int process, subprocess, subprocessMax, norm;
58 int idA, idB, Lmax, Imax;
61 double mA, mB, binMax, sigElMax;
66 map < int, pair < int, int > > sp2in;
67 map < pair < int, int >,
int > in2sp;
70 map < int, map < int, double > > isoCoeff;
74 map < int, map < double, complex > > pwData;
77 vector < double > PlVec, PlpVec;
80 vector < vector < vector < double > > > gridMax;
81 vector < vector < double > > gridNorm;
84 void setupSubprocesses();
90 double sigma(
int,
double,
double = 0.);
93 void legendreP(
double,
bool =
false);
104 typedef pair < int, int > HSIndex;
106 class HadronScatterPair {
109 HadronScatterPair() {}
110 HadronScatterPair(
const HSIndex &i1in,
int yt1in,
int pt1in,
111 const HSIndex &i2in,
int yt2in,
int pt2in,
113 i1(i1in), yt1(yt1in), pt1(pt1in),
114 i2(i2in), yt2(yt2in), pt2(pt2in),
115 measure(measureIn) {}
118 bool operator<(
const HadronScatterPair& in)
const {
119 return this->measure < in.measure;
136 class HadronScatter {
144 bool init(Info* infoPtrIn, Settings& settings, Rndm* rndmPtrIn,
145 ParticleData *particleDataPtr);
148 void scatter(
Event&);
151 void scatterOld(
Event&);
160 bool scatSameString, scatMultTimes;
162 double p2max, yDiffMax, Rmax, maxProbDS, neighNear, neighFar,
163 minProbSS, maxProbSS;
166 bool doOldScatter, afterDecay, allowDecayProd,
167 scatterRepeat, doTile;
168 int hadronSelect, scatterProb;
169 double Npar, kPar, pPar, jPar, rMax, rMax2;
170 double pTsigma, pTsigma2, pT0MPI;
175 double yMin, yMax, ytSize, ptSize;
176 vector < vector < set < HSIndex > > > tile;
179 set < HSIndex > scattered;
182 SigmaPartialWave sigmaPW[3];
188 bool canScatter(
Event &,
int);
191 bool doesScatter(
Event &,
const HSIndex &,
const HSIndex &);
194 double measure(
Event &,
int,
int);
197 bool hadronScatter(
Event &, HadronScatterPair &);
200 bool tileIntProb(vector < HadronScatterPair > &,
Event &,
201 const HSIndex &,
int,
int,
bool);
202 int yTile(
Event& event,
int idx) {
203 return (doTile) ? int((event[idx].y() - yMin) / ytSize) : 0;
205 int pTile(
Event& event,
int idx) {
206 return (doTile) ? int((event[idx].phi() + M_PI) / ptSize) : 0;
211 void mergeSortCollFlow(vector< pair<int,double> >& sort,
212 int iStart = 1,
int iEnd = -1);
213 void mergeCollFlow(vector< pair<int,double> >& sort,
int iStart,
214 int iDivide,
int iEnd);
225 #endif // Pythia8_HadronScatter_H