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"
17 class SigmaPartialWave {
20 bool init(
int,
string,
string, Info *, ParticleData *, Rndm *);
23 bool readFile(
string,
string);
26 bool setSubprocess(
int);
27 bool setSubprocess(
int,
int);
30 double sigmaEl(
double Wcm) {
return sigma(0, Wcm); }
31 double sigmaTot(
double Wcm) {
return sigma(1, Wcm); }
32 double dSigma(
double Wcm,
double cTheta) {
return sigma(2, Wcm, cTheta); }
35 double pickCosTheta(
double);
38 double getSigmaElMax() {
return sigElMax; }
43 ParticleData *particleDataPtr;
47 static const int LSHIFT, ISHIFT, SUBBIN, ITER;
48 static const double CONVERT2MB, WCMBIN, CTBIN, MASSSAFETY, GRIDSAFETY;
49 static const complex BINEND;
52 int process, subprocess, subprocessMax, norm;
55 int idA, idB, Lmax, Imax;
58 double mA, mB, binMax, sigElMax;
63 map < int, pair < int, int > > sp2in;
64 map < pair < int, int >,
int > in2sp;
67 map < int, map < int, double > > isoCoeff;
71 map < int, map < double, complex > > pwData;
74 vector < double > PlVec, PlpVec;
77 vector < vector < vector < double > > > gridMax;
78 vector < vector < double > > gridNorm;
81 void setupSubprocesses();
87 double sigma(
int,
double,
double = 0.);
90 void legendreP(
double,
bool =
false);
102 typedef pair < int, int > HSIndex;
104 class HadronScatterPair {
107 HadronScatterPair(
const HSIndex &i1in,
int yt1in,
int pt1in,
108 const HSIndex &i2in,
int yt2in,
int pt2in,
110 i1(i1in), yt1(yt1in), pt1(pt1in),
111 i2(i2in), yt2(yt2in), pt2(pt2in),
112 measure(measureIn) {}
115 bool operator<(
const HadronScatterPair& in)
const {
116 return this->measure < in.measure;
133 class HadronScatter {
141 bool init(Info* infoPtrIn, Settings& settings, Rndm* rndmPtrIn,
142 ParticleData *particleDataPtr);
145 void scatter(
Event&);
154 bool doHadronScatter, afterDecay, allowDecayProd,
155 scatterRepeat, doTile;
156 int hadronSelect, scatterProb;
157 double Npar, kPar, pPar, jPar, rMax, rMax2;
158 double pTsigma, pTsigma2, pT0MPI;
162 double yMin, yMax, ytSize, ptSize;
163 vector < vector < set < HSIndex > > > tile;
166 set < HSIndex > scattered;
169 SigmaPartialWave sigmaPW[3];
175 bool canScatter(
Event &,
int);
178 bool doesScatter(
Event &,
const HSIndex &,
const HSIndex &);
181 double measure(
Event &,
int,
int);
184 bool hadronScatter(
Event &, HadronScatterPair &);
187 bool tileIntProb(vector < HadronScatterPair > &,
Event &,
188 const HSIndex &,
int,
int,
bool);
189 int yTile(
Event& event,
int idx) {
190 return (doTile) ? int((event[idx].y() - yMin) / ytSize) : 0;
192 int pTile(
Event& event,
int idx) {
193 return (doTile) ? int((event[idx].phi() + M_PI) / ptSize) : 0;
205 #endif // Pythia8_HadronScatter_H